/* 知命 App —— 设计系统
   墨蓝（宇宙、命盘）＋ 金（星、卦）＋ 宣纸底；吉绿凶朱，平灰，参半琥珀。
   ⚠️主题只认 <html data-theme>（首屏脚本写入），不靠 prefers-color-scheme 单独起作用——
   主站「底色是深的、输入框却是白的」那一幕就是两套判据各管一半。 */

:root {
  --bg: #F4F0E6; --bg2: #ECE6D8; --card: #FFFFFF; --card2: #FAF7F0; --line: #E5DDCB;
  --text: #221E1A; --text2: #675F52; --text3: #9A9182;
  --brand: #2B2370; --brand2: #4B40A8; --brand-ink: #FFFFFF;
  --gold: #B88A36; --gold2: #E2BC6C; --gold-soft: #F5E9CC;
  --good: #1D8556; --good-bg: #E2F2E9; --bad: #BF3F2D; --bad-bg: #FAE6E1;
  --flat: #7A7466; --flat-bg: #EEEAE0; --mixed: #A8741A; --mixed-bg: #F8EDD5;
  --great: #0C6E43; --terrible: #962617;
  --hero1: #2E2578; --hero2: #17123E;
  --shadow: 0 1px 2px rgba(45, 32, 10, .05), 0 6px 20px rgba(45, 32, 10, .07);
  --radius: 18px; --radius-s: 12px;
  --tab-h: 62px; --head-h: 54px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
          "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", STSong, serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0C0D13; --bg2: #12141C; --card: #171923; --card2: #1D2030; --line: #2A2D3E;
  --text: #EEE9DE; --text2: #ABA597; --text3: #77726A;
  --brand: #9086F2; --brand2: #B4ACFF; --brand-ink: #14112E;
  --gold: #DDB96E; --gold2: #F2D592; --gold-soft: #33291A;
  --good: #47C18B; --good-bg: #12281E; --bad: #F07A63; --bad-bg: #2E1714;
  --flat: #9C978C; --flat-bg: #22242F; --mixed: #E3AE4E; --mixed-bg: #2C2414;
  --great: #5FD9A0; --terrible: #FF8F79;
  --hero1: #2A2170; --hero2: #0F0C26;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--brand2); text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0; letter-spacing: .02em; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ── 骨架 ── */
.app { max-width: 600px; margin: 0 auto; min-height: 100vh; position: relative;
       padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 18px); }
.app.no-tab { padding-bottom: 32px; }
.head {
  position: sticky; top: 0; z-index: 30; height: var(--head-h);
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.head h1 { font-size: 19px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head .back { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
              color: var(--text); margin-left: -6px; }
.head .back:active { background: var(--bg2); }
.head .act { color: var(--text2); font-size: 14px; }
.wrap { padding: 14px 16px 0; }

/* ── 底栏 ── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar-in { max-width: 600px; margin: 0 auto; display: flex; height: var(--tab-h); }
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--text3); font-size: 11.5px; position: relative; font-weight: 500;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--brand2); }
:root:not([data-theme="dark"]) .tabbar a.on { color: var(--brand); }
.tabbar a.on .ti::after { content: ""; position: absolute; top: 6px; left: 50%; margin-left: 9px;
                          width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.tabbar .dot { position: absolute; top: 7px; left: 50%; margin-left: 6px; min-width: 16px; height: 16px;
               padding: 0 4px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px;
               line-height: 16px; text-align: center; font-weight: 700; }

/* ── 卡片 ── */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 16px; margin-bottom: 14px; border: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.card h2 { font-size: 16.5px; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card h2 .sub { font-family: var(--font); font-size: 12.5px; color: var(--text3); font-weight: 400; margin-left: auto; }
.card h2 .ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
                background: var(--gold-soft); color: var(--gold); font-size: 14px; }
.card.flat { box-shadow: none; }
.muted { color: var(--text2); }
.tiny { font-size: 12.5px; color: var(--text3); }
.sep { height: 1px; background: var(--line); margin: 12px 0; }

/* ── 运势主卡（今日/流月/流年/大运共用）── */
.hero {
  position: relative; overflow: hidden; color: #F6F1E4; border-radius: 22px; padding: 18px 18px 16px;
  background: radial-gradient(120% 90% at 85% 0%, rgba(124, 108, 240, .45), transparent 60%),
              linear-gradient(160deg, var(--hero1), var(--hero2));
  box-shadow: 0 10px 30px rgba(30, 20, 90, .25); margin-bottom: 14px;
}
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px;
               border-radius: 50%; border: 2px solid rgba(226, 188, 108, .25); }
.hero::before { content: ""; position: absolute; right: -10px; top: -10px; width: 120px; height: 120px;
                border-radius: 50%; border: 1px dashed rgba(226, 188, 108, .25); }
.hero .date { font-size: 13px; opacity: .85; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.hero .date b { font-family: var(--serif); font-size: 15px; letter-spacing: .06em; color: var(--gold2); font-weight: 700; }
.hero .verdict { display: flex; align-items: center; gap: 14px; margin: 12px 0 8px; }
.hero .seal {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-family: var(--serif); font-size: 30px; font-weight: 800; letter-spacing: .04em;
  background: rgba(255, 255, 255, .06); border: 2px solid rgba(242, 213, 146, .65); color: #F6DC98;
  box-shadow: inset 0 0 0 5px rgba(242, 213, 146, .12);
}
.hero .seal.en { font-family: var(--font); font-size: 19px; letter-spacing: 0; }
.hero .seal.sm { width: 60px; height: 60px; font-size: 22px; }
.hero .seal.t-good, .hero .seal.t-great { color: #8FF0C0; border-color: rgba(143, 240, 192, .7); box-shadow: inset 0 0 0 5px rgba(143, 240, 192, .12); }
.hero .seal.t-bad, .hero .seal.t-terrible { color: #FFB2A2; border-color: rgba(255, 178, 162, .7); box-shadow: inset 0 0 0 5px rgba(255, 178, 162, .12); }
.hero .seal.t-mixed { color: #FFD98A; }
.hero .stars { color: #F2D592; letter-spacing: 2px; font-size: 15px; }
.hero .head-line { font-size: 16px; font-weight: 600; line-height: 1.5; }
.hero .cross { font-size: 13.5px; opacity: .85; margin-top: 4px; }
.hero .ctx { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.hero .ctx span { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: rgba(255, 255, 255, .09);
                  border: 1px solid rgba(255, 255, 255, .12); }
.hero .ctx span i { font-style: normal; font-weight: 700; margin-left: 4px; }
.hero .ctx .t-good i, .hero .ctx .t-great i { color: #8FF0C0; }
.hero .ctx .t-bad i, .hero .ctx .t-terrible i { color: #FFB2A2; }

/* ── 吉凶色 ── */
.t-great { --tc: var(--great); --tb: var(--good-bg); }
.t-good { --tc: var(--good); --tb: var(--good-bg); }
.t-flat { --tc: var(--flat); --tb: var(--flat-bg); }
.t-bad { --tc: var(--bad); --tb: var(--bad-bg); }
.t-terrible { --tc: var(--terrible); --tb: var(--bad-bg); }
.t-mixed { --tc: var(--mixed); --tb: var(--mixed-bg); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 99px;
       font-size: 12.5px; font-weight: 600; color: var(--tc, var(--text2)); background: var(--tb, var(--bg2)); white-space: nowrap; }
.line { display: flex; gap: 10px; padding: 7px 0; align-items: flex-start; }
.line + .line { border-top: 1px dashed var(--line); }
.line .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; background: var(--tc, var(--text3)); }
.line .txt { flex: 1; min-width: 0; }

/* ── 宜忌 ── */
.yiji { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.yiji > div { border-radius: var(--radius-s); padding: 12px; }
.yiji .yi { background: var(--good-bg); }
.yiji .ji { background: var(--bad-bg); }
.yiji .lab { font-family: var(--serif); font-size: 22px; font-weight: 800; line-height: 1; margin-bottom: 8px; display: block; }
.yiji .yi .lab { color: var(--good); }
.yiji .ji .lab { color: var(--bad); }
.yiji ul { list-style: none; padding: 0; margin: 0; }
.yiji li { font-size: 14px; padding: 3px 0; }
.yiji li::before { content: "·"; margin-right: 6px; opacity: .6; }

/* ── 分项 ── */
.doms { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; }
.dom { padding: 10px 2px 8px; border-radius: var(--radius-s); background: var(--tb); }
.dom .i { font-size: 20px; line-height: 1.2; }
.dom .n { font-size: 12.5px; color: var(--text2); margin-top: 2px; }
.dom .v { font-size: 13px; font-weight: 700; color: var(--tc); }
.dom-lines { margin-top: 10px; }
.dom-lines .line { font-size: 14px; }

/* ── 开运格 ── */
.lucky { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lucky > div { background: var(--card2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 9px 10px; }
.lucky .k { font-size: 11.5px; color: var(--text3); }
.lucky .v { font-size: 14px; font-weight: 600; line-height: 1.35; }
.lucky .wide { grid-column: span 2; }

/* ── 列表、行 ── */
.list a, .list .row { display: flex; align-items: center; gap: 12px; padding: 13px 4px; color: var(--text); }
.list > * + * { border-top: 1px solid var(--line); }
.list .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
            background: var(--gold-soft); color: var(--gold); font-size: 17px; }
.list .grow { flex: 1; min-width: 0; }
.list .grow .t { font-weight: 600; display: block; }
.list .grow .s { display: block; font-size: 12.5px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .chev { color: var(--text3); }
.sec-title { font-size: 12.5px; color: var(--text3); margin: 18px 6px 8px; letter-spacing: .05em; }

/* ── 按钮与表单 ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer;
       height: 46px; padding: 0 20px; border-radius: 14px; font-weight: 650; font-size: 15.5px;
       background: var(--brand); color: #fff; width: 100%; transition: transform .08s, opacity .2s; }
:root[data-theme="dark"] .btn { background: var(--brand); color: var(--brand-ink); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; }
.btn.gold { background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #2A1E07; }
.btn.ghost { background: transparent; color: var(--brand2); border: 1.5px solid var(--line); }
.btn.sm { height: 34px; font-size: 13.5px; padding: 0 12px; border-radius: 10px; width: auto; }
.btn.danger { background: var(--bad); color: #fff; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; height: 46px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card2);
  padding: 0 14px; font-size: 15.5px; color: var(--text); outline: none; transition: border-color .15s;
  -webkit-appearance: none; appearance: none;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 14px; resize: vertical; }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--text3) 50%), linear-gradient(135deg, var(--text3) 50%, transparent 50%);
               background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.input:focus { border-color: var(--brand2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.seg { display: flex; background: var(--bg2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg label, .seg a, .seg button { flex: 1; text-align: center; padding: 8px 6px; border-radius: 9px; font-size: 14px;
                       color: var(--text2); cursor: pointer; border: 0; background: transparent; font-weight: 550; }
.seg input { display: none; }
.seg input:checked + span, .seg .on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.seg label span { display: block; padding: 0; margin: -8px -6px; padding: 8px 6px; border-radius: 9px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--text2); }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.err { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 12px; font-size: 14px; margin-bottom: 12px; }
.ok { background: var(--good-bg); color: var(--good); padding: 10px 12px; border-radius: 12px; font-size: 14px; margin-bottom: 12px; }
.note { background: var(--gold-soft); color: var(--text2); padding: 10px 12px; border-radius: 12px; font-size: 13px; }

/* ── 锁 ── */
.lock { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-s);
        background: repeating-linear-gradient(135deg, var(--card2), var(--card2) 10px, var(--bg2) 10px, var(--bg2) 20px);
        color: var(--text2); font-size: 14px; border: 1px dashed var(--line); }
.lock .lk { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); flex: none; }
.lock a { margin-left: auto; font-weight: 600; white-space: nowrap; }
.closed-card { text-align: center; padding: 34px 18px 28px; }
.closed-ic { width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold); font-size: 26px; }
.closed-t { font-weight: 700; font-size: 17px; }
.off-tag { margin-left: auto; font-size: 12px; padding: 2px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--bg2); color: var(--text2); border: 1px solid var(--line); }
.list .off { opacity: .72; }

/* ── 折叠（只给 admin 的备注/出处）── */
details.adm { margin-top: 10px; border-radius: 10px; background: var(--card2); border: 1px dashed var(--line); padding: 6px 10px; font-size: 13px; color: var(--text2); }
details.adm summary { cursor: pointer; color: var(--text3); font-size: 12.5px; }
details.adm pre { white-space: pre-wrap; font-family: inherit; margin: 6px 0; }
.src { font-size: 12px; color: var(--text3); }

/* ── 原局四柱 ── */
.pillars { display: grid; grid-template-columns: 54px repeat(4, 1fr); gap: 0; text-align: center; border-radius: var(--radius-s); overflow: hidden; border: 1px solid var(--line); }
.pillars > div { padding: 7px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.pillars .rh { background: var(--card2); color: var(--text3); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.pillars .ch { background: var(--card2); font-weight: 600; color: var(--text2); font-size: 12.5px; }
.pillars .gz { font-family: var(--serif); font-size: 26px; font-weight: 800; line-height: 1.15; }
.pillars .day { background: color-mix(in srgb, var(--gold-soft) 55%, transparent); }
.wx-木 { color: #2E9B57; } .wx-火 { color: #D9483A; } .wx-土 { color: #A9782C; } .wx-金 { color: #B9932E; } .wx-水 { color: #2F78C4; }
:root[data-theme="dark"] .wx-木 { color: #5AD08A; } :root[data-theme="dark"] .wx-火 { color: #FF7E6B; }
:root[data-theme="dark"] .wx-土 { color: #D9A85A; } :root[data-theme="dark"] .wx-金 { color: #E8C770; } :root[data-theme="dark"] .wx-水 { color: #6FB2FF; }
.pillars .hide { font-size: 11.5px; line-height: 1.45; color: var(--text2); }
.wxbar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; margin: 6px 0 8px; }
.wxbar span { display: block; height: 100%; }
.wxlegend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text2); }
.wxlegend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; }
.bg-木 { background: #3BAA67; } .bg-火 { background: #E45B4B; } .bg-土 { background: #C4934A; } .bg-金 { background: #D6B356; } .bg-水 { background: #3E8AD6; }
.yong-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; margin-bottom: 10px; }
.yong-box > div { border-radius: var(--radius-s); padding: 10px 4px; background: var(--card2); border: 1px solid var(--line); }
.yong-box .k { font-size: 12px; color: var(--text3); }
.yong-box .v { font-family: var(--serif); font-size: 18px; font-weight: 800; white-space: nowrap; }

/* ── 细断 a–m ── */
.acc { border: 1px solid var(--line); border-radius: var(--radius-s); margin-bottom: 8px; overflow: hidden; background: var(--card); }
.acc > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 600; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary .k { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase; }
:root[data-theme="dark"] .acc > summary .k { color: var(--brand-ink); }
.acc > summary .n { margin-left: auto; font-size: 12px; color: var(--text3); font-weight: 400; }
.acc[open] > summary { border-bottom: 1px solid var(--line); }
.acc .body { padding: 6px 14px 10px; }
.acc.locked > summary { color: var(--text3); }
.acc.locked > summary .k { background: var(--bg2); color: var(--text3); }

/* ── 日历 ── */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal .wd { text-align: center; font-size: 11.5px; color: var(--text3); padding-bottom: 2px; }
.cal .d { aspect-ratio: 1 / 1.05; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center;
          background: var(--tb); color: var(--tc); font-weight: 700; font-size: 14px; position: relative; }
.cal .d small { font-size: 9.5px; font-weight: 500; opacity: .8; }
.cal .d.today { outline: 2px solid var(--gold); outline-offset: 1px; }
.cal .d.blank { background: transparent; }
.cal-legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--text2); }
.cal-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--tb); border: 1.5px solid var(--tc); margin-right: 4px; vertical-align: -1px; }

/* ── 年 / 大运条 ── */
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip a { flex: none; min-width: 64px; padding: 8px 10px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line);
           text-align: center; color: var(--text); scroll-snap-align: center; }
.strip a .y { font-size: 12px; color: var(--text3); }
.strip a .g { font-family: var(--serif); font-size: 17px; font-weight: 800; }
.strip a .tg { font-size: 11.5px; font-weight: 700; color: var(--tc); }
.strip a.sel { border-color: var(--brand2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand2) 18%, transparent); }
.strip a.cur .y::after { content: " ●"; color: var(--gold); }
.strip .lockcell { flex: none; min-width: 110px; display: grid; place-items: center; border-radius: 14px; border: 1.5px dashed var(--line); color: var(--text3); font-size: 12px; padding: 8px; text-align: center; }
.mgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mgrid a, .mgrid div { border-radius: 10px; padding: 7px 4px; text-align: center; background: var(--tb); color: var(--tc); font-weight: 700; font-size: 13px; }
.mgrid small { display: block; font-weight: 500; font-size: 11px; opacity: .85; }

/* ── 断事 ── */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cats label { display: block; }
.cats input { display: none; }
.cats span { display: block; text-align: center; font-size: 13px; padding: 9px 2px; border-radius: 11px; background: var(--card2); border: 1.5px solid var(--line); cursor: pointer; }
.cats input:checked + span { border-color: var(--brand2); background: color-mix(in srgb, var(--brand2) 12%, var(--card)); color: var(--brand2); font-weight: 650; }
.coins { display: flex; justify-content: center; gap: 14px; margin: 16px 0 8px; }
.coin { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-weight: 800; font-size: 18px;
        background: radial-gradient(circle at 35% 30%, #F8E2A6, #C9A04F 60%, #9C7428); color: #4A3510; box-shadow: inset 0 0 0 4px rgba(90, 60, 10, .25), 0 3px 8px rgba(0, 0, 0, .2); position: relative; }
.coin::after { content: ""; width: 14px; height: 14px; border: 2px solid rgba(74, 53, 16, .6); position: absolute; }
.coin span { position: relative; z-index: 1; font-size: 13px; }
.coin.spin { animation: spin .7s ease-in-out; }
@keyframes spin { 0% { transform: rotateY(0) translateY(0); } 50% { transform: rotateY(540deg) translateY(-18px); } 100% { transform: rotateY(1080deg) translateY(0); } }
.hexa { display: flex; flex-direction: column-reverse; gap: 9px; align-items: center; margin: 14px 0; }
.yao { width: 170px; height: 14px; display: flex; gap: 22px; position: relative; }
.yao i { flex: 1; border-radius: 4px; background: var(--brand); }
:root[data-theme="dark"] .yao i { background: var(--gold); }
.yao.yang i:nth-child(2) { display: none; }
.yao.unset i { background: var(--line); }
.yao.moving::after { content: "○"; position: absolute; right: -26px; top: -6px; color: var(--bad); font-size: 15px; font-weight: 700; }
.yao.moving.yin::after { content: "×"; }
.gua-names { text-align: center; font-family: var(--serif); font-size: 20px; font-weight: 800; }
.gua-names .arr { color: var(--gold); margin: 0 8px; font-family: var(--font); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two > div { background: var(--card2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; }
.two .h { display: flex; justify-content: space-between; align-items: center; font-weight: 650; margin-bottom: 4px; }

/* ── 商城 ── */
.prods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prod { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; position: relative;
        border: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.prod .pic { height: 78px; border-radius: 12px; display: grid; place-items: center; font-size: 38px; margin-bottom: 8px;
             background: linear-gradient(160deg, var(--card2), var(--bg2)); }
.prod .nm { font-weight: 650; font-size: 14.5px; line-height: 1.35; }
.prod .br { font-size: 12px; color: var(--text3); margin: 3px 0 8px; flex: 1; }
.prod .pr { display: flex; align-items: center; justify-content: space-between; }
.prod .pr b { color: var(--bad); font-size: 16px; }
.prod .fit { position: absolute; top: 8px; left: 8px; font-size: 11px; padding: 1px 8px; border-radius: 99px; background: var(--gold); color: #fff; font-weight: 700; }

/* ── 消息 ── */
.msg { display: flex; gap: 12px; padding: 13px 2px; border-top: 1px solid var(--line); color: var(--text); }
.msg:first-child { border-top: 0; }
.msg .ic { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; font-size: 18px; background: var(--gold-soft); }
.msg .b { flex: 1; min-width: 0; }
.msg .t { font-weight: 650; display: flex; gap: 6px; align-items: center; }
.msg .t .u { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); flex: none; }
.msg .x { font-size: 13.5px; color: var(--text2); }
.msg .tm { font-size: 11.5px; color: var(--text3); }

/* ── 登录 ── */
.auth { min-height: 100vh; display: flex; flex-direction: column; padding: 0 22px 28px; max-width: 460px; margin: 0 auto; }
.auth .brand { text-align: center; padding: 56px 0 26px; }
.auth .brand img { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 10px 30px rgba(40, 30, 110, .35); }
.auth .brand h1 { font-size: 30px; margin-top: 14px; letter-spacing: .25em; padding-left: .25em; }
.auth .brand p { color: var(--text3); margin: 6px 0 0; font-size: 13.5px; letter-spacing: .08em; }
.auth .disc { margin-top: auto; padding-top: 22px; font-size: 12px; line-height: 1.7; color: var(--text3); text-align: justify; }
.auth .alt { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text2); }
.acct { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); margin-bottom: 8px; cursor: pointer; }
.acct .av { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.acct .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct .q, .sw .q { display: inline-flex; gap: 4px; }
.qb { font-size: 11.5px; line-height: 1; padding: 3px 7px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-weight: 600; }
.sw { cursor: pointer; }
.sw .av { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.qrow { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.qrow .grow { flex: 1; }

/* ── 手势密码板（BZ.gesturePad）── */
.gp-bg { position: fixed; inset: 0; z-index: 120; background: rgba(12, 10, 30, .62); display: flex; align-items: center; justify-content: center;
         opacity: 0; transition: opacity .18s; padding: 16px; }
.gp-bg.open { opacity: 1; }
.gp { width: 100%; max-width: 340px; background: var(--card); border-radius: 22px; padding: 22px 18px 16px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.gp-h { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.gp-s { color: var(--text3); font-size: 13px; margin-top: 4px; min-height: 1em; }
.gp-pad { width: 100%; max-width: 270px; aspect-ratio: 1; margin: 14px auto 4px; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.gp-dot { fill: var(--card2); stroke: var(--line); stroke-width: 2; transition: r .12s; }
.gp-dot.on { fill: var(--brand); stroke: var(--gold); stroke-width: 3; r: 16; }
.gp-line, .gp-tail { fill: none; stroke: var(--gold); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.gp.bad .gp-dot.on { fill: var(--bad); stroke: var(--bad); }
.gp.bad .gp-line { stroke: var(--bad); }
.gp-msg { min-height: 20px; font-size: 13.5px; color: var(--text2); }
.gp.bad .gp-msg { color: var(--bad); animation: gp-shake .3s; }
.gp-foot { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.gp-foot .btn { width: auto; flex: 1; }
@keyframes gp-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ── 杂项 ── */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 30px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
         background: rgba(20, 18, 40, .92); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0;
         transition: all .25s; z-index: 100; pointer-events: none; max-width: 86vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 90; display: none; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 91; background: var(--card); border-radius: 22px 22px 0 0;
         padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
         max-width: 600px; margin: 0 auto; max-height: 86vh; overflow: auto; visibility: hidden; }
.sheet.open { transform: translateY(0); visibility: visible; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.skel { background: linear-gradient(90deg, var(--bg2), var(--card2), var(--bg2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; height: 14px; margin: 8px 0; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.empty { text-align: center; color: var(--text3); padding: 34px 0; font-size: 14px; }
.chip { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--bg2); color: var(--text2); margin: 2px 4px 2px 0; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; font-size: 14px; }
.kv .k { color: var(--text3); }
.env-w { display: flex; align-items: center; gap: 14px; }
.env-w .temp { font-size: 30px; font-weight: 300; }
.env-w .temp small { font-size: 13px; color: var(--text3); margin-left: 4px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-table td, .adm-table th { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; vertical-align: top; }
.adm-table th { color: var(--text3); font-weight: 500; }
.inline-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 4px 0; }
.inline-form .input { height: 34px; font-size: 13px; width: auto; padding: 0 8px; }
@media (min-width: 640px) {
  .app { box-shadow: 0 0 0 1px var(--line); background: var(--bg); }
}
.cal .d.t-great { background: var(--good); color: #fff; }
.cal .d.t-terrible { background: var(--bad); color: #fff; }
.cal-legend .t-great::before { background: var(--good); }
.cal-legend .t-terrible::before { background: var(--bad); }
.strip a.lockcell { min-width: 150px; max-width: 170px; white-space: normal; line-height: 1.45; display: grid; place-items: center; color: var(--text3); border-style: dashed; }

/* 细断 a–m：每栏标所需会员等级；够不着的是一行、点不开 */
.acc .acc-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-weight: 600; color: var(--text3); cursor: not-allowed; }
.acc.locked .acc-row .k { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--bg2); color: var(--text3); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.acc .n .up { cursor: pointer; margin-left: 6px; font-weight: 600; font-size: 12px; }
.acc .acc-row .n { margin-left: auto; font-size: 12px; font-weight: 400; display: flex; align-items: center; gap: 4px; }
.tier-tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 99px; font-weight: 600; }
.tier-basic { background: var(--flat-bg); color: var(--flat); }
.tier-mid { background: var(--gold-soft); color: var(--gold); }
.tier-adv { background: color-mix(in srgb, var(--brand2) 15%, var(--card)); color: var(--brand2); }

/* 会员才看得到的格子：注明所需等级，不带吉凶、点不进 */
.strip .locked-cell { flex: none; min-width: 64px; padding: 8px 10px; border-radius: 14px; border: 1.5px dashed var(--line);
                      text-align: center; color: var(--text3); background: var(--card2); cursor: not-allowed; }
.strip .locked-cell .y { font-size: 12px; }
.strip .locked-cell .g { font-size: 15px; line-height: 1.6; }
.strip a .tier-tag, .strip .locked-cell .tier-tag { margin-top: 3px; font-size: 10px; padding: 0 6px; }
.strip .lockcell { flex: none; min-width: 110px; max-width: 150px; display: grid; place-items: center; border-radius: 14px;
                   border: 1.5px dashed var(--line); color: var(--text3); font-size: 12px; padding: 8px; text-align: center; line-height: 1.45; }
.mgrid .mlock { background: var(--card2); color: var(--text3); border: 1px dashed var(--line); cursor: not-allowed; font-weight: 600; }
.mgrid .mlock .tier-tag { display: block; margin: 3px auto 0; width: fit-content; font-size: 10px; padding: 0 6px; }
