:root {
    --bg-dark: #0B0E11;
    --card-bg: rgba(22, 26, 30, 0.85);
    --gold: #F3BA2F;
    --gold-dim: #C59D28;
    --jade: #00FFA3;
    --jade-dim: #00CC82;
    --crimson: #FF4D4D;
    --text-primary: #EAECEF;
    --text-secondary: #848E9C;
    --border: #2B2F36;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Inter', 'Noto Sans TC', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

.main-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: rgba(11, 14, 17, 0.95);
    position: sticky;
    top: 0;
    z-index: 100;
    position: relative;
    /* 手機版：為左右絕對定位元素預留空間 */
    padding-left: 68px;
    padding-right: 120px;
}

.header-app-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 0 12px rgba(243,186,47,0.25);
    border: 1px solid rgba(243,186,47,0.2);
}

.logo {
    display: flex;
    flex-direction: column;
}

.gold-text {
    color: var(--gold);
    font-family: 'Noto Serif TC', serif;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 2px;
}

.sub-logo {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 4px;
    margin-top: -5px;
}

.content-section {
    display: none;
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.content-section.active {
    display: block;
}

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.section-title {
    color: var(--gold);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    font-family: 'Noto Serif TC', serif;
}

.section-desc {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    font-weight: 700;
}

input, select {
    background: #1E2329;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.9rem;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: var(--gold);
    outline: none;
}

.btn-container {
    margin-top: 3rem;
    text-align: center;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    color: #000;
    border: none;
    padding: 1.1rem 3rem;
    font-size: 1.1rem;
    font-weight: 800;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(243, 186, 47, 0.2);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 186, 47, 0.4);
}

.btn-gold.disabled {
    background: #474D57;
    color: #848E9C;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* MBTI Progress */
.progress-container {
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #2B2F36;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--jade);
    width: 0%;
    transition: width 0.3s ease;
}

#progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Quiz Styles - Single Question Card */
.question-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    min-height: 280px;
}

.question-number {
    font-size: 0.85rem;
    color: var(--gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    font-weight: 600;
}

.question-text {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    line-height: 1.7;
    font-family: 'Noto Serif TC', serif;
}

.mbti-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mbti-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    background: #1A1D24;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-primary);
    text-align: left;
    transition: all 0.25s ease;
    width: 100%;
    font-family: inherit;
    line-height: 1.5;
}

.mbti-option:hover {
    border-color: var(--jade);
    background: rgba(0, 255, 163, 0.06);
    transform: translateX(4px);
}

.mbti-option.selected {
    border-color: var(--jade);
    background: rgba(0, 255, 163, 0.15);
    color: #fff;
    font-weight: 600;
}

.mbti-option.selected .option-label {
    background: var(--jade);
    color: #000;
}

.option-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: #2B2F36;
    color: var(--gold);
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.25s;
}

.option-text {
    flex: 1;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    gap: 1rem;
}

.btn-nav {
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-prev {
    background: #2B2F36;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-prev:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.btn-next {
    background: linear-gradient(135deg, var(--jade), var(--jade-dim));
    color: #000;
    font-weight: 700;
    min-width: 140px;
    text-align: center;
}

.btn-next:hover:not([disabled]) {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 255, 163, 0.3);
}

.btn-next[disabled] {
    background: #2B2F36;
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Task Done State */
.task-item.task-done .task-name::before {
    content: '✅ ';
}

.task-item.task-done .btn-sm {
    opacity: 0.5;
    pointer-events: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.modal-content {
    max-width: 600px;
    width: 90%;
}

.task-list {
    list-style: none;
    margin: 1.5rem 0;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
    border-bottom: 1px solid var(--border);
}

.task-name {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    text-decoration: none;
    background: #2B2F36;
    color: var(--text-primary);
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-sm.jade { color: var(--jade); border: 1px solid var(--jade); }
.btn-sm.crimson { color: var(--crimson); border: 1px solid var(--crimson); }

.fake-ad {
    padding: 0.6rem 1.2rem;
    background: rgba(243, 186, 47, 0.1);
    border: 1px dashed var(--gold);
    color: var(--gold);
    cursor: pointer;
    font-size: 0.85rem;
    border-radius: 4px;
}

#user-email {
    width: 240px;
    padding: 0.6rem;
    font-size: 0.9rem;
}

/* Report View */
.report-view {
    max-width: 1000px;
}

.report-paper {
    background: #fff;
    color: #1E2329;
    padding: 4rem;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    min-height: 1000px;
    position: relative;
}

.report-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 2rem;
    margin-bottom: 3rem;
}

.report-brand {
    display: block;
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: 4px;
    margin-bottom: 0.5rem;
}

.report-title-main {
    font-family: 'Noto Serif TC', serif;
    font-size: 2.2rem;
    font-weight: 900;
}

.advice-card {
    margin-top: 2rem;
    padding: 2rem;
    border: 1px solid #ddd;
    background: #f9f9f9;
}

.advice-card h3 {
    margin-bottom: 1.5rem;
    color: #000;
    border-bottom: 1px solid #000;
    display: inline-block;
}

.advice-grid {
    display: grid;
    gap: 1.5rem;
}

.report-footer {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid #ddd;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
}

.footer-links {
    margin: 1rem 0;
    font-weight: 700;
}

.hidden { display: none; }

/* MBTI Test Card 元件樣式 */
.mbti-test-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    min-height: 280px;
}
.test-header {
    margin-bottom: 1.5rem;
}
.test-header h3 {
    color: var(--gold);
    font-family: 'Noto Serif TC', serif;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}
.q-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
    display: block;
}
.test-question {
    margin-bottom: 1.5rem;
}
.test-options {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.btn-outline-sm {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.2s;
}
.btn-outline-sm:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* MBTI option-btn 基礎樣式 */
.option-btn {
    display: block;
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 12px;
    background: rgba(26, 29, 36, 0.9);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.6;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}
.option-btn:hover {
    border-color: var(--jade);
    background: rgba(0, 255, 163, 0.06);
}
.option-btn:active {
    transform: scale(0.98);
}

/* quiz-question 和 quiz-options 樣式 */
.quiz-question {
    padding: 0.5rem 0;
}
.quiz-question h3 {
    font-size: 0.9rem;
    color: var(--gold);
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
    font-family: 'Noto Serif TC', serif;
}
.quiz-question p {
    font-size: 1.15rem;
    color: var(--text-primary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-family: 'Noto Serif TC', serif;
}
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* MBTI 已選選項高亮 */
.btn-option.selected {
    background: linear-gradient(135deg, rgba(243,186,47,0.25), rgba(243,186,47,0.15));
    border-color: rgba(243,186,47,0.8);
    color: #F3BA2F;
    box-shadow: 0 0 12px rgba(243,186,47,0.3);
}

/* Print Styles */
@media print {
    body { background: #fff; color: #000; }
    .no-print { display: none !important; }
    .content-section { display: none !important; }
    .content-section.report-view { display: block !important; max-width: 100%; margin: 0; padding: 0; }
    .report-paper { box-shadow: none; padding: 2cm; }
    .glass-card { background: none; border: none; box-shadow: none; backdrop-filter: none; }
}

@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
    #user-email { width: 100%; margin-top: 1rem; }
    .task-item { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .report-paper { padding: 2rem 1rem; }

    /* === 手機版 Header 修正 === */
    .main-header {
        padding: 0.75rem 1rem;
        padding-left: 64px;
        padding-right: 8px;
    }
    .header-app-icon {
        left: 12px;
        width: 38px;
        height: 38px;
    }
    .gold-text {
        font-size: 1.25rem;
        letter-spacing: 1px;
    }
    .sub-logo {
        font-size: 0.6rem;
        letter-spacing: 2px;
    }
    /* 手機版 user-info-bar：改為 header 下方獨立列 */
    #user-info-bar {
        position: static !important;
        transform: none !important;
        display: flex !important;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 4px;
        padding: 4px 8px;
        background: rgba(0,0,0,0.3);
        border-top: 1px solid rgba(255,255,255,0.06);
        font-size: 11px !important;
    }

    /* === 手機版 AB 選項字體放大 === */
    .option-btn,
    .btn-option {
        font-size: 1rem !important;
        padding: 14px 16px !important;
        line-height: 1.6 !important;
        min-height: 52px;
    }
    .mbti-option {
        font-size: 1rem;
        padding: 1rem 1.2rem;
    }
    .question-text {
        font-size: 1.1rem;
    }
    .quiz-question p {
        font-size: 1.1rem;
        line-height: 1.7;
    }
    .quiz-question h3 {
        font-size: 0.85rem;
    }
}
