:root {
    --bg-dark: #0f172a;
    --card-front-bg: linear-gradient(145deg, #1e293b, #0f172a);
    --card-back-bg: linear-gradient(145deg, #1e1b4b, #312e81);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #818cf8;
    --border-color: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Noto Serif TC', serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(49, 46, 129, 0.2), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(30, 58, 138, 0.2), transparent 25%);
    background-attachment: fixed;
}

.container {
    text-align: center;
    padding: 2rem;
}

.title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.2em;
    color: #e2e8f0;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    letter-spacing: 0.1em;
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    justify-content: center;
    perspective: 1000px;
}

.card {
    width: 260px;
    height: 400px;
    background-color: transparent;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    border-radius: 16px;
}

.card:hover .card-inner {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: 0 20px 40px rgba(129, 140, 248, 0.2);
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card.flipped:hover .card-inner {
    transform: rotateY(180deg) translateY(-10px);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* 牌面設計 */
.card-front {
    background: var(--card-front-bg);
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-front::after {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    pointer-events: none;
}

.card-front-content h2 {
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0.5em;
    font-size: 2rem;
    color: #cbd5e1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* 牌背設計 */
.card-back {
    background: var(--card-back-bg);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
}

.card-back::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
    pointer-events: none;
}

.content {
    position: relative;
    z-index: 1;
}

.content h3 {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    letter-spacing: 0.1em;
}

.content p {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.8;
    text-align: justify;
}

/* Modal 背景 */
.modal {
    display: none; /* 預設隱藏 */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* 半透明黑色背景 */
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

/* Modal 內的圖片 */
.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    animation: zoomIn 0.4s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 關閉按鈕 */
.close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    user-select: none;
}

.close:hover,
.close:focus {
    color: #818cf8;
    text-decoration: none;
}

/* Modal 內部滿版點擊背景 */
.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* 導航按鈕容器 */
.nav-buttons-container {
    position: absolute;
    bottom: 120px;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    width: 90%;
    animation: bounce 2s infinite;
}

/* 個別導航按鈕 */
.nav-btn {
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
}

.water-btn {
    background-color: #3b82f6;
}
.water-btn:hover {
    background-color: #2563eb;
}

.point-btn {
    background-color: #ef4444; /* 紅色系，用來強調攔截點 */
}
.point-btn:hover {
    background-color: #dc2626;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

/* 響應式調整 */
@media (max-width: 900px) {
    .card-container {
        gap: 2rem;
    }
    .close {
        top: 15px;
        right: 25px;
        font-size: 40px;
    }
    .nav-buttons-container {
        bottom: 90px;
        gap: 10px;
    }
    .nav-btn {
        font-size: 0.95rem;
        padding: 8px 16px;
    }
}

/* --- 科技感一鍵導航文字樣式 --- */
.tech-text {
    color: #00ffff; /* 科技霓虹青色 */
    font-weight: bold;
    letter-spacing: 2px;
    padding: 2px 10px;
    border: 1px solid #00ffff;
    border-radius: 4px;
    background-color: rgba(0, 255, 255, 0.1);
    /* 發光效果 */
    text-shadow: 0 0 5px #00ffff, 0 0 15px #00ffff;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.5) inset, 0 0 5px rgba(0, 255, 255, 0.5);
    display: inline-block;
    position: relative;
    /* 呼吸動態效果 */
    animation: tech-pulse 1.5s infinite alternate;
}
/* 科技感呼吸燈動畫 */
@keyframes tech-pulse {
    from {
        text-shadow: 0 0 2px #00ffff, 0 0 5px #00ffff;
        box-shadow: 0 0 2px rgba(0, 255, 255, 0.3) inset, 0 0 2px rgba(0, 255, 255, 0.3);
    }
    to {
        text-shadow: 0 0 5px #00ffff, 0 0 15px #00ffff, 0 0 25px #00ffff;
        box-shadow: 0 0 10px rgba(0, 255, 255, 0.8) inset, 0 0 10px rgba(0, 255, 255, 0.8);
    }
}