/* ═══════════════ TaoMate 道侣 — Design System ═══════════════ */

:root {
    --red: #8B0000;
    --red-light: #a52a2a;
    --gold: #D4A017;
    --gold-light: #e8c547;
    --cream: #FFF8E7;
    --cream-dark: #f0e6cc;
    --ink: #1a1a2e;
    --ink-light: #2d2d44;
    --jade: #2E8B57;
    --jade-light: #3da46a;
    --text: #333;
    --text-light: #666;
    --text-muted: #999;
    --border: #e0d5c0;

    --wx-wood: #2d7d46;
    --wx-fire: #c0392b;
    --wx-earth: #b8860b;
    --wx-metal: #95a5a6;
    --wx-water: #1a5276;

    --font-serif: 'Noto Serif SC', 'STSongti-SC', 'Songti SC', 'SimSun', serif;
    --font-sans: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --radius: 12px;
}

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

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--cream);
    min-height: 100vh;
    line-height: 1.6;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(139,0,0,0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(212,160,23,0.04) 0%, transparent 50%);
}

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

/* ═══════════════ Header ═══════════════ */

.site-header {
    background: linear-gradient(135deg, var(--ink) 0%, var(--ink-light) 100%);
    color: var(--cream);
    text-align: center;
    position: relative;
}

.header-border-top, .header-border-bottom {
    height: 4px;
    background: linear-gradient(90deg, var(--red), var(--gold), var(--red));
}

.header-content { padding: 32px 20px 24px; }

.site-title { display: flex; align-items: baseline; justify-content: center; gap: 12px; }

.title-cn {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.15em;
}

.title-en {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.1em;
}

.site-subtitle {
    font-family: var(--font-serif);
    color: rgba(255,248,231,0.6);
    font-size: 0.95rem;
    margin-top: 6px;
    letter-spacing: 0.3em;
}

/* ═══════════════ Setup Section ═══════════════ */

.setup-section { padding: 40px 0; }

.setup-card {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-md);
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.card-ornament {
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin-bottom: 24px;
    border-radius: 2px;
}

.card-ornament-bottom {
    margin-top: 24px;
    margin-bottom: 0;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    color: var(--red);
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 0.1em;
}

.setup-desc {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 28px;
}

.form-row { display: flex; gap: 16px; margin-bottom: 20px; }

.form-row-datetime .form-group { flex: 1; }

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 6px;
    font-weight: 500;
}

.optional-tag {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-sans);
    background: var(--cream);
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,160,23,0.15);
}

.form-row-options { gap: 32px; }

.radio-group .group-label {
    margin-bottom: 8px;
}

.radio-buttons { display: flex; gap: 12px; }

.radio-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s;
}

.radio-btn:has(input:checked) {
    border-color: var(--red);
    background: rgba(139,0,0,0.05);
}

.radio-btn input { display: none; }

.radio-label { font-size: 0.95rem; }

.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    margin-top: 24px;
    background: linear-gradient(135deg, var(--red), var(--red-light));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-sm);
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-submit:active { transform: translateY(0); }

/* ═══════════════ Loading ═══════════════ */

.loading-section {
    padding: 80px 0;
    text-align: center;
}

.taiji-spinner {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: conic-gradient(var(--ink) 50%, var(--cream-dark) 50%);
    position: relative;
    margin: 0 auto 20px;
    animation: spin 2s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    font-family: var(--font-serif);
    color: var(--text-light);
    font-size: 1.1rem;
    letter-spacing: 0.2em;
}

/* ═══════════════ Dashboard ═══════════════ */

.dashboard-section { padding: 24px 0 60px; }

.dashboard-card {
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border-top: 3px solid var(--gold);
}

.dashboard-card .section-title {
    margin-bottom: 16px;
}

/* ═══════════════ BaZi Chart ═══════════════ */

.bazi-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.bazi-chart {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.pillar {
    text-align: center;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--cream);
    min-width: 90px;
    border: 1px solid var(--border);
}

.pillar-daymaster {
    border: 2px solid var(--gold);
    background: rgba(212,160,23,0.08);
}

.pillar-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.daymaster-badge {
    font-size: 0.65rem;
    background: var(--gold);
    color: white;
    padding: 1px 6px;
    border-radius: 4px;
}

.shishen {
    font-size: 0.75rem;
    color: var(--red);
    margin-bottom: 6px;
    min-height: 1.2em;
}

.tiangan, .dizhi {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    padding: 4px 0;
}

.tiangan[data-wuxing="木"], .dizhi[data-wuxing="木"] { color: var(--wx-wood); }
.tiangan[data-wuxing="火"], .dizhi[data-wuxing="火"] { color: var(--wx-fire); }
.tiangan[data-wuxing="土"], .dizhi[data-wuxing="土"] { color: var(--wx-earth); }
.tiangan[data-wuxing="金"], .dizhi[data-wuxing="金"] { color: var(--wx-metal); }
.tiangan[data-wuxing="水"], .dizhi[data-wuxing="水"] { color: var(--wx-water); }

.tiangan-daymaster {
    text-shadow: 0 0 12px rgba(212,160,23,0.3);
}

.canggan {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    min-height: 1.2em;
}

.wuxing-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.legend-item {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 2px 12px;
    border-radius: 4px;
}

.wx-wood { color: var(--wx-wood); background: rgba(45,125,70,0.1); }
.wx-fire { color: var(--wx-fire); background: rgba(192,57,43,0.1); }
.wx-earth { color: var(--wx-earth); background: rgba(184,134,11,0.1); }
.wx-metal { color: var(--wx-metal); background: rgba(149,165,166,0.15); }
.wx-water { color: var(--wx-water); background: rgba(26,82,118,0.1); }

/* ═══════════════ WuXing Bars ═══════════════ */

.wuxing-profile { padding: 8px 0; }

.wx-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.wx-label {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    width: 30px;
    text-align: center;
}

.wx-bar-track {
    flex: 1;
    height: 24px;
    background: var(--cream);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.wx-bar-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.8s ease-out;
}

.wx-fill-wood { background: linear-gradient(90deg, var(--wx-wood), #3da46a); }
.wx-fill-fire { background: linear-gradient(90deg, var(--wx-fire), #e74c3c); }
.wx-fill-earth { background: linear-gradient(90deg, var(--wx-earth), #d4a017); }
.wx-fill-metal { background: linear-gradient(90deg, #7f8c8d, var(--wx-metal)); }
.wx-fill-water { background: linear-gradient(90deg, var(--wx-water), #2980b9); }

.wx-value {
    font-size: 0.85rem;
    color: var(--text-light);
    width: 45px;
    text-align: right;
}

.wx-badge {
    font-size: 0.75rem;
    width: 24px;
    text-align: center;
}

.wuxing-summary {
    margin-top: 16px;
    padding: 16px;
    background: var(--cream);
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-light);
}

/* ═══════════════ Daily Energy ═══════════════ */

.daily-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.daily-date { flex: 1; }

.date-solar {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.date-lunar {
    font-family: var(--font-serif);
    color: var(--text-light);
    margin: 4px 0;
}

.date-ganzhi {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--red);
    font-weight: 700;
}

.daily-gauge {
    position: relative;
    width: 120px;
    height: 120px;
}

.gauge-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: var(--cream-dark);
    stroke-width: 8;
}

.gauge-fill {
    fill: none;
    stroke: var(--gold);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 314;
    stroke-dashoffset: 314;
    transition: stroke-dashoffset 1s ease-out, stroke 0.3s;
}

.gauge-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-score {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.gauge-text {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.daily-suggestions {
    display: grid;
    gap: 12px;
}

.suggestion-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--cream);
    border-radius: 8px;
    border-left: 3px solid var(--gold);
}

.suggestion-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.suggestion-content { flex: 1; }

.suggestion-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.suggestion-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* ═══════════════ K-Line Chart ═══════════════ */

.kline-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-serif);
    margin-bottom: 20px;
    letter-spacing: 0.2em;
}

.kline-chart-wrapper {
    height: 400px;
    position: relative;
    padding-top: 16px;
}

/* ═══════════════ Feedback ═══════════════ */

.feedback-question { margin-bottom: 24px; }

.feedback-label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text);
}

.emoji-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.emoji-btn {
    font-size: 2rem;
    background: none;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.6;
}

.emoji-btn:hover { opacity: 1; transform: scale(1.15); }

.emoji-btn.selected {
    border-color: var(--gold);
    background: rgba(212,160,23,0.1);
    opacity: 1;
    transform: scale(1.15);
}

.thumbs-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.thumb-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.thumb-btn:hover { border-color: var(--gold); }

.thumb-btn.selected {
    border-color: var(--gold);
    background: rgba(212,160,23,0.1);
}

.thumb-icon { font-size: 1.3rem; }

.feedback-textarea {
    width: 100%;
    padding: 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    background: var(--cream);
    resize: vertical;
}

.feedback-textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,160,23,0.15);
}

.btn-feedback { margin-top: 8px; }

.feedback-thanks {
    text-align: center;
    padding: 40px 20px;
}

.thanks-icon {
    font-size: 2.5rem;
    color: var(--jade);
    margin-bottom: 12px;
}

.thanks-text {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--text);
}

.thanks-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ═══════════════ Footer ═══════════════ */

.site-footer {
    background: var(--ink);
    color: rgba(255,248,231,0.4);
    text-align: center;
    padding: 24px 20px;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
}

/* ═══════════════ User Bar ═══════════════ */

.user-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}

.user-name {
    color: var(--gold);
    font-size: 0.9rem;
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(255,248,231,0.3);
    color: rgba(255,248,231,0.6);
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s;
}

.btn-logout:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* ═══════════════ Auth Section ═══════════════ */

.auth-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
}

.auth-tab {
    flex: 1;
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    color: var(--red);
    border-bottom-color: var(--red);
    font-weight: 600;
}

.auth-tab:hover { color: var(--text); }

.auth-error {
    color: #c0392b;
    font-size: 0.85rem;
    text-align: center;
    padding: 8px;
    margin-bottom: 12px;
    background: rgba(192,57,43,0.08);
    border-radius: 6px;
}

/* ═══════════════ Calibration Badge ═══════════════ */

.calibration-badge {
    text-align: center;
    font-size: 0.8rem;
    color: var(--jade);
    background: rgba(46,139,87,0.08);
    padding: 4px 12px;
    border-radius: 12px;
    margin-bottom: 16px;
    display: inline-block;
    width: 100%;
}

/* ═══════════════ Rich Feedback ═══════════════ */

.feedback-intro {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.feedback-dimensions {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--cream);
    border-radius: 8px;
}

.dimension-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.dimension-row:last-child { margin-bottom: 0; }

.dim-label {
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 100px;
    color: var(--text);
}

.dim-icon { margin-right: 4px; }

.dim-slider-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dim-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
}

.dim-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gold);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.dim-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gold);
    width: 20px;
    text-align: center;
}

.accuracy-buttons, .event-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.acc-btn, .event-btn {
    padding: 8px 18px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.acc-btn:hover, .event-btn:hover { border-color: var(--gold); }

.acc-btn.selected, .event-btn.selected {
    border-color: var(--gold);
    background: rgba(212,160,23,0.1);
    font-weight: 600;
}

.event-note-input {
    width: 100%;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    background: var(--cream);
}

.event-note-input:focus {
    outline: none;
    border-color: var(--gold);
}

/* ═══════════════ Quick Lookup ═══════════════ */

.btn-quick-lookup {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s;
}

.btn-quick-lookup:hover {
    background: rgba(212,160,23,0.15);
}

.ql-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--ink), var(--ink-light));
    color: var(--cream);
    padding: 12px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.ql-person-name {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--gold);
}

.ql-label {
    color: rgba(255,248,231,0.6);
    font-size: 0.85rem;
}

.btn-back {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s;
}

.btn-back:hover {
    background: rgba(212,160,23,0.15);
}

.btn-new-lookup {
    background: transparent;
    border: 1px solid rgba(255,248,231,0.3);
    color: rgba(255,248,231,0.6);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s;
}

.btn-new-lookup:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* ═══════════════ Responsive ═══════════════ */

@media (max-width: 640px) {
    .title-cn { font-size: 2rem; }
    .form-row-datetime { flex-wrap: wrap; }
    .form-row-datetime .form-group { flex: 1 1 40%; }
    .form-row-options { flex-direction: column; gap: 16px; }
    .bazi-chart { gap: 8px; }
    .pillar { min-width: 72px; padding: 10px 8px; }
    .tiangan, .dizhi { font-size: 1.6rem; }
    .daily-header { flex-direction: column; text-align: center; }
    .dashboard-card { padding: 24px 16px; }
    .ql-header-bar { flex-direction: column; gap: 10px; text-align: center; }
}
