/* ============================================================
   易策 · 墨夜朱金 设计系统
   深墨画布 × 朱砂行动色 × 鎏金结构色 × 宣纸文字色
   ============================================================ */

/* === 设计令牌 === */
:root {
    --bg: #14161c;
    --bg-deep: #0f1116;
    --surface: #1c2028;
    --surface-2: #232834;
    --surface-3: #2a3040;
    --border: #2e3543;
    --border-soft: #262c38;

    --text: #e9e4d8;
    --text-2: #aca698;
    --text-3: #7e8494;

    --gold: #d8ab53;
    --gold-2: #f0cd85;
    --gold-dim: #a3823f;
    --cinnabar: #e0502f;
    --cinnabar-2: #f26a45;
    --cinnabar-deep: #b93a1f;
    --jade: #4fb380;
    --azure: #6b9fe8;

    --font-display: "Ma Shan Zheng", "KaiTi", "STKaiti", "楷体", serif;
    --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;

    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --r: 10px;
}

/* === 全局 === */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(216, 171, 83, 0.28); color: var(--text); }

a { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-2); }

.hidden { display: none !important; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; border: 2px solid var(--bg-deep); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* === 环境背景层（八卦字符 + 光晕） === */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient::before {
    content: ''; position: absolute; inset: 0;
    background:
        radial-gradient(900px 620px at 10% -10%, rgba(224, 80, 47, 0.10), transparent 62%),
        radial-gradient(1000px 720px at 94% 110%, rgba(216, 171, 83, 0.09), transparent 62%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}
.amb-glyph {
    position: absolute; left: var(--x); top: var(--y);
    font-family: var(--font-display); font-size: var(--s, 5rem);
    color: rgba(216, 171, 83, 0.06); white-space: nowrap; user-select: none;
    animation: amb-float var(--d, 24s) ease-in-out infinite alternate;
}
@keyframes amb-float {
    from { transform: translateY(-16px) rotate(-4deg); }
    to   { transform: translateY(16px) rotate(4deg); }
}

/* 内容置于背景层之上 */
.navbar, .container, .footer { position: relative; z-index: 1; }

/* === 导航栏 === */
.navbar {
    background: rgba(18, 20, 26, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-soft);
    padding: 0 2rem;
    display: flex; align-items: center; justify-content: space-between;
    height: 62px;
    position: sticky; top: 0; z-index: 100;
}

.nav-brand { display: flex; align-items: baseline; gap: 0.6rem; }
.brand-mark {
    font-size: 1.5rem; color: var(--gold);
    text-shadow: 0 0 18px rgba(216, 171, 83, 0.45);
    align-self: center;
}
.nav-brand a {
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1.55rem;
    letter-spacing: 4px;
}
.nav-brand a:hover { color: var(--gold-2); }

.nav-subtitle { color: var(--text-3); font-size: 0.78rem; letter-spacing: 1px; }

.nav-links a {
    color: var(--text-2);
    margin-left: 1.6rem;
    font-size: 0.95rem;
    padding: 0.55rem 0;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .25s;
}
.nav-links a:hover { color: var(--gold-2); border-bottom-color: var(--gold-dim); }
.nav-links a.active { color: var(--gold); border-bottom-color: var(--gold); }

/* === 容器 === */
.container { max-width: 980px; margin: 2.2rem auto; padding: 0 1.5rem; }

/* === 卡片 === */
.card {
    background: linear-gradient(180deg, var(--surface) 0%, #1a1e26 100%);
    border: 1px solid var(--border-soft);
    border-radius: var(--r);
    padding: 1.6rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
}
/* 卡片顶部鎏金饰线 */
.card::before {
    content: ''; position: absolute; top: 0; left: 1.4rem; right: 1.4rem; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(216, 171, 83, 0.35), transparent);
}

.card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 400;
    letter-spacing: 2px;
    margin-bottom: 1.1rem;
    color: var(--gold);
    display: flex; align-items: center; gap: 0.55rem;
}
.card h3::before {
    content: ''; width: 4px; height: 1.05em; border-radius: 2px;
    background: linear-gradient(180deg, var(--gold), var(--cinnabar));
    flex-shrink: 0;
}
.card h3 .hint { font-family: var(--font-body); font-size: 0.78rem; color: var(--text-3); font-weight: normal; letter-spacing: 0; }

/* === 按钮 === */
.btn {
    display: inline-block;
    padding: 0.55rem 1.35rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.92rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: transform .18s, box-shadow .25s, background .2s, border-color .2s, color .2s;
    letter-spacing: 1px;
}
.btn:active { transform: translateY(1px) scale(0.98); }

.btn-primary {
    background: linear-gradient(180deg, var(--cinnabar-2), var(--cinnabar-deep));
    color: #fff;
    box-shadow: 0 4px 16px rgba(224, 80, 47, 0.32);
}
.btn-primary:hover { box-shadow: 0 6px 22px rgba(242, 106, 69, 0.45); transform: translateY(-1px); color: #fff; }

.btn-secondary {
    background: transparent;
    color: var(--text-2);
    border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--gold-dim); color: var(--gold-2); background: rgba(216, 171, 83, 0.06); }

.btn-danger { background: linear-gradient(180deg, #d64545, #a02b2b); color: #fff; }
.btn-danger:hover { box-shadow: 0 4px 16px rgba(214, 69, 69, 0.4); }

.btn-large { padding: 0.8rem 2.4rem; font-size: 1.02rem; }
.btn-sm {
    padding: 0.28rem 0.7rem; font-size: 0.8rem; border-radius: 6px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); cursor: pointer;
    transition: border-color .2s, color .2s;
}
.btn-sm:hover { border-color: var(--gold-dim); color: var(--gold-2); }

/* === 表单 === */
.form-group { margin-bottom: 1.1rem; flex: 1; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--text-2); }

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.55rem 0.8rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.92rem;
    font-family: var(--font-body);
    transition: border-color .2s, box-shadow .2s;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-3); }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216, 171, 83, 0.14);
}
.form-group select option { background: var(--surface-2); color: var(--text); }

.form-row { display: flex; gap: 1rem; }
.form-actions { display: flex; gap: 0.6rem; margin-top: 0.6rem; }

/* === 起卦时间选择 === */
.time-toggle { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.time-pill {
    flex: 1; padding: 0.5rem 1rem; border-radius: 8px;
    border: 1px solid var(--border); background: var(--surface-2);
    font-size: 0.85rem; color: var(--text-3); cursor: pointer; transition: all .2s;
}
.time-pill.active { border-color: var(--gold); background: rgba(216, 171, 83, 0.08); color: var(--gold); font-weight: 600; }
.time-hint { padding: 0.55rem 0.8rem; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 8px; font-size: 0.8rem; color: var(--text-3); line-height: 1.5; }

.label-tip { font-size: 0.75rem; color: var(--cinnabar-2); font-weight: 600; }
.field-hint {
    margin-top: 0.55rem; padding: 0.55rem 0.8rem;
    background: rgba(224, 80, 47, 0.07); border-left: 3px solid var(--cinnabar);
    border-radius: 6px; font-size: 0.78rem; color: var(--text-2); line-height: 1.65;
}
.field-hint b { color: var(--cinnabar-2); }

.time-custom-area { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.time-custom-area .sub-label { font-size: 0.8rem; color: var(--text-3); margin-bottom: 0.25rem; display: block; }
.time-custom-area .form-row { display: flex; gap: 0.75rem; }
.time-custom-area .form-row > div { flex: 1; }
.time-custom-area input[type="date"], .time-custom-area input[type="time"] {
    width: 100%; padding: 0.55rem 0.8rem; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 0.92rem;
    color-scheme: dark;
}

/* === 表格 === */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 0.65rem 0.8rem; font-size: 0.78rem; letter-spacing: 1px; color: var(--gold-dim); border-bottom: 2px solid var(--border); text-transform: uppercase; }
.data-table td { padding: 0.65rem 0.8rem; font-size: 0.9rem; color: var(--text-2); border-bottom: 1px solid var(--border-soft); }
.data-table tr:hover { background: rgba(216, 171, 83, 0.05); cursor: pointer; }
.data-table tr:hover td { color: var(--text); }

/* === 状态标签（红涨绿跌） === */
.status-badge { padding: 0.18rem 0.55rem; border-radius: 10px; font-size: 0.75rem; font-weight: 600; }
.status-empty { background: rgba(126, 132, 148, 0.16); color: var(--text-3); }
.status-holding { background: rgba(216, 171, 83, 0.14); color: var(--gold); }
.status-profit { background: rgba(224, 80, 47, 0.16); color: var(--cinnabar-2); }
.status-loss { background: rgba(79, 179, 128, 0.14); color: var(--jade); }

/* === 首页 === */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat-item {
    text-align: center; padding: 1.2rem 1rem;
    background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--r);
    transition: border-color .25s, transform .25s;
}
.stat-item:hover { border-color: var(--gold-dim); transform: translateY(-2px); }
.stat-value { display: block; font-family: var(--font-display); font-size: 2.4rem; line-height: 1.1; color: var(--gold); text-shadow: 0 0 22px rgba(216, 171, 83, 0.3); }
.stat-label { font-size: 0.8rem; color: var(--text-3); letter-spacing: 1px; }
.quick-actions { display: flex; gap: 0.8rem; margin-top: 1.2rem; }
.empty-hint { text-align: center; color: var(--text-3); padding: 2rem; }

/* 首页首屏（卦象开场） */
.hero-card { display: flex; align-items: center; gap: 2rem; overflow: hidden; }
.hero-copy { flex: 1; }
.hero-title {
    font-family: var(--font-display); font-weight: 400;
    font-size: clamp(2.4rem, 5vw, 3.4rem); letter-spacing: 6px; line-height: 1.15;
    color: var(--text);
}
.hero-title .accent { color: var(--gold); text-shadow: 0 0 26px rgba(216, 171, 83, 0.4); }
.hero-sub { margin-top: 0.6rem; color: var(--text-2); font-size: 0.95rem; max-width: 34em; }
.hero-hex { flex-shrink: 0; text-align: center; }
.hero-hex .hex-visual { width: 96px; }
.hero-hex .hex-line-seg { background: var(--gold); box-shadow: 0 0 12px rgba(216, 171, 83, 0.35); }
.hero-hex-name { margin-top: 0.7rem; font-family: var(--font-display); color: var(--gold-dim); letter-spacing: 3px; font-size: 1rem; }
@media (max-width: 640px) { .hero-card { flex-direction: column; text-align: center; } .hero-sub { margin-left: auto; margin-right: auto; } .quick-actions { justify-content: center; } }

/* === 摇卦页 === */
.method-select { display: flex; gap: 1rem; }
.method-btn {
    flex: 1; padding: 1.1rem; border: 1px solid var(--border); border-radius: var(--r);
    background: var(--surface-2); cursor: pointer; text-align: center;
    transition: border-color .2s, background .2s, transform .2s; font-size: 0.95rem; color: var(--text-2);
}
.method-btn:hover { border-color: var(--gold-dim); transform: translateY(-2px); }
.method-btn.active { border-color: var(--gold); background: rgba(216, 171, 83, 0.08); color: var(--gold); }
.method-img { width: 26px; height: 26px; display: block; margin: 0 auto 0.35rem; object-fit: contain; }
.method-btn span { display: block; letter-spacing: 2px; }

/* 铜钱 */
.coin-area { text-align: center; padding: 1.2rem 0; }
.coin-hint { font-size: 0.85rem; color: var(--text-3); margin-bottom: 1.1rem; }
.coins-container { display: flex; justify-content: center; gap: 1.6rem; margin-bottom: 1.6rem; }
.coin.clickable {
    width: 84px; height: auto; background: none; border-radius: 0; box-shadow: none;
    flex-direction: column; gap: 0.35rem; cursor: pointer; transition: transform .2s;
}
.coin.clickable:hover { transform: scale(1.08); }
.coin.clickable:active { transform: scale(0.95); }
.coin-img {
    width: 62px; height: 62px; object-fit: contain; border-radius: 50%;
    transition: transform .3s, filter .3s, box-shadow .3s;
    box-shadow: 0 0 0 rgba(216, 171, 83, 0);
}
.coin.clickable:hover .coin-img { box-shadow: 0 0 22px rgba(216, 171, 83, 0.4); }
.coin.is-yin .coin-img { filter: brightness(0.7) saturate(0.6); transform: rotateY(180deg); }
.coin-label { font-size: 0.8rem; font-weight: 600; color: var(--text-3); letter-spacing: 2px; }
.toss-progress { margin-top: 0.8rem; font-size: 0.9rem; color: var(--gold-dim); letter-spacing: 2px; }

/* 爻线（视觉化，阳爻连续/阴爻两段 — 遵循既有规范） */
.lines-display { margin-top: 1.6rem; max-width: 320px; margin-left: auto; margin-right: auto; }
.line-row { display: flex; align-items: center; padding: 0.5rem 0; border-bottom: 1px dashed var(--border-soft); }
.line-pos { font-size: 0.8rem; color: var(--text-3); width: 42px; flex-shrink: 0; letter-spacing: 1px; }
.line-visual { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 24px; }
.line-seg { display: block; height: 6px; border-radius: 3px; background: var(--text-2); transition: background .3s, box-shadow .3s; }
.line-yang .line-seg { width: 100%; background: var(--gold); box-shadow: 0 0 10px rgba(216, 171, 83, 0.28); }
.line-yin .line-seg { flex: 1; background: var(--text-2); }
.line-changing .line-seg { background: var(--cinnabar-2); box-shadow: 0 0 12px rgba(242, 106, 69, 0.4); }
.line-change { width: 22px; text-align: center; font-size: 1rem; color: var(--cinnabar-2); font-weight: 700; flex-shrink: 0; }

/* 卦象结果 */
.hexagram-result {
    display: flex; align-items: center; justify-content: center; gap: 2rem;
    padding: 1.6rem; background: var(--surface-2); border: 1px solid var(--border-soft);
    border-radius: var(--r); margin-bottom: 1rem;
}
.hex-main, .hex-changed { text-align: center; }
.hex-name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; letter-spacing: 3px; margin-bottom: 0.4rem; color: var(--gold); }
.hex-visual { display: flex; flex-direction: column; gap: 6px; width: 120px; margin: 0 auto; }
.hex-line-row { display: flex; align-items: center; justify-content: center; gap: 8px; height: 12px; }
.hex-line-seg { height: 6px; border-radius: 3px; background: var(--text-2); }
.hex-line-yang { width: 100%; background: var(--gold); box-shadow: 0 0 10px rgba(216, 171, 83, 0.3); }
.hex-line-yin-seg { flex: 1; }
.hex-arrow { font-size: 1.6rem; color: var(--cinnabar-2); }
.changing-info { text-align: center; font-size: 0.85rem; color: var(--text-2); margin-bottom: 1.1rem; letter-spacing: 1px; }
.result-actions { display: flex; gap: 0.8rem; justify-content: center; }

/* === 股票搜索下拉 === */
.stock-search-wrap { position: relative; }
.search-dropdown {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
    max-height: 210px; overflow-y: auto; z-index: 50; box-shadow: var(--shadow); margin-top: 4px;
}
.search-item { padding: 0.55rem 0.8rem; cursor: pointer; font-size: 0.85rem; color: var(--text-2); border-bottom: 1px solid var(--border-soft); transition: background .15s, color .15s; }
.search-item:hover { background: rgba(216, 171, 83, 0.08); color: var(--gold-2); }
.search-item .price { float: right; color: var(--text-3); }
.search-item-empty { cursor: default; color: var(--text-3); font-style: italic; }
.search-item-empty:hover { background: transparent; color: var(--text-3); }

/* === 六爻排盘 === */
.paipan-card { margin-bottom: 1rem; }
.paipan-head { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.8rem; }
.paipan-tag {
    font-size: 0.78rem; padding: 0.22rem 0.65rem; border-radius: 12px;
    background: rgba(216, 171, 83, 0.08); color: var(--gold); border: 1px solid rgba(216, 171, 83, 0.22);
    letter-spacing: 1px;
}
.paipan-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.paipan-table th { text-align: left; padding: 0.45rem 0.6rem; color: var(--gold-dim); font-weight: 600; border-bottom: 2px solid var(--border); white-space: nowrap; letter-spacing: 1px; }
.paipan-table td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--border-soft); white-space: nowrap; color: var(--text-2); }
.paipan-row-move { background: rgba(224, 80, 47, 0.08); }
.paipan-row-move td { font-weight: 600; color: var(--cinnabar-2); }
.paipan-yao { letter-spacing: 1px; color: var(--gold); }
.paipan-mark { display: inline-block; font-size: 0.72rem; padding: 0.06rem 0.4rem; border-radius: 4px; margin-right: 0.25rem; color: #fff; font-weight: 600; }
.mark-shi { background: var(--cinnabar-deep); }
.mark-ying { background: #3d6ca8; }
.mark-kong { background: #565e70; }
.paipan-fushen { margin-top: 0.8rem; padding: 0.55rem 0.8rem; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 8px; font-size: 0.82rem; color: var(--text-2); }
.fushen-label { font-weight: 600; margin-right: 0.5rem; color: var(--gold-dim); }
.fushen-item { margin-right: 0.9rem; }
.paipan-note { margin-top: 0.65rem; font-size: 0.75rem; color: var(--text-3); }
@media (max-width: 640px) {
    .paipan-table { font-size: 0.76rem; }
    .paipan-table th, .paipan-table td { padding: 0.3rem 0.35rem; }
}

/* === 页面头部 / 页脚 === */
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.page-header h2 { margin: 0; font-family: var(--font-display); font-weight: 400; letter-spacing: 3px; color: var(--text); font-size: 1.7rem; }
.footer { text-align: center; padding: 2.2rem; color: var(--text-3); font-size: 0.8rem; letter-spacing: 1px; border-top: 1px solid var(--border-soft); margin-top: 2rem; }

/* === 解卦页 === */
.interpret-page { max-width: 820px; margin: 0 auto; padding: 2rem 1rem; }
.back-link { color: var(--gold-dim); font-size: 0.9rem; }
.back-link:hover { color: var(--gold-2); }

.hexagram-info-card { margin-bottom: 1.5rem; }
.hexagram-display {
    display: flex; align-items: center; justify-content: center; gap: 2rem;
    padding: 1.6rem; background: var(--surface-2); border: 1px solid var(--border-soft);
    border-radius: var(--r); margin-bottom: 1.1rem;
}
.hex-section { text-align: center; }
.hex-label { font-size: 0.82rem; color: var(--text-3); margin-bottom: 0.5rem; letter-spacing: 2px; }

.divination-meta { display: flex; flex-direction: column; gap: 0.75rem; padding: 1.1rem; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--r); }
.meta-item { display: flex; gap: 0.6rem; font-size: 0.9rem; }
.meta-label { color: var(--text-3); min-width: 80px; letter-spacing: 1px; }
.meta-value { color: var(--text); font-weight: 500; }

.interpret-result-card { margin-bottom: 1.5rem; }
.interpret-content { padding: 1rem 0; }

#interpret-text { white-space: normal; line-height: 1.85; font-size: 0.96rem; color: var(--text); }
#interpret-text h2 { font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; letter-spacing: 2px; margin: 1.4rem 0 0.55rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--border); color: var(--gold); }
#interpret-text h3 { font-size: 1.04rem; margin: 1.05rem 0 0.4rem; color: var(--gold-2); }
#interpret-text p { margin: 0.55rem 0; color: var(--text); }
#interpret-text ul { margin: 0.45rem 0 0.85rem; padding-left: 1.4rem; }
#interpret-text li { margin: 0.28rem 0; color: var(--text-2); }
#interpret-text strong { color: var(--cinnabar-2); }
#interpret-text code { background: var(--surface-3); color: var(--gold-2); padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.9em; }
#interpret-text hr { border: none; border-top: 1px dashed var(--border); margin: 1.1rem 0; }

.interpret-error { padding: 1.1rem; background: rgba(224, 80, 47, 0.1); border: 1px solid rgba(224, 80, 47, 0.35); border-radius: var(--r); color: var(--cinnabar-2); text-align: center; }
.interpret-actions { display: flex; justify-content: center; align-items: center; gap: 1rem; flex-wrap: wrap; }
.interpret-meta { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--text-3); display: flex; gap: 1.5rem; flex-wrap: wrap; }
.saved-status { color: var(--jade); font-size: 0.9rem; display: flex; align-items: center; gap: 0.3rem; }

/* 解卦等待动画 */
.interpret-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3rem 1rem; color: var(--text-2); }
.loading-animation { position: relative; display: inline-block; margin-bottom: 1.5rem; }
.hexagram-symbol { font-size: 4.2rem; color: var(--gold); text-shadow: 0 0 30px rgba(216, 171, 83, 0.5); animation: rotate-symbol 3s ease-in-out infinite; }
@keyframes rotate-symbol { 0%, 100% { transform: rotateY(0deg); opacity: 1; } 50% { transform: rotateY(180deg); opacity: 0.6; } }
.loading-dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1rem; }
.loading-dots span { width: 12px; height: 12px; background: var(--cinnabar); border-radius: 50%; animation: bounce-dots 1.4s ease-in-out infinite; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; background: var(--gold); }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce-dots { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }
.loading-text { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: 3px; color: var(--text); margin-bottom: 0.5rem; animation: pulse-text 2s ease-in-out infinite; }
@keyframes pulse-text { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.loading-subtitle { font-size: 0.9rem; color: var(--text-3); }
.loading-spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 1rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === 历史记录页 === */
.history-page { padding: 1rem 0; }
.record-count { font-size: 0.85rem; color: var(--text-3); letter-spacing: 1px; }
.history-list { display: flex; flex-direction: column; gap: 1rem; }
.history-card { position: relative; transition: transform .2s, box-shadow .2s, border-color .2s; padding-right: 3rem; }
.history-card-content { cursor: pointer; }
.history-card:hover { transform: translateY(-3px); border-color: var(--gold-dim); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); }
.delete-btn {
    position: absolute; top: 0.8rem; right: 0.8rem; width: 28px; height: 28px;
    border: 1px solid var(--border); border-radius: 50%; background: var(--surface-2); color: var(--text-3);
    font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .2s, color .2s, border-color .2s; z-index: 1;
}
.delete-btn:hover { background: var(--cinnabar-deep); border-color: var(--cinnabar); color: #fff; }
.history-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; }
.history-question { font-size: 1rem; font-weight: 600; color: var(--text); flex: 1; }
.history-date { font-size: 0.85rem; color: var(--text-3); white-space: nowrap; margin-left: 1rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.history-hexagram { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.history-hexagram .hex-name { font-size: 1.1rem; margin-bottom: 0; }
.history-hexagram .hex-arrow { font-size: 1.1rem; }
.history-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.stock-tag, .model-tag { font-size: 0.8rem; padding: 0.2rem 0.65rem; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--text-3); }
.stock-tag { color: var(--gold); border-color: rgba(216, 171, 83, 0.22); }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-3); }
.empty-state p { margin-bottom: 1rem; }

/* === 持仓页 === */
.positions-page .page-header h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: 3px; font-size: 1.7rem; }

/* === 响应式 === */
@media (max-width: 720px) {
    .navbar { padding: 0 1rem; }
    .nav-links a { margin-left: 0.9rem; font-size: 0.88rem; }
    .nav-subtitle { display: none; }
    .container { margin: 1.4rem auto; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
    .stat-value { font-size: 1.8rem; }
    .hexagram-result, .hexagram-display { gap: 1.2rem; }
    .form-row { flex-direction: column; gap: 0.5rem; }
}

/* ============================================================
   多用户系统增补样式（additive，不改既有选择器）
   ============================================================ */

/* === 导航：注册 CTA / 退出 / 次数徽章 === */
.btn-nav-cta {
    padding: 0.35rem 1rem;
    border: 1px solid var(--gold-dim);
    border-radius: 8px;
    color: var(--gold-2) !important;
    background: rgba(216, 171, 83, 0.08);
}
.btn-nav-cta:hover { background: rgba(216, 171, 83, 0.16); border-color: var(--gold); }
.nav-logout { color: var(--text-3) !important; }
.nav-logout:hover { color: var(--cinnabar-2) !important; }
.credit-badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    margin-left: 0.9rem;
    font-size: 0.82rem;
    color: var(--gold-2);
    background: rgba(216, 171, 83, 0.10);
    border: 1px solid rgba(216, 171, 83, 0.3);
    border-radius: 999px;
}
.credit-badge-lg { font-size: 0.95rem; padding: 0.3rem 0.95rem; margin-left: 0; }

/* === 认证表单（登录/注册/找回） === */
.auth-wrap { display: flex; justify-content: center; padding: 2rem 0; }
.auth-card { width: 100%; max-width: 440px; padding: 2.2rem 2rem; }
.auth-title { font-family: var(--font-display); font-weight: 400; letter-spacing: 2px; font-size: 1.7rem; margin-bottom: 0.4rem; }
.auth-sub { color: var(--text-3); font-size: 0.9rem; margin-bottom: 1.6rem; }
.auth-form .field { display: block; margin-bottom: 1.1rem; }
.field-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--text-2); }
.auth-form input, .redeem-form input, .admin-form input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
}
.auth-form input::placeholder, .redeem-form input::placeholder, .admin-form input::placeholder { color: var(--text-3); }
.auth-form input:focus, .redeem-form input:focus, .admin-form input:focus {
    outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216, 171, 83, 0.14);
}
.field-inline { display: flex; gap: 0.6rem; }
.field-inline input { flex: 1; }
.captcha-box {
    min-width: 118px;
    padding: 0.6rem 0.5rem;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--gold-2);
    font-family: var(--font-body);
    font-size: 1rem;
    letter-spacing: 1px;
    cursor: pointer;
    white-space: nowrap;
}
.captcha-box:hover { border-color: var(--gold-dim); }
.sms-btn { min-width: 118px; white-space: nowrap; }
.sms-btn.disabled, .sms-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; margin-top: 0.4rem; }
.auth-error {
    color: var(--cinnabar-2);
    font-size: 0.88rem;
    padding: 0.55rem 0.75rem;
    background: rgba(224, 80, 47, 0.08);
    border: 1px solid rgba(224, 80, 47, 0.25);
    border-radius: 8px;
    margin-bottom: 0.9rem;
}
.auth-ok {
    color: var(--jade);
    font-size: 0.88rem;
    padding: 0.55rem 0.75rem;
    background: rgba(79, 179, 128, 0.08);
    border: 1px solid rgba(79, 179, 128, 0.25);
    border-radius: 8px;
    margin-bottom: 0.9rem;
}
.auth-links { display: flex; justify-content: space-between; margin-top: 1.3rem; font-size: 0.88rem; }

/* === 落地首页 === */
.landing-hero {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 2rem;
    align-items: center;
    padding: 2.6rem 0 1.4rem;
}
.landing-eyebrow { color: var(--gold); letter-spacing: 1px; font-size: 0.9rem; margin-bottom: 0.8rem; }
.landing-title { font-family: var(--font-display); font-weight: 400; font-size: 3rem; letter-spacing: 3px; line-height: 1.2; }
.landing-title .accent { color: var(--gold-2); }
.landing-sub { color: var(--text-2); font-size: 1.05rem; margin: 1rem 0 1.6rem; max-width: 32em; }
.landing-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.landing-note { color: var(--text-3); font-size: 0.85rem; margin-top: 1rem; }
.landing-hero-hex { display: flex; flex-direction: column; align-items: center; gap: 0.8rem; }
.hero-hex-name { font-family: var(--font-display); color: var(--gold-2); letter-spacing: 3px; font-size: 1.2rem; }
.landing-section { margin: 2.6rem 0; }
.landing-h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: 3px; font-size: 1.7rem; text-align: center; margin-bottom: 1.6rem; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.step-card { position: relative; }
.step-index { font-family: var(--font-display); color: var(--gold-2); font-size: 2rem; margin-bottom: 0.5rem; }
.step-card h3 { margin-bottom: 0.5rem; }
.step-card p { color: var(--text-2); font-size: 0.92rem; }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.feature-card h3 { color: var(--gold-2); margin-bottom: 0.5rem; font-size: 1.05rem; }
.feature-card p { color: var(--text-2); font-size: 0.9rem; }
.pricing-card { max-width: 640px; margin: 0 auto; text-align: center; padding: 2rem; }
.pricing-list { list-style: none; text-align: left; margin: 1.2rem 0 1.6rem; display: flex; flex-direction: column; gap: 0.7rem; }
.pricing-list li { color: var(--text-2); }
.pricing-list .tick { color: var(--jade); font-weight: 700; margin-right: 0.5rem; }
.landing-disclaimer { text-align: center; color: var(--text-3); font-size: 0.82rem; margin: 2rem auto 1rem; max-width: 44em; }

/* === 仪表盘兑换码 === */
.redeem-head { display: flex; align-items: center; justify-content: space-between; }
.redeem-hint { color: var(--text-3); font-size: 0.88rem; margin: 0.5rem 0 1rem; }
.redeem-form { display: flex; gap: 0.7rem; }
.redeem-form input { flex: 1; }
.redeem-msg { margin-top: 0.8rem; font-size: 0.9rem; }
.redeem-msg.ok { color: var(--jade); }
.redeem-msg.err { color: var(--cinnabar-2); }

/* === 管理后台 === */
.page-title { font-family: var(--font-display); font-weight: 400; letter-spacing: 3px; font-size: 1.9rem; margin-bottom: 1.4rem; }
.admin-form { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.admin-form .field { margin-bottom: 0; }
.admin-form .field input { min-width: 140px; }
.gen-result { margin-top: 1rem; }
.gen-result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.gen-codes-text {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--gold-2);
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: 0.9rem;
    padding: 0.7rem;
    resize: vertical;
}
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; }
.admin-table .mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.tag { display: inline-block; padding: 0.12rem 0.55rem; border-radius: 6px; font-size: 0.78rem; }
.tag-used { color: var(--text-3); background: var(--surface-3); border: 1px solid var(--border-soft); }
.tag-unused { color: var(--jade); background: rgba(79, 179, 128, 0.1); border: 1px solid rgba(79, 179, 128, 0.28); }
.tag-admin { color: var(--gold-2); background: rgba(216, 171, 83, 0.1); border: 1px solid rgba(216, 171, 83, 0.3); }

/* === 增补响应式 === */
@media (max-width: 720px) {
    .landing-hero { grid-template-columns: 1fr; }
    .landing-hero-hex { display: none; }
    .landing-title { font-size: 2.2rem; }
    .steps-grid, .features-grid { grid-template-columns: 1fr; }
    .redeem-form { flex-direction: column; }
    .admin-form { flex-direction: column; align-items: stretch; }
}
