/* ========= 全域設定 ========= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft JhengHei', Arial, sans-serif;
    line-height: 1.7;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========= 通用區塊樣式 ========= */
.hidden {
    display: none;
}

/* ========= 進度條 ========= */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: #636efa;
    z-index: 1000;
    transition: width 0.3s ease;
}

/* ========= 故事場景 ========= */
.story-section {
    position: relative;
    z-index: 1;
}

.story-frame {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    padding-bottom: 80px;
    z-index: auto;
}

.story-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease-out;
    z-index: 1;
}

/* ========= 毛玻璃內容框 ========= */
.story-content,
.content-overlay {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(15px);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    line-height: 1.7;
}

.content-overlay {
    max-width: 800px;
}

/* ========= 場景背景 ========= */
.thinking-bg {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
}

.computer-bg {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.decision-bg {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

/* ========= 場景占位符與角色 ========= */
.scene-placeholder,
.reflection-visual-center,
.determination-visual-center {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.character-thinking,
.character-computer,
.character-decide,
.reflection-character,
.determination-character {
    font-size: 10em;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.thought-bubble,
.computer-screen,
.decision-text,
.reflection-bubble,
.determination-bubble {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(15px);
    padding: 15px 25px;
    border-radius: 20px;
    font-size: 1.2em;
    font-weight: 600;
    color: #2c3e50;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ========= 對話泡泡 ========= */
.dialog-bubble {
    background: rgba(99, 110, 250, 0.15);
    backdrop-filter: blur(15px);
    color: #1e40af;
    padding: 20px 30px;
    border-radius: 20px;
    margin: 20px 0;
    position: relative;
    box-shadow: 0 4px 16px rgba(99, 110, 250, 0.15);
    border: 1px solid rgba(99, 110, 250, 0.2);
}

.dialog-bubble::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-top-color: rgba(99, 110, 250, 0.15);
}

/* ========= 滾動提示 ========= */
.scroll-hint {
    margin-top: 30px;
    color: rgb(44, 62, 80);
    font-size: 1.1em;
}

.scroll-arrow {
    font-size: 2em;
    animation: bounce 2s infinite;
    margin-top: 10px;
}

/* ========= 場景文字與決定 ========= */
.scene-text {
    font-size: 1.2em;
    color: #2c3e50;
    margin: 10px 0;
    line-height: 1.6;
}

.final-decision {
    background: rgba(99, 110, 250, 0.15);
    backdrop-filter: blur(15px);
    padding: 25px;
    border-radius: 15px;
    margin: 10px 0;
    border-left: 4px solid rgba(99, 110, 250, 0.15);
    border: 1px solid rgba(99, 110, 250, 0.15);
}

.final-decision h3 {
    color: #1e40af;
    margin-bottom: 15px;
}

.mission-text {
    background: rgba(248, 250, 252, 0.6);
    backdrop-filter: blur(15px);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #636efa;
    margin: 10px 0;
    border: 1px solid rgba(99, 110, 250, 0.15);
}

/* ========= 視差背景 ========= */
.parallax-section {
    position: relative;
    min-height: 100vh;
}

.parallax-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    transform: translateZ(0);
    transition: transform 0.5s ease-out;
    z-index: -1;
}

/* ========= 標題 ========= */
.main-title {
    font-size: 3em;
    color: #636efa;
    text-align: center;
    margin-bottom: 10px;
    font-weight: 700;
}

.sub-title {
    font-size: 1.5em;
    color: #5a6c7d;
    text-align: center;
    margin-bottom: 15px;
    font-weight: 400;
}

/* ========= 人物介紹 ========= */
.character-intro {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(15px);
    color: #2c3e50;
    padding: 30px;
    border-radius: 15px;
    margin: 30px 0;
    border: 1px solid rgba(99, 110, 250, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.character-name {
    font-size: 1.8em;
    margin-bottom: 15px;
    font-weight: bold;
}

.character-details {
    font-size: 1.1em;
    line-height: 1.5;
}

/* ========= 按鈕 ========= */
.btn {
    background: #636efa;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 110, 250, 0.3);
    display: block;
    margin: 30px auto;
    margin-bottom: 50px;
    text-align: center;
    font-weight: 500;
}

.btn:hover {
    background: #4c5fd5;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 110, 250, 0.4);
}

/* ========= 新聞報導 ========= */
.news-section {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(15px);
    margin: 10px 0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-align: left;
}

.news-header {
    background: #2c3e50;
    color: white;
    padding: 20px;
    font-size: 1.3em;
    font-weight: 600;
    text-align: left;
}

.news-title {
    font-size: 1.5em;
    color: #636efa;
    margin: 20px;
    font-weight: 700;
    text-align: left;
}

.news-subtitle {
    font-size: 1.2em;
    color: #5a6c7d;
    margin: 15px 20px;
    font-weight: 500;
    text-align: left;
}

.news-content {
    padding: 20px;
    line-height: 1.8;
    font-size: 1.1em;
    text-align: justify;
    text-align-last: left;
}

/* ========= 題目區塊 ========= */
.question-block {
    background: rgba(248, 250, 252, 0.6);
    backdrop-filter: blur(15px);
    padding: 25px;
    margin: 20px;
    border-radius: 12px;
    border-left: 4px solid #636efa;
    border: 1px solid rgba(99, 110, 250, 0.15);
    text-align: left;
}

.question-title {
    font-size: 1.5em;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: left;
}

.option {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    margin: 10px 0;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(99, 110, 250, 0.1);
    user-select: none;
    text-align: left;
}

.option:hover {
    background: rgba(99, 110, 250, 0.05);
    border-color: #636efa;
    transform: translateX(5px);
}

.option.correct {
    background: rgba(52, 211, 153, 0.15);
    border-color: #34d399;
    color: #065f46;
}

.option.incorrect {
    background: rgba(248, 113, 113, 0.15);
    border-color: #f87171;
    color: #991b1b;
}

.option.disabled {
    pointer-events: none;
    opacity: 0.6;
}

/* ========= 易廷解析 ========= */
.analysis-block {
    background: rgba(254, 243, 199, 0.5);
    backdrop-filter: blur(15px);
    padding: 25px;
    margin: 20px;
    border-radius: 12px;
    border-left: 4px solid #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
    text-align: left;
}

.analysis-toggle {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    user-select: none;
}

.analysis-toggle:hover {
    transform: translateY(-2px);
}

.analysis-title {
    color: #92400e;
    font-size: 1.2em;
    font-weight: 600;
}

.toggle-arrow {
    font-size: 1.5em;
    transition: transform 0.3s ease;
    color: #92400e;
}

.toggle-arrow.rotated {
    transform: rotate(180deg);
}

.analysis-content {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(146, 64, 14, 0.2);
    font-size: 1em;
    line-height: 1.7;
    color: #1f2937;
    transition: all 0.3s ease;
    overflow: hidden;
    text-align: left;
}

.analysis-content.hidden {
    display: none;
}

.analysis-content.show {
    display: block;
    animation: fadeInDown 0.3s ease;
}

/* ========= 三大問題卡片 ========= */
.problem-card {
    display: flex;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(15px);
    padding: 25px;
    margin: 20px 0;
    border-radius: 15px;
    border: 1px solid rgba(99, 110, 250, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    text-align: left;
}

.problem-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.problem-icon {
    font-size: 3em;
    margin-right: 20px;
    flex-shrink: 0;
}

.problem-content {
    flex: 1;
    text-align: left;
}

.problem-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    text-align: left;
}

.problem-description {
    font-size: 1.05em;
    line-height: 1.7;
    color: #1f2937;
    text-align: left;
}

/* ========= 淡入動畫 ========= */
.fade-in {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========= 導航選單 ========= */
.nav-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
}

.nav-toggle {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(15px);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

.nav-toggle span {
    width: 20px;
    height: 2px;
    background: #333;
    margin: 2px 0;
    transition: 0.3s;
    border-radius: 1px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.nav-items {
    position: absolute;
    top: 60px;
    right: 0;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-items.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border-radius: 10px;
    margin: 5px;
}

.nav-item:hover {
    background: rgba(99, 110, 250, 0.1);
    color: #636efa;
    transform: translateX(-3px);
}

.nav-item i {
    font-size: 1.2em;
    margin-right: 10px;
    width: 25px;
    text-align: center;
}

.nav-item span {
    font-size: 1em;
    font-weight: 500;
}

/* ========= 頁面指示器 ========= */
.page-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 998;
}

.page-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.page-dot.active {
    background: #636efa;
    border-color: white;
    transform: scale(1.2);
}

.page-dot:hover {
    background: #a5b4fc;
    transform: scale(1.1);
}

/* ========= 反饋彈窗 ========= */
.feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(15px);
    color: #1f2937;
    padding: 20px 40px;
    border-radius: 16px;
    font-size: 1.3em;
    z-index: 1000;
    animation: popIn 0.3s ease-out;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
    min-width: 200px;
    text-align: center;
}

.feedback.correct {
    border-left: 5px solid #34d399;
    color: #065f46;
}

.feedback.incorrect {
    border-left: 5px solid #f87171;
    color: #991b1b;
}

/* ========= 動畫效果 ========= */
@keyframes float {
    0%, 100% {
        transform: translateY(-50px);
    }
    50% {
        transform: translateY(-70px);
    }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ========================================
   響應式設計 - 平板 (小於 1024px)
======================================== */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }

    .story-content,
    .content-overlay {
        max-width: 90%;
        padding: 30px;
    }

    .main-title {
        font-size: 2.5em;
    }

    .character-thinking,
    .character-computer,
    .character-decide,
    .reflection-character,
    .determination-character {
        font-size: 7em;
    }
}

/* ========================================
   響應式設計 - 手機 (小於 768px)
======================================== */
@media (max-width: 768px) {
    body {
        font-size: 16px;
        line-height: 1.6;
    }

    .container {
        padding: 0 10px;
    }

    /* 標題 */
    .main-title {
        font-size: 2.2em;
    }

    .sub-title {
        font-size: 1.3em;
    }

    /* 內容框 */
    .story-content,
    .content-overlay {
        padding: 25px;
        margin: 10px;
        max-width: 95%;
    }

    /* 角色與占位符 */
    .character-thinking,
    .character-computer,
    .character-decide,
    .reflection-character,
    .determination-character {
        font-size: 5em;
    }

    .thought-bubble,
    .computer-screen,
    .decision-text,
    .reflection-bubble,
    .determination-bubble {
        font-size: 1em;
        padding: 12px 20px;
    }

    /* 人物介紹 */
    .character-name {
        font-size: 1.4em;
    }

    .character-details {
        font-size: 1em;
        line-height: 1.6;
    }

    /* 新聞報導 */
    .news-title {
        font-size: 1.4em;
        margin: 15px;
    }

    .news-subtitle {
        font-size: 1.15em;
        margin: 10px 15px;
    }

    .news-content {
        padding: 15px;
        font-size: 1.15em;
    }

    /* 題目 */
    .question-block {
        padding: 15px;
        margin: 10px;
    }

    .question-title {
        font-size: 1.15em;
    }

    .option {
        padding: 12px;
        font-size: 1em;
        margin: 8px 0;
    }

    /* 按鈕 */
    .btn {
        font-size: 1.1em;
        padding: 12px 20px;
    }

    /* 問題卡片 */
    .problem-card {
        flex-direction: column;
        padding: 20px;
    }

    .problem-icon {
        font-size: 2.8em;
        margin-right: 0;
        margin-bottom: 15px;
    }

    .problem-title {
        font-size: 1.2em;
    }

    .problem-description {
        font-size: 1em;
    }

    /* 導航 */
    .nav-menu {
        top: 10px;
        right: 10px;
    }

    .nav-toggle {
        width: 45px;
        height: 45px;
    }

    .nav-items {
        min-width: 150px;
    }

    .nav-item {
        padding: 12px 15px;
    }

    .nav-item span {
        font-size: 0.9em;
    }

    /* 頁面指示器 */
    .page-indicator {
        bottom: 20px;
    }

    .page-dot {
        width: 10px;
        height: 10px;
    }

    /* 視差背景固定問題 */
    .parallax-bg {
        background-attachment: scroll;
    }

    /* 場景框架 */
    .story-frame {
        padding-bottom: 60px;
    }
}

/* ========================================
   響應式設計 - 小手機 (小於 480px)
======================================== */
@media (max-width: 480px) {
    body {
        font-size: 13px;
        line-height: 1.5;
    }

    /* 標題 */
    .main-title {
        font-size: 1.6em;
    }

    .sub-title {
        font-size: 1em;
    }

    /* 內容框 */
    .story-content,
    .content-overlay {
        padding: 15px;
        border-radius: 15px;
    }

    /* 角色 */
    .character-thinking,
    .character-computer,
    .character-decide,
    .reflection-character,
    .determination-character {
        font-size: 4em;
    }

    .thought-bubble,
    .computer-screen,
    .decision-text,
    .reflection-bubble,
    .determination-bubble {
        font-size: 0.9em;
        padding: 10px 15px;
    }

    /* 人物介紹 */
    .character-name {
        font-size: 1.2em;
    }

    .character-details {
        font-size: 0.9em;
    }

    /* 新聞 */
    .news-title {
        font-size: 1.1em;
        margin: 10px;
    }

    .news-subtitle {
        font-size: 0.9em;
        margin: 8px 10px;
    }

    .news-content {
        padding: 12px;
        font-size: 0.95em;
    }

    /* 題目 */
    .question-block {
        padding: 12px;
        margin: 8px;
    }

    .question-title {
        font-size: 1em;
    }

    .option {
        padding: 10px;
        font-size: 0.9em;
    }

    /* 按鈕 */
    .btn {
        font-size: 0.95em;
        padding: 10px 16px;
    }

    /* 問題卡片 */
    .problem-card {
        padding: 15px;
    }

    .problem-icon {
        font-size: 2em;
        margin-bottom: 10px;
    }

    .problem-title {
        font-size: 1.1em;
    }

    .problem-description {
        font-size: 0.95em;
    }

    /* 導航 */
    .nav-toggle {
        width: 40px;
        height: 40px;
    }

    .nav-items {
        min-width: 130px;
    }

    .nav-item {
        padding: 10px 12px;
    }

    .nav-item span {
        font-size: 0.85em;
    }

    /* 頁面指示器 */
    .page-dot {
        width: 8px;
        height: 8px;
    }

    /* 反饋 */
    .feedback {
        font-size: 1.1em;
        padding: 15px 30px;
        min-width: 150px;
    }
}

/* ========= 頁底版權聲明 ========= */
.footer-copyright {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(44, 62, 80, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    text-align: center;
    padding: 15px 20px;
    padding-bottom: 60px;
    font-size: 0.9em;
    z-index: 900;
    line-height: 1.6;
}

.footer-copyright p {
    margin: 5px 0;
}

.footer-copyright a {
    color: #74b9ff;
    text-decoration: underline;
    cursor: pointer;
}

.footer-copyright a:hover {
    color: #a8edea;
}

/* ========= 版權聲明彈出視窗 ========= */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

.modal-content h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.modal-content p {
    color: #1f2937;
    line-height: 1.8;
    margin-bottom: 15px;
    text-align: left;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #999;
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 手機響應式 */
@media (max-width: 768px) {
    .footer-copyright {
        bottom: 0;
        padding: 10px;
        padding-bottom: 70px;
        font-size: 0.75em;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 20% auto;
    }
    
    .modal-content h2 {
        font-size: 1.4em;
    }
}