/* ============================================================
   应用页 · 淡墨宣纸主题（在 style-v3.css 之后加载）
   ============================================================ */

:root {
  --paper: #f8f3e7;
  --paper-2: #fdfaf2;
  --ink: #2b241d;
  --ink-2: #5a5044;
  --ink-3: #94836a;
  --rule: #e2d5bb;
  --rule-2: #d3c3a4;
  --zhu: #a8302a;
  --jin: #9a7a35;
  --mu: #4d6b42;
  --shui: #38607c;
  --huo: #a8302a;
  --tu: #7d5f38;
  --kai: "STKaiti", "Kaiti SC", "KaiTi", "楷体", "Songti SC", serif;
  color-scheme: light;
}

html, body {
  background: var(--paper);
  background-image:
    radial-gradient(circle at 82% 4%, rgba(214, 158, 120, .16), transparent 38%),
    radial-gradient(circle at 8% 92%, rgba(150, 160, 145, .14), transparent 42%),
    linear-gradient(180deg, #faf6ec, #f5eedd);
  background-attachment: fixed;
  color: var(--ink);
}
body::before { display: none; }
.wrap { padding-top: 10px; }

/* ---------- 顶部：品牌条 ---------- */
.masthead {
  position: relative;
  padding: 8px 6px 14px;
  margin-bottom: 6px;
  background: none;
  border: 0;
  box-shadow: none;
  text-align: center;
}
.masthead::before,
.masthead::after { content: none; display: none; }

.masthead .kicker {
  font-size: 0;
  letter-spacing: 0;
  margin: 0 0 6px;
}
.masthead .kicker::before {
  content: "街 · 頭 · 一 · 卦";
  font-family: var(--kai);
  font-size: 10px;
  letter-spacing: .32em;
  color: var(--ink-3);
}

.masthead h1 {
  font-size: 0;
  line-height: 0;
  margin: 0;
  letter-spacing: 0;
  text-indent: 0;
}
.brush-title {
  display: block;
  width: 168px;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 2px 3px rgba(90, 70, 40, .12));
}
.masthead .lede {
  font-family: var(--kai);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .18em;
  margin-top: 8px;
  white-space: nowrap;
}

/* 返回首页 */
.back-home {
  position: absolute;
  left: 6px;
  top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--kai);
  font-size: 12px;
  color: var(--ink-3);
  text-decoration: none;
  letter-spacing: .08em;
}
.back-home::before { content: "‹"; font-size: 16px; line-height: 1; }

/* ---------- 导航：下划线式 ---------- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 16px;
  padding: 0 4px;
}
.tab {
  flex: 1;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .12em;
  color: var(--ink-2);
  padding: 10px 0 11px;
  position: relative;
}
.tab.active {
  background: none;
  color: var(--zhu);
  font-weight: 600;
  box-shadow: none;
}
.tab.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 28px;
  height: 2px;
  margin-left: -14px;
  background: var(--zhu);
  border-radius: 1px;
}

/* ---------- 卡片 ---------- */
.panel {
  background: linear-gradient(180deg, rgba(255, 253, 246, .95), rgba(252, 247, 236, .85));
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(120, 96, 60, .07);
  padding: 20px 18px 24px;
  color: var(--ink);
}
.panel::before { content: none; display: none; }
.panel::after { display: none; }

/* 表单 */
.field > .lab { color: var(--ink-3); font-family: var(--kai); letter-spacing: .2em; }
.field input { color: var(--ink); border-bottom: 1px solid var(--rule-2); background: transparent; }
.field input:focus { border-bottom-color: var(--zhu); }
.field input::placeholder { color: #b7a486; }
.seg button { color: var(--ink-3); font-family: var(--kai); }
.seg button.on { color: var(--zhu); border-bottom: 2px solid var(--zhu); }
details.adv { border-top: 1px dashed var(--rule-2); }
details.adv summary { color: var(--ink-3); font-family: var(--kai); letter-spacing: .16em; }

/* 按钮：朱漆卷轴 */
.btn {
  border-radius: 8px;
  border: 2px solid #c9a568;
  background: linear-gradient(180deg, #b03a30, #8d221c);
  color: #fdf3de;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .3em;
  text-indent: .3em;
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 160, .32),
    0 6px 16px rgba(120, 40, 30, .28);
  text-shadow: none;
}
.btn[disabled] {
  background: #eee3cd;
  color: #a8977a;
  border-color: var(--rule-2);
  box-shadow: none;
}
.btn-text {
  color: #8c5a2e;
  font-family: var(--kai);
  border-top: 1px dashed var(--rule-2);
  text-shadow: none;
  font-weight: 500;
}

/* 结果区 */
.sec-h { border-bottom: 1px solid var(--ink); }
.sec-h b { font-family: var(--serif); color: var(--zhu); letter-spacing: .24em; }
.sec-h span { color: var(--ink-3); }

.read-block { border-top: 1px dashed var(--rule-2); }
.rb-l { font-family: var(--serif); color: #8c2620; letter-spacing: .16em; }
.rb-tag {
  font-family: var(--kai);
  color: #fff;
  background: var(--zhu);
  border: 1px solid #8c2620;
}
.rb-lead { font-family: var(--serif); font-size: 16.5px; color: var(--ink); }
.read-block p { color: var(--ink-2); }
.rb-foot { border-top: 1px dashed var(--rule-2); color: var(--ink-2); }

.pillars { border-top: 1px solid var(--rule-2); }
.pillar { border-right: 1px solid var(--rule-2); }
.pillar .pl { font-family: var(--kai); color: var(--ink-3); }
.pillar .gz { font-family: var(--serif); font-size: 34px; font-weight: 700; }
.pillar .ss { font-family: var(--kai); color: var(--ink-2); }
.pillar .ny { color: var(--ink-3); }

.dy-item + .dy-item { border-left: 1px solid var(--rule-2); }
.dy-item .g { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.wx-track { background: rgba(150, 120, 70, .18); }

.hl.yang { background: var(--ink); }
.hl.yin i { background: var(--ink); }
.hl.mv.yang { background: var(--zhu); }
.hl.mv.yin i { background: var(--zhu); }

.quote {
  background: rgba(255, 252, 244, .9);
  border-left: 3px solid var(--zhu);
  box-shadow: inset 0 0 0 1px rgba(168, 48, 42, .10);
}
.quote small { font-family: var(--kai); color: var(--zhu); }
.q-short { font-family: var(--serif); font-size: 18px; color: var(--ink); }
.q-plain { color: var(--ink-2); }
.q-advice { border-top: 1px dashed var(--rule-2); }
.q-advice i { color: var(--zhu); font-family: var(--kai); }

.cast-name { font-family: var(--serif); font-size: 24px; color: #8c2620; }
.cast-tag { font-family: var(--kai); color: var(--ink-3); }
.cast-meta { color: var(--ink-3); }

.yao { border-top: 1px solid var(--rule-2); }
.yao-row .god { font-family: var(--kai); color: var(--ink-3); }
.yao-row .gz { font-family: var(--serif); }
.yao-row .lq { font-family: var(--kai); }
.yao-row .sy { font-family: var(--kai); color: var(--zhu); }
.yao-row .pos { font-family: var(--kai); color: var(--ink-3); }

.slot { font-family: var(--kai); color: #b7a486; border-top: 2px solid var(--rule-2); }
.slot.done { color: var(--ink); border-top-color: var(--ink); }
.slot.done.mv { color: var(--zhu); border-top-color: var(--zhu); }
.coin-caption { font-family: var(--kai); color: var(--ink-3); }

.zw-stage { border: 1px solid var(--ink); background: rgba(255, 252, 244, .7); }
.zw-cell { border-right: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); }
.zw-cell.ming { background: rgba(168, 48, 42, .06); }
.zw-cell .pn { font-family: var(--kai); color: #6d4a1e; }
.zw-cell .st { font-family: var(--serif); }
.zw-center .t { font-family: var(--serif); color: #8c2620; }

.qstick { font-family: var(--serif); }
.qn { font-family: var(--serif); font-size: 24px; color: #8c2620; }
.qian-meta { font-family: var(--kai); color: var(--ink-3); }

footer {
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-family: var(--kai);
}

/* 卦金碗 / 香炉 区域换成浅底，去掉重阴影 */
.alms-bowl, .censer-img { filter: drop-shadow(0 6px 10px rgba(120, 96, 60, .22)); }
.alms-label, .altar-label { color: var(--ink-3); }
.alms-stage::after { background: radial-gradient(ellipse at center, rgba(120, 96, 60, .18), transparent 70%); }
.censer-note { color: #8c2620; text-shadow: none; }
.alms-thanks { color: #8c2620; text-shadow: none; }


/* 浅色主题不显示街边挂件 */
.bagua-bg, .stall-hang { display: none; }


/* ---------- 卦金碗 / 香炉（浅色主题沿用结构，只调颜色） ---------- */
/* ============================================================
   卦金碗
   ============================================================ */
.alms {
  margin: 0;
  width: auto;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.alms-stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 132px;
}
.alms-bowl {
  width: 138px;
  position: relative;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .55));
  transition: transform .18s ease;
}
.alms-bowl img {
  display: block;
  width: 100%;
  height: auto;
}
.alms:active .alms-bowl { transform: translateY(2px) scale(.985); }

/* 碗下的影子 */
.alms-stage::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 132px;
  height: 16px;
  margin-left: -66px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .5), transparent 70%);
  filter: blur(3px);
  z-index: -1;
}

.alms-label {
  margin-top: 10px;
  font-family: var(--kai);
  font-size: 12px;
  letter-spacing: .3em;
  color: #c79a52;
  opacity: .85;
}

.alms-thanks {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translate(-50%, 0);
  font-family: var(--kai);
  font-size: 13px;
  letter-spacing: .2em;
  color: #f0cd85;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 0 10px rgba(240, 205, 133, .6);
}
.alms-thanks.show {
  animation: thanksUp 1.2s ease forwards;
}
@keyframes thanksUp {
  0% { opacity: 0; transform: translate(-50%, 6px); }
  25% { opacity: 1; transform: translate(-50%, -6px); }
  100% { opacity: 0; transform: translate(-50%, -26px); }
}

/* 落下的铜钱 */
.alms-coin {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  background: url(assets/coin-front-clean.png) center / contain no-repeat;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5));
  pointer-events: none;
  z-index: 2;
}

/* ============================================================
   香炉 + 一炷香
   ============================================================ */
.altar {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 26px;
  margin: 30px auto 6px;
}

.censer { width: 108px; text-align: center; }
.censer-stage {
  position: relative;
  height: 138px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.censer-img {
  display: block;
  width: 108px;
  height: auto;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .55));
}

/* 香：从香灰里插出来，会越烧越短 */
.incense {
  position: absolute;
  left: 50%;
  bottom: 66px;
  width: 0;
  height: 0;
  z-index: 3;
  --h: 42px;
}
.incense-stick {
  position: absolute;
  bottom: 0;
  left: -1px;
  width: 2px;
  height: var(--h, 42px);
  background: linear-gradient(180deg, #4a3222, #7b5533 60%, #4a3222);
  border-radius: 1px;
  transition: height .9s linear;
}
.ember {
  position: absolute;
  bottom: calc(var(--h, 42px) - 3px);
  left: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff8a4a;
  box-shadow:
    0 0 5px 1.5px rgba(255, 130, 60, .85),
    0 0 14px 5px rgba(255, 90, 40, .35);
  transition: bottom .9s linear;
  animation: emberPulse 3.4s ease-in-out infinite;
}
@keyframes emberPulse {
  0%, 100% { opacity: .75; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* 烟：跟着火点走 */
.smoke {
  position: absolute;
  left: 0;
  bottom: var(--h, 42px);
  width: 0;
  height: 0;
  z-index: 3;
  transition: bottom .9s linear;
}
.smoke i {
  position: absolute;
  left: -7px;
  bottom: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 242, 220, .68), rgba(255, 242, 220, 0) 70%);
  filter: blur(2.5px);
  opacity: 0;
  animation: smokeRise 9s linear infinite;
}
.smoke i:nth-child(2) { animation-delay: 3s; }
.smoke i:nth-child(3) { animation-delay: 6s; }

@keyframes smokeRise {
  0%   { transform: translate(0, 0) scale(.55); opacity: 0; }
  12%  { opacity: .85; }
  45%  { transform: translate(9px, -46px) scale(1.7); opacity: .45; }
  75%  { transform: translate(-7px, -86px) scale(2.7); opacity: .18; }
  100% { transform: translate(5px, -124px) scale(3.4); opacity: 0; }
}

.altar-label {
  margin-top: 10px;
  font-family: var(--kai);
  font-size: 12px;
  letter-spacing: .3em;
  color: #c79a52;
  opacity: .85;
  text-align: center;
}

/* 浅底下的阴影与文字色 */
.alms-stage::after { background: radial-gradient(ellipse at center, rgba(120, 96, 60, .20), transparent 70%); }
.alms-bowl, .censer-img { filter: drop-shadow(0 8px 12px rgba(120, 96, 60, .25)); }
.alms-label, .altar-label { color: #94836a; }
.alms-thanks { color: #8c2620; text-shadow: none; }
.censer-note { color: #8c2620; text-shadow: none; }
