/* ============================================================
   周易卦象 · 样式
   ============================================================ */

:root {
  --paper: #f6f1e4;
  --paper-2: #fbf7ec;
  --paper-3: #efe7d5;
  --ink: #241f1a;
  --ink-2: #4a4137;
  --ink-3: #7a6d5c;
  --cinnabar: #a8342a;
  --cinnabar-soft: #c0563f;
  --azure: #35586b;
  --gold: #b08d4f;
  --line: #d9cdb4;
  --shadow: 0 12px 34px rgba(64, 48, 26, .10);
  --radius: 4px;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
  --kai: "Kaiti SC", "KaiTi", "STKaiti", var(--serif);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--serif);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(176, 141, 79, .09), transparent 46%),
    radial-gradient(circle at 82% 78%, rgba(53, 88, 107, .07), transparent 50%),
    repeating-linear-gradient(0deg, rgba(120, 96, 58, .028) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(120, 96, 58, .022) 0 1px, transparent 1px 4px);
  min-height: 100vh;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 12px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(246, 241, 228, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.seal {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--cinnabar);
  color: #fbf3e4;
  font-family: var(--kai);
  font-size: 24px;
  border-radius: 3px;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 2px rgba(251, 243, 228, .35);
  transform: rotate(-3deg);
}

.brand h1 {
  font-family: var(--kai);
  font-size: 21px;
  font-weight: 600;
  margin: 0;
  letter-spacing: .18em;
}

.brand span {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .32em;
  margin-top: 2px;
}

.nav {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.nav button {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: .14em;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: .22s;
}

.nav button:hover { color: var(--cinnabar); border-color: var(--line); }

.nav button.active {
  color: var(--cinnabar);
  border-color: var(--cinnabar);
  background: rgba(168, 52, 42, .05);
}

/* ---------- 布局 ---------- */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 46px) clamp(16px, 4vw, 32px) 80px;
}

.view { display: none; animation: fadeUp .45s ease both; }
.view.on { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.lead {
  text-align: center;
  margin: 0 auto 34px;
  max-width: 620px;
}

/* 每日一签 · 首页大字入口（当天签过后隐去，改从顶栏按钮查看） */
.daily-hero {
  display: block;
  width: 100%;
  max-width: 620px;
  margin: 0 auto 26px;
  padding: 20px 18px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(176, 141, 79, .10), transparent 70%),
    var(--paper-2);
  font-family: inherit;
  color: inherit;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.daily-hero[hidden] { display: none; }
.daily-hero:hover,
.daily-hero:focus-visible {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 16px 38px rgba(64, 48, 26, .16);
  outline: none;
}
.daily-hero .dh-eyebrow {
  display: block;
  font-size: 11px;
  letter-spacing: .42em;
  text-indent: .42em;
  color: var(--gold);
  margin-bottom: 8px;
}
.daily-hero b {
  display: block;
  font-family: var(--kai);
  font-size: clamp(30px, 5.4vw, 44px);
  font-weight: 500;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--cinnabar);
  line-height: 1.24;
}
.daily-hero .dh-line {
  display: block;
  margin-top: 10px;
  font-size: 12.5px;
  letter-spacing: .1em;
  color: var(--ink-3);
}

.lead h2 {
  font-family: var(--kai);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 500;
  letter-spacing: .26em;
  margin: 0 0 12px;
  text-indent: .26em;
}

.lead p {
  margin: 0;
  color: var(--ink-3);
  font-size: 13.5px;
  letter-spacing: .1em;
}

.rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 18px 0 0;
  color: var(--gold);
}
.rule::before, .rule::after {
  content: "";
  width: 54px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.rule span { font-size: 12px; letter-spacing: .3em; }

/* ---------- 卡片 ---------- */
.card {
  background: linear-gradient(180deg, var(--paper-2), #f8f3e6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 3vw, 30px);
  position: relative;
}

.card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(176, 141, 79, .22);
  border-radius: 2px;
  pointer-events: none;
}

/* ---------- 起卦方式 ---------- */
.methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 26px;
}

.method {
  font-family: var(--serif);
  cursor: pointer;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .45);
  border-radius: var(--radius);
  color: var(--ink-2);
  transition: .22s;
}

.method b {
  display: block;
  font-family: var(--kai);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .1em;
  margin-bottom: 3px;
  color: var(--ink);
}

.method small { color: var(--ink-3); font-size: 11.5px; letter-spacing: .06em; }

.method:hover { border-color: var(--gold); background: rgba(255, 255, 255, .8); }

.method.on {
  border-color: var(--cinnabar);
  background: rgba(168, 52, 42, .06);
  box-shadow: inset 3px 0 0 var(--cinnabar);
}
.method.on b { color: var(--cinnabar); }

.panel { display: none; }
.panel.on { display: block; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  letter-spacing: .22em;
  color: var(--ink-3);
  margin-bottom: 7px;
}

input[type="text"], input[type="number"] {
  width: 100%;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, .6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 13px;
  outline: none;
  transition: .2s;
}
input:focus { border-color: var(--cinnabar); background: #fff; }

.nums { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.hint { font-size: 12px; color: var(--ink-3); letter-spacing: .06em; margin: 6px 0 0; }

/* ---------- 按钮 ---------- */
.btn {
  font-family: var(--kai);
  font-size: 16px;
  letter-spacing: .3em;
  text-indent: .3em;
  padding: 13px 30px;
  border: 1px solid var(--cinnabar);
  background: var(--cinnabar);
  color: #fdf6e7;
  cursor: pointer;
  border-radius: var(--radius);
  transition: .22s;
  box-shadow: 0 6px 18px rgba(168, 52, 42, .22);
}
.btn:hover { background: #922c23; transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn.ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--line);
  box-shadow: none;
  font-size: 14px;
  padding: 10px 20px;
}
.btn.ghost:hover { color: var(--cinnabar); border-color: var(--cinnabar); background: rgba(168, 52, 42, .04); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 22px; }

/* ---------- 摇卦器 ---------- */
.caster {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: clamp(20px, 5vw, 54px);
  align-items: center;
  margin: 8px 0 4px;
}

.board {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, .95), transparent 52%),
    radial-gradient(circle at 50% 52%, #f8f1de, #ece0c4 62%, #dcc9a3 100%);
  box-shadow:
    inset 0 0 0 1px rgba(176, 141, 79, .55),
    inset 0 0 40px rgba(160, 128, 72, .20),
    0 16px 38px rgba(90, 66, 24, .14);
  perspective: 900px;
  transition: transform .18s;
}

/* 刻度环 */
.board::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg,
    rgba(150, 120, 68, .34) 0deg .7deg, transparent .7deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 0 61%, #000 62% 100%);
  mask: radial-gradient(circle, transparent 0 61%, #000 62% 100%);
  pointer-events: none;
}

/* 内圈 */
.board::after {
  content: "";
  position: absolute;
  inset: 19%;
  border-radius: 50%;
  border: 1px dashed rgba(168, 52, 42, .24);
  pointer-events: none;
}

.board.shake { animation: bShake .34s ease-in-out; }

@keyframes bShake {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-4px) rotate(-.6deg); }
  55% { transform: translateY(2px) rotate(.5deg); }
  80% { transform: translateY(-1px) rotate(0); }
}

.coin3d {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 66px;
  height: 66px;
  margin: -33px 0 0 -33px;
  transform-style: preserve-3d;
  will-change: transform;
  z-index: 2;
}

/* 铜钱落在盘面上的投影：抛起时缩小变淡，落地压扁加深 */
.coin-sh {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 15px;
  margin: -7px 0 0 -29px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(86, 62, 22, .5), rgba(86, 62, 22, .16) 55%, rgba(86, 62, 22, 0) 72%);
  filter: blur(1.2px);
  opacity: .38;
  pointer-events: none;
  z-index: 1;
  will-change: transform, opacity;
}

.coin-in {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}

.cf {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid rgba(84, 58, 18, .9);
  background-image:
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='48' height='48' filter='url(%23n)' opacity='0.3'/%3E%3C/svg%3E"),
    radial-gradient(circle at 30% 22%, rgba(255, 250, 225, .9), rgba(255, 250, 225, 0) 42%),
    radial-gradient(circle at 76% 74%, rgba(88, 126, 96, .38), rgba(88, 126, 96, 0) 34%),
    radial-gradient(circle at 22% 82%, rgba(92, 62, 22, .45), rgba(92, 62, 22, 0) 32%),
    radial-gradient(circle at 36% 28%, #f3dda2 0%, #ddba76 30%, #c09652 58%, #97712f 84%, #7d5a23 100%);
  background-size: 48px 48px, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-blend-mode: overlay, screen, normal, normal, normal;
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 214, .34),
    inset 0 3px 5px rgba(255, 250, 228, .45),
    inset 0 -5px 9px rgba(66, 45, 12, .55),
    inset 7px 0 12px rgba(255, 248, 220, .10),
    inset -7px 0 12px rgba(66, 45, 12, .30),
    0 7px 14px rgba(70, 48, 14, .32),
    0 2px 4px rgba(70, 48, 14, .28);
}

/* 边缘收圆的暗角（铸造厚边） */
.cf::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(58, 38, 8, 0) 56%,
    rgba(74, 50, 14, .26) 84%,
    rgba(52, 34, 6, .58) 100%);
  pointer-events: none;
}

/* 钱缘（外郭） */
.cf::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1px solid rgba(96, 68, 24, .34);
  box-shadow:
    inset 0 1px 1px rgba(255, 246, 214, .45),
    inset 0 -1px 1px rgba(70, 48, 12, .38);
  pointer-events: none;
}

/* 方孔（穿） */
.cf .hole {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  border-radius: 1.5px;
  background: radial-gradient(circle at 50% 32%, #f8f2e0, #e4d6b1 78%, #d3c29a);
  border: 1px solid rgba(70, 48, 12, .6);
  box-shadow:
    inset 1px 1px 2px rgba(58, 40, 10, .8),
    inset -1px -1px 1px rgba(255, 246, 218, .55),
    0 1px 1px rgba(58, 40, 10, .4);
}

/* 内郭（方孔外一圈凸起） */
.cf .hole::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 2px;
  border: 1px solid rgba(96, 68, 24, .3);
  box-shadow: inset 0 1px 1px rgba(255, 246, 214, .35);
}

/* 钱文（有字面，浮雕感） */
.cf .t {
  position: absolute;
  font-family: var(--kai);
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  color: #6a4713;
  text-shadow:
    0 1px 0 rgba(255, 240, 198, .85),
    0 -1px 0 rgba(72, 48, 12, .8),
    0 0 2px rgba(60, 40, 8, .3);
}

.cf .t-u { top: 7px; left: 50%; transform: translateX(-50%); }
.cf .t-d { bottom: 7px; left: 50%; transform: translateX(-50%); }
.cf .t-l { left: 7px; top: 50%; transform: translateY(-50%); }
.cf .t-r { right: 7px; top: 50%; transform: translateY(-50%); }

.c-back { transform: rotateY(0deg); }
.c-front { transform: rotateY(180deg); }

.ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 130px;
  height: 130px;
  margin: -65px 0 0 -65px;
  border-radius: 50%;
  border: 1px solid rgba(168, 52, 42, .38);
  pointer-events: none;
  z-index: 1;
  animation: ringOut .62s ease-out forwards;
}

@keyframes ringOut {
  from { transform: scale(.45); opacity: .95; }
  to { transform: scale(2.1); opacity: 0; }
}

/* 爻柱 */
.stage { text-align: center; }

.hexstage {
  display: flex;
  flex-direction: column-reverse;
  gap: 9px;
  align-items: center;
  justify-content: center;
  min-height: 174px;
  padding: 6px 0;
}

.cslot {
  display: grid;
  grid-template-columns: 20px 168px;
  gap: 10px;
  align-items: center;
}

.cslot .lb {
  font-family: var(--serif);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .08em;
  text-align: center;
}

.bar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  height: 14px;
}

.bar-wrap .ph {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg,
    rgba(120, 96, 58, .13) 0 3px, transparent 3px 9px);
}

.bar-wrap i {
  display: block;
  height: 14px;
  flex: 1;
  border-radius: 1px;
  background: linear-gradient(90deg, #322b23, #241f1a);
  transform-origin: center;
  animation: barIn .34s cubic-bezier(.2, .8, .2, 1) both;
}

.bar-wrap.yin i { flex: 0 0 74px; }

.bar-wrap.mv i {
  background: linear-gradient(90deg, var(--cinnabar), #8d241b);
  box-shadow: 0 0 10px rgba(168, 52, 42, .35);
}

@keyframes barIn {
  from { transform: scaleX(0); opacity: .15; }
  to { transform: none; opacity: 1; }
}

.stage-cap {
  font-family: var(--kai);
  font-size: 13.5px;
  letter-spacing: .2em;
  color: var(--ink-3);
  min-height: 26px;
  margin-top: 6px;
  transition: .25s;
}

.stage-cap.done {
  font-size: 20px;
  color: var(--cinnabar);
  letter-spacing: .16em;
}

/* 八卦环 */
.bagua {
  --r: -94px;
  position: relative;
  width: 236px;
  height: 236px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 72%);
}

.bagua::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(176, 141, 79, .42);
}

.bagua::after {
  content: "";
  position: absolute;
  inset: 27px;
  border-radius: 50%;
  border: 1px dashed rgba(176, 141, 79, .3);
}

.tg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 34px;
  margin: -17px 0 0 -18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transform: rotate(var(--a)) translateY(var(--r)) rotate(calc(-1 * var(--a)));
  transition: opacity .3s;
}

.tg .sym {
  display: flex;
  flex-direction: column-reverse;
  gap: 2.5px;
  align-items: center;
}

.tg .tl {
  display: flex;
  gap: 4px;
  width: 20px;
  height: 2.5px;
}

.tg .tl span {
  flex: 1;
  background: rgba(84, 70, 46, .48);
  border-radius: 1px;
  transition: .3s;
}

.tg .tl.y span { flex: 0 0 8px; }

.tg b {
  font-family: var(--kai);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: .04em;
  color: var(--ink-3);
  line-height: 1;
  transition: .3s;
}

.tg.on .tl span {
  background: var(--cinnabar);
  box-shadow: 0 0 6px rgba(168, 52, 42, .45);
}

.tg.on b { color: var(--cinnabar); }

/* 八卦环内的六爻柱 */
.bagua .hexstage {
  min-height: 0;
  gap: 6px;
  padding: 0;
  z-index: 2;
}

.bagua .cslot {
  grid-template-columns: 13px 96px;
  gap: 7px;
}

.bagua .cslot .lb { font-size: 9px; }

.bagua .bar-wrap { gap: 12px; }

.bagua .bar-wrap i { height: 9px; }

.bagua .bar-wrap.yin i { flex: 0 0 42px; }

/* ---------- 结果 ---------- */
#result { display: none; margin-top: 30px; }
#result.on { display: block; }

/* 每日一签 / 梅花易数的结果容器 */
.card.fold { display: none; margin-top: 30px; }
.card.fold.on { display: block; }

/* ---------- 每日一签 ---------- */
.daily-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 18px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px dashed var(--line);
}
.dh-date {
  font-family: var(--kai);
  font-size: 21px;
  letter-spacing: .14em;
  color: var(--ink);
}
.dh-sub { font-size: 12.5px; color: var(--ink-3); letter-spacing: .04em; }

/* 签头：农历生日 + 补填入口 */
.daily-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--ink-3);
}
.daily-meta b { color: var(--cinnabar); font-weight: 600; letter-spacing: .04em; }
/* 签已落定的说明：压在 meta 行右端，不抢主文 */
.daily-meta .dm-lock {
  margin-left: auto;
  font-style: normal;
  font-size: 11.5px;
  letter-spacing: .12em;
  color: var(--ink-3);
  opacity: .85;
}
/* 取签时的等待态：与正文同字号，居中留白 */
.daily-load {
  padding: 42px 0 46px;
  text-align: center;
  font-size: 13px;
  letter-spacing: .22em;
  color: var(--ink-3);
  animation: aipulse 1.4s ease-in-out infinite;
}
.link-btn {
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: .06em;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid rgba(168, 52, 42, .35);
  background: none;
  color: var(--cinnabar);
  cursor: pointer;
  transition: .2s;
}
.link-btn:hover { border-bottom-color: var(--cinnabar); }

/* ---------- AI 解读 ---------- */
.ai-body {
  white-space: pre-wrap;
  line-height: 1.95;
  font-size: 14.5px;
  color: var(--ink-2, #4a4238);
}
.ai-body.is-loading { color: var(--ink-3); animation: aipulse 1.5s ease-in-out infinite; }
@keyframes aipulse {
  0%, 100% { opacity: .45; }
  50%      { opacity: 1; }
}
.ai-body.is-error { color: #8c4a3e; }
.ai-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: .03em;
}

.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 16px;
  margin-bottom: 22px;
}

.result-head .no {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .2em;
  color: var(--ink-3);
}

.result-head h3 {
  font-family: var(--kai);
  font-size: clamp(24px, 3.6vw, 32px);
  font-weight: 600;
  letter-spacing: .18em;
  margin: 0;
}

.level {
  font-family: var(--kai);
  font-size: 12.5px;
  letter-spacing: .18em;
  padding: 3px 11px;
  border: 1px solid currentColor;
  border-radius: 2px;
}
.level.s-上上, .level.s-上 { color: var(--cinnabar); }
.level.s-中上 { color: var(--azure); }
.level.s-中 { color: var(--ink-3); }
.level.s-中下 { color: #8a6f3c; }
.level.s-下 { color: #5c5c5c; }

.kw { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.kw span {
  font-size: 11.5px;
  letter-spacing: .12em;
  color: var(--ink-3);
  border: 1px solid var(--line);
  padding: 2px 9px;
  border-radius: 999px;
}

/* 卦象对照 */
.gua-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(14px, 4vw, 46px);
  align-items: center;
  margin-bottom: 26px;
}

.gua-pair.one { grid-template-columns: 1fr; justify-items: center; }

.gua { text-align: center; }

.gua .cap {
  font-size: 12px;
  letter-spacing: .3em;
  color: var(--ink-3);
  margin-bottom: 12px;
}

.gua .figure {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.line { width: 172px; height: 15px; display: flex; gap: 24px; position: relative; }
.line i {
  display: block;
  height: 15px;
  background: linear-gradient(90deg, #322b23, #241f1a);
  flex: 1;
  border-radius: 1px;
  transform-origin: center;
  animation: draw .5s cubic-bezier(.2, .8, .2, 1) both;
}
.line.yin i { flex: 0 0 74px; }
.line.moving i { background: linear-gradient(90deg, var(--cinnabar), #8d241b); }
.line.moving::after {
  content: "○";
  position: absolute;
  top: -2px;
  right: -24px;
  color: var(--cinnabar);
  font-size: 13px;
  line-height: 15px;
}
.line.moving.yin::after { content: "×"; }

@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.gua .name {
  font-family: var(--kai);
  font-size: 20px;
  letter-spacing: .14em;
  margin: 0 0 2px;
}
.gua .name em { font-style: normal; color: var(--cinnabar); }
.gua .uni { font-size: 34px; line-height: 1; color: var(--ink-2); margin: 6px 0; }
.gua .sub { font-size: 12px; color: var(--ink-3); letter-spacing: .14em; }

/* 迷你卦象（CSS 爻线） */
.mini-fig {
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
  align-items: center;
  margin: 7px 0 8px;
}
.mini-fig .r { display: flex; gap: 7px; width: 36px; height: 3.5px; }
.mini-fig .r.s { width: 28px; gap: 5px; height: 3px; }
.mini-fig .r i { flex: 1; background: #3a322a; border-radius: 1px; }

.arrow {
  font-size: 13px;
  letter-spacing: .2em;
  color: var(--gold);
  text-align: center;
  line-height: 1.9;
  white-space: nowrap;
}

/* 文本块 */
.block { margin-bottom: 24px; }
.block h4 {
  font-family: var(--kai);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .22em;
  color: var(--ink);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.block h4::before {
  content: "";
  width: 3px;
  height: 14px;
  background: var(--cinnabar);
  display: block;
}
.block h4 .tag {
  font-family: var(--serif);
  font-size: 10.5px;
  letter-spacing: .1em;
  color: var(--ink-3);
  border: 1px solid var(--line);
  padding: 1px 7px;
  border-radius: 2px;
}

.classic {
  font-family: var(--kai);
  font-size: 17px;
  line-height: 2.1;
  letter-spacing: .08em;
  color: var(--ink);
  margin: 0;
  padding: 14px 18px;
  background: rgba(176, 141, 79, .07);
  border-left: 2px solid var(--gold);
}

.plain {
  font-size: 15px;
  color: var(--ink-2);
  letter-spacing: .04em;
  margin: 0;
  text-align: justify;
}

.advice {
  display: flex;
  gap: 12px;
  font-size: 14px;
  color: var(--ink-2);
  background: rgba(53, 88, 107, .055);
  border-left: 2px solid var(--azure);
  padding: 12px 16px;
  letter-spacing: .04em;
}
.advice b { font-family: var(--kai); color: var(--azure); letter-spacing: .16em; white-space: nowrap; }

/* 动爻 */
.moving-list { display: grid; gap: 10px; }
.mv {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 14px;
  align-items: start;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .5);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cinnabar);
  border-radius: 2px;
}
.mv b {
  font-family: var(--kai);
  font-size: 15px;
  letter-spacing: .1em;
  color: var(--cinnabar);
}
.mv p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.8; }
.mv .meta { font-size: 11.5px; color: var(--ink-3); letter-spacing: .1em; margin-top: 4px; }

/* 三卦小卡 */
.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.mini {
  text-align: center;
  padding: 16px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, .4);
  transition: .2s;
  cursor: pointer;
}
.mini:hover { border-color: var(--gold); background: #fff; transform: translateY(-2px); }
.mini .t { font-size: 11px; letter-spacing: .24em; color: var(--ink-3); margin-bottom: 8px; }
.mini .u { font-size: 30px; line-height: 1; color: var(--ink-2); }
.mini .nm { font-family: var(--kai); font-size: 15px; letter-spacing: .1em; margin-top: 6px; }
.mini .fs { font-size: 11px; color: var(--ink-3); }

/* ---------- 六十四卦 ---------- */
.grid64 {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
}

.hx {
  text-align: center;
  padding: 14px 4px 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, .38);
  cursor: pointer;
  transition: .2s;
}
.hx:hover { background: #fff; border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(64, 48, 26, .08); }
.hx .u { font-size: 30px; line-height: 1.1; color: var(--ink-2); }
.hx .nm { font-family: var(--kai); font-size: 14.5px; letter-spacing: .08em; margin-top: 4px; }
.hx .n { font-size: 10px; color: var(--ink-3); letter-spacing: .1em; }

/* ---------- 模态 ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(36, 31, 26, .45);
  backdrop-filter: blur(3px);
  display: none;
  z-index: 90;
  padding: clamp(12px, 4vw, 50px);
  overflow-y: auto;
}
.modal.on { display: block; animation: fadeUp .3s ease both; }

.modal-inner {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 22px;
  color: var(--ink-3);
  cursor: pointer;
  line-height: 1;
  z-index: 2;
}
.modal-close:hover { color: var(--cinnabar); }

/* ---------- 历史 ---------- */
.hist { display: grid; gap: 8px; margin-top: 14px; }
.hist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .4);
  border-radius: 2px;
  font-size: 13.5px;
}
.hist-item .tm { color: var(--ink-3); font-size: 11.5px; letter-spacing: .06em; margin-left: auto; }
.hist-item .q { color: var(--ink-3); font-size: 12px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-item b { font-family: var(--kai); letter-spacing: .06em; }
.hist-empty { color: var(--ink-3); font-size: 13px; text-align: center; padding: 16px; }

/* ---------- 说明 ---------- */
.doc h3 {
  font-family: var(--kai);
  font-size: 17px;
  letter-spacing: .18em;
  margin: 26px 0 10px;
  padding-left: 12px;
  border-left: 3px solid var(--cinnabar);
}
.doc h3:first-child { margin-top: 0; }
.doc p, .doc li { font-size: 14.5px; color: var(--ink-2); letter-spacing: .03em; text-align: justify; }
.doc ul { padding-left: 20px; }
.doc li { margin-bottom: 6px; }
.doc .code {
  font-family: ui-monospace, Consolas, monospace;
  background: rgba(176, 141, 79, .12);
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 13px;
}

/* 铜钱正背示意 */
.coin-demo {
  display: flex;
  gap: clamp(20px, 6vw, 56px);
  justify-content: center;
  align-items: flex-start;
  margin: 20px 0 8px;
  padding: 18px 10px 6px;
  border: 1px dashed var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, .3);
}

.cd-item { text-align: center; }

.cd-face {
  position: relative;
  width: 92px;
  height: 92px;
  margin: 0 auto 10px;
}

.cd-face .cf { transform: none !important; }

.cd-face .t { font-size: 13px; }
.cd-face .t-u { top: 9px; }
.cd-face .t-d { bottom: 9px; }
.cd-face .t-l { left: 9px; }
.cd-face .t-r { right: 9px; }
.cd-face .hole { width: 22px; height: 22px; }

.cd-cap {
  font-size: 12.5px;
  letter-spacing: .08em;
  color: var(--ink-3);
}

.cd-cap b {
  font-family: var(--kai);
  font-size: 14px;
  color: var(--ink);
  letter-spacing: .1em;
}

/* 文档表格 */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 18px;
  font-size: 13.5px;
}

.doc-table th {
  font-family: var(--kai);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  text-align: left;
  color: var(--ink);
  padding: 9px 10px;
  background: rgba(176, 141, 79, .1);
  border-bottom: 1px solid var(--gold);
  white-space: nowrap;
}

.doc-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  line-height: 1.7;
}

.doc-table tr:last-child td { border-bottom: none; }

.doc-table td b {
  font-family: var(--kai);
  color: var(--ink);
}

.foot {
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: .16em;
  padding: 30px 0 10px;
}

/* ---------- 爻辞列表 ---------- */
.yao-list {
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, .35);
}

.yao-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.yao-row:last-child { border-bottom: none; }

.y-t {
  font-family: var(--kai);
  font-size: 14px;
  letter-spacing: .06em;
  color: var(--ink-2);
  padding-top: 2px;
  white-space: nowrap;
}

.y-c p {
  margin: 0;
  font-family: var(--kai);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: .04em;
  color: var(--ink);
}

.y-x {
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink-3);
  letter-spacing: .02em;
  margin-top: 3px;
}

.yao-row.is-mv {
  background: rgba(168, 52, 42, .055);
  box-shadow: inset 3px 0 0 var(--cinnabar);
}
.yao-row.is-mv .y-t { color: var(--cinnabar); }
.yao-row.is-use { background: rgba(176, 141, 79, .07); }
.yao-row.is-use .y-t { color: var(--gold); }

.y-badge {
  font-family: var(--kai);
  font-size: 11px;
  letter-spacing: .1em;
  color: #fdf6e7;
  background: var(--cinnabar);
  padding: 1px 6px;
  border-radius: 2px;
  margin-top: 2px;
}

/* ---------- 卦变说明 ---------- */

/* 默认只出本卦，变/互/错/综折叠在后面，点开才铺开 */
.btn.deriv-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 11px 16px;
  font-size: 13.5px;
  letter-spacing: .18em;
  text-indent: 0;
}
.btn.deriv-toggle .dt-hint {
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--ink-3);
}
.btn.deriv-toggle.on { color: var(--cinnabar); border-color: var(--cinnabar); }
.btn.deriv-toggle.on .dt-hint { color: var(--cinnabar); opacity: .75; }

.deriv-wrap { margin-top: 14px; }
.deriv-wrap[hidden] { display: none; }

/* 六爻安静时没有变卦，说清楚即可，不必画一个和本卦一样的卦 */
.dv-none {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, .3);
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: .04em;
  color: var(--ink-3);
}
.dv-none b { color: var(--cinnabar); font-weight: 600; }

.derivs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dv {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, .42);
  cursor: pointer;
  transition: .2s;
}

.dv:hover {
  border-color: var(--gold);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(64, 48, 26, .07);
}

.dv-fig { padding-top: 3px; }

.dv-h {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dv-k {
  font-family: var(--kai);
  font-size: 11.5px;
  letter-spacing: .14em;
  color: #fdf6e7;
  background: var(--ink-2);
  padding: 1px 7px;
  border-radius: 2px;
}

.dv.is-v .dv-k { background: var(--cinnabar); }

.dv-h b {
  font-family: var(--kai);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .08em;
}

.dv-h em {
  font-style: normal;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .05em;
}

.dv-how {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-2);
  letter-spacing: .02em;
  text-align: justify;
}

.dv-how b {
  font-family: var(--kai);
  font-weight: 600;
  color: var(--ink);
}

.dv-why {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-3);
  letter-spacing: .02em;
}

.dv-why::before {
  content: "▸ ";
  color: var(--gold);
}

/* ---------- 易传 ---------- */
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--line);
}

.subnav button {
  font-family: var(--kai);
  font-size: 14.5px;
  letter-spacing: .14em;
  padding: 7px 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .45);
  color: var(--ink-2);
  border-radius: 2px;
  cursor: pointer;
  transition: .2s;
}
.subnav button:hover { border-color: var(--gold); }
.subnav button.on {
  background: var(--cinnabar);
  border-color: var(--cinnabar);
  color: #fdf6e7;
}

.subsub { display: flex; gap: 8px; margin-bottom: 20px; }
.subsub button {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .1em;
  padding: 5px 15px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-3);
  border-radius: 999px;
  cursor: pointer;
  transition: .2s;
}
.subsub button.on {
  border-color: var(--azure);
  color: var(--azure);
  background: rgba(53, 88, 107, .07);
}

.yz-body p {
  position: relative;
  font-family: var(--kai);
  font-size: 16.5px;
  line-height: 2.15;
  letter-spacing: .05em;
  color: var(--ink);
  text-indent: 2em;
  margin: 0 0 15px;
  padding-left: 30px;
  text-align: justify;
}

.yz-body p .pn {
  position: absolute;
  left: 0;
  top: 6px;
  font-family: var(--serif);
  font-size: 11px;
  color: var(--ink-3);
  text-indent: 0;
  letter-spacing: 0;
  opacity: .6;
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .methods { grid-template-columns: 1fr; }
  .grid64 { grid-template-columns: repeat(4, 1fr); }
  .gua-pair { grid-template-columns: 1fr; justify-items: center; }
  .arrow { transform: rotate(90deg); margin: 4px 0; }
  .mini-grid { grid-template-columns: 1fr; }
  .brand span { display: none; }
  .nav { gap: 0; }
  .nav button { padding: 8px 11px; font-size: 13px; letter-spacing: .06em; }
  .kw { margin-left: 0; width: 100%; }
  .caster { grid-template-columns: 1fr; gap: 22px; }
  .board { max-width: 280px; }
  .bagua { width: 220px; height: 220px; --r: -88px; }
  .derivs { grid-template-columns: 1fr; }
  .hexstage { min-height: 152px; gap: 7px; }
  .cslot { grid-template-columns: 18px 140px; gap: 8px; }
  .bar-wrap.yin i { flex: 0 0 60px; }
  .bar-wrap { gap: 16px; }
}

@media (max-width: 480px) {
  .grid64 { grid-template-columns: repeat(4, 1fr); gap: 7px; }
  .hx .u { font-size: 24px; }
  .line { width: 132px; }
  .line.yin i { flex: 0 0 56px; }
  .nums { grid-template-columns: 1fr; }
  .board { max-width: 232px; }
  .coin3d { width: 56px; height: 56px; margin: -28px 0 0 -28px; }
  .cf { font-size: 16px; }
  .cf .t { font-size: 8.5px; }
  .cf .hole { width: 13px; height: 13px; }
  .bagua { width: 196px; height: 196px; --r: -78px; }
  .bagua .cslot { grid-template-columns: 12px 84px; gap: 6px; }
  .bagua .bar-wrap { gap: 10px; }
  .bagua .bar-wrap.yin i { flex: 0 0 37px; }
  .coin-demo { gap: 22px; padding: 14px 4px 4px; }
  .cd-face { width: 76px; height: 76px; }
  .cd-face .t { font-size: 11px; }
  .cd-face .t-u { top: 7px; }
  .cd-face .t-d { bottom: 7px; }
  .cd-face .t-l { left: 7px; }
  .cd-face .t-r { right: 7px; }
  .cd-face .hole { width: 18px; height: 18px; }
  .cd-cap { font-size: 11.5px; }
  .doc-table { font-size: 12px; }
  .doc-table th { font-size: 11.5px; padding: 7px 5px; }
  .doc-table td { padding: 7px 5px; }
  .cslot { grid-template-columns: 16px 124px; gap: 7px; }
  .bar-wrap.yin i { flex: 0 0 52px; }
  .stage-cap { font-size: 12.5px; letter-spacing: .12em; }
  .stage-cap.done { font-size: 17px; }
}

/* ============================================================
   账号 · 额度 · 续卦
   ============================================================ */

/* ---------- 顶栏账号 ---------- */
.acct { position: relative; display: flex; align-items: center; }

/* 登录后：今日一签徽标 + 账号按钮 并排 */
.acct-in { display: flex; align-items: center; gap: 8px; }
/* display:flex 会盖掉 [hidden] 的默认 display:none，必须显式补回，否则未登录也显示 */
.acct-in[hidden] { display: none; }

.acct-daily {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: .08em;
  color: var(--cinnabar);
  background: rgba(168, 52, 42, .06);
  border: 1px solid rgba(168, 52, 42, .26);
  border-radius: var(--radius);
  padding: 5px 10px;
  cursor: pointer;
  transition: .22s;
  max-width: 190px;
}
.acct-daily:hover {
  background: rgba(168, 52, 42, .12);
  border-color: var(--cinnabar);
}
.acct-daily .ad-lb { color: var(--ink-3); font-size: 11.5px; letter-spacing: .04em; }
.acct-daily b {
  font-family: var(--kai);
  font-weight: 400;
  letter-spacing: .1em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-login {
  font-family: var(--serif);
  font-size: 13.5px;
  letter-spacing: .18em;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 15px;
  cursor: pointer;
  transition: .22s;
}
.acct-login:hover {
  color: var(--cinnabar);
  border-color: var(--cinnabar);
  background: rgba(168, 52, 42, .05);
}

.acct-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 13.5px;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 12px 4px 5px;
  cursor: pointer;
  transition: .22s;
}
.acct-btn:hover { border-color: var(--gold); }

.acct-btn .av {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: var(--cinnabar);
  color: #fbf3e4;
  font-family: var(--kai);
  font-size: 15px;
  font-style: normal;
  border-radius: 2px;
  overflow: hidden;
}
.acct-btn .av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.acct-btn .av:has(img:not([hidden])) { background: var(--paper-3); }

.acct-btn b {
  font-weight: 400;
  letter-spacing: .06em;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-btn em {
  font-style: normal;
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--cinnabar);
  border-left: 1px solid var(--line);
  padding-left: 8px;
}

.acct-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  min-width: 168px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: var(--shadow);
  padding: 5px;
  z-index: 60;
}
.acct-menu button {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--ink-2);
  background: transparent;
  border: none;
  padding: 9px 12px;
  cursor: pointer;
  border-radius: 2px;
  transition: .18s;
}
.acct-menu button:hover { background: rgba(168, 52, 42, .07); color: var(--cinnabar); }

/* ---------- 额度提示 ---------- */
.quota-line {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  letter-spacing: .06em;
  color: var(--ink-3);
  text-align: center;
}
.quota-line b { font-family: var(--kai); font-size: 15px; color: var(--cinnabar); }
.quota-line a {
  color: var(--cinnabar);
  text-decoration: none;
  border-bottom: 1px solid rgba(168, 52, 42, .35);
}
.quota-line a:hover { border-bottom-color: var(--cinnabar); }

/* ---------- 登录框 ---------- */
.modal-inner.narrow { max-width: 440px; }

.ac-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.ac-head h3 {
  font-family: var(--kai);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .3em;
  margin: 0;
}

.auth-tabs { display: flex; gap: 5px; }
/* display:flex 会盖掉 [hidden] 的 display:none，补填生日时要把这排页签真正藏起来 */
.auth-tabs[hidden] { display: none; }
.auth-tabs button {
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: .1em;
  padding: 4px 13px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-3);
  border-radius: 999px;
  cursor: pointer;
  transition: .2s;
}
.auth-tabs button.on {
  border-color: var(--cinnabar);
  color: var(--cinnabar);
  background: rgba(168, 52, 42, .06);
}

input[type="password"] {
  width: 100%;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, .6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 13px;
  outline: none;
  transition: .2s;
}
input[type="password"]:focus { border-color: var(--cinnabar); background: #fff; }

/* 生日：年月日三联 + 选填时辰 */
.birth-row { display: grid; grid-template-columns: 1.15fr .85fr .85fr; gap: 8px; }
.birth-row select,
input[type="time"] {
  width: 100%;
  font-family: var(--serif);
  font-size: 14.5px;
  color: var(--ink);
  background: rgba(255, 255, 255, .6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 8px;
  outline: none;
  transition: .2s;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
  text-align-last: center;
}
.birth-row select:focus, input[type="time"]:focus {
  border-color: var(--cinnabar);
  background: #fff;
}
input[type="time"] { text-align: left; text-align-last: left; padding: 10px 13px; }
.lb-tip {
  float: right;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-3);
  opacity: .85;
}
.birth-lunar {
  margin: 8px 0 0;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--ink-3);
  min-height: 17px;
}
.birth-lunar b { color: var(--cinnabar); font-weight: 600; }

.auth-err {
  min-height: 20px;
  margin: 0 0 4px;
  font-size: 12.5px;
  color: var(--cinnabar);
  letter-spacing: .04em;
}

.auth-note {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.8;
  margin: 16px 0 0;
  letter-spacing: .02em;
  text-align: justify;
}

/* ---------- 续卦面板 ---------- */
.pay-quota {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 12px 16px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, .45);
}
.pay-quota b {
  font-family: var(--kai);
  font-size: 19px;
  font-weight: 600;
  color: var(--cinnabar);
  letter-spacing: .06em;
}
.pay-quota span { font-size: 12.5px; color: var(--ink-3); letter-spacing: .04em; }

/* 个人中心 · 只读资料表 */
.me-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.me-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--paper-2);
}
.me-item span {
  flex: none;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--ink-3);
  white-space: nowrap;
}
.me-item b {
  font-family: var(--kai);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink);
  text-align: right;
  word-break: break-all;
}
.me-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 560px) {
  .me-grid { grid-template-columns: 1fr; }
}

.me-sub {
  margin: 4px 0 12px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .22em;
  color: var(--ink-2);
}

/* 个人中心 · 头像 */
.me-avatar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, .4);
}
.me-avatar .ma-pic {
  flex: none;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 3px;
  overflow: hidden;
  background: var(--paper-3);
  border: 1px solid var(--line);
}
.me-avatar .ma-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-avatar .ma-pic b {
  font-family: var(--kai);
  font-size: 26px;
  font-weight: 500;
  color: var(--ink-3);
}
.me-avatar .ma-side { flex: 1; min-width: 0; }
.me-avatar .ma-side .btn { padding: 7px 16px; font-size: 12.5px; letter-spacing: .14em; }
.me-avatar .hint { margin: 8px 0 0; font-size: 12px; line-height: 1.7; color: var(--ink-3); }

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 15px;
  margin-bottom: 18px;
  border-left: 3px solid var(--gold);
  background: rgba(176, 141, 79, .09);
  border-radius: 0 3px 3px 0;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-2);
}
.notice b {
  font-family: var(--kai);
  color: var(--gold);
  letter-spacing: .1em;
  white-space: nowrap;
}
.notice span { letter-spacing: .02em; text-align: justify; }
.notice span b { color: var(--ink); font-family: var(--serif); letter-spacing: .04em; }

.pay-ch { display: flex; gap: 8px; margin-bottom: 14px; }
.pay-ch .ch {
  flex: 1;
  font-family: var(--serif);
  font-size: 13.5px;
  letter-spacing: .12em;
  padding: 10px 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: .2s;
}
.pay-ch .ch:hover { border-color: var(--gold); }
.pay-ch .ch.on {
  border-color: var(--cinnabar);
  color: var(--cinnabar);
  background: rgba(168, 52, 42, .06);
}

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; }
.plan {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 15px 6px 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .4);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--serif);
  transition: .2s;
}
.plan:hover { border-color: var(--gold); }
.plan.on {
  border-color: var(--cinnabar);
  background: rgba(168, 52, 42, .06);
  box-shadow: inset 0 0 0 1px rgba(168, 52, 42, .25);
}
.plan .p-n { font-family: var(--kai); font-size: 16px; letter-spacing: .12em; color: var(--ink); }
.plan .p-d { font-size: 11px; color: var(--ink-3); letter-spacing: .01em; text-align: center; }
.plan .p-a { font-family: var(--kai); font-size: 17px; color: var(--cinnabar); margin-top: 5px; }
.plan .p-per { font-size: 10.5px; color: var(--ink-3); letter-spacing: .02em; }

.order-card {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, .5);
  animation: fadeUp .28s ease both;
}
.oc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 7px;
  border-bottom: 1px dashed var(--line);
}
.oc-top span { font-family: var(--kai); font-size: 15px; letter-spacing: .16em; }
.oc-top em {
  font-style: normal;
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--gold);
  border: 1px solid rgba(176, 141, 79, .5);
  padding: 1px 9px;
  border-radius: 999px;
}
.oc-row { display: flex; align-items: baseline; gap: 12px; font-size: 13px; padding: 3px 0; }
.oc-row span { color: var(--ink-3); letter-spacing: .1em; min-width: 56px; }
.oc-row b { font-family: var(--kai); font-weight: 600; font-size: 14.5px; letter-spacing: .06em; }
.oc-row b.amt { color: var(--cinnabar); font-size: 18px; }
.oc-note {
  font-size: 11.5px;
  line-height: 1.85;
  color: var(--ink-3);
  margin: 11px 0 0;
  letter-spacing: .02em;
  text-align: justify;
}
.oc-note b { color: var(--ink-2); font-weight: 400; }
.oc-act { margin-top: 12px; }

.redeem { margin-top: 24px; padding-top: 18px; border-top: 1px dashed var(--line); }
.redeem h4 {
  font-family: var(--kai);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .26em;
  margin: 0 0 11px;
  color: var(--ink-2);
}
.redeem-row { display: flex; gap: 8px; }
.redeem-row input {
  flex: 1;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  letter-spacing: .14em;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .6);
  color: var(--ink);
  outline: none;
  transition: .2s;
}
.redeem-row input:focus { border-color: var(--cinnabar); background: #fff; }
.redeem-row .btn { flex: 0 0 auto; }

@media (max-width: 860px) {
  .acct-btn b, .acct-btn em { display: none; }
  .acct-btn { padding: 4px; gap: 0; }
  .acct { margin-left: 4px; }
  .acct-in { gap: 5px; }
  .acct-daily { padding: 5px 8px; font-size: 12px; max-width: 110px; }
  .acct-daily .ad-lb { display: none; }
  .plans { grid-template-columns: repeat(2, 1fr); }
  .notice { flex-direction: column; gap: 4px; }
}

@media (max-width: 480px) {
  .topbar { gap: 8px; }
  .nav button { padding: 7px 8px; font-size: 12.5px; }
  .acct-login { padding: 6px 11px; font-size: 12.5px; letter-spacing: .1em; }
  .pay-ch .ch { font-size: 12px; letter-spacing: .04em; padding: 9px 2px; }
  .plan .p-n { font-size: 15px; }
  /* 三联生日在窄屏要收一收，否则「1990 年」会被挤掉字 */
  .birth-row { gap: 6px; }
  .birth-row select { font-size: 13px; padding: 10px 4px; }
}

/* ============================================================
   典籍模式（archive）
   ------------------------------------------------------------
   国内站只放典籍查阅：起卦、梅花易数、账号与付费入口全部收起。
   服务端在 archive 下已把对应接口一律 403，这里只是别让界面
   留下点了必然失败的按钮。默认视图切到「六十四卦」由 app.js 负责。
   ============================================================ */
html.mode-archive .nav button[data-view="cast"],
html.mode-archive .nav button[data-view="meihua"],
html.mode-archive .acct,
html.mode-archive #btnDailyHero {
  display: none !important;
}

/* 签次不足：弹窗里的一句说明，替代卦象位 */
.daily-needpay {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px 18px;
  text-align: center;
  color: var(--ink-2, #4a4038);
}
.daily-needpay b { font-size: 17px; letter-spacing: .06em; }
.daily-needpay span { font-size: 13px; line-height: 1.7; color: var(--ink-3, #6b5f55); }
