/* css/style.css - 基础样式与禅意主题 */
:root {
    --bg: #0e1518;
    --bg-soft: #142025;
    --ink: #e8e4d8;
    --ink-dim: #9aa0a0;
    --gold: #c9a96a;
    --gold-soft: #8a7548;
    --jade: #6fa287;
    --line: rgba(201, 169, 106, 0.18);
    --card: rgba(20, 32, 37, 0.7);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    height: 100%;
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Serif SC", serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.7;
    overflow-x: hidden;
}

#app {
    min-height: 100vh;
    max-width: 720px;
    margin: 0 auto;
    position: relative;
}

/* 顶部细栏 */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    background: rgba(14, 21, 24, 0.92);
    backdrop-filter: blur(8px);
    z-index: 50;
}
.topbar .brand { font-size: 18px; color: var(--gold); letter-spacing: 4px; }
.topbar .quota { font-size: 12px; color: var(--ink-dim); }

/* 通用容器 */
.page { padding: 24px 20px 80px; animation: fade 0.5s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h2.title {
    font-size: 22px;
    color: var(--gold);
    font-weight: 400;
    letter-spacing: 3px;
    margin-bottom: 6px;
}
.subtitle { color: var(--ink-dim); font-size: 13px; margin-bottom: 24px; }

/* 卡片 */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.card h3 { color: var(--gold); font-size: 15px; font-weight: 500; margin-bottom: 12px; letter-spacing: 2px; }

/* 表单 */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--ink-dim); margin-bottom: 6px; }
.field input, .field select, .field textarea {
    width: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 14px;
    color: var(--ink);
    font-size: 15px;
    font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--gold-soft);
}
.field textarea { resize: vertical; min-height: 70px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

/* 按钮 */
.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--gold), var(--gold-soft));
    color: #1a1a1a;
    border: none;
    border-radius: 24px;
    padding: 13px 32px;
    font-size: 15px;
    font-family: inherit;
    letter-spacing: 2px;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.15s;
    text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-block { display: block; width: 100%; }
.btn-ghost {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold-soft);
}
.btn-sm { padding: 8px 18px; font-size: 13px; }

/* 六爻排盘表 */
.paipan { width: 100%; font-size: 14px; }
.paipan .row {
    display: grid;
    grid-template-columns: 38px 1fr 110px 54px 40px 60px;
    gap: 6px;
    align-items: center;
    padding: 7px 4px;
    border-bottom: 1px solid rgba(201, 169, 106, 0.08);
}
.paipan .row.head { color: var(--ink-dim); font-size: 12px; border-bottom: 1px solid var(--line); }
.paipan .yao-yang { color: var(--ink); letter-spacing: 1px; }
.paipan .yao-yin { color: var(--ink); letter-spacing: 1px; }
.paipan .dong { color: var(--gold); }
.paipan .shi, .paipan .ying { color: var(--jade); font-size: 12px; }
.paipan .mark { color: #d88; font-size: 11px; }

/* 信息条 */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 13px; }
.info-grid .k { color: var(--ink-dim); }
.info-grid .v { color: var(--ink); }
.shensha-list { font-size: 13px; color: var(--ink-dim); line-height: 2; }
.shensha-list span { margin-right: 14px; }
.shensha-list b { color: var(--gold); font-weight: 500; }

/* 对话气泡 */
.chat { display: flex; flex-direction: column; gap: 14px; }
.bubble {
    max-width: 88%;
    padding: 13px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}
.bubble.ai { background: var(--card); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.me { background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: #1a1a1a; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-input { display: flex; gap: 10px; margin-top: 16px; position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; }
.chat-input input { flex: 1; }
.chat-input .btn { padding: 11px 20px; }

/* Markdown 渲染区（AI 解读 / 心灵对话 / 评审摘要） */
.bubble.md-body, .md-body { white-space: normal; }
.md-body > *:first-child { margin-top: 0; }
.md-body > *:last-child { margin-bottom: 0; }
.md-body p { margin: .55em 0; }
.md-body h1, .md-body h2 { font: 600 1.15em/1.4 Georgia,"Noto Serif SC",serif; color: var(--gold); margin: .9em 0 .4em; letter-spacing: .02em; }
.md-body h3 { font: 600 1.05em/1.4 Georgia,"Noto Serif SC",serif; color: var(--gold); margin: .85em 0 .35em; }
.md-body h4 { font: 600 1em/1.4 Georgia,"Noto Serif SC",serif; color: var(--accent); margin: .7em 0 .3em; }
.md-body ul, .md-body ol { margin: .45em 0; padding-left: 1.4em; }
.md-body li { margin: .25em 0; }
.md-body li::marker { color: var(--gold-soft); }
.md-body blockquote { border-left: 2px solid var(--gold-soft); padding: 2px 0 2px 12px; color: var(--ink-dim); margin: .6em 0; }
.md-body code { background: rgba(255,255,255,.07); padding: 1px 5px; border-radius: 4px; font-size: .9em; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.md-body pre { background: rgba(0,0,0,.32); padding: 12px 14px; border-radius: 8px; overflow-x: auto; margin: .6em 0; white-space: pre; }
.md-body pre code { background: none; padding: 0; color: var(--ink); }
.md-body hr { border: 0; border-top: 1px solid var(--line); margin: 1em 0; }
.md-body strong { color: var(--gold); font-weight: 650; }
.md-body em { color: var(--ink); font-style: italic; }
.md-body a { color: var(--jade); text-decoration: underline; text-underline-offset: 2px; }

/* 加载点 */
.dots::after { content: '...'; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0%{content:'.'} 33%{content:'..'} 66%{content:'...'} }

/* 提示 */
.toast {
    position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
    background: rgba(20,32,37,0.95); border: 1px solid var(--line);
    color: var(--ink); padding: 12px 22px; border-radius: 24px; font-size: 13px;
    z-index: 100; box-shadow: var(--shadow); animation: fade 0.3s;
}

/* 订阅页 */
.sub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
@media (max-width: 520px) { .sub-grid { grid-template-columns: 1fr; } }
.sub-plan {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    padding: 20px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.sub-name { color: var(--gold); font-size: 17px; letter-spacing: 3px; }
.sub-desc { color: var(--ink-dim); font-size: 12px; margin: 6px 0 14px; }
.sub-price { font-size: 28px; color: var(--ink); letter-spacing: 1px; }
.sub-price small { font-size: 13px; color: var(--ink-dim); margin-left: 4px; }
.sub-bullets { flex: 1; margin: 12px 0 16px; font-size: 13px; color: var(--ink-dim); }
.sub-bullet { line-height: 1.9; }
.sub-note { font-size: 12px; color: var(--ink-dim); margin-top: 8px; }

/* 铜钱摇卦 */
.coin-stage { text-align:center; padding: 18px 0 6px; }
.coin-area { display:flex; gap:18px; justify-content:center; }
.coin {
    width: 58px; height: 58px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #e0c886, #9a8348 70%, #6b5a30);
    color: #2a2010; display:flex; align-items:center; justify-content:center;
    font-size: 22px; font-weight: bold;
    border: 2px solid #5c4d28;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35), inset 0 1px 2px rgba(255,255,255,0.2);
    user-select: none;
}
.coin.spinning { animation: coinSpin 0.18s linear infinite; }
@keyframes coinSpin { from{transform:rotateY(0)} to{transform:rotateY(360deg)} }

/* 摇卦动效（cast-fx.js）：掌心抖动 → 坠落 → 弹起落定 */
.coin { will-change: transform; transform-style: preserve-3d; }
.coin.tossing { animation: coinToss .38s ease-in-out infinite; }
@keyframes coinToss {
    0%   { transform: translateY(0) rotateY(0) rotateZ(0); }
    35%  { transform: translateY(-12px) rotateY(160deg) rotateZ(5deg); }
    70%  { transform: translateY(-4px) rotateY(300deg) rotateZ(-4deg); }
    100% { transform: translateY(0) rotateY(360deg) rotateZ(0); }
}
.coin.dropping { animation: coinDrop .6s cubic-bezier(.36, .86, .55, 1) both; }
@keyframes coinDrop {
    0%   { transform: translateY(-260px) rotateX(0) rotateZ(var(--tilt, 0deg)); opacity: .96; }
    58%  { transform: translateY(0) rotateX(var(--drop-turns, 720deg)) rotateZ(var(--tilt, 0deg)); }
    74%  { transform: translateY(-18px) rotateX(var(--drop-turns, 720deg)) rotateZ(var(--tilt, 0deg)); }
    100% { transform: translateY(0) rotateX(var(--drop-turns, 720deg)) rotateZ(var(--tilt, 0deg)); }
}
.coin.settled { animation: none; }
@media (prefers-reduced-motion: reduce) {
    .coin.tossing, .coin.dropping { animation: none; transition: opacity .25s ease; }
}

.yao-list { margin-top: 8px; }
.yao-row {
    display:flex; justify-content:space-between; align-items:center;
    padding: 9px 4px; border-bottom: 1px solid rgba(201,169,106,0.08);
    font-size: 14px;
}
.yao-row .yao-no { color: var(--ink-dim); font-size: 13px; min-width: 56px; text-align:left;}
.yao-row .yao-sym { font-family: monospace; letter-spacing: 1px; color: var(--ink); flex:1; text-align:center; }
.yao-row .yao-label { color: var(--gold); font-size: 12px; min-width: 80px; text-align:right; }

/* 2026 product polish: quieter editorial luxury, bilingual and responsive. */
:root {
    --bg: #090c0e;
    --bg-soft: #101619;
    --ink: #f1eee7;
    --ink-dim: #9ea6a5;
    --gold: #d8bd82;
    --gold-soft: #8e774b;
    --accent: #e6c47a;
    --jade: #82b5a0;
    --line: rgba(232, 217, 183, .13);
    --card: rgba(18, 24, 27, .78);
    --shadow: 0 24px 80px rgba(0, 0, 0, .34);
}
html { color-scheme: dark; }
body {
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at 15% -10%, rgba(108, 145, 131, .12), transparent 34rem),
        radial-gradient(circle at 90% 0, rgba(180, 140, 74, .10), transparent 30rem), var(--bg);
    letter-spacing: .01em;
}
#app { max-width: 880px; }
.page { padding: clamp(32px, 7vw, 72px) clamp(20px, 5vw, 44px) 100px; }
.topbar {
    padding: 14px clamp(16px, 4vw, 34px); background: rgba(9, 12, 14, .78);
    border-color: rgba(255,255,255,.07); backdrop-filter: blur(20px) saturate(130%);
}
.topbar a, .topbar button { color: var(--ink-dim); text-decoration: none; }
.topbar .brand a { color: var(--gold); font-family: Georgia, "Noto Serif SC", serif; letter-spacing: .13em; }
.topbar nav { display: flex; gap: 18px; align-items: center; font-size: 12px; }
.topbar nav button { background: none; border: 0; cursor: pointer; font: inherit; }
.topbar nav a:hover, .topbar nav button:hover { color: var(--ink); }
.quota-pill { border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }
.lang-switcher { display: inline-flex; gap: 1px; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: rgba(0,0,0,.18); }
.lang-switcher button { background: none; border: 0; color: var(--ink-dim); cursor: pointer; font: inherit; font-size: 11px; line-height: 1; padding: 4px 8px; border-radius: 999px; transition: color .15s, background .15s; }
.lang-switcher button.active { color: var(--ink); background: var(--bg-soft); }
.lang-switcher button:hover { color: var(--ink); }
.eyebrow { color: var(--jade); font-size: 10px; font-weight: 700; letter-spacing: .24em; margin-bottom: 10px; }
h2.title { font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(27px, 5vw, 43px); color: var(--ink); letter-spacing: .02em; line-height: 1.2; }
.subtitle { font-size: 13px; line-height: 1.7; max-width: 630px; }
.card, .sub-plan {
    border: 1px solid rgba(255,255,255,.08); border-radius: 18px;
    background: linear-gradient(145deg, rgba(20,27,30,.9), rgba(13,18,21,.82));
    box-shadow: var(--shadow); padding: clamp(18px, 4vw, 28px);
}
.card h3, .sub-name { font-family: Georgia, "Noto Serif SC", serif; letter-spacing: .04em; }
.btn {
    background: linear-gradient(120deg, #ead49d, #ba9554); color: #17130c;
    box-shadow: 0 8px 28px rgba(202, 165, 93, .16); font-weight: 650; letter-spacing: .08em;
}
.btn-ghost { background: rgba(255,255,255,.015); color: var(--gold); box-shadow: none; }
.quiet-link { color: var(--ink-dim); text-decoration: none; }
.progress-count { float: right; font: 400 12px/1.7 Inter, sans-serif; color: var(--ink-dim); }
.warning, .error-state, .form-error { color: #e9a59e; }
.full-width { max-width: 100%; border-radius: 8px; }
.is-hidden { display: none !important; }
.microcopy, .payment-note { color: var(--ink-dim); font-size: 12px; line-height: 1.7; }
.notice { border: 1px solid var(--line); border-radius: 12px; padding: 12px 15px; margin: 14px 0; font-size: 13px; }
.notice a { color: var(--gold); }
.notice.success { border-color: rgba(130,181,160,.35); color: var(--jade); }

.sub-grid.three { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
.sub-plan { position: relative; min-height: 225px; }
.sub-plan.featured { border-color: rgba(216,189,130,.55); transform: translateY(-6px); }
.plan-badge { position: absolute; top: 12px; right: 12px; color: var(--gold); font-size: 9px; letter-spacing: .16em; }
.sub-price { margin: auto 0 18px; }
.credit-balance { display:flex; align-items:baseline; gap:8px; margin: 28px 0 20px; color:var(--ink-dim); font-size:12px; text-transform:uppercase; letter-spacing:.16em; }
.credit-balance span { font: 46px/1 Georgia, serif; color: var(--ink); }
.payment-note { text-align: center; margin-top: 14px; }

.auth-card { max-width: 520px; }
.auth-tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 12px; margin-bottom: 18px; }
.auth-tabs button { flex: 1; border: 0; border-radius: 9px; padding: 10px; color: var(--ink-dim); background: transparent; cursor:pointer; }
.auth-tabs button.active { color: var(--ink); background: var(--bg-soft); }
.auth-card input, .feedback-card textarea, .feedback-card select,
.payment-feedback-card input, .payment-feedback-card textarea, .payment-feedback-card select {
    width:100%; border:1px solid var(--line); background:var(--bg-soft); color:var(--ink);
    border-radius:11px; padding:13px 14px; margin-bottom:12px; font:inherit;
}
.form-error { min-height: 26px; font-size: 12px; }
.auth-card .microcopy { margin-top: 18px; }
.account-email { color: var(--ink); font-size: 18px; }
.account-metrics { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:25px 0; }
.account-metrics div { padding:18px; border:1px solid var(--line); border-radius:13px; display:flex; flex-direction:column; }
.account-metrics b { font:32px Georgia,serif; color:var(--gold); }
.account-metrics span { color:var(--ink-dim); font-size:11px; text-transform:uppercase; }
.account-actions { display:flex; gap:10px; }

.history-list { display:flex; flex-direction:column; gap:10px; }
.history-item { display:flex; justify-content:space-between; align-items:center; gap:18px; padding:20px; border:1px solid var(--line); border-radius:15px; background:var(--card); }
.history-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:4px; }
.history-select-all { display:flex; align-items:center; gap:8px; color:var(--ink-dim); font-size:13px; cursor:pointer; }
.history-select { display:flex; align-items:center; align-self:stretch; cursor:pointer; }
.history-select input, .history-select-all input { width:17px; height:17px; accent-color:var(--gold); cursor:pointer; }
.history-content { flex:1; min-width:0; }
.analysis-next-action { display:flex; justify-content:center; margin:18px 0; }
.analysis-next-action .btn { min-width:220px; }
.history-item time, .history-item p { color:var(--ink-dim); font-size:11px; }
.history-item h3 { font: 17px/1.45 Georgia,"Noto Serif SC",serif; margin:4px 0; }
.empty-state { text-align:center; color:var(--ink-dim); padding:36px 20px; }

.feedback-card { margin-top:22px; }
.payment-feedback-card { max-width:640px; margin:22px auto 0; }
.payment-feedback-card label { display:block; color:var(--ink-dim); font-size:12px; margin:16px 0 7px; }
.payment-feedback-card .form-error.success { color:var(--jade); }
.rating-row { display:flex; gap:7px; margin:16px 0; }
.rating-row button { border:1px solid var(--line); background:transparent; color:var(--ink-dim); border-radius:999px; padding:7px 10px; cursor:pointer; }
.rating-row button.active { border-color:var(--gold); color:var(--gold); background:rgba(216,189,130,.08); }

@media (max-width: 700px) {
    .topbar nav { gap: 10px; }
    .topbar nav > a:nth-of-type(1) { display:none; }
    .sub-grid.three { grid-template-columns: 1fr; }
    .sub-plan.featured { transform:none; }
    .paipan { overflow-x:auto; }
    .paipan .row { min-width: 590px; }
}
@media (max-width: 480px) {
    .topbar .brand { font-size:14px; }
    .topbar nav { gap:7px; }
    .quota-pill { padding:3px 7px; }
    .field-row { flex-direction:column; gap:0; }
    .history-item { align-items:flex-start; flex-direction:column; }
    .history-select { align-self:flex-start; }
    .history-toolbar { align-items:stretch; flex-direction:column; }
}
