/* ============================================================
 * 合欢宗 · 静态原型主题
 * 配色：墨黑 + 绛红 + 点缀金
 * 移动优先：默认即移动样式，>=1024px 进入桌面布局
 * 浏览器目标：iOS Safari 14+ / Chrome 90+ / 国产 WebView (Chromium 80+)
 * ============================================================ */

/* ---------- 1. 主题变量 ---------- */
:root {
  /* 拉开层次：卡片底色明显高于全局背景，分隔更清楚 */
  --hh-bg-0: #0d0a08;
  --hh-bg-1: #1a130f;
  --hh-bg-2: #221913;
  --hh-bg-3: #2a1f18;
  --hh-line: #3a2a22;
  --hh-line-2: #4a3528;

  --hh-crimson: #8b1d24;
  --hh-crimson-1: #a82a30;
  --hh-crimson-2: #6b1318;
  --hh-crimson-soft: rgba(168, 42, 48, 0.18);

  --hh-gold: #d4b676;
  --hh-gold-1: #e8cc8c;
  --hh-gold-soft: rgba(212, 182, 118, 0.22);

  /* 文字层级：主 / 次 / 暗，三级对比拉到 AA 以上 */
  --hh-ink: #f5ecd2;
  --hh-text: #ece1c4;
  --hh-text-dim: #cebd97;
  --hh-text-mute: #9d8c70;

  --hh-ok: #5a8f6a;
  --hh-warn: #b58a3a;
  --hh-err: #b3433d;

  --hh-sider-w: 240px;
  --hh-sider-w-md: 208px;
  --hh-top-h: 56px;
  --hh-tabbar-h: 60px;
  /* 安全区（iOS 刘海/底部 Home Indicator） */
  --hh-safe-bottom: env(safe-area-inset-bottom, 0px);
  --hh-safe-top: env(safe-area-inset-top, 0px);

  --hh-radius: 4px;
  --hh-radius-lg: 8px;

  --hh-shadow-card: 0 4px 18px rgba(0, 0, 0, 0.5), inset 0 0 0 1px var(--hh-line);
  --hh-shadow-glow: 0 0 0 1px var(--hh-gold-soft), 0 6px 24px rgba(168, 42, 48, 0.22);

  /* 正文用无衬线（中文笔画清晰），衬体仅保留给标题/品牌 */
  --hh-font-sys: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --hh-font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC",
    "STSongti-SC-Regular", "SimSun", serif;
  --hh-font-cal: "STKaiti", "Kaiti SC", "KaiTi", "楷体",
    "Noto Serif SC", "Source Han Serif SC", serif;
  --hh-font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Consolas,
    "Microsoft YaHei", monospace;
}

/* ---------- 2. Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--hh-bg-0);
  color: var(--hh-text);
  font-family: var(--hh-font-sys);
  font-size: 15px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* 防止 iOS 横竖屏切换时字号缩放 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* iOS 滚动惯性 */
  -webkit-overflow-scrolling: touch;
}

/* 移动端：禁止文字双击放大 / 长按高亮 / 横向滑动切页 */
body {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-touch-callout: none;
  overflow-x: hidden;
  /* 阻止 iOS Safari 横划触发前进/后退手势 */
  overscroll-behavior-x: none;
}

/* 输入框允许选中文本 */
input,
textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(168, 42, 48, 0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 120%, rgba(201, 168, 106, 0.06), transparent 60%),
    linear-gradient(180deg, var(--hh-bg-0) 0%, var(--hh-bg-1) 100%);
  background-attachment: fixed;
}

a {
  color: var(--hh-text);
  text-decoration: none;
}

a:hover {
  color: var(--hh-gold-1);
}

button {
  font-family: inherit;
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--hh-ink);
}

p {
  margin: 0;
}

input,
textarea,
select {
  font-family: inherit;
}

/* ---------- 3. 整体框架 ---------- */
.hh-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--hh-sider-w) 1fr;
  grid-template-rows: var(--hh-top-h) 1fr;
  grid-template-areas:
    "top top"
    "side main";
}

.hh-topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  height: var(--hh-top-h);
  background: linear-gradient(180deg, #110b09 0%, #0c0807 100%);
  border-bottom: 1px solid var(--hh-line);
  position: sticky;
  top: 0;
  z-index: 30;
}

.hh-topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hh-gold-soft), transparent);
}

.hh-burger {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--hh-line-2);
  background: transparent;
  border-radius: var(--hh-radius);
  position: relative;
}

.hh-burger::before,
.hh-burger::after,
.hh-burger > i {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 1px;
  background: var(--hh-gold);
}

.hh-burger::before { top: 11px; }
.hh-burger > i     { top: 17px; }
.hh-burger::after  { top: 23px; }

.hh-brand {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-flex: 1;
  -ms-flex: 1 1 0%;
  flex: 1 1 0%;
  min-width: 0;
}

/* 旧浏览器 flex gap fallback：靠子元素 margin */
.hh-brand .hh-seal {
  margin-right: 12px;
}

.hh-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: linear-gradient(160deg, var(--hh-crimson-1), var(--hh-crimson-2));
  color: var(--hh-gold-1);
  font-family: var(--hh-font-cal);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  border: 1px solid var(--hh-gold-soft);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

.hh-brand-text {
  font-family: var(--hh-font-cal);
  font-size: 19px;
  letter-spacing: 0.12em;
  color: var(--hh-ink);
}

.hh-brand-sub {
  font-size: 12px;
  color: var(--hh-text-dim);
  letter-spacing: 0.06em;
  margin-left: 8px;
}

.hh-topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 0 0 auto;
}

.hh-stone {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  padding: 4px 12px;
  background: var(--hh-bg-2);
  border: 1px solid var(--hh-line);
  border-radius: 999px;
  color: var(--hh-gold-1);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  /* 不用 flex gap：旧版 Android Chromium / iOS 14.0 不支持 */
}

.hh-stone-num {
  font-family: var(--hh-font-mono);
}

.hh-stone-ico {
  width: 10px;
  height: 10px;
  margin-right: 6px;
  background: var(--hh-gold);
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
  -webkit-box-shadow: 0 0 8px var(--hh-gold-soft);
  box-shadow: 0 0 8px var(--hh-gold-soft);
  /* 防止 flex 收缩成 0 */
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

.hh-disciple {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  color: var(--hh-text);
}

.hh-disciple .hh-avatar {
  margin-right: 8px;
}

/* 用户名做成可点击链接（顶栏右上 → 洞府，含出宗入口） */
.hh-disciple--link {
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.18s ease, opacity 0.18s ease;
}
.hh-disciple--link:hover,
.hh-disciple--link:focus {
  color: var(--hh-gold-1);
  outline: none;
}
.hh-disciple--link:active { opacity: 0.7; }

.hh-avatar {
  width: 30px;
  height: 30px;
  background: linear-gradient(160deg, #2a1c18, #4a2a25);
  border: 1px solid var(--hh-line-2);
  border-radius: 50%;
  position: relative;
}

.hh-avatar::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  bottom: 4px;
  left: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6b3a36 0%, #2a1612 70%);
}

.hh-name {
  font-family: var(--hh-font-cal);
  font-size: 14px;
  letter-spacing: 0.08em;
}

/* ---------- 4. 侧栏 ---------- */
.hh-sider {
  grid-area: side;
  background: linear-gradient(180deg, #120c0a 0%, #0c0807 100%);
  border-right: 1px solid var(--hh-line);
  padding: 20px 14px 80px;
  overflow-y: auto;
  position: sticky;
  top: var(--hh-top-h);
  height: calc(100vh - var(--hh-top-h));
  z-index: 25;
}

.hh-sider::-webkit-scrollbar { width: 6px; }
.hh-sider::-webkit-scrollbar-thumb { background: var(--hh-line-2); border-radius: 3px; }

.hh-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hh-nav-title {
  font-size: 11px;
  color: var(--hh-text-dim);
  letter-spacing: 0.18em;
  padding: 12px 12px 6px;
  border-bottom: 1px dashed var(--hh-line);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.hh-nav-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  grid-template-rows: auto auto;
  grid-column-gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--hh-radius);
  background: transparent;
  position: relative;
  transition: all 0.2s ease;
}

.hh-nav-item:hover {
  background: var(--hh-bg-2);
  border-color: var(--hh-line-2);
}

.hh-nav-item.is-active {
  background: linear-gradient(90deg, var(--hh-crimson-soft), transparent);
  border-color: var(--hh-line-2);
  box-shadow: inset 3px 0 0 var(--hh-crimson-1);
}

.hh-nav-item.is-active .hh-nav-text {
  color: var(--hh-gold-1);
}

.hh-nav-ico {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hh-gold);
}

.hh-nav-ico svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.4;
  fill: none;
}

.hh-nav-text {
  grid-column: 2;
  font-family: var(--hh-font-cal);
  font-size: 16px;
  letter-spacing: 0.1em;
  color: var(--hh-ink);
}

.hh-nav-sub {
  grid-column: 2;
  font-size: 12px;
  color: var(--hh-text-dim);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.hh-sider-foot {
  margin-top: 28px;
  padding: 14px 12px;
  border-top: 1px solid var(--hh-line);
  text-align: center;
}

.hh-mask {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 24;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

/* ---------- 5. 主区域 ---------- */
.hh-main {
  grid-area: main;
  padding: 24px clamp(16px, 3vw, 40px) 60px;
  min-width: 0;
}

.hh-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--hh-line);
  position: relative;
}

.hh-page-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, var(--hh-crimson-1), transparent);
}

.hh-page-title {
  font-family: var(--hh-font-cal);
  font-size: 28px;
  letter-spacing: 0.16em;
  color: var(--hh-ink);
  position: relative;
  padding-left: 18px;
}

.hh-page-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: linear-gradient(180deg, var(--hh-crimson-1), var(--hh-crimson-2));
}

.hh-page-sub {
  color: var(--hh-text-dim);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.hh-crumb {
  font-size: 12px;
  color: var(--hh-text-dim);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.hh-crumb a {
  color: var(--hh-gold);
}

.hh-crumb a:hover {
  color: var(--hh-gold-1);
  text-decoration: underline;
}

.hh-crumb-sep {
  margin: 0 6px;
  color: var(--hh-text-mute);
}

/* ---------- 6. 通用组件 ---------- */
.hh-card {
  background: var(--hh-bg-1);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius-lg);
  padding: 18px;
  position: relative;
  box-shadow: var(--hh-shadow-card);
}

.hh-card--ornate {
  padding: 22px 22px 22px 26px;
}

.hh-card--ornate::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: linear-gradient(180deg, var(--hh-gold) 0%, transparent 80%);
}

.hh-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--hh-font-cal);
  font-size: 17px;
  letter-spacing: 0.12em;
  color: var(--hh-ink);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--hh-line-2);
}

.hh-card-title::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--hh-crimson-1);
  transform: rotate(45deg);
  display: inline-block;
}

.hh-card-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--hh-line-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* 按钮 */
.hh-btn {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  padding: 9px 18px;
  font-family: var(--hh-font-cal);
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--hh-ink);
  background: linear-gradient(180deg, #2a1d18, #1a120f);
  border: 1px solid var(--hh-line-2);
  border-radius: var(--hh-radius);
  -webkit-transition: all 0.2s ease;
  transition: all 0.2s ease;
  text-decoration: none;
}

.hh-btn > * + * {
  margin-left: 6px;
}

.hh-btn:hover {
  border-color: var(--hh-gold);
  color: var(--hh-gold-1);
  box-shadow: 0 0 0 1px var(--hh-gold-soft), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hh-btn--primary {
  background: linear-gradient(180deg, var(--hh-crimson-1), var(--hh-crimson));
  color: #fdeec0;
  border-color: var(--hh-crimson-2);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.hh-btn--primary:hover {
  background: linear-gradient(180deg, #c0353c, var(--hh-crimson-1));
  color: #fff5d2;
  box-shadow: 0 0 0 1px var(--hh-gold-soft), 0 6px 18px rgba(168, 42, 48, 0.45);
}

.hh-btn--gold {
  background: transparent;
  border-color: var(--hh-gold);
  color: var(--hh-gold-1);
}

.hh-btn--gold:hover {
  background: var(--hh-gold-soft);
}

.hh-btn--block {
  display: flex;
  width: 100%;
}

.hh-btn--lg {
  padding: 14px 28px;
  font-size: 16px;
  letter-spacing: 0.18em;
}

.hh-btn--sm {
  padding: 5px 12px;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.hh-btn[disabled],
.hh-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

/* 徽章 */
.hh-badge {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  padding: 2px 10px;
  font-size: 12px;
  letter-spacing: 0.04em;
  background: var(--hh-bg-2);
  color: var(--hh-text);
  border: 1px solid var(--hh-line);
  border-radius: 2px;
}

.hh-badge > * + * {
  margin-left: 4px;
}

.hh-badge--crimson {
  background: var(--hh-crimson-soft);
  color: #f0c4a8;
  border-color: var(--hh-crimson-2);
}

.hh-badge--gold {
  background: var(--hh-gold-soft);
  color: var(--hh-gold-1);
  border-color: var(--hh-gold-soft);
}

.hh-badge--ok {
  background: rgba(90, 143, 106, 0.18);
  color: #97c8a3;
  border-color: rgba(90, 143, 106, 0.4);
}

.hh-badge--warn {
  background: rgba(181, 138, 58, 0.18);
  color: #e8c388;
  border-color: rgba(181, 138, 58, 0.4);
}

.hh-badge--err {
  background: rgba(179, 67, 61, 0.18);
  color: #e89e98;
  border-color: rgba(179, 67, 61, 0.45);
}

/* 灵石标价 */
.hh-stone-tag {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  padding: 2px 10px;
  background: var(--hh-bg-2);
  border: 1px solid var(--hh-gold-soft);
  border-radius: 2px;
  color: var(--hh-gold-1);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.hh-stone-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 5px;
  background: var(--hh-gold);
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
  display: inline-block;
  -webkit-box-shadow: 0 0 5px var(--hh-gold-soft);
  box-shadow: 0 0 5px var(--hh-gold-soft);
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

/* 骨架与分隔 */
.hh-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hh-line-2), transparent);
  border: none;
  margin: 22px 0;
}

.hh-grid {
  display: grid;
  gap: 16px;
}

.hh-grid--2 { grid-template-columns: repeat(2, 1fr); }
.hh-grid--3 { grid-template-columns: repeat(3, 1fr); }
.hh-grid--4 { grid-template-columns: repeat(4, 1fr); }

.hh-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* 全站统一 toast：屏幕正中央显示，金边墨底 */
.hh-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  min-width: 160px;
  max-width: min(80vw, 420px);
  background: linear-gradient(180deg, rgba(42, 28, 24, 0.96), rgba(26, 18, 16, 0.96));
  border: 1px solid var(--hh-gold-soft);
  color: var(--hh-gold-1);
  padding: 14px 26px;
  border-radius: 4px;
  font-family: var(--hh-font-cal);
  font-size: 15px;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 9999;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 16px 48px rgba(0, 0, 0, 0.7),
    0 0 28px rgba(204, 156, 79, 0.18);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  word-break: break-word;
}

.hh-toast.is-show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* 成功（金色描边偏暖）*/
.hh-toast--ok {
  border-color: var(--hh-gold);
  color: var(--hh-gold-1);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 16px 48px rgba(0, 0, 0, 0.7),
    0 0 28px rgba(204, 156, 79, 0.32);
}

/* 失败（绛红描边）*/
.hh-toast--err {
  border-color: var(--hh-crimson);
  color: #f4d6c8;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4),
    0 16px 48px rgba(0, 0, 0, 0.7),
    0 0 28px rgba(176, 47, 56, 0.35);
}

/* ============================================================
 * 7. 个人洞府 dongfu.html
 * ============================================================ */
.df-disciple {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
}

.df-portrait {
  width: 96px;
  height: 96px;
  position: relative;
  background: radial-gradient(circle at 40% 35%, #5a2e2a 0%, #2a1612 60%, #150b09 100%);
  border: 1px solid var(--hh-gold-soft);
  border-radius: 4px;
  overflow: hidden;
}

.df-portrait::after {
  content: "欢";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--hh-font-cal);
  font-size: 36px;
  color: var(--hh-gold-1);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  letter-spacing: 0;
}

.df-disciple-name {
  font-family: var(--hh-font-cal);
  font-size: 24px;
  letter-spacing: 0.14em;
  color: var(--hh-ink);
  display: flex;
  align-items: center;
  gap: 12px;
}

.df-rank {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  font-size: 12px;
  font-family: var(--hh-font-cal);
  letter-spacing: 0.08em;
  color: #fff5d2;
  background: linear-gradient(180deg, var(--hh-crimson-1), var(--hh-crimson-2));
  border: 1px solid var(--hh-gold-soft);
  border-radius: 2px;
}

.df-disciple-meta {
  margin-top: 8px;
  color: var(--hh-text-dim);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.df-stone {
  text-align: center;
  padding: 18px 12px;
  background: linear-gradient(180deg, rgba(168, 42, 48, 0.06), transparent),
    var(--hh-bg-2);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius);
  position: relative;
}

.df-stone-num {
  font-family: var(--hh-font-cal);
  font-size: 38px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--hh-gold-1);
  line-height: 1.1;
  text-shadow: 0 0 12px var(--hh-gold-soft);
}

.df-stone-label {
  margin-top: 6px;
  color: var(--hh-text-dim);
  font-size: 12px;
  letter-spacing: 0.18em;
}

.df-stone-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.df-checkin {
  margin-top: 12px;
}

.df-checkin-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.df-checkin-cell {
  text-align: center;
  padding: 10px 0;
  border: 1px solid var(--hh-line);
  border-radius: 3px;
  background: var(--hh-bg-2);
  font-family: var(--hh-font-cal);
  letter-spacing: 0.02em;
  color: var(--hh-text-dim);
  font-size: 13px;
  position: relative;
}

.df-checkin-cell.is-done {
  background: linear-gradient(180deg, rgba(168, 42, 48, 0.18), transparent), var(--hh-bg-2);
  border-color: var(--hh-crimson-2);
  color: var(--hh-gold-1);
}

.df-checkin-cell.is-done::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--hh-gold);
  transform: translateX(-50%) rotate(45deg);
}

.df-checkin-cell.is-today {
  background: linear-gradient(180deg, var(--hh-crimson-1), var(--hh-crimson-2));
  color: #fdeec0;
  border-color: var(--hh-gold-soft);
}

/* 弟子身份卡片底部：出宗操作行 */
.df-account-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--hh-line-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.df-account-foot-tip {
  font-size: 12px;
  color: var(--hh-text-mute);
  letter-spacing: 0.04em;
  flex: 1;
  min-width: 0;
}
.df-logout-form {
  flex-shrink: 0;
}
.df-logout-btn {
  border-color: var(--hh-crimson-soft);
  color: var(--hh-crimson-1);
}
.df-logout-btn:hover {
  background: var(--hh-crimson-soft);
  color: #f4d6c8;
}

/* 修为境界进度区 */
.df-realm-wrap {
  margin-top: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(168, 42, 48, 0.07) 0%, transparent 60%);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius);
}

.df-realm-meta {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: baseline;
      -ms-flex-align: baseline;
          align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  -ms-flex-wrap: wrap;
      flex-wrap: wrap;
}

.df-realm-name {
  font-family: var(--hh-font-cal);
  font-size: 17px;
  color: var(--hh-ink);
  letter-spacing: 0.12em;
}

.df-realm-lv {
  font-size: 13px;
  color: var(--hh-gold-1);
  letter-spacing: 0.08em;
}

.df-realm-cult {
  margin-left: auto;
  font-size: 12px;
  color: var(--hh-text-dim);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* 洞府页进度条（比顶栏大）*/
.df-realm-wrap .hh-realm-bar {
  gap: 4px;
  width: 100%;
}

.df-realm-wrap .hh-realm-cell {
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  height: 8px;
  border-radius: 2px;
}

.df-gate {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--hh-line);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(168, 42, 48, 0.08), transparent), var(--hh-bg-2);
}
.df-gate.is-ok {
  border-color: rgba(90, 143, 106, 0.45);
  background: linear-gradient(180deg, rgba(90, 143, 106, 0.12), transparent), var(--hh-bg-2);
}
.df-gate-title {
  font-family: var(--hh-font-cal);
  color: var(--hh-gold-1);
  font-size: 14px;
  letter-spacing: 0.1em;
}
.df-gate-msg {
  margin-top: 6px;
  color: var(--hh-text);
  font-size: 13px;
  line-height: 1.75;
  letter-spacing: 0.02em;
}
.df-gate-bars {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.df-gate-row {
  border: 1px solid var(--hh-line);
  border-radius: 4px;
  padding: 6px 8px;
  text-align: center;
}
.df-gate-k {
  display: block;
  color: var(--hh-text-dim);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.df-gate-v {
  display: block;
  margin-top: 2px;
  color: var(--hh-gold-1);
  font-family: var(--hh-font-mono);
  font-size: 12px;
}
.df-gate-unlock {
  margin-top: 10px;
  border-top: 1px dashed var(--hh-line);
  padding-top: 8px;
}
.df-gate-unlock-title {
  font-size: 12px;
  color: var(--hh-text-dim);
  letter-spacing: 0.06em;
}
.df-gate-unlock-list {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.df-gate-unlock-item {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--hh-gold-soft);
  border-radius: 999px;
  color: var(--hh-gold-1);
  background: rgba(212, 182, 118, 0.08);
  font-size: 12px;
  letter-spacing: 0.03em;
}

/* 打卡格增强 */
.df-checkin-cell {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 3px;
}

.df-checkin-wday {
  font-size: 10px;
  color: var(--hh-text-mute);
  letter-spacing: 0;
  line-height: 1;
  font-family: var(--hh-font-body);
}

.df-checkin-day {
  font-family: var(--hh-font-cal);
  font-size: 14px;
  letter-spacing: 0;
  color: var(--hh-text-dim);
  line-height: 1;
}

.df-checkin-cell.is-done .df-checkin-day { color: var(--hh-gold-1); }
.df-checkin-cell.is-today .df-checkin-day { color: #fdeec0; }

/* ============================================================
 * 8. 修炼室列表 xiulian.html
 * ============================================================ */
.xl-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--hh-line-2);
}

.xl-tab {
  padding: 6px 18px;
  font-family: var(--hh-font-cal);
  letter-spacing: 0.1em;
  color: var(--hh-text);
  border: 1px solid var(--hh-line);
  background: var(--hh-bg-2);
  border-radius: 2px;
  font-size: 14px;
  text-decoration: none;
}

.xl-tab.is-active {
  color: var(--hh-gold-1);
  border-color: var(--hh-gold-soft);
  background: linear-gradient(180deg, var(--hh-crimson-soft), transparent);
}

.xl-tab:hover {
  color: var(--hh-gold-1);
}

.xl-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.xl-card {
  position: relative;
  padding: 18px;
  background: linear-gradient(180deg, var(--hh-bg-1), var(--hh-bg-0));
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius-lg);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 180px;
  overflow: hidden;
}

.xl-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background:
    radial-gradient(140px 80px at 100% 0%, var(--hh-crimson-soft), transparent 70%),
    radial-gradient(120px 80px at 0% 100%, var(--hh-gold-soft), transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}

.xl-card:hover {
  transform: translateY(-2px);
  border-color: var(--hh-gold-soft);
  box-shadow: var(--hh-shadow-glow);
}

.xl-card-name {
  font-family: var(--hh-font-cal);
  font-size: 19px;
  letter-spacing: 0.14em;
  color: var(--hh-ink);
  position: relative;
  padding-left: 12px;
}

.xl-card-name::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: linear-gradient(180deg, var(--hh-crimson-1), transparent);
}

.xl-card-desc {
  flex: 1;
  font-size: 13px;
  color: var(--hh-text);
  letter-spacing: 0.02em;
  line-height: 1.8;
}

.xl-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--hh-line-2);
}

/* ============================================================
 * 9. 修炼操作页 xiulian-detail.html
 * ============================================================ */
.xd-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 22px;
  align-items: start;
}

.xd-form {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-wrap: wrap;
      -ms-flex-wrap: wrap;
          flex-wrap: wrap;
  gap: 18px;
  -webkit-align-items: flex-start;
      -ms-flex-align: start;
          align-items: flex-start;
}

.xd-field {
  display: block;
  font-family: var(--hh-font-cal);
  letter-spacing: 0.1em;
  color: var(--hh-ink);
  font-size: 15px;
  margin-bottom: 8px;
}

.xd-field-tip {
  margin-left: 8px;
  font-size: 12px;
  color: var(--hh-text-dim);
  letter-spacing: 0.02em;
  font-family: var(--hh-font-sys);
}

/* 字段容器 */
.xd-field-wrap {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-flex-direction: column;
      -ms-flex-direction: column;
          flex-direction: column;
  gap: 8px;
}

/* 图片 / 参考视频字段：PC 固定 400px，可与图片并排 */
.xd-field-wrap[data-type="image"],
.xd-field-wrap[data-type="video"] {
  -webkit-flex: 0 0 400px;
      -ms-flex: 0 0 400px;
          flex: 0 0 400px;
  width: 400px;
}

/* 提示词 / 参数选择：始终独占一行 */
.xd-field-wrap[data-type="prompt"],
.xd-field-wrap[data-type="select"] {
  -webkit-flex: 0 0 100%;
      -ms-flex: 0 0 100%;
          flex: 0 0 100%;
  width: 100%;
}

.xd-upload {
  position: relative;
  border: 1px dashed var(--hh-gold-soft);
  border-radius: var(--hh-radius);
  background: var(--hh-bg-2);
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  overflow: hidden;
  width: 400px;
  height: 400px; /* aspect-ratio fallback for Safari 14.0 / old WebView */
  aspect-ratio: 1 / 1;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-justify-content: center;
          justify-content: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
}

.xd-upload:hover,
.xd-upload.is-dragover {
  border-color: var(--hh-gold);
  background: linear-gradient(180deg, var(--hh-crimson-soft), transparent), var(--hh-bg-2);
}

.xd-upload input[type="file"] {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.xd-upload-empty {
  color: var(--hh-text-dim);
  letter-spacing: 0.04em;
  font-size: 13px;
}

.xd-upload-empty-em {
  display: block;
  font-family: var(--hh-font-cal);
  font-size: 20px;
  color: var(--hh-gold-1);
  letter-spacing: 0.18em;
  margin-bottom: 6px;
}

.xd-upload-preview {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.xd-upload.has-file .xd-upload-empty { display: none; }
.xd-upload.has-file .xd-upload-preview { display: block; }

/* 参考视频：预览在框内水平垂直居中（与图片 background-position:center 一致） */
.xd-upload--video.has-file .xd-upload-preview {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
}
.xd-upload--video .xd-upload-preview video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  -o-object-fit: contain;
     object-fit: contain;
  pointer-events: auto;
}

/* 火狐等：有预览后透明 file 仍抢命中，需关闭指针事件，换文件请点「移除」再选 */
.xd-upload--video.has-file input[type="file"] {
  pointer-events: none;
}

.xd-upload-clear {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--hh-gold-soft);
  color: var(--hh-gold-1);
  border-radius: 50%;
  font-size: 18px;
  z-index: 3;
  line-height: 26px;
  pointer-events: auto;
}

.xd-upload.has-file .xd-upload-clear { display: inline-block; }

.xd-prompt {
  width: 100%;
  min-height: 120px;
  background: var(--hh-bg-2);
  border: 1px solid var(--hh-line-2);
  border-radius: var(--hh-radius);
  padding: 12px 14px;
  color: var(--hh-ink);
  font-family: var(--hh-font-sys);
  font-size: 15px;
  line-height: 1.8;
  letter-spacing: 0.01em;
  resize: vertical;
  outline: none;
}

.xd-prompt::placeholder {
  color: var(--hh-text-mute);
  letter-spacing: 0.02em;
}

.xd-prompt:focus {
  border-color: var(--hh-gold-soft);
  box-shadow: 0 0 0 1px var(--hh-gold-soft);
}

.xd-aside {
  position: sticky;
  top: calc(var(--hh-top-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.xd-summary {
  background: linear-gradient(180deg, var(--hh-bg-1), var(--hh-bg-0));
  border: 1px solid var(--hh-line-2);
  border-radius: var(--hh-radius-lg);
  padding: 18px;
}

.xd-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--hh-line);
  font-size: 13px;
  color: var(--hh-text);
  letter-spacing: 0.02em;
}

.xd-summary-row:last-child { border-bottom: none; }

.xd-summary-key {
  color: var(--hh-text-dim);
  letter-spacing: 0.06em;
}

.xd-summary-val {
  color: var(--hh-ink);
  font-family: var(--hh-font-cal);
  letter-spacing: 0.06em;
}

.xd-summary-val--gold {
  color: var(--hh-gold-1);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 6px var(--hh-gold-soft);
}

.xd-notice {
  font-size: 13px;
  line-height: 1.85;
  color: var(--hh-text);
  letter-spacing: 0.02em;
  padding: 14px 16px;
  background: var(--hh-bg-2);
  border-left: 3px solid var(--hh-crimson-2);
  border-radius: 2px;
}

.xd-notice em {
  color: var(--hh-gold-1);
  font-style: normal;
}

/* ============================================================
 * 10. 演武场 yanwu.html
 * ============================================================ */
.yw-filter {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--hh-bg-1);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius);
  margin-bottom: 16px;
}

.yw-filter-label {
  font-family: var(--hh-font-cal);
  letter-spacing: 0.08em;
  color: var(--hh-text-dim);
  font-size: 14px;
}

.yw-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.yw-chip {
  padding: 4px 14px;
  font-size: 13px;
  letter-spacing: 0.04em;
  background: var(--hh-bg-2);
  border: 1px solid var(--hh-line-2);
  border-radius: 2px;
  color: var(--hh-text);
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.yw-chip:hover {
  border-color: var(--hh-gold-soft);
  color: var(--hh-gold-1);
}

.yw-chip.is-active {
  color: var(--hh-gold-1);
  border-color: var(--hh-gold-soft);
  background: var(--hh-crimson-soft);
}

.yw-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.yw-item {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.6fr 0.6fr 100px;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  background: var(--hh-bg-1);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.yw-item:hover {
  border-color: var(--hh-gold-soft);
  background: linear-gradient(90deg, var(--hh-crimson-soft), transparent);
}

.yw-item-name {
  font-family: var(--hh-font-cal);
  font-size: 16px;
  letter-spacing: 0.1em;
  color: var(--hh-ink);
}

.yw-item-id {
  margin-top: 4px;
  font-size: 12px;
  font-family: var(--hh-font-mono);
  color: var(--hh-text-dim);
  letter-spacing: 0;
}

.yw-item-meta {
  font-size: 13px;
  color: var(--hh-text);
  letter-spacing: 0.02em;
}

.yw-item-meta-em {
  display: block;
  color: var(--hh-text-dim);
  font-size: 11px;
  letter-spacing: 0.12em;
  margin-bottom: 2px;
  font-family: var(--hh-font-cal);
}

.yw-item-action {
  text-align: right;
}

.yw-pager {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.yw-pager-item {
  min-width: 32px;
  height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hh-bg-2);
  border: 1px solid var(--hh-line-2);
  color: var(--hh-text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  border-radius: 2px;
  text-decoration: none;
}

.yw-pager-item.is-active {
  background: linear-gradient(180deg, var(--hh-crimson-1), var(--hh-crimson-2));
  color: #fdeec0;
  border-color: var(--hh-gold-soft);
}

.yw-pager-item:hover {
  border-color: var(--hh-gold-soft);
  color: var(--hh-gold-1);
}

/* ============================================================
 * 11. 演武详情 yanwu-detail.html
 * ============================================================ */
.yd-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--hh-line);
  background: var(--hh-bg-1);
  border-radius: var(--hh-radius-lg);
  overflow: hidden;
  margin-bottom: 18px;
}

.yd-summary-cell {
  padding: 18px 20px;
  border-right: 1px solid var(--hh-line);
}

.yd-summary-cell:last-child { border-right: none; }

.yd-summary-key {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--hh-text-dim);
  margin-bottom: 6px;
  font-family: var(--hh-font-cal);
}

.yd-summary-val {
  font-family: var(--hh-font-cal);
  font-size: 19px;
  letter-spacing: 0.08em;
  color: var(--hh-ink);
}

.yd-section {
  background: var(--hh-bg-1);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius-lg);
  padding: 18px;
  margin-bottom: 18px;
}

.yd-section-title {
  font-family: var(--hh-font-cal);
  font-size: 17px;
  letter-spacing: 0.12em;
  color: var(--hh-ink);
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px dashed var(--hh-line-2);
  display: flex;
  align-items: center;
  gap: 10px;
}

.yd-section-title::before {
  content: "";
  width: 6px;
  height: 16px;
  background: linear-gradient(180deg, var(--hh-crimson-1), var(--hh-crimson-2));
  display: inline-block;
}

.yd-asset {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  /* 整块素材（原料 / 成果）控制在一屏内浏览，多格时仅区域内滚动 */
  max-height: min(88vh, 920px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.yd-asset-cell {
  position: relative;
  box-sizing: border-box;
  background: linear-gradient(160deg, #261713 0%, #160d0a 100%);
  border: 1px solid var(--hh-line-2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hh-gold);
  font-family: var(--hh-font-cal);
  letter-spacing: 0.18em;
  font-size: 22px;
  opacity: 0.92;
  overflow: hidden;
}

/* 图 / 视频 / 占位：正方形预览，宽高上下限 + 不超过约半屏高，避免撑爆页面 */
.yd-asset-cell:not(.yd-asset-cell--prompt) {
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: min(100%, 520px);
  max-height: min(48vh, 520px);
  min-height: 112px;
  margin-inline: auto;
  justify-self: center;
}

.yd-asset-cell::after {
  content: attr(data-label);
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--hh-text-dim);
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 8px;
  border-radius: 2px;
}

.yd-asset--1 {
  grid-template-columns: 1fr;
}

.yd-asset--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 防止 grid 子项因 min-content 被长图/长词撑开；与 minmax(0,1fr) 配合 */
.yd-asset > .yd-asset-cell {
  min-width: 0;
}

.yd-asset-cell--figure {
  padding: 8px;
}

.yd-asset-img,
.yd-asset-video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.yd-asset-video {
  background: #0a0807;
}

.yd-asset-cell--prompt {
  align-items: stretch;
  aspect-ratio: auto;
  width: 100%;
  max-width: min(100%, 720px);
  max-height: min(38vh, 360px);
  min-height: 96px;
  min-width: 0;
  margin-inline: 0;
  justify-self: stretch;
}

.yd-prompt-body {
  box-sizing: border-box;
  flex: 1;
  min-height: 0;
  min-width: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-wrap: break-word;
  -webkit-overflow-scrolling: touch;
  font-family: var(--hh-font-serif);
  font-size: 14px;
  letter-spacing: 0.02em;
  line-height: 1.85;
  color: var(--hh-ink);
  padding: 14px;
  text-align: left;
  width: 100%;
}

.yd-error {
  background: linear-gradient(180deg, rgba(179, 67, 61, 0.18), transparent), var(--hh-bg-1);
  border: 1px solid rgba(179, 67, 61, 0.45);
  padding: 14px 16px;
  border-radius: var(--hh-radius);
  color: #f5c8c4;
  letter-spacing: 0.02em;
  font-size: 14px;
  line-height: 1.8;
}

/* ============================================================
 * 12. 分享/邀请 share.html
 * ============================================================ */
.sh-hero {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  padding: 28px;
  background:
    radial-gradient(400px 200px at 100% 0%, var(--hh-crimson-soft), transparent),
    linear-gradient(180deg, var(--hh-bg-1), var(--hh-bg-0));
  border: 1px solid var(--hh-line-2);
  border-radius: var(--hh-radius-lg);
  position: relative;
  overflow: hidden;
}

.sh-hero::before {
  content: "合";
  position: absolute;
  font-family: var(--hh-font-cal);
  font-size: 320px;
  color: var(--hh-crimson-2);
  opacity: 0.08;
  right: -20px;
  bottom: -90px;
  line-height: 1;
  letter-spacing: 0;
  pointer-events: none;
}

.sh-hero-title {
  font-family: var(--hh-font-cal);
  font-size: 36px;
  letter-spacing: 0.18em;
  color: var(--hh-gold-1);
  margin-bottom: 8px;
}

.sh-hero-sub {
  color: var(--hh-text);
  letter-spacing: 0.02em;
  font-size: 15px;
  line-height: 1.85;
  margin-bottom: 22px;
}

.sh-link-box {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--hh-bg-2);
  border: 1px dashed var(--hh-gold-soft);
  border-radius: 2px;
  margin-bottom: 12px;
  overflow: hidden;
}

.sh-link-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--hh-gold-1);
  font-family: var(--hh-font-mono);
  padding: 12px 14px;
  font-size: 14px;
  letter-spacing: 0;
}

.sh-link-box button {
  padding: 12px 22px;
  background: linear-gradient(180deg, var(--hh-crimson-1), var(--hh-crimson-2));
  border: none;
  border-left: 1px dashed var(--hh-gold-soft);
  color: #fff5d2;
  font-family: var(--hh-font-cal);
  letter-spacing: 0.12em;
  font-size: 15px;
  cursor: pointer;
}

/* 宣传海报区 */
.sh-poster-wrap {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
      -ms-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  gap: 12px;
  -webkit-align-self: start;
          align-self: start;
  justify-self: center;
}

.sh-poster-wrap canvas {
  display: block;
  width: 240px;       /* 展示尺寸：实际像素 480×720 */
  border-radius: 6px;
  -webkit-box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(212,182,118,0.2);
          box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(212,182,118,0.2);
}

.sh-download-btn {
  width: 240px;
  -ms-flex-negative: 0;
      flex-shrink: 0;
  font-family: var(--hh-font-cal);
  letter-spacing: 0.12em;
}

.sh-poster-tip {
  font-size: 11px;
  color: var(--hh-text-mute);
  letter-spacing: 0.04em;
  text-align: center;
  margin: 0;
}

/* iOS 长按保存弹层 */
.sh-save-inner {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
          flex-direction: column;
  -webkit-box-align: center;
  -webkit-align-items: center;
          align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 360px;
}

.sh-save-inner img {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  border-radius: 6px;
  -webkit-box-shadow: 0 8px 32px rgba(0,0,0,0.8);
          box-shadow: 0 8px 32px rgba(0,0,0,0.8);
  /* 防止 iOS 长按时出现文字选择浮层 */
  -webkit-user-select: none;
  -webkit-touch-callout: default; /* 允许系统长按菜单（保存图片）*/
}

.sh-save-tip {
  font-size: 14px;
  color: rgba(212, 182, 118, 0.85);
  letter-spacing: 0.06em;
  text-align: center;
  margin: 0;
  font-family: var(--hh-font-cal);
}

/* 与 share.js / yd-detail.js 共用：iOS 长按保存弹层 */
.hh-save-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  box-sizing: border-box;
}
.hh-save-modal-overlay.is-open {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
}

.sh-poster-wrap--empty {
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
}

.sh-poster-placeholder {
  width: 240px;
  height: 160px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  border: 1px dashed var(--hh-gold-soft);
  border-radius: 6px;
  color: var(--hh-text-mute);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 20px;
}

.sh-rules {
  margin-top: 22px;
  padding: 18px 20px;
  background: var(--hh-bg-1);
  border: 1px solid var(--hh-line);
  border-radius: var(--hh-radius-lg);
}

.sh-rule-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--hh-line-2);
  align-items: flex-start;
}

.sh-rule-row:last-child { border-bottom: none; }

.sh-rule-num {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--hh-crimson-1), var(--hh-crimson-2));
  color: var(--hh-gold-1);
  font-family: var(--hh-font-cal);
  font-size: 14px;
  border-radius: 2px;
  letter-spacing: 0;
}

.sh-rule-text {
  color: var(--hh-text);
  letter-spacing: 0.02em;
  line-height: 1.85;
  font-size: 14px;
}

.sh-rule-text em {
  color: var(--hh-gold-1);
  font-style: normal;
  font-family: var(--hh-font-cal);
  letter-spacing: 0.06em;
  margin: 0 2px;
}

.sh-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.sh-table th,
.sh-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px dashed var(--hh-line);
  font-size: 14px;
  color: var(--hh-text);
  letter-spacing: 0.02em;
}

.sh-table th {
  font-family: var(--hh-font-cal);
  letter-spacing: 0.08em;
  color: var(--hh-text-dim);
  font-weight: normal;
  font-size: 13px;
  background: var(--hh-bg-2);
}

.sh-table tr:hover td {
  background: rgba(168, 42, 48, 0.08);
}

/* ============================================================
 * 13. 底部 TabBar（移动端主导航，>=1024 桌面端隐藏）
 * ============================================================ */
.hh-tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  flex-direction: row;
  align-items: stretch;
  height: calc(var(--hh-tabbar-h) + var(--hh-safe-bottom));
  padding-bottom: var(--hh-safe-bottom);
  background: linear-gradient(180deg, #110b09 0%, #0c0807 100%);
  border-top: 1px solid var(--hh-line);
  -webkit-box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.55);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.55);
}

.hh-tabbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hh-gold-soft), transparent);
  pointer-events: none;
}

.hh-tab {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px 4px;
  color: var(--hh-text-dim);
  text-decoration: none;
  font-family: var(--hh-font-cal);
  font-size: 11px;
  letter-spacing: 0.04em;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  -webkit-transition: color 0.18s ease, -webkit-transform 0.12s ease;
  transition: color 0.18s ease, transform 0.12s ease;
}

.hh-tab.is-active {
  color: var(--hh-gold-1);
}

.hh-tab.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 28px;
  height: 2px;
  margin-left: -14px;
  background: linear-gradient(90deg, var(--hh-crimson-1), var(--hh-gold));
  border-radius: 0 0 2px 2px;
}

.hh-tab:active {
  -webkit-transform: scale(0.94);
  transform: scale(0.94);
}

.hh-tab-ico {
  width: 26px;
  height: 26px;
  display: -webkit-inline-box;
  display: inline-flex;
  -webkit-box-align: center;
  align-items: center;
  -webkit-box-pack: center;
  justify-content: center;
  margin-bottom: 2px;
}

.hh-tab-ico svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.hh-tab-text {
  letter-spacing: 0.04em;
  line-height: 1.2;
}

/* 修炼操作页：sticky 底部行动条（默认隐藏，移动端启用） */
.xd-actionbar {
  display: none;
}

/* 演武详情图块：旧浏览器降级（aspect-ratio 不支持时用 min-height） */
.yd-asset-cell {
  min-height: 110px;
}

/* ============================================================
 * 14. 平板/移动 (<= 1023px)：取消侧栏，启用底部 TabBar
 * ============================================================ */
@media (max-width: 1023px) {
  :root {
    --hh-top-h: 52px;
  }

  /* 单列布局 */
  .hh-app {
    grid-template-columns: 1fr;
    grid-template-rows: var(--hh-top-h) 1fr;
    grid-template-areas:
      "top"
      "main";
  }

  /* 隐藏侧栏 / 汉堡 / 抽屉遮罩（移动端用底部 TabBar 替代） */
  .hh-sider,
  .hh-burger,
  .hh-mask {
    display: none !important;
  }

  /* 顶栏精简 */
  .hh-topbar { padding: 0 14px; gap: 10px; }
  .hh-brand { gap: 8px; }
  .hh-seal { width: 34px; height: 34px; font-size: 14px; }
  .hh-brand-text { font-size: 16px; letter-spacing: 0.06em; }
  .hh-brand-sub { display: none; }
  .hh-disciple .hh-name { display: none; }
  .hh-topbar-right { gap: 10px; }
  .hh-stone { padding: 4px 10px; font-size: 12px; }

  /* 显示底部 TabBar */
  .hh-tabbar { display: -webkit-box; display: -ms-flexbox; display: flex; }

  /* 主区域留出 TabBar 空间 + 安全区 */
  .hh-main {
    padding: 16px 14px calc(var(--hh-tabbar-h) + var(--hh-safe-bottom) + 24px);
    min-width: 0;
  }

  /* 修炼操作页：再额外加底部行动条空间 */
  .hh-app.is-xd .hh-main {
    padding-bottom: calc(var(--hh-tabbar-h) + var(--hh-safe-bottom) + 88px);
  }

  /* 页面头：单列堆叠 */
  .hh-page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-bottom: 12px;
    margin-bottom: 16px;
  }
  .hh-page-title { font-size: 22px; letter-spacing: 0.1em; padding-left: 14px; }
  .hh-page-sub { font-size: 13px; letter-spacing: 0.02em; }
  .hh-crumb { font-size: 12px; }

  /* 通用按钮：触摸热区 */
  .hh-btn { min-height: 40px; padding: 9px 18px; }
  .hh-btn--sm { min-height: 36px; padding: 7px 14px; font-size: 13px; }
  .hh-btn--lg { min-height: 48px; padding: 13px 22px; font-size: 15px; letter-spacing: 0.14em; }
  .hh-row { gap: 10px; }

  /* 卡片内边距收紧 */
  .hh-card { padding: 14px; }
  .hh-card--ornate { padding: 16px 14px 14px 18px; }

  /* 网格 fallback */
  .hh-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .hh-grid--4 { grid-template-columns: repeat(2, 1fr); }

  /* ----- 个人洞府 ----- */
  .df-disciple { grid-template-columns: 72px 1fr; gap: 14px; }
  .df-portrait { width: 72px; height: 72px; }
  .df-portrait::after { font-size: 28px; }
  .df-disciple-name { font-size: 20px; letter-spacing: 0.1em; gap: 8px; -ms-flex-wrap: wrap; flex-wrap: wrap; }
  .df-stone-num { font-size: 30px; }
  .df-stone-actions { -ms-flex-wrap: wrap; flex-wrap: wrap; gap: 6px; }
  .df-checkin-row { grid-template-columns: repeat(7, 1fr); gap: 6px; }
  .df-checkin-cell { padding: 8px 0; }
  .df-realm-wrap .hh-realm-cell { height: 7px; }
  .df-gate-bars { grid-template-columns: 1fr; }

  /* ----- 修炼室：单列大卡（缩略图 + 标题/描述/价格） ----- */
  .xl-grid { grid-template-columns: 1fr; gap: 10px; }
  .xl-card {
    min-height: 0;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 56px 1fr auto;
    grid-template-rows: auto auto;
    -webkit-column-gap: 12px;
    column-gap: 12px;
    row-gap: 4px;
    -webkit-box-align: center;
    align-items: center;
  }
  .xl-card::before { display: none; }
  .xl-card::after {
    content: "";
    grid-column: 1;
    grid-row: 1 / 3;
    width: 56px;
    height: 56px;
    background: linear-gradient(160deg, #4a2a25, #1a120f);
    border: 1px solid var(--hh-gold-soft);
    border-radius: var(--hh-radius);
    -webkit-box-shadow: inset 0 0 12px rgba(168, 42, 48, 0.25);
    box-shadow: inset 0 0 12px rgba(168, 42, 48, 0.25);
  }
  .xl-card-name {
    grid-column: 2;
    grid-row: 1;
    font-size: 16px;
    letter-spacing: 0.06em;
    padding-left: 0;
  }
  .xl-card-name::before { display: none; }
  .xl-card-desc {
    grid-column: 2;
    grid-row: 2;
    font-size: 12px;
    line-height: 1.55;
    color: var(--hh-text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    line-clamp: 1;
  }
  .xl-card-foot {
    grid-column: 3;
    grid-row: 1 / 3;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: end;
    align-items: flex-end;
    -webkit-box-pack: center;
    justify-content: center;
    gap: 6px;
    padding-top: 0;
    margin-top: 0;
    border-top: none;
  }
  .xl-card-foot .hh-badge { display: none; }

  /* 修炼室 tabs：横向滚动 */
  .xl-tabs {
    -ms-flex-wrap: nowrap;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin: 0 -14px 14px;
    padding: 0 14px 12px;
    -webkit-scroll-snap-type: x mandatory;
    scroll-snap-type: x mandatory;
  }
  .xl-tabs::-webkit-scrollbar { display: none; }
  .xl-tab {
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 8px 18px;
    font-size: 14px;
  }

  /* ----- 修炼操作页：单列 + 底部 sticky 行动条 ----- */
  .xd-grid { grid-template-columns: 1fr; gap: 14px; }
  .xd-aside { position: static; }
  .xd-aside .xd-summary { padding: 14px 16px; }
  /* 隐藏摘要里嵌入的"祭出法器"区块（由 .xd-actionbar 接管） */
  .xd-summary > div[style] { display: none; }

  /* 移动端：单图/单视频一行，自适应宽度，最大 260px，居中 */
  .xd-field-wrap[data-type="image"],
  .xd-field-wrap[data-type="video"] {
    -webkit-flex: 0 0 100%;
        -ms-flex: 0 0 100%;
            flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
  }
  .xd-upload {
    width: 100%;
    max-width: 260px;
    height: auto;       /* 配合 aspect-ratio 自动等高 */
    min-height: 180px;  /* 旧浏览器（不支持 aspect-ratio）的最小高度兜底 */
    max-height: 260px;
    margin-left: auto;
    margin-right: auto;
  }
  .xd-prompt { font-size: 14px; min-height: 110px; }

  .xd-actionbar {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--hh-tabbar-h) + var(--hh-safe-bottom));
    z-index: 35;
    -webkit-box-align: center;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: linear-gradient(180deg, #1a1210, #110b09);
    border-top: 1px solid var(--hh-line);
    -webkit-box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.55);
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.55);
  }
  .xd-actionbar-cost {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    line-height: 1.3;
    color: var(--hh-text-dim);
    font-size: 11px;
    letter-spacing: 0.04em;
  }
  .xd-actionbar-cost-num {
    color: var(--hh-gold-1);
    font-family: var(--hh-font-mono);
    font-size: 17px;
    letter-spacing: 0;
  }
  .xd-actionbar .hh-btn {
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    padding: 11px 22px;
    font-size: 15px;
    letter-spacing: 0.12em;
    min-height: 44px;
  }

  /* ----- 演武场：紧凑筛选 + 2 行卡片 ----- */
  .yw-filter {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: stretch;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }
  .yw-filter > div[style*="margin-left:auto"] {
    margin-left: 0 !important;
  }
  .yw-filter-chips { gap: 6px; }
  .yw-chip { padding: 5px 12px; font-size: 12px; }

  .yw-item {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 4px 10px;
    padding: 12px;
  }
  /* 标题块（首列 div），跨满三列 */
  .yw-item > div:nth-child(1) {
    grid-column: 1 / 4;
    grid-row: 1;
    min-width: 0;
  }
  .yw-item-name {
    font-size: 15px;
    letter-spacing: 0.06em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .yw-item-id { font-size: 11px; }
  /* 三个 meta 在第 2 行自动顺序占 col 2/3/4 */
  .yw-item-meta {
    grid-row: 2;
    font-size: 12px;
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }
  .yw-item-meta-em { display: none; }
  /* "查看法相"按钮单独占第 3 行通栏 */
  .yw-item-action {
    grid-column: 1 / 4;
    grid-row: 3;
    text-align: right;
    padding-top: 8px;
    margin-top: 2px;
    border-top: 1px dashed var(--hh-line);
  }
  .yw-item-action .hh-btn { min-height: 32px; padding: 6px 14px; }
  .yw-pager-item { min-width: 36px; height: 36px; padding: 0 8px; font-size: 13px; }

  /* ----- 演武详情 ----- */
  .yd-summary { grid-template-columns: repeat(2, 1fr); }
  .yd-summary-cell { padding: 14px 16px; }
  .yd-summary-cell:nth-child(2n) { border-right: none; }
  .yd-summary-cell:nth-child(-n + 2) { border-bottom: 1px solid var(--hh-line); }
  .yd-asset--1,
  .yd-asset--2 { gap: 10px; }
  .yd-asset--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yd-section { padding: 16px; margin-bottom: 14px; }
  .yd-section-title { font-size: 16px; letter-spacing: 0.1em; }

  /* ----- 分享/邀请 ----- */
  .sh-hero { grid-template-columns: 1fr; padding: 22px 18px; gap: 18px; }
  .sh-hero::before { font-size: 220px; bottom: -60px; }
  .sh-hero-title { font-size: 26px; letter-spacing: 0.14em; }
  .sh-hero-sub { font-size: 14px; }
  .sh-poster-wrap canvas { width: 200px; }
  .sh-link-box input { font-size: 13px; padding: 11px 12px; }
  .sh-link-box button { padding: 11px 18px; font-size: 14px; }
  .sh-rules { padding: 14px 16px; }
  .sh-rule-row { grid-template-columns: 28px 1fr; gap: 10px; padding: 8px 0; }
  .sh-rule-num { width: 24px; height: 24px; font-size: 13px; }
  .sh-rule-text { font-size: 13px; line-height: 1.75; }

  /* 缘簿表格 → 卡片列表 */
  .sh-table thead { display: none; }
  .sh-table,
  .sh-table tbody,
  .sh-table tr,
  .sh-table td {
    display: block;
    width: auto;
  }
  .sh-table tr {
    margin-bottom: 10px;
    padding: 10px 12px;
    background: var(--hh-bg-2);
    border: 1px solid var(--hh-line);
    border-radius: var(--hh-radius);
  }
  .sh-table tr:hover td { background: transparent; }
  .sh-table td {
    padding: 5px 0;
    border-bottom: none;
    font-size: 13px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    align-items: center;
    gap: 10px;
    text-align: right;
  }
  .sh-table td::before {
    content: attr(data-label);
    color: var(--hh-text-dim);
    font-size: 12px;
    font-family: var(--hh-font-cal);
    letter-spacing: 0.06em;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    text-align: left;
  }
  .sh-table td:empty::before { content: attr(data-label); }
}

/* ============================================================
 * 15. 超窄屏 (<= 480px)：进一步退化为单列
 * ============================================================ */
@media (max-width: 480px) {
  .hh-grid--3 { grid-template-columns: 1fr; }
  .hh-grid--2 { grid-template-columns: 1fr; }
  .hh-grid--4 { grid-template-columns: 1fr; }

  .hh-page-title { font-size: 20px; letter-spacing: 0.08em; }

  .yd-summary { grid-template-columns: 1fr; }
  .yd-summary-cell { border-right: none; border-bottom: 1px solid var(--hh-line); }
  .yd-summary-cell:last-child { border-bottom: none; }
  .yd-asset--1,
  .yd-asset--2 { grid-template-columns: 1fr; }

  .xd-form .xl-grid {
    grid-template-columns: 1fr !important;
  }

  .yw-item {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 4px 8px;
  }
  .yw-item > div:nth-child(1) { grid-column: 1 / 3; grid-row: 1; min-width: 0; }
  .yw-item-meta { grid-row: 2; font-size: 11px; }
  .yw-item-action {
    grid-column: 1 / 3;
    grid-row: 3;
    text-align: left;
  }

  .sh-poster-wrap canvas { width: 180px; }
  .sh-link-box {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
  }
  .sh-link-box input { width: 100%; }
  .sh-link-box button {
    width: 100%;
    border-left: none;
    border-top: 1px dashed var(--hh-gold-soft);
  }

  .df-stone-num { font-size: 26px; }
  .df-disciple-name { font-size: 18px; }
  .df-disciple { grid-template-columns: 60px 1fr; }
  .df-portrait { width: 60px; height: 60px; }
  .df-portrait::after { font-size: 24px; }
  .df-realm-name { font-size: 15px; }
  .df-realm-cult { margin-left: 0; width: 100%; }

  .xl-card { grid-template-columns: 48px 1fr auto; }
  .xl-card::after { width: 48px; height: 48px; }
  .xl-card-name { font-size: 15px; }
}

/* ============================================================
 * 16. 桌面 (>= 1024px)：保留侧栏布局，隐藏 TabBar
 * ============================================================ */
@media (min-width: 1024px) {
  .hh-tabbar { display: none !important; }
  .xd-actionbar { display: none !important; }
}

/* ============================================================
 * 17. 桌面 (1024-1199px)：使用收窄的侧栏
 * ============================================================ */
@media (min-width: 1024px) and (max-width: 1199px) {
  :root {
    --hh-sider-w: var(--hh-sider-w-md);
  }
  .xl-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
 * 18. 屏幕过宽时主区域不要拉伸过远
 * ============================================================ */
@media (min-width: 1500px) {
  .hh-main {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
  }
}

/* ============================================================
 * 19. aspect-ratio 降级
 *     现代浏览器优先使用 aspect-ratio；不支持时由 min-height 兜底
 * ============================================================ */
@supports (aspect-ratio: 1 / 1) {
  .yd-asset-cell { min-height: 0; }
}

/* ============================================================
 * 20. 老 IE / 不支持的浏览器：底部 TabBar 只读且不破坏布局
 * ============================================================ */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  /* IE 11：直接退化为顶部下拉，避免 fixed bottom 抖动 */
  .hh-tabbar { position: static; height: auto; }
}

/* ============================================================
 * 21. flex gap 兼容兜底（运行时探测 -> .no-flex-gap）
 *     旧版 Android Chromium (<84) / iOS Safari 14.0 不支持 flex gap
 *     用 margin 在子元素间模拟，行内方向用 margin-left，列方向用 margin-top
 * ============================================================ */
.no-flex-gap .hh-topbar > * + * { margin-left: 14px; }
.no-flex-gap .hh-topbar-right > * + * { margin-left: 18px; }
.no-flex-gap .hh-row > * + * { margin-left: 16px; margin-top: 0; }
.no-flex-gap .hh-card-title > * + * { margin-left: 10px; }
.no-flex-gap .hh-card-foot > * + * { margin-left: 10px; }
.no-flex-gap .hh-page-head > * + * { margin-left: 16px; }

.no-flex-gap .xl-tabs > * + * { margin-left: 8px; }
.no-flex-gap .xl-card-foot > * + * { margin-left: 8px; }

.no-flex-gap .yw-filter > * + * { margin-left: 16px; }
.no-flex-gap .yw-filter-chips > * + * { margin-left: 6px; }
.no-flex-gap .yw-pager > * + * { margin-left: 6px; }
.no-flex-gap .yw-list > * + * { margin-top: 10px; }

.no-flex-gap .xd-actionbar > * + * { margin-left: 12px; }
.no-flex-gap .xd-form > * + * { margin-top: 18px; }
/* PC 两张图并排：第二张 margin-left，不加 margin-top */
.no-flex-gap .xd-field-wrap[data-type="image"] + .xd-field-wrap[data-type="image"] { margin-left: 18px; margin-top: 0; }
/* 图片后的文本/选择字段保留 margin-top */
.no-flex-gap .xd-field-wrap[data-type="prompt"],
.no-flex-gap .xd-field-wrap[data-type="select"] { margin-top: 18px; }
.no-flex-gap .xd-aside > * + * { margin-top: 14px; }

.no-flex-gap .df-stone-actions > * + * { margin-left: 8px; }

.no-flex-gap .sh-link-box > * + * { margin-left: 0; }

/* 移动端（<= 1023px）：行方向 gap 收紧 */
@media (max-width: 1023px) {
  .no-flex-gap .hh-row > * + * { margin-left: 10px; }
  .no-flex-gap .yw-filter > * + * { margin-left: 0; margin-top: 10px; }
  .no-flex-gap .hh-page-head > * + * { margin-left: 0; margin-top: 8px; }
  .no-flex-gap .hh-topbar > * + * { margin-left: 10px; }
  .no-flex-gap .hh-topbar-right > * + * { margin-left: 10px; }
}

/* 移动端缘簿 td → key-value 行 */
@media (max-width: 1023px) {
  .no-flex-gap .sh-table td::before { margin-right: 10px; }
}

/* 超窄屏 share 链接框列布局时，按钮换行不需要 left margin */
@media (max-width: 480px) {
  .no-flex-gap .sh-link-box > * + * { margin-top: 0; margin-left: 0; }
}

/* ================== 22. 登录 / 注册 表单（紧凑） ================== */
.hh-auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 24px 16px;
}
.hh-auth-card {
  width: 100%;
  max-width: 380px;
  padding: 26px 22px;
}
.hh-auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.hh-auth-brand .hh-seal {
  margin-right: 10px;
}
.hh-auth-brand-text {
  font-family: var(--hh-font-cal);
  font-size: 22px;
  letter-spacing: 0.16em;
  color: var(--hh-ink);
}
.hh-auth-brand-sub {
  margin-left: 8px;
  font-size: 12px;
  color: var(--hh-text-dim);
  letter-spacing: 0.08em;
}
.hh-auth-title {
  font-family: var(--hh-font-cal);
  font-size: 22px;
  letter-spacing: 0.18em;
  color: var(--hh-ink);
  text-align: center;
  margin: 0 0 18px;
}
.hh-auth-err {
  margin-bottom: 14px;
  font-size: 13px;
}
.hh-auth-form {
  display: block;
}
.hh-auth-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--hh-text-dim);
  margin: 14px 0 6px;
}
.hh-auth-label:first-child {
  margin-top: 0;
}
.hh-auth-input {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  letter-spacing: 0.04em;
  line-height: 40px;
  color: var(--hh-ink);
  background: var(--hh-bg-2);
  border: 1px solid var(--hh-line-2);
  border-radius: 6px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  box-sizing: border-box;
  font-family: var(--hh-font-sys);
}
.hh-auth-input:focus {
  border-color: var(--hh-gold-soft);
  box-shadow: 0 0 0 1px var(--hh-gold-soft);
}
.hh-auth-input::placeholder {
  color: var(--hh-text-mute);
  letter-spacing: 0.02em;
}
.hh-auth-submit {
  margin-top: 22px;
  height: 42px;
  letter-spacing: 0.18em;
}
.hh-auth-foot {
  margin-top: 14px;
  text-align: center;
  color: var(--hh-text-dim);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.hh-auth-foot a {
  color: var(--hh-gold-1);
  text-decoration: none;
}
.hh-auth-foot a:hover {
  text-decoration: underline;
}
@media (max-width: 480px) {
  .hh-auth-brand-sub {
    display: none;
  }
}

/* ================================================================
   修炼操作页 · select chip 组
   ================================================================ */
.xd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.xd-chip {
  padding: 6px 18px;
  background: var(--hh-bg-2);
  border: 1px solid var(--hh-line-2);
  border-radius: 999px;
  color: var(--hh-text-dim);
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.xd-chip:hover {
  border-color: var(--hh-gold-soft);
  color: var(--hh-text);
}
.xd-chip.is-active {
  border-color: var(--hh-gold);
  background: var(--hh-gold-soft);
  color: var(--hh-gold-1);
}
.xd-required {
  color: var(--hh-err);
  margin-left: 2px;
  font-style: normal;
}
/* ================================================================
   灵石充值页
   ================================================================ */
.hh-page--pay { max-width: 640px; margin: 0 auto; }
.hh-page-hd   { text-align: center; padding: 32px 0 20px; }
.hh-page-title {
  font-family: var(--hh-font-cal);
  font-size: 26px;
  color: var(--hh-gold-1);
  letter-spacing: 0.16em;
  margin: 0 0 6px;
}
.hh-page-sub {
  font-size: 13px;
  color: var(--hh-text-dim);
  letter-spacing: 0.04em;
}

.pay-wrap { padding: 0 16px 80px; }

.pay-section { margin-bottom: 28px; }
.pay-section-title {
  font-family: var(--hh-font-cal);
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--hh-text-dim);
  margin: 0 0 12px;
}

/* 套餐网格 */
.pay-pkgs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.pay-pkg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 10px 14px;
  background: var(--hh-bg-2);
  border: 1px solid var(--hh-line-2);
  border-radius: var(--hh-radius-lg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  text-align: center;
}
.pay-pkg:hover {
  border-color: var(--hh-gold-soft);
  background: var(--hh-bg-3);
}
.pay-pkg.is-active {
  border-color: var(--hh-gold);
  background: linear-gradient(180deg, var(--hh-bg-3), var(--hh-bg-2));
  box-shadow: var(--hh-shadow-glow);
}
.pay-pkg-stones {
  font-family: var(--hh-font-cal);
  font-size: 22px;
  color: var(--hh-gold-1);
  letter-spacing: 0.04em;
}
.pay-pkg-stones em {
  font-style: normal;
  font-size: 12px;
  color: var(--hh-text-dim);
  margin-left: 2px;
}
.pay-pkg-price {
  font-size: 18px;
  font-weight: 600;
  color: var(--hh-ink);
  font-variant-numeric: tabular-nums;
}
.pay-pkg-desc {
  font-size: 11px;
  color: var(--hh-text-mute);
  letter-spacing: 0.02em;
}

/* 支付渠道 */
.pay-channels { display: flex; flex-wrap: wrap; gap: 10px; }
.pay-channel {
  padding: 8px 22px;
  background: var(--hh-bg-2);
  border: 1px solid var(--hh-line-2);
  border-radius: var(--hh-radius);
  color: var(--hh-text-dim);
  font-size: 14px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.pay-channel:hover { border-color: var(--hh-gold-soft); color: var(--hh-text); }
.pay-channel.is-active {
  border-color: var(--hh-gold);
  background: var(--hh-gold-soft);
  color: var(--hh-gold-1);
}

/* 提交区 */
.pay-submit-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 0 0;
}
.pay-total {
  font-size: 15px;
  color: var(--hh-text-dim);
  letter-spacing: 0.04em;
}
.pay-total strong { color: var(--hh-gold-1); font-variant-numeric: tabular-nums; }
.pay-submit {
  width: 100%;
  max-width: 320px;
  height: 46px;
  letter-spacing: 0.16em;
  font-size: 16px;
}
.pay-tip {
  font-size: 12px;
  color: var(--hh-text-mute);
  letter-spacing: 0.02em;
}

/* 结果提示 */
.pay-result {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--hh-radius);
  font-size: 14px;
  text-align: center;
  letter-spacing: 0.04em;
}
.pay-result--ok  { background: rgba(90, 143, 106, 0.15); color: var(--hh-ok);  border: 1px solid rgba(90, 143, 106, 0.3); }
.pay-result--err { background: rgba(179, 67,  61, 0.12); color: var(--hh-err); border: 1px solid rgba(179, 67, 61, 0.25); }

/* ================================================================
 * 修为境界 · 顶栏进度条
 * ================================================================ */
.hh-realm-bar {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  gap: 2px;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
}
.hh-realm-cell {
  display: inline-block;
  width: 5px;
  height: 9px;
  border-radius: 1px;
  background: rgba(212, 182, 118, 0.12);
  border: 1px solid rgba(212, 182, 118, 0.2);
  -webkit-transition: background 0.4s, box-shadow 0.4s;
          transition: background 0.4s, box-shadow 0.4s;
}
.hh-realm-cell.is-filled {
  background: var(--hh-gold);
  border-color: var(--hh-gold-1);
  -webkit-box-shadow: 0 0 5px rgba(212, 182, 118, 0.6);
          box-shadow: 0 0 5px rgba(212, 182, 118, 0.6);
}

/* ================================================================
 * 境界晋升 Toast（华丽全屏覆盖）
 * ================================================================ */
.hh-realm-toast {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  opacity: 0;
  pointer-events: none;
  -webkit-transition: opacity 0.5s ease;
          transition: opacity 0.5s ease;
}
.hh-realm-toast.is-show {
  opacity: 1;
  pointer-events: all;
}
/* 背景：从中心金色向外渐变为深黑 */
.hh-realm-toast__bd {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 48%,
    rgba(30, 18, 4, 0.92) 0%,
    rgba(10, 6, 2, 0.97) 65%,
    rgba(0, 0, 0, 0.98) 100%
  );
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
}
/* 中心内容容器 */
.hh-realm-toast__box {
  position: relative;
  text-align: center;
  padding: 48px 60px;
}
/* 光晕 */
.hh-realm-toast__aura {
  position: absolute;
  inset: -80px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(212, 182, 118, 0.28) 0%,
    rgba(168, 100, 20,  0.12) 45%,
    transparent 75%
  );
  -webkit-animation: rtAuraPulse 2s ease-in-out infinite alternate;
          animation: rtAuraPulse 2s ease-in-out infinite alternate;
}
@-webkit-keyframes rtAuraPulse {
  from { -webkit-transform: scale(0.85); transform: scale(0.85); opacity: 0.5; }
  to   { -webkit-transform: scale(1.15); transform: scale(1.15); opacity: 1;   }
}
@keyframes rtAuraPulse {
  from { transform: scale(0.85); opacity: 0.5; }
  to   { transform: scale(1.15); opacity: 1;   }
}
/* 粒子容器 */
.hh-realm-toast__sparks {
  position: absolute;
  inset: -120px;
  pointer-events: none;
}
.hh-rt-spark {
  position: absolute;
  left: 50%; top: 50%;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--hh-gold-1);
  margin-left: -2.5px; margin-top: -2.5px;
  -webkit-animation: rtSparkFly var(--dur, 1.5s) ease-out var(--dl, 0s) infinite;
          animation: rtSparkFly var(--dur, 1.5s) ease-out var(--dl, 0s) infinite;
}
@-webkit-keyframes rtSparkFly {
  0%   { -webkit-transform: rotate(var(--a,0deg)) translateX(0) scale(1); transform: rotate(var(--a,0deg)) translateX(0) scale(1); opacity: 1; }
  100% { -webkit-transform: rotate(var(--a,0deg)) translateX(var(--d,80px)) scale(0); transform: rotate(var(--a,0deg)) translateX(var(--d,80px)) scale(0); opacity: 0; }
}
@keyframes rtSparkFly {
  0%   { transform: rotate(var(--a,0deg)) translateX(0) scale(1); opacity: 1; }
  100% { transform: rotate(var(--a,0deg)) translateX(var(--d,80px)) scale(0); opacity: 0; }
}
/* 旋转符文 */
.hh-realm-toast__ico {
  font-size: 40px;
  line-height: 1;
  color: var(--hh-gold);
  -webkit-animation: rtIcoSpin 6s linear infinite;
          animation: rtIcoSpin 6s linear infinite;
  margin-bottom: 10px;
  -webkit-filter: drop-shadow(0 0 12px rgba(212, 182, 118, 0.9));
          filter: drop-shadow(0 0 12px rgba(212, 182, 118, 0.9));
}
@-webkit-keyframes rtIcoSpin {
  from { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
  to   { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}
@keyframes rtIcoSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
/* "修为圆满 · 突破晋升" 小字 */
.hh-realm-toast__sub {
  font-size: 13px;
  color: rgba(232, 204, 140, 0.65);
  letter-spacing: 0.32em;
  margin: 0 0 10px;
  -webkit-animation: rtFadeUp 0.5s ease 0.15s both;
          animation: rtFadeUp 0.5s ease 0.15s both;
}
/* 境界大字 */
.hh-realm-toast__name {
  font-size: 60px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1;
  background: -webkit-linear-gradient(45deg, #c8960c 0%, #f5d87a 35%, #fff0b8 55%, #e8b840 80%, #c8960c 100%);
  background:         linear-gradient(45deg, #c8960c 0%, #f5d87a 35%, #fff0b8 55%, #e8b840 80%, #c8960c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  -webkit-filter: drop-shadow(0 0 24px rgba(245, 200, 66, 0.7));
          filter: drop-shadow(0 0 24px rgba(245, 200, 66, 0.7));
  -webkit-animation: rtNameReveal 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s both;
          animation: rtNameReveal 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s both;
  margin: 0 0 14px;
}
@-webkit-keyframes rtNameReveal {
  from { -webkit-transform: scale(0.2) translateY(30px); transform: scale(0.2) translateY(30px); opacity: 0; }
  to   { -webkit-transform: scale(1)   translateY(0);    transform: scale(1)   translateY(0);    opacity: 1; }
}
@keyframes rtNameReveal {
  from { transform: scale(0.2) translateY(30px); opacity: 0; }
  to   { transform: scale(1)   translateY(0);    opacity: 1; }
}
/* 层/期小字 */
.hh-realm-toast__lv {
  font-size: 18px;
  color: rgba(245, 220, 130, 0.85);
  letter-spacing: 0.24em;
  margin: 0 0 18px;
  -webkit-animation: rtFadeUp 0.45s ease 0.55s both;
          animation: rtFadeUp 0.45s ease 0.55s both;
}
/* "轻触关闭" */
.hh-realm-toast__hint {
  font-size: 11px;
  color: rgba(212, 182, 118, 0.3);
  letter-spacing: 0.2em;
  margin: 0;
  -webkit-animation: rtFadeUp 0.4s ease 0.9s both;
          animation: rtFadeUp 0.4s ease 0.9s both;
}
@-webkit-keyframes rtFadeUp {
  from { opacity: 0; -webkit-transform: translateY(10px); transform: translateY(10px); }
  to   { opacity: 1; -webkit-transform: translateY(0);    transform: translateY(0);    }
}
@keyframes rtFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

