/* ============================================================
   玄机阁 v3 · DApp 首页 / 工具页 / 钱包
   延续 v1/v2 的宣纸底 + 朱砂 / 松青 / 金三色
   ============================================================ */

.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .92em; word-break: break-all; }
.linkish { border: none; background: none; color: var(--red); cursor: pointer; padding: 0 2px; font: inherit; text-decoration: underline; text-underline-offset: 3px; }

.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2fae74; box-shadow: 0 0 0 3px rgba(47, 174, 116, .18); margin-right: 6px; vertical-align: 1px; animation: livePulse 2s ease-in-out infinite; }
.live-dot.is-off { background: var(--ink-3); box-shadow: none; animation: none; }
@keyframes livePulse { 50% { box-shadow: 0 0 0 6px rgba(47, 174, 116, .05); } }
#authBtn { gap: 6px; }

/* 今日 */
.today-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.t-card { padding: 20px; }
.t-wide { grid-column: 1 / -1; }
.t-dl { display: grid; gap: 0; margin: 12px 0; }
.t-dl > div { display: grid; grid-template-columns: 80px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.t-dl dt { color: var(--ink-3); }
.t-line { margin-top: 12px; font-size: 13.5px; line-height: 1.85; color: var(--ink-2); }
.hbar-list { display: grid; gap: 10px; margin-top: 12px; }
.yiji { display: grid; gap: 8px; margin: 12px 0; }
.yiji > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.yiji b { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-family: var(--f-display); color: #fff; font-size: 15px; }
.yiji-y b { background: var(--jade); }
.yiji-j b { background: var(--red); }
.yiji span { padding: 4px 10px; border-radius: 8px; font-size: 13px; }
.yiji-y span { background: var(--jade-soft); color: var(--jade); }
.yiji-j span { background: var(--red-soft); color: var(--red); }
.hours { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; margin-top: 10px; }
.hour { position: relative; display: grid; justify-items: center; gap: 2px; padding: 10px 2px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-soft); }
.hour b { font-family: var(--f-display); font-size: 18px; }
.hour span { font-size: 9.5px; color: var(--ink-3); font-family: var(--f-num); }
.hour em { font-style: normal; font-size: 11px; color: var(--ink-2); }
.hour i { font-style: normal; font-size: 10px; padding: 0 6px; border-radius: 4px; }
.hour.is-good i { background: var(--jade-soft); color: var(--jade); }
.hour.is-bad i { background: var(--bg-soft); color: var(--ink-3); }
.hour.is-good b { color: var(--jade); }
.hour.is-now { border-color: var(--red); box-shadow: 0 0 0 3px rgba(185, 58, 43, .1); background: #fff; }
.fest-list { display: grid; margin-top: 8px; }
.fest-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.fest-list li:last-child { border-bottom: none; }
.fest-list b { font-family: var(--f-display); font-size: 16px; }
.fest-list span { font-size: 12px; color: var(--ink-3); }
.fest-list em { font-style: normal; font-family: var(--f-num); font-size: 13px; color: var(--red); }
.fest-list--big { margin-top: 14px; }

/* 钱包 */
.wallet-opts { display: grid; gap: 10px; margin-top: 18px; }
.wallet-opt { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-soft); cursor: pointer; text-align: left; font: inherit; transition: border-color .16s, background .16s; }
.wallet-opt:hover { border-color: var(--red); background: #fff; }
.wallet-opt b { display: block; font-size: 15px; }
.wallet-opt small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.wallet-opt em { font-style: normal; font-size: 13px; color: var(--red); }
.wallet-card { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, #1c2723, #26362f); color: #f2f4ee; }
.wallet-card b { display: block; font-family: var(--f-num); font-size: 18px; }
.wallet-card small { font-size: 11.5px; color: rgba(242, 244, 238, .65); }

/* 工具页 */
.tool-head { display: flex; align-items: center; gap: 20px; }
.tool-head h1 { margin-top: 8px; }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.tool-layout .side-stack { position: sticky; top: 92px; }
.card-back {
  display: grid; place-items: center; gap: 10px; width: 220px; height: 300px; margin: 18px auto 6px; border-radius: 22px; cursor: pointer;
  border: none; color: #fff; font: inherit;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .08) 0 10px, transparent 10px 20px), linear-gradient(150deg, #c94a34, #8d2a1d);
  box-shadow: 0 24px 40px -24px rgba(140, 42, 28, .9); transition: transform .3s var(--ease);
}
.card-back span { font-size: 56px; }
.card-back b { font-size: 14px; letter-spacing: .2em; }
.card-back:hover { transform: translateY(-4px) rotate(-1deg); }
.card-back.is-flip { animation: flip .7s var(--ease); }
@keyframes flip { 50% { transform: rotateY(90deg) scale(.96); } }

.quiz { display: grid; gap: 14px; margin-top: 16px; counter-reset: q; }
.quiz li p { font-size: 14.5px; font-weight: 500; margin-bottom: 8px; }
.quiz-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.quiz-opts button { padding: 9px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #fff; font-size: 13.5px; cursor: pointer; transition: all .15s; }
.quiz-opts button:hover { border-color: var(--ink-3); }
.quiz-opts button.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

.tr-card { margin-top: 18px; padding: clamp(18px, 2.6vw, 28px); border-radius: var(--r-xl); background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-3); animation: pageIn .45s var(--ease) both; }
.tr-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tr-title { flex: 1; min-width: 180px; }
.tr-title h2 { font-family: var(--f-display); font-size: 23px; font-weight: 700; letter-spacing: .03em; }
.tr-title p { margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.tr-verdict { padding: 6px 14px; border-radius: 10px; background: var(--red); color: #fff; font-family: var(--f-display); font-size: 16px; letter-spacing: .1em; }
.mini-ring { position: relative; width: 64px; height: 64px; }
.mini-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mini-ring .ring-track, .mini-ring .ring-bar { stroke-width: 7; }
.mini-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-num); font-size: 19px; color: var(--red); }
.tr-card .master-tags { margin-top: 14px; }
.gua-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0 6px; padding: 16px; border-radius: 18px; background: var(--surface-soft); border: 1px solid var(--line); flex-wrap: wrap; }
.gua-row > div:not(.gua-arrow) { display: grid; justify-items: center; gap: 6px; }
.gua-row span { font-size: 11px; color: var(--ink-3); letter-spacing: .14em; }
.gua-row b { font-family: var(--f-display); font-size: 15px; }
.gua-arrow { color: var(--ink-3); }
.hex { width: 58px; height: 64px; }
.big-card { margin: 18px auto 4px; max-width: 420px; padding: 34px 28px; border-radius: 22px; text-align: center; background: linear-gradient(160deg, #fff, #fbf6ec); border: 2px solid var(--cc, var(--gold)); box-shadow: 0 18px 36px -26px rgba(0, 0, 0, .5); }
.big-card p { font-family: var(--f-display); font-size: 22px; line-height: 1.7; color: var(--cc, var(--ink)); }
.big-card-pic { display: block; font-size: 15px; color: var(--ink-2); margin-bottom: 12px; }
.tr-secs { display: grid; gap: 0; margin-top: 10px; }
.tr-secs article { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.tr-secs article:last-child { border-bottom: none; }
.tr-secs h4 { font-size: 13px; color: var(--red); letter-spacing: .08em; margin-bottom: 6px; font-weight: 600; }
.tr-secs p { font-size: 14.5px; line-height: 1.95; color: var(--ink-2); }
.tr-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
#trProof { margin-top: 10px; color: var(--jade); }
.record-tool { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.record-tool .ti { width: 36px; height: 36px; }
.record-tool .ti img { width: 24px; height: 24px; }

/* 罗盘 */
.compass { position: relative; width: min(340px, 86vw); aspect-ratio: 1; margin: 20px auto 10px; }
.compass-dial { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, #fffaf0 0 38%, #f6ecd6 38% 39%, #fff7e8 39% 64%, #ead9b4 64% 65%, #fcf2dc 65%); border: 2px solid #c9952e; transition: transform .3s ease-out; }
.compass-dial span { position: absolute; left: 50%; top: 50%; transform: rotate(var(--a)) translateY(-138%) rotate(0); transform-origin: 0 0; font-family: var(--f-display); font-size: 13px; color: var(--ink-2); translate: -50% -50%; }
.compass-dial span.is-main { color: var(--red); font-weight: 700; font-size: 15px; }
.cmp-mark { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; color: #fff; transform: rotate(var(--a)) translateY(-118px) rotate(calc(-1 * var(--a))); }
.cmp-xi { background: var(--red); }
.cmp-cai { background: var(--gold); }
.compass-center { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; background: #fff; border: 2px solid #c9952e; }
.compass-needle { position: absolute; left: 50%; top: 6%; width: 0; height: 44%; border-left: 3px solid var(--red); transform: translateX(-50%); pointer-events: none; }
.compass-needle::before { content: ""; position: absolute; top: -8px; left: -9px; border: 8px solid transparent; border-bottom: 12px solid var(--red); border-top: none; }
.cmp-range { width: 100%; max-width: 340px; display: block; margin: 8px auto; accent-color: var(--red); }
.cmp-read { text-align: center; font-family: var(--f-display); font-size: 18px; }

/* 老师 */
.teacher-list { display: grid; gap: 12px; margin-top: 16px; }
.teacher { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: var(--surface-soft); border: 1px solid var(--line); }
.teacher b { font-size: 15px; }
.teacher small { margin-left: 8px; font-size: 12px; color: var(--ink-3); }
.teacher p { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.teacher-side { display: grid; justify-items: end; gap: 6px; }
.teacher-side em { font-style: normal; font-family: var(--f-num); font-size: 18px; color: var(--red); font-weight: 600; }
.teacher-side em small { font-size: 11px; color: var(--ink-3); margin-left: 2px; }
#slots button.is-on { background: var(--ink); color: #fff; }

/* 解压 */
.zen-stage { position: relative; display: grid; place-items: center; min-height: 300px; margin-top: 14px; border-radius: 22px; background: radial-gradient(circle at 50% 40%, #fffaf0, #f3ecdc); border: 1px solid var(--line); overflow: hidden; }
.muyu { width: 220px; border: none; background: none; cursor: pointer; padding: 0; }
.muyu.is-hit { animation: hit .18s ease; }
@keyframes hit { 50% { transform: scale(.94) translateY(4px); } }
.merit-float { position: absolute; top: 34%; font-family: var(--f-display); font-size: 18px; color: var(--gold); animation: floatUp .9s ease-out forwards; pointer-events: none; }
@keyframes floatUp { to { transform: translateY(-80px); opacity: 0; } }
#floatZone { position: absolute; inset: 0; pointer-events: none; }
.beads { position: relative; width: 220px; height: 220px; border-radius: 50%; border: none; background: none; cursor: pointer; transform: rotate(var(--rot, 0deg)); transition: transform .25s var(--ease); }
.beads i { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #d99a5c, #7a4518); transform: rotate(var(--a)) translateY(-92px); box-shadow: inset -3px -3px 6px rgba(0, 0, 0, .25); }
.beads span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-display); font-size: 26px; color: var(--ink-2); transform: rotate(calc(-1 * var(--rot, 0deg))); }
.nature-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.nature-opts button { display: grid; justify-items: center; gap: 6px; padding: 18px 8px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-soft); cursor: pointer; font-size: 13.5px; }
.nature-opts button span { font-size: 30px; }
.nature-opts button.is-on { background: var(--jade-soft); border-color: var(--jade); color: var(--jade); }
.bubble-input { display: flex; gap: 8px; margin-top: 14px; }
.bubble-zone { position: relative; height: 340px; margin-top: 14px; border-radius: 22px; background: linear-gradient(180deg, #eaf4fb, #f7fbff); border: 1px solid var(--line); overflow: hidden; }
.bubble { position: absolute; bottom: -90px; width: calc(84px * var(--s)); height: calc(84px * var(--s)); border-radius: 50%; border: 1px solid rgba(120, 170, 220, .5); background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .95), rgba(190, 220, 245, .45) 40%, rgba(160, 200, 240, .2)); color: #2b4a78; font-size: 13px; cursor: pointer; animation: rise linear forwards; }
.bubble.is-pop { animation: pop .28s ease-out forwards !important; }
@keyframes rise { to { transform: translateY(-460px); } }
@keyframes pop { to { transform: scale(1.6); opacity: 0; } }
.breath { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, #fff, var(--jade-soft)); border: 2px solid var(--jade); color: var(--jade); font-family: var(--f-display); font-size: 20px; transition: transform 4s ease-in-out; }
.breath.is-in { transform: scale(1.7); }
.breath.is-hold { transform: scale(1.7); }
.breath.is-out { transform: scale(1); transition-duration: 6s; }

/* 响应式 */
@media (max-width: 1080px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-layout .side-stack { position: static; }
  .like-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .h-hero { grid-template-columns: 1fr; }
  .h-hero-side { grid-template-columns: 1fr auto; grid-template-areas: "date mascot" "greet mascot" "adv mascot"; justify-items: start; text-align: left; }
  .h-date { grid-area: date; justify-self: start; }
  .h-greet { grid-area: greet; }
  .mascot { grid-area: mascot; width: 100px; height: 108px; }
  .h-advice, #bindHint { grid-column: 1; }
  .self-grid { grid-template-columns: 1fr 1fr; }
  .course-list { grid-template-columns: 1fr; }
  .today-grid { grid-template-columns: 1fr; }
  .hours { grid-template-columns: repeat(6, 1fr); }
  .group-tabs { top: 62px; }
}
@media (max-width: 720px) {
  .h-top { gap: 8px; }
  .h-wallet { display: none; }
  .h-tabs { gap: 16px; }
  .h-hero { padding: 18px; }
  .h-score { gap: 18px; }
  .ring { width: 104px; height: 104px; }
  .ring-num b { font-size: 32px; }
  .vbar-track { height: 80px; }
  .h-bars { gap: 14px; }
  .self-grid { padding: 10px; gap: 10px; }
  .self-card { padding: 14px; }
  .self-card h3 { font-size: 16px; }
  .self-card .ti--xl { width: 46px; height: 46px; }
  .self-card .ti--xl img { width: 28px; height: 28px; }
  .tool-grid { grid-template-columns: repeat(4, 1fr); }
  .tool-item { font-size: 12px; }
  .tool-item .ti { width: 42px; height: 42px; }
  .like-grid { grid-template-columns: 1fr; }
  .course-card { grid-template-columns: 110px 1fr; }
  .tool-head { align-items: flex-start; }
  .tool-head .ti--xxl { width: 64px; height: 64px; }
  .nature-opts { grid-template-columns: 1fr 1fr; }
  .teacher { grid-template-columns: auto 1fr; }
  .teacher-side { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .hours { grid-template-columns: repeat(4, 1fr); }
  .live-feed li { grid-template-columns: auto 1fr; }
  .live-feed time { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mascot, .live-dot { animation: none; }
}
