/* ========== CSS Variables & Reset ========== */
:root {
    --primary: #2d8a56;
    --primary-light: #e8f5ee;
    --primary-dark: #1b6b3f;
    --gold: #c9a84c;
    --gold-light: #faf3e0;
    --bg: #f7f5f0;
    --card-bg: #ffffff;
    --text: #2c2c2c;
    --text-secondary: #6b6b6b;
    --border: #e8e4dc;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: 0.25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ========== Header ========== */
.header {
    background: linear-gradient(135deg, #1a4a2e, #2d6a42);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo-icon { font-size: 28px; }

.nav { display: flex; gap: 4px; }

.nav-link {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover { color: white; background: rgba(255,255,255,0.12); }
.nav-link.active { color: white; background: rgba(255,255,255,0.2); font-weight: 600; }

.header-actions { display: flex; gap: 10px; align-items: center; }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(45,138,86,0.3); }

.btn-outline {
    background: transparent;
    border: 1.5px solid currentColor;
    color: inherit;
}
.btn-outline:hover { background: rgba(255,255,255,0.12); }

.btn-text { background: transparent; color: var(--text-secondary); }
.btn-text:hover { color: var(--text); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-row { margin-top: 20px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ========== Cards ========== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a4a2e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ========== Forms ========== */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text);
}

.form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: #fafafa;
}
.form-select:focus, .form-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45,138,86,0.1); background: white; }
.form-textarea { resize: vertical; min-height: 80px; }

.radio-group { display: flex; gap: 20px; }
.radio-item { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.radio-item input { accent-color: var(--primary); }

.disclaimer {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-top: 16px;
}

/* ========== Symptom Tags ========== */
.symptom-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 7px 16px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    background: white;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}
.tag:hover { border-color: var(--primary); color: var(--primary); }
.tag.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ========== Consult Layout ========== */
.consult-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.consult-result {
    position: sticky;
    top: 84px;
}

.result-placeholder {
    text-align: center;
    padding: 60px 30px;
    color: var(--text-secondary);
}

.placeholder-icon { font-size: 64px; margin-bottom: 16px; }
.result-placeholder h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }

/* ========== Result Card ========== */
.result-card { min-height: 400px; }

.result-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.result-section:last-child { border-bottom: none; margin-bottom: 0; }

.result-section h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #1a4a2e;
}

.constitution-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin: 0 4px 4px 0;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }

.result-list {
    list-style: none;
    padding: 0;
}

.result-list li {
    padding: 6px 0;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.result-list li::before {
    content: "▸";
    color: var(--primary);
    font-weight: bold;
    flex-shrink: 0;
}

.advice-box {
    background: var(--primary-light);
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 14px;
    color: var(--primary-dark);
    line-height: 1.7;
}

.warn-box {
    background: #fff3e0;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 14px;
    color: #e65100;
    line-height: 1.7;
}

.premium-lock {
    background: linear-gradient(135deg, #faf3e0, #f5e6c8);
    border: 2px dashed var(--gold);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-top: 16px;
}

.premium-lock h4 {
    font-size: 16px;
    color: #8b6914;
    margin-bottom: 8px;
}

.premium-lock p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

/* ========== Constitution Grid ========== */
.constitution-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.constitution-card {
    background: #fafaf8;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    cursor: default;
}
.constitution-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }

.constitution-card .c-icon { font-size: 36px; margin-bottom: 8px; }
.constitution-card .c-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.constitution-card .c-desc { font-size: 12px; color: var(--text-secondary); }

/* ========== Test ========== */
.test-progress {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e8e4dc;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.progress-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.test-question {
    margin-bottom: 14px;
    padding: 12px 16px;
    background: #fafaf8;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.test-question .q-text {
    font-size: 14px;
    flex: 1;
    min-width: 200px;
}

.test-question .q-options {
    display: flex;
    gap: 6px;
}

.q-opt {
    padding: 5px 12px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: white;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}
.q-opt:hover { border-color: var(--primary); }
.q-opt.selected { background: var(--primary); color: white; border-color: var(--primary); }

.test-result-section {
    margin-bottom: 24px;
}

.test-result-section h3 {
    font-size: 18px;
    margin-bottom: 6px;
}

.score-bar {
    height: 10px;
    background: #e8e4dc;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 8px;
}

.score-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
}

/* ========== Diet Grid ========== */
.diet-filter, .acupoint-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 14px;
}

.diet-filter .form-select, .acupoint-filter .form-select {
    width: auto;
    min-width: 150px;
}

.diet-grid, .acupoint-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.diet-card, .acupoint-card {
    background: #fafaf8;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: var(--transition);
}
.diet-card:hover, .acupoint-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }

.diet-card .d-icon { font-size: 32px; margin-bottom: 8px; }
.diet-card .d-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.diet-card .d-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    background: var(--primary-light);
    color: var(--primary);
    margin-right: 4px;
    margin-bottom: 6px;
}
.diet-card .d-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.diet-card .d-effect { font-size: 12px; color: var(--primary); margin-top: 8px; font-weight: 500; }

.acupoint-card .a-icon { font-size: 28px; margin-bottom: 8px; }
.acupoint-card .a-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.acupoint-card .a-location { font-size: 12px; color: var(--primary); margin-bottom: 6px; }
.acupoint-card .a-method { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.acupoint-card .a-symptom {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    background: #fff3e0;
    color: #e65100;
    margin-right: 4px;
    margin-bottom: 6px;
}

/* ========== Modal ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 36px 30px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
}
.modal-close:hover { color: #333; }

.modal-icon { font-size: 48px; margin-bottom: 12px; }
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.modal-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.6; }

.modal-price {
    margin: 16px 0;
    color: var(--primary);
}

.price-symbol { font-size: 18px; vertical-align: top; }
.price-num { font-size: 42px; font-weight: 800; }
.price-unit { font-size: 14px; color: var(--text-secondary); }

.modal-features {
    list-style: none;
    text-align: left;
    margin: 16px 0;
    padding: 0;
}

.modal-features li {
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
}

.modal .btn { margin-top: 6px; }

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 300;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.toast.show { opacity: 1; }

/* ========== Utilities ========== */
.hidden { display: none !important; }

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.35s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== Responsive ========== */
@media (max-width: 900px) {
    .consult-layout { grid-template-columns: 1fr; }
    .consult-result { position: static; }
    .constitution-grid { grid-template-columns: repeat(2, 1fr); }
    .diet-grid, .acupoint-grid { grid-template-columns: repeat(2, 1fr); }
    .nav { display: none; }
    .nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #1a4a2e, #2d6a42);
        padding: 12px;
        gap: 4px;
    }
    .menu-toggle { display: block; }
    .header .container { flex-wrap: wrap; }
}

@media (max-width: 600px) {
    .constitution-grid { grid-template-columns: 1fr; }
    .diet-grid, .acupoint-grid { grid-template-columns: 1fr; }
    .card { padding: 18px; }
    .header .container { height: auto; padding: 12px 16px; }
    .logo { font-size: 17px; }
    .test-question { flex-direction: column; align-items: flex-start; }
}
