:root {
    --bg: #f5f1e8;
    --card: #fffdf8;
    --ink: #3b2f2f;
    --ink-2: #6b5d52;
    --red: #a4322a;
    --red-deep: #7a211c;
    --gold: #b98a2f;
    --line: #e5dcc8;
    --wx-金: #b8860b;
    --wx-木: #2e7d32;
    --wx-水: #1565c0;
    --wx-火: #c62828;
    --wx-土: #8d6e63;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Serif SC", serif;
    background: var(--bg);
    background-image: radial-gradient(circle at 20% 10%, rgba(185,138,47,.06) 0, transparent 40%),
                      radial-gradient(circle at 80% 90%, rgba(164,50,42,.06) 0, transparent 40%);
    color: var(--ink);
    line-height: 1.7;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px 48px; }

/* 顶部导航 · 古朴深邃 */
.topnav {
    position: sticky; top: 0; z-index: 100;
    background: linear-gradient(180deg, #4a3b2d 0%, #3e3024 55%, #34291c 100%);
    border-bottom: 1px solid #2a2015;
    box-shadow: 0 2px 12px rgba(40, 26, 12, .3), inset 0 1px 0 rgba(222, 178, 96, .22);
}
.topnav > * { display: flex; }
.topnav {
    display: flex; align-items: center; justify-content: space-between;
    max-width: 860px; margin: 0 auto; padding: 0 16px; height: 58px;
}
.tn-logo {
    font-family: "KaiTi", "STKaiti", "Noto Serif SC", serif;
    font-size: 21px; letter-spacing: 5px; font-weight: 700;
    color: #ecc880;
    text-shadow: 0 1px 2px rgba(0,0,0,.35);
    text-decoration: none;
}
.tn-logo::after {
    content: ""; display: inline-block; width: 1px; height: 16px;
    margin: 0 0 0 16px; vertical-align: -3px;
    background: linear-gradient(180deg, transparent, rgba(185,138,47,.55), transparent);
}
.tn-links {
    display: flex; gap: 6px; flex-wrap: wrap;
    font-family: "KaiTi", "STKaiti", "Noto Serif SC", serif;
    font-size: 15px; letter-spacing: 2px;
}
.tn-links a {
    position: relative;
    color: #dccaa8;
    padding: 5px 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: color .25s, background .25s;
}
.tn-links a::before,
.tn-links a::after {
    content: "·"; color: rgba(185,138,47,0); transition: color .25s;
}
.tn-links a::before { margin-right: 6px; }
.tn-links a::after  { margin-left: 6px; }
.tn-links a:hover { color: #f6e2b2; background: rgba(222, 178, 96, .16); }
.tn-links a:hover::before, .tn-links a:hover::after { color: rgba(222, 178, 96, .8); }
.tn-links a.on {
    color: #faecc8;
    font-weight: 700;
    background: linear-gradient(180deg, rgba(164,50,42,.45), rgba(122,33,28,.32));
    box-shadow: inset 0 0 0 1px rgba(222, 178, 96, .5), 0 1px 3px rgba(0,0,0,.3);
}
.tn-links a.on::before, .tn-links a.on::after { color: #ecc880; }
@media (max-width: 600px) {
    .topnav { height: auto; flex-direction: column; gap: 6px; padding: 10px 12px; }
    .tn-links { justify-content: center; gap: 2px; }
    .tn-logo::after { display: none; }
}

.hero { text-align: center; padding: 42px 16px 26px; }
.bagua { font-size: 52px; color: var(--red); animation: spin 24s linear infinite; display: inline-block; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.hero h1 { font-size: 34px; letter-spacing: 14px; margin-left: 14px; color: var(--red-deep); font-weight: 700; }
.hero .sub { color: var(--ink-2); margin-top: 6px; font-size: 14px; letter-spacing: 3px; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 24px 26px;
    margin-bottom: 22px;
    box-shadow: 0 3px 14px rgba(90, 60, 30, .06);
}
.card h2 { font-size: 20px; color: var(--red-deep); border-bottom: 1px dashed var(--line); padding-bottom: 10px; margin-bottom: 16px; }
.card h2 .date { font-size: 13px; color: var(--ink-2); font-weight: normal; float: right; margin-top: 6px; }
.card h3 { font-size: 16px; color: var(--red-deep); margin: 18px 0 10px; }

/* 黄历 */
.alm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 18px; }
.alm-item { display: flex; gap: 10px; align-items: baseline; }
.alm-k { color: var(--gold); font-size: 13px; min-width: 84px; white-space: nowrap; }
.alm-v { font-size: 15px; }
.alm-v.big { font-size: 19px; font-weight: 700; color: var(--red); letter-spacing: 4px; }
.alm-v.warn { color: var(--red); }
.alm-v.term { color: #1565c0; font-weight: 700; }

.yiji { display: flex; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.yiji > div { flex: 1; min-width: 260px; padding: 12px 14px; border-radius: 8px; font-size: 14px; }
.yiji .yi { background: #f0f7ee; border: 1px solid #cfe3c8; }
.yiji .ji { background: #fbf0ee; border: 1px solid #ecd2cc; }
.yiji .tag {
    display: inline-block; width: 26px; height: 26px; line-height: 26px; text-align: center;
    border-radius: 50%; color: #fff; margin-right: 8px; font-size: 14px;
}
.yi .tag { background: #3d7a3a; }
.ji .tag { background: var(--red); }

.jishi { margin-top: 16px; }
.jishi-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.hour {
    padding: 5px 10px; border-radius: 6px; font-size: 14px;
    background: #f2ede0; border: 1px solid var(--line); color: var(--ink-2);
}
.hour.good { background: #fdf3e0; border-color: var(--gold); color: var(--red-deep); font-weight: 700; }

/* 测算表单 */
.calc .tip { color: var(--ink-2); font-size: 13px; margin-bottom: 14px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--gold); margin-bottom: 6px; }
.form input, .form select {
    padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
    background: #fff; font-size: 15px; color: var(--ink); outline: none;
}
.form input:focus, .form select:focus { border-color: var(--gold); }
.date-selects { display: flex; gap: 8px; flex-wrap: wrap; }
.date-selects input { width: 90px; }
.btn {
    margin-top: 8px; padding: 11px 34px; border: none; border-radius: 30px;
    background: linear-gradient(135deg, var(--red), var(--red-deep));
    color: #fff; font-size: 16px; letter-spacing: 4px; cursor: pointer;
    box-shadow: 0 4px 12px rgba(164, 50, 42, .3); transition: transform .15s;
}
.btn:hover { transform: translateY(-2px); }
.error { color: var(--red); margin-top: 10px; font-size: 14px; }

/* 结果 */
.pillars { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 8px 0 4px; }
.pillar { text-align: center; background: #faf6ec; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; min-width: 96px; }
.p-label { font-size: 12px; color: var(--gold); }
.p-gz { font-size: 24px; font-weight: 700; letter-spacing: 4px; margin: 4px 0; }
.p-gz.main { color: var(--red); }
.p-wx { display: flex; gap: 6px; justify-content: center; }
.wx { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; color: #fff; }
.wx-金 { background: var(--wx-金); } .wx-木 { background: var(--wx-木); }
.wx-水 { background: var(--wx-水); } .wx-火 { background: var(--wx-火); }
.wx-土 { background: var(--wx-土); }
.hour-note { text-align: center; color: var(--ink-2); font-size: 12px; margin-bottom: 6px; }

.wx-bars { margin-top: 4px; }
.wx-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.wx-bar-row .wx { width: 34px; text-align: center; }
.bar { flex: 1; height: 12px; background: #efe9d8; border-radius: 6px; overflow: hidden; }
.fill { height: 100%; border-radius: 6px; transition: width .6s; }
.cnt { width: 20px; text-align: center; color: var(--ink-2); font-size: 13px; }
.xiyong { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.xiyong b { color: var(--red); }

.fortune { display: flex; gap: 22px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.score-ring {
    width: 120px; height: 120px; border-radius: 50%; flex-shrink: 0;
    background: conic-gradient(var(--red) calc(var(--score) * 1%), #efe9d8 0);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 10px; background: var(--card); border-radius: 50%; }
.score-num { font-size: 34px; font-weight: 700; color: var(--red); position: relative; line-height: 1.1; }
.score-label { font-size: 13px; color: var(--gold); position: relative; }
.fortune-info { flex: 1; min-width: 260px; }
.comment { color: var(--ink); font-size: 15px; margin: 6px 0 12px; }
.lucks { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--ink-2); }

.notes { margin-top: 18px; background: #fbf6ea; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; }
.notes ol { padding-left: 20px; }
.notes li { font-size: 14px; margin-bottom: 6px; }
.disclaimer { margin-top: 16px; font-size: 12px; color: #a99e8e; text-align: center; }

.footer { text-align: center; color: #a99e8e; font-size: 12px; padding: 18px 0 30px; }

@media (max-width: 600px) {
    .hero h1 { font-size: 26px; letter-spacing: 8px; }
    .card { padding: 18px; }
    .alm-k { min-width: 70px; }
}

/* ========== 生辰页扩展 ========== */
/* 四柱扩展信息（纳音/十神/藏干） */
.p-extra { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.p-nayin { color: #b8860b; letter-spacing: 1px; }
.p-ss { color: #a4322a; font-weight: 700; letter-spacing: 2px; }
.p-cg { color: var(--ink-2); }

/* 性别选择 */
.gender-pick { display: flex; gap: 12px; }
.gender-pick .gp input { display: none; }
.gender-pick .gp span {
    display: inline-block; padding: 6px 26px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--card); cursor: pointer; transition: all .2s; letter-spacing: 3px;
}
.gender-pick .gp input:checked + span {
    border-color: var(--red); color: var(--red-deep); font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(164,50,42,.25); background: rgba(164,50,42,.04);
}

/* 命主信息 */
.ming-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.ming-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; background: #fff; }
.ming-k { display: block; font-size: 12px; color: var(--ink-2); letter-spacing: 2px; }
.ming-v { display: block; font-size: 16px; font-weight: 700; margin-top: 4px; color: var(--red-deep); font-family: "KaiTi","STKaiti",serif; }

/* 大运 */
.dayun-row { display: flex; gap: 8px; flex-wrap: wrap; }
.dy-item {
    flex: 1 1 100px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 6px;
    text-align: center; background: linear-gradient(180deg, #fffdf8, #f7f1e3);
}
.dy-gz { font-size: 22px; font-weight: 700; color: var(--red-deep); font-family: "KaiTi","STKaiti",serif; letter-spacing: 2px; }
.dy-age { font-size: 12px; color: var(--ink-2); margin-top: 4px; }

/* 命理小知识 */
.bz-know { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.bk-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fff; }
.bk-item h4 { color: var(--red-deep); font-size: 14px; margin-bottom: 6px; letter-spacing: 2px; }
.bk-item p { font-size: 12px; color: var(--ink-2); line-height: 1.8; }

/* ========== 会员中心（生辰页） ========== */
.account .sub-h { font-size: 12px; font-weight: 400; color: var(--ink-2); letter-spacing: 1px; }
.tabs { display: flex; gap: 8px; margin: 12px 0 6px; }
.tab { border: 1px solid var(--line); background: var(--card); color: var(--ink-2); padding: 6px 24px; border-radius: 20px; cursor: pointer; font-family: "KaiTi","STKaiti",serif; letter-spacing: 3px; transition: all .2s; }
.tab.on { border-color: var(--red); color: #fff; background: linear-gradient(180deg,#b4322a,#8a241d); box-shadow: 0 2px 6px rgba(140,40,30,.3); }
.me-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 10px; margin: 14px 0; }
.me-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-align: center; background: #fff; }
.me-k { display: block; font-size: 12px; color: var(--ink-2); letter-spacing: 2px; }
.me-v { display: block; font-size: 17px; font-weight: 700; margin-top: 6px; color: var(--red-deep); font-family: "KaiTi","STKaiti",serif; }
.me-v.bz { letter-spacing: 3px; font-size: 18px; }
.btn.ghost { display: inline-block; margin-top: 6px; border: 1px solid var(--red); color: var(--red-deep); background: transparent; padding: 8px 22px; border-radius: 8px; text-decoration: none; letter-spacing: 3px; }
.btn.ghost:hover { background: rgba(164,50,42,.06); }
.warn { background: rgba(184,134,11,.12); border: 1px solid rgba(184,134,11,.4); color: #8a6d1a; padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 8px; }
