/* ============================================
   功夫谱 · 设计系统 (Design System)
   暗红 + 金色 · 中华武术传承平台
   ============================================ */

/* ===== CSS 变量 (Variables) ===== */
:root {
  /* 主色 — 暗红 */
  --c-red: #8B1F1F;
  --c-red-dark: #661818;
  --c-red-light: #B84A4A;

  /* 金色 */
  --c-gold: #C9A063;
  --c-gold-light: #E3C58F;
  --c-gold-dark: #b49147;

  /* 墨色文字 */
  --c-ink: #1A1A1A;
  --c-ink-light: #3D3D3D;
  --c-muted: #8C8C8C;

  /* 纸色背景 */
  --c-paper: #F7F3EA;
  --c-paper-2: #FFFDF8;
  --c-border: #E8E1D4;

  /* 状态色 */
  --c-success: #2E7D32;
  --c-warning: #E67E22;
  --c-danger: #a12b2b;

  /* 别名 — 兼容旧视图 (Legacy aliases) */
  --primary-red: var(--c-red);
  --dark-red: var(--c-red-dark);
  --light-red: var(--c-red-light);
  --accent-gold: var(--c-gold);
  --light-gold: var(--c-gold-light);
  --dark-gold: var(--c-gold-dark);
  --bg-cream: #fdf3e7;
  --bg-light: var(--c-paper);
  --bg-white: var(--c-paper-2);
  --bg-gray: var(--c-paper);
  --text-dark: var(--c-ink);
  --text-muted: var(--c-muted);
  --text-light: var(--c-muted);
  --text-white: #ffffff;
  --border-light: var(--c-border);
  --border-muted: var(--c-border);
  --success: var(--c-success);
  --warning: var(--c-warning);
  --danger: var(--c-danger);

  /* 间距 */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 999px;
  --radius: 12px;

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(26, 26, 26, 0.06);
  --shadow-md: 0 8px 24px rgba(26, 26, 26, 0.10);
  --shadow-lg: 0 18px 48px rgba(26, 26, 26, 0.14);

  /* 尺寸 */
  --header-h: 72px;
  --menu-w: 320px;

  /* 过渡 */
  --transition: all 0.2s ease;
}

/* ===== 全局样式 (Global) ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  background: var(--c-paper);
  color: var(--c-ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 标题不设固定颜色 — 继承父级，深色区块内自动变白 */
h1, h2, h3, h4, h5, h6 {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.6em;
}

h1 { font-size: 1.9rem; letter-spacing: 1px; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.95rem; }
h6 { font-size: 0.85rem; }

p { margin: 0 0 var(--spacing-md); }
p:last-child { margin-bottom: 0; }

a { color: var(--c-red); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--c-red-dark); }

img { max-width: 100%; height: auto; }
button { font-family: inherit; }

/* ===== 容器 (Container) ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-fluid { width: 100%; padding: 0 20px; }

/* ===== 主内容区 (Main) ===== */
main,
.main-content {
  min-height: 60vh;
}

/* 未改造的旧页面：首个 .container 需要顶部留白，整幅区块则不需要 */
main > .container:first-child { padding-top: var(--spacing-xl); }

/* ===== 区块 (Sections) ===== */
.section { padding: 56px 0; }
.section-alt { background: var(--c-paper-2); }

.section-header {
  text-align: center;
  margin-bottom: 40px;
}
.section-header h2 { font-size: 1.9rem; margin-bottom: 10px; }
.section-header p {
  color: var(--c-muted);
  max-width: 620px;
  margin: 0 auto;
}

/* ===== 英雄横幅 (Hero) ===== */
/* 首页横幅：与内页 .page-header 用同一支暖红渐变（参考站首页的
   .page-banner 本来就是内页那一个类，只是把内边距加大）。
   原先首页单独用一支更暗的褐色渐变，与内页横幅明显不是一套。 */
.hero {
  position: relative;
  background: linear-gradient(135deg, #6b1410 0%, #8b1a1a 60%, #a0522d 100%);
  color: #fff;
  padding: 96px 0 80px;
  overflow: hidden;
}

/* 与内页一致的「承」「武」水印 */
.hero::after {
  content: "武";
  position: absolute;
  right: 4%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 280px;
  line-height: 1;
  opacity: 0.055;
  font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif;
  pointer-events: none;
  z-index: 1;
}
@media (max-width: 768px) {
  .hero { padding: 64px 0 54px; }
  .hero::after { font-size: 150px; right: -4%; }
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: .4;
  pointer-events: none;
}

.hero .container { position: relative; z-index: 2; }

/* 横幅内所有文字均为浅色 */
.hero h1,
.hero h2,
.hero h3 { color: #fff; }

.hero-eyebrow {
  color: var(--c-gold);
  font-size: 0.85rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  margin-bottom: 18px;
  line-height: 1.15;
}

.hero-desc {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 620px;
  margin-bottom: 32px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ===== 数据统计栏 (Stats) ===== */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 48px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  backdrop-filter: blur(4px);
}

.stat-number {
  font-family: "Noto Serif SC", serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--c-gold);
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 8px;
}

/* ===== 头部 (Header) ===== */
/* ── 顶栏 ──
   参照 new_system_v2：深褐渐变底 + 金色文字，八大模块直接平铺在导航上。
   原来是浅色半透明毛玻璃，与参考站差别很大，也压不住下面的红色横幅。 */
.site-header {
  position: sticky;
  top: 0;
  min-height: var(--header-h);
  background: linear-gradient(180deg, #2c1810, #3d2015);
  color: #e8d8c8;
  border-bottom: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  display: flex;
  align-items: center;
}

/* 顶栏里的八大模块导航 */
.site-header .nav-links {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
  justify-content: center;
  min-width: 0;
}
.site-header .nav-links a {
  color: #e8d8c8;
  padding: 7px 11px;
  border-radius: 4px;
  font-size: 0.875rem;
  white-space: nowrap;
  text-decoration: none;
  transition: var(--transition);
}
.site-header .nav-links a:hover,
.site-header .nav-links a.active {
  color: #f0c040;
  background: rgba(240, 192, 64, 0.12);
}

/* 顶栏转成深色后，里面的控件也要跟着换色 */
.site-header .brand-text h1,
.site-header .brand-text span { color: #f0c040; }
.site-header .brand-text span { color: #c8b8a8; }
.site-header .header-cart { color: #e8d8c8; }
.site-header .header-cart:hover { background: rgba(240, 192, 64, 0.14); color: #f0c040; }
.site-header .user-menu-name { color: #e8d8c8; }
.site-header .user-menu-caret { color: #c8b8a8; }
.site-header .hamburger span { background: #e8d8c8; }

/* 窄屏：模块导航收起，交给汉堡抽屉 */
@media (max-width: 1100px) {
  .site-header .nav-links { display: none; }
}

/* 顶栏里原先那条深色搜索框的样式已删除：搜索框改为弹层，顶栏只剩一个图标。 */

/* 登录/注册按钮：参考站用金色实心「会员登录」+ 一个淡色注册链接 */
.site-header .header-auth-btn.btn-outline {
  border-color: rgba(240, 192, 64, 0.5);
  color: #e8d8c8;
  background: transparent;
}
.site-header .header-auth-btn.btn-outline:hover {
  border-color: #f0c040;
  color: #f0c040;
  background: rgba(240, 192, 64, 0.12);
}
.site-header .header-auth-btn.btn-primary {
  background: var(--c-gold, #b8860b);
  border-color: transparent;
  color: #fff;
  border-radius: 10px;
}
.site-header .header-auth-btn.btn-primary:hover { background: #d4a017; color: #fff; }

/* 用户下拉仍是浅色卡片，深色顶栏下需要更强的分隔 */
.site-header .user-dropdown { box-shadow: 0 8px 26px rgba(0, 0, 0, 0.32); }

.header-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--c-ink);
  flex-shrink: 0;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--c-border);
}

.brand-text h1 {
  font-size: 1.25rem;
  margin: 0;
  letter-spacing: 1px;
  color: var(--c-ink);
}

.brand-text span {
  font-size: 0.7rem;
  color: var(--c-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 顶部搜索 — 桌面端显示 */
.search-bar-top {
  /* 搜索框已从顶栏搬进弹层（#searchDialog），不再需要在顶栏里抢宽度，
     所以去掉 flex 与 max-width，让它在弹层里占满一行。 */
  display: flex;
  position: relative;
  align-items: center;
  width: 100%;
  min-width: 0;
}

/* 选择器要比后面的通用表单规则更强。
   `.search-bar-top input` 与 `input[type="text"]` 权重相同 (0,1,1)，
   而通用规则写在后面，于是 padding-left 被压回 14px —— 文字就压到放大镜上了。
   这里带上 [type] 提高权重 (0,2,1)。 */
.search-bar-top input[type="text"] {
  width: 100%;
  padding: 8px 14px 8px 38px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: var(--c-paper-2);
  font-size: 0.9rem;
  color: var(--c-ink);
  outline: none;
  font-family: inherit;
}

.search-bar-top input[type="text"]:focus { border-color: var(--c-gold); }
.search-bar-top input[type="text"]::placeholder { color: var(--c-muted); }

.search-bar-top svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-muted);
  pointer-events: none;
}

/* ===== 搜索建议下拉 (Search suggestions) ===== */
.search-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 320px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--c-paper-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 1040;
  padding: 6px;
}

.ss-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--c-ink);
  text-decoration: none;
}

.ss-item:hover,
.ss-item.is-active { background: var(--c-paper); color: var(--c-ink); }

.ss-av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--c-paper);
}

.ss-av-text {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Noto Serif SC", serif;
  color: var(--c-red);
  font-size: 0.95rem;
  /* 图片绝对定位盖在首字上面，需要定位上下文与裁切 */
  position: relative;
  overflow: hidden;
}

/* 搜索建议里的头像图片。图片加载失败时 JS 会把它摘掉，
   露出垫在下面的姓名首字，避免出现浏览器的破图图标。 */
.ss-av-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  background: var(--c-paper);
}

.ss-body { flex: 1; min-width: 0; }

.ss-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-sub {
  display: block;
  font-size: 0.76rem;
  color: var(--c-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 类型标签 —— 一眼看出这条是门派、专家还是拳种 */
.ss-type {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid currentColor;
  opacity: .85;
}

.ss-type-school { color: var(--c-red); }
.ss-type-expert { color: var(--c-gold-dark); }
.ss-type-member { color: var(--c-success); }
.ss-type-record { color: var(--c-muted); }
.ss-type-style  { color: var(--c-red-light); }

.ss-empty {
  padding: 14px 12px;
  font-size: 0.85rem;
  color: var(--c-muted);
  text-align: center;
}

.ss-all {
  display: block;
  padding: 10px 12px;
  margin-top: 4px;
  border-top: 1px solid var(--c-border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-red);
  text-decoration: none;
  text-align: center;
  border-radius: var(--radius-sm);
}

.ss-all:hover,
.ss-all.is-active { background: var(--c-paper); color: var(--c-red-dark); }

/* 小屏时搜索框本身已占满一行，下拉沿用相对定位即可，
   不再需要按固定头高来定位（头部在窄屏是自动高度）。 */
@media (max-width: 640px) {
  .search-suggest { min-width: 0; }
}

/* ===== 按钮 (Buttons) ===== */
/* 按钮：与参考站 new_system_v2 对齐 ——
   圆角 6px（我们原先是 999px 的胶囊形，观感差别最大的就是这里），
   内距 9px 26px、字号 15px。 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 26px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 0.94rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all .18s ease;
}

/* 主按钮 — 暗红 */
.btn-primary {
  background: var(--c-red);
  border-color: var(--c-red);
  color: #fff;
}
.btn-primary:hover {
  background: var(--c-red-dark);
  border-color: var(--c-red-dark);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 31, 31, 0.28);
}

/* 描边按钮 — 悬停填充 */
.btn-outline {
  background: transparent;
  border-color: var(--c-red);
  color: var(--c-red);
}
.btn-outline:hover {
  background: var(--c-red);
  color: #fff;
}

/* 金色按钮 — 深色区块的主按钮 */
.btn-gold {
  background: var(--c-gold);
  border-color: var(--c-gold);
  color: #1a1a1a;
}
.btn-gold:hover {
  background: var(--c-gold-light);
  border-color: var(--c-gold-light);
  color: #1a1a1a;
  box-shadow: 0 4px 14px rgba(201, 160, 99, 0.35);
}

/* 深色底描边按钮 — 白边白字，悬停反白 */
.btn-on-dark,
.btn-outline-light {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}
.btn-on-dark:hover,
.btn-outline-light:hover {
  background: #fff;
  border-color: #fff;
  color: var(--c-red);
}

.btn-ghost {
  background: transparent;
  border-color: var(--c-border);
  color: var(--c-ink-light);
}
.btn-ghost:hover { background: var(--c-paper-2); color: var(--c-red); }

.btn-danger {
  background: var(--c-danger);
  border-color: var(--c-danger);
  color: #fff;
}
.btn-danger:hover { background: #8b2020; color: #fff; }

.btn-sm { padding: 5px 14px; font-size: 0.82rem; border-radius: 6px; }
.btn-lg { padding: 12px 34px; font-size: 1rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }

/* 旧视图别名 */
.btn-outline-danger {
  background: transparent;
  border-color: var(--c-red);
  color: var(--c-red);
}
.btn-outline-danger:hover { background: var(--c-red); color: #fff; }

/* ===== 汉堡菜单 (Hamburger) — 始终可见，它是主导航入口 ===== */
.hamburger {
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}

.hamburger:hover { border-color: var(--c-red); background: var(--c-paper-2); }

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-ink);
  border-radius: 1px;
  transition: .25s;
}

.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== 侧边菜单 (Slide Menu) — 自右侧滑出 ===== */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  z-index: 1010;
}

.menu-overlay.active { opacity: 1; pointer-events: auto; }

.slide-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: min(var(--menu-w), 85vw);
  height: 100vh;
  background: var(--c-paper-2);
  box-shadow: var(--shadow-lg);
  transform: translateX(110%);
  transition: transform .3s cubic-bezier(.25, .8, .25, 1);
  z-index: 1020;
  display: flex;
  flex-direction: column;
}

.slide-menu.active { transform: translateX(0); }

.slide-menu-header {
  padding: 20px;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slide-menu-header h2 { font-size: 1.1rem; margin: 0; }

.menu-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--c-border);
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--c-ink);
  transition: var(--transition);
}
.menu-close:hover { background: var(--c-paper); color: var(--c-red); }

.menu-nav { flex: 1; overflow-y: auto; padding: 16px; }

.menu-section { margin-bottom: 24px; }

.menu-section-title {
  font-size: 0.75rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  padding-left: 12px;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  color: var(--c-ink);
  font-weight: 500;
  transition: .15s;
}

.menu-item:hover { background: var(--c-paper); color: var(--c-red); }
.menu-item .arrow { color: var(--c-muted); font-size: 1.1rem; }

.menu-sub {
  padding-left: 12px;
  border-left: 2px solid var(--c-border);
  margin: 6px 0 12px 12px;
}

.menu-sub .menu-item {
  padding: 10px 12px;
  font-size: 0.92rem;
  color: var(--c-ink-light);
}

.menu-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-user {
  padding: 0 0 14px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 14px;
}
.menu-user .label { font-size: 0.75rem; color: var(--c-muted); }
.menu-user .name { font-size: 0.98rem; font-weight: 700; color: var(--c-red); }
.menu-user .role { font-size: 0.78rem; color: var(--c-muted); }

/* ===== 区块标题栏 (Section Bar) — 标题在左，操作在右 ===== */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--c-border);
}
.section-bar h2 { margin: 0; font-size: 1.5rem; }

/* ===== 详情页头部 (Detail Hero) — 门派 / 专家 / 成员 ===== */
.detail-hero {
  background: linear-gradient(135deg, #4a1f1f, #2a1212);
  color: #fff;
  padding: 48px 0;
}

.detail-hero h1, .detail-hero h2 { color: #fff; }

.detail-hero-inner {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  flex-wrap: wrap;
}

.detail-hero-logo {
  width: 120px;
  height: 120px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 3px solid var(--c-gold-light);
  background: var(--c-paper);
  flex-shrink: 0;
}

.detail-hero-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--c-gold);
  font-family: "Noto Serif SC", serif;
  font-size: 2.6rem;
}

/* 人物档案头像 — 圆形 */
.profile-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--c-gold-light);
  background: var(--c-paper);
  flex-shrink: 0;
}

.profile-photo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--c-gold);
  font-family: "Noto Serif SC", serif;
  font-size: 2.6rem;
}

.detail-hero-body { flex: 1 1 320px; }
.detail-hero-body h1 { font-size: 2rem; margin: 10px 0 12px; }

.detail-hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 14px;
}

.detail-hero-desc {
  color: rgba(255, 255, 255, 0.85);
  max-width: 720px;
  margin: 0;
}

.detail-hero-role {
  color: var(--c-gold);
  font-weight: 600;
  margin: -6px 0 12px;
}

.detail-hero .hero-actions { margin-top: 18px; }

/* ===== 简明列表 (Plain List) — 师承 / 弟子 ===== */
.plain-list { list-style: none; margin: 0; padding: 0; }

.plain-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 0;
  border-bottom: 1px solid var(--c-border);
}

.plain-list li:last-child { border-bottom: none; }
.plain-list li:first-child { padding-top: 0; }

/* ===== 卡片 (Cards) — 细边框 ===== */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.card {
  display: block;
  background: var(--c-paper-2);
  border: 1px solid var(--c-border);
  /* 参考站的卡片是 10px 圆角 + 25px 28px 内距 */
  border-radius: 10px;
  padding: 25px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

/* 卡片本身是链接时，文字保持墨色 */
a.card, a.card:hover { color: var(--c-ink); }
a.card:hover { border-color: var(--c-gold); }

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--c-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-red);
  font-size: 1.3rem;
  flex-shrink: 0;
}

.card h3 { margin: 0; font-size: 1.15rem; }
.card p { color: var(--c-ink-light); margin: 0; }

.card-heading {
  font-size: 1.25rem;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--c-border);
}

/* ===== 专家卡片 (Expert Card) — 圆形头像 + 细金边 ===== */
.expert-card { text-align: center; cursor: pointer; }

.expert-avatar,
.expert-photo {
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid var(--c-gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.expert-avatar {
  background: linear-gradient(135deg, var(--c-red), var(--c-red-dark));
  color: #fff;
  font-size: 1.8rem;
  font-family: "Noto Serif SC", serif;
}

.expert-photo { object-fit: cover; background: var(--c-paper); display: block; }

.expert-card h4 { margin: 0 0 4px; font-size: 1.1rem; }
.expert-card .role { color: var(--c-muted); font-size: 0.85rem; margin: 0; }
.expert-card .gen { color: var(--c-muted); font-size: 0.78rem; margin: 2px 0 0; }

/* ===== 门派卡片 (School Card) ===== */
.school-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.school-card::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--c-red);
}

.school-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--c-success);
  background: rgba(46, 125, 50, 0.08);
  padding: 4px 10px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.school-card h4 { margin: 0 0 6px; font-size: 1.2rem; }
.school-card .alias { color: var(--c-muted); font-size: 0.8rem; margin-bottom: 10px; }
.school-card p { font-size: 0.92rem; color: var(--c-ink-light); }

/* ===== 徽章 / 标签 (Badges & Tags) ===== */
.badge, .tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--c-paper);
  color: var(--c-ink-light);
  border: 1px solid var(--c-border);
  white-space: nowrap;
}

.badge-primary, .tag-red { background: var(--c-red); color: #fff; border-color: var(--c-red); }
.badge-gold, .tag-gold { background: var(--c-gold); color: #1a1a1a; border-color: var(--c-gold); }
.badge-success { background: #eaf7eb; color: var(--c-success); border-color: #b7dfb9; }
.badge-warning { background: #fff3e0; color: #6d4c41; border-color: #ffcc80; }
.badge-danger { background: #fdf0f0; color: var(--c-danger); border-color: #e0a4a4; }

/* ===== 表单 (Forms) ===== */
.form-group { margin-bottom: 18px; }

.form-group label,
label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--c-ink-light);
}

.form-group label .required { color: var(--c-red); margin-left: 2px; }

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="phone"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-paper-2);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--c-ink);
  outline: none;
  transition: var(--transition);
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus { border-color: var(--c-gold); }

textarea { resize: vertical; min-height: 120px; }

.form-hint { font-size: 0.8rem; color: var(--c-muted); margin-top: 4px; }

/* ===== 认证页 (Auth Pages) — 登录 / 注册 ===== */
.auth-page {
  background: linear-gradient(135deg, #2a1212 0%, #4a1f1f 55%, #2a1212 100%);
  min-height: 100vh;
}

.auth-shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 注册表单字段较多，需要更宽的容器 */
.auth-shell-wide { max-width: 780px; }

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  color: #fff;
}

.auth-brand img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--c-gold);
}

.auth-brand h1 { font-size: 1.4rem; margin: 0; color: #fff; letter-spacing: 1px; }
.auth-brand span { font-size: 0.7rem; color: var(--c-gold); letter-spacing: 2px; text-transform: uppercase; }

.auth-card {
  width: 100%;
  background: var(--c-paper-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 34px 30px;
}

.auth-card-wide { max-width: 100%; }

.auth-title { font-size: 1.5rem; margin: 0 0 6px; text-align: center; }
.auth-sub { color: var(--c-muted); font-size: 0.9rem; text-align: center; margin-bottom: 26px; }

.auth-alt {
  text-align: center;
  margin: 18px 0 0;
  font-size: 0.9rem;
  color: var(--c-muted);
}
.auth-alt a { font-weight: 600; margin-left: 4px; }

.auth-copyright {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.8rem;
  margin: 26px 0 0;
  text-align: center;
}

/* 表单分组标题 */
.form-section {
  font-size: 0.95rem;
  color: var(--c-red);
  margin: 26px 0 16px;
  padding-left: 10px;
  border-left: 3px solid var(--c-gold);
}
.form-section:first-of-type { margin-top: 0; }

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 16px;
}

/* 密码显示切换 */
.password-field { position: relative; }
.password-field input { padding-right: 62px; }

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--c-muted);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.password-toggle:hover { color: var(--c-red); background: var(--c-paper); }

/* 单选组 */
.radio-row { display: flex; flex-wrap: wrap; gap: 10px; }

.radio-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: var(--c-paper-2);
  cursor: pointer;
  margin: 0;
  font-weight: 500;
  transition: var(--transition);
}
.radio-item:hover { border-color: var(--c-red); }
.radio-item input { accent-color: var(--c-red); width: auto; margin: 0; }
.radio-item span { font-size: 0.9rem; }

/* 与 .form-group label 同样式，但不是 label —— 见 sign_up 的说明 */
.form-label-text {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--c-ink-light);
}

/* ===== 头像选择 (Avatar picker) ===== */
/* 浏览器原生的 file input 样式无法定制，且不显示预览。
   把它隐藏起来，用一个 label 承载点击，并在里面画预览。 */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.avatar-picker {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px dashed var(--c-border);
  border-radius: var(--radius);
  background: var(--c-paper-2);
  cursor: pointer;
  margin: 0;
  font-weight: 400;
  transition: var(--transition);
}

.avatar-picker:hover { border-color: var(--c-gold); background: var(--c-paper); }
.avatar-picker.is-error { border-color: var(--c-danger); border-style: solid; }

/* 键盘可达：input 获得焦点时给这个可见区域描边 */
.visually-hidden:focus-visible + .avatar-picker { outline: 2px solid var(--c-red); outline-offset: 2px; }

.avatar-preview {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-paper);
  border: 2px solid var(--c-border);
  overflow: hidden;
  color: var(--c-muted);
}

.avatar-preview svg { width: 26px; height: 26px; }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-preview.has-image { border-color: var(--c-gold); border-style: solid; }

.avatar-picker-text { flex: 1; min-width: 0; }

.avatar-picker-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar-picker.is-error .avatar-picker-title { color: var(--c-danger); }

.avatar-picker-hint {
  display: block;
  font-size: 0.76rem;
  color: var(--c-muted);
  margin-top: 2px;
}

.avatar-picker-btn { flex-shrink: 0; pointer-events: none; }

@media (max-width: 480px) {
  .avatar-picker-btn { display: none; }
}

/* 复选行 — 同意条款 */
.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.88rem;
  color: var(--c-ink-light);
  font-weight: 400;
  margin: 4px 0 0;
  cursor: pointer;
}
.checkbox-line input {
  width: auto;
  margin: 3px 0 0;
  accent-color: var(--c-red);
  flex-shrink: 0;
}

/* ===== 表格 (Tables) ===== */
/* 宽表格在自身容器内横向滚动，页面本身绝不横向滚动 */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table,
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: var(--c-paper-2);
  border-radius: var(--radius);
  overflow: hidden;
}

.table th, .table td,
.info-table th, .info-table td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
  vertical-align: top;
}

.table th {
  background: var(--c-red);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

.info-table th {
  width: 140px;
  color: var(--c-muted);
  font-weight: 500;
  background: var(--c-paper);
}

/* ===== 搜索 (Search) ===== */
.search-hero {
  background: var(--c-paper-2);
  border-bottom: 1px solid var(--c-border);
  padding: 40px 0;
}

.search-box-lg {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
}

.search-box-lg input {
  flex: 1;
  padding: 14px 20px 14px 46px;
  border: 2px solid var(--c-border);
  border-radius: 6px;
  font-size: 1.05rem;
  background: var(--c-paper-2);
  outline: none;
}

.search-box-lg input:focus { border-color: var(--c-gold); }

.search-box-lg > svg {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-muted);
  pointer-events: none;
  z-index: 1;
}

/* 搜索结果卡片 */
.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.result-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-paper-2);
  color: var(--c-ink);
  transition: var(--transition);
}

.result-card:hover { border-color: var(--c-gold); color: var(--c-ink); box-shadow: var(--shadow-sm); }

.result-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--c-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Noto Serif SC", serif;
  color: var(--c-red);
  font-size: 1.2rem;
  overflow: hidden;
  flex-shrink: 0;
}

.result-avatar img { width: 100%; height: 100%; object-fit: cover; }

.result-meta { flex: 1; min-width: 0; }
.result-meta .name { font-weight: 600; font-size: 1rem; }
.result-meta .sub { font-size: 0.82rem; color: var(--c-muted); }

/* ===== 数据磁贴 (Stat Tiles) — 仪表板概览 ===== */
.stat-tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: var(--radius);
  color: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}

.stat-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  color: #fff;
}

.stat-tile-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: .7px;
  opacity: .85;
  margin-bottom: 6px;
}

.stat-tile-number {
  font-family: "Noto Serif SC", serif;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-tile-link {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 12px;
  opacity: .9;
}

.stat-tile-red  { background: linear-gradient(135deg, var(--c-red), var(--c-red-dark)); }
.stat-tile-gold { background: linear-gradient(135deg, var(--c-gold-dark), var(--c-gold)); color: #2a1212; }
.stat-tile-gold .stat-tile-number,
.stat-tile-gold .stat-tile-link { color: #2a1212; }
.stat-tile-gold:hover { color: #2a1212; }
.stat-tile-dark { background: linear-gradient(135deg, #3a3030, #241d1d); }

/* ===== 快捷操作 (Quick Actions) ===== */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ===== 富文本 (Rich Text) — 后台维护的正文，如条款 / 隐私政策 ===== */
.rich-text {
  max-width: 900px;
  margin: 0 auto;
  color: var(--c-ink-light);
}

.rich-text h1,
.rich-text h2,
.rich-text h3,
.rich-text h4 {
  color: var(--c-ink);
  margin: 30px 0 12px;
}
.rich-text > :first-child { margin-top: 0; }

.rich-text h1 { font-size: 1.6rem; }
.rich-text h2 {
  font-size: 1.3rem;
  padding-left: 12px;
  border-left: 4px solid var(--c-red);
}
.rich-text h3 { font-size: 1.05rem; }

.rich-text p { font-size: 15px; line-height: 2; margin: 0 0 14px; }
.rich-text ul,
.rich-text ol { padding-left: 22px; margin: 0 0 16px; }
.rich-text li { font-size: 15px; line-height: 1.9; margin-bottom: 6px; }
.rich-text a { text-decoration: underline; }
.rich-text strong { color: var(--c-ink); }

.rich-text img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 10px 0;
}

.rich-text blockquote {
  margin: 0 0 16px;
  padding: 14px 18px;
  background: var(--c-paper-2);
  border-left: 3px solid var(--c-gold);
  border-radius: var(--radius-sm);
}

/* 后台富文本里的表格同样不得撑破页面 */
.rich-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  display: block;
  overflow-x: auto;
}
.rich-text th,
.rich-text td {
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  text-align: left;
}
.rich-text th { background: var(--c-paper); font-weight: 600; }

/* ===== 隐私提示 (Privacy banner) ===== */
.privacy-banner {
  background: #fff8e6;
  border: 1px solid #f0d89e;
  color: #7a5c1a;
  padding: 13px 17px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.7;
}
.privacy-banner strong { color: #6d4c10; }

/* 头部标签行 */
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* 卡片内的次级标题 */
.sub-heading {
  font-size: 0.95rem;
  color: var(--c-muted);
  margin: 0 0 10px;
  font-weight: 600;
}

/* 成果 / 同门 标签组 */
.achievement-tags,
.sibling-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.achievement-tags .tag small {
  color: var(--c-muted);
  margin-left: 5px;
  font-size: 0.72rem;
}

.tag-link {
  background: var(--c-paper);
  color: var(--c-red);
  border-color: var(--c-red);
  cursor: pointer;
}
.tag-link:hover { background: var(--c-red); color: #fff; }

/* ===== 空状态 / 提示 (Empty & Notices) ===== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--c-muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; opacity: .5; }

.notice {
  background: #eaf7eb;
  border: 1px solid #b7dfb9;
  color: #1b5e20;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.notice-warn { background: #fff3e0; border-color: #ffcc80; color: #6d4c41; }

/* ===== 页面头 (Page Header) — 内页顶部 ===== */
/* ── 页面横幅 ──
   参照 new_system_v2 的 .page-banner：暖红渐变 + 两侧「武」「承」水印。
   原来是 #4a1f1f → #2a1212 的深褐渐变，颜色偏暗也偏平，与参考站差别明显。
   全站 50 个页面共用这个类，改这一处即可全部跟上。 */
.page-header {
  background: linear-gradient(135deg, #6b1410 0%, #8b1a1a 60%, #a0522d 100%);
  color: #fff;
  padding: 56px 0 46px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* 两侧的大字水印。opacity 很低，只作肌理，不抢标题。
   aria-hidden 由 content 生成的伪元素天然不进无障碍树，读屏不会念出来。 */
.page-header::before,
.page-header::after {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 200px;
  line-height: 1;
  opacity: 0.06;
  font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif;
  pointer-events: none;
  z-index: 0;
}
.page-header::before { content: "承"; left: 5%; }
.page-header::after  { content: "武"; right: 5%; }

/* 文字要压在水印上面（全站 50 处都是 > .container，这里放宽到任意直接子元素） */
.page-header > * { position: relative; z-index: 1; }

.page-header h1 {
  font-size: 2.05rem;
  margin-bottom: 10px;
  color: #fff;
  letter-spacing: 6px;
  font-family: "Noto Serif SC", "STKaiti", "KaiTi", serif;
}
.page-header p {
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  letter-spacing: 2px;
}

@media (max-width: 768px) {
  .page-header { padding: 38px 0 32px; }
  .page-header h1 { font-size: 1.45rem; letter-spacing: 3px; }
  .page-header p { letter-spacing: 1px; font-size: 0.88rem; }
  /* 窄屏上 200px 的水印会盖住标题，缩小并往外挪 */
  .page-header::before,
  .page-header::after { font-size: 120px; opacity: 0.05; }
  .page-header::before { left: -2%; }
  .page-header::after  { right: -2%; }
}

/* ===== 页脚 (Footer) ===== */
.site-footer,
footer.site-footer {
  background: #241c1c;
  color: rgba(255, 255, 255, 0.75);
  padding: 56px 0 28px;
  font-size: 0.92rem;
}

.site-footer h3,
.site-footer h4 { color: #fff; }

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.footer-brand h3 { margin-bottom: 8px; font-size: 1.3rem; }
.footer-brand p { color: rgba(255, 255, 255, 0.72); }
.footer-brand strong { color: var(--c-gold); font-weight: 600; }

.footer-links h4 { font-size: 0.95rem; margin-bottom: 14px; }

.footer-links a,
.footer-links span {
  display: block;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 8px;
  transition: .15s;
}

.footer-links a:hover { color: var(--c-gold); }

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 8px;
}
.footer-contact-item svg { flex-shrink: 0; margin-top: 5px; color: var(--c-gold); }

/* 电话 / 邮箱做成可点击链接。默认继承周围的浅灰，避免footer里突然
   冒出一个蓝色下划线链接；hover 时转成金色，提示它是可以点的。 */
.footer-contact-link {
  color: inherit;
  text-decoration: none;
  word-break: break-word;
}
.footer-contact-link:hover,
.footer-contact-link:focus-visible {
  color: var(--c-gold);
  text-decoration: underline;
}


.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

/* ===== 工具类 (Utilities) ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--c-muted); }
.text-danger, .text-cinnabar { color: var(--c-red); }
.text-light { color: #fff; }
.text-decoration-none { text-decoration: none; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-none { display: none; }
.flex { display: flex; }
.flex-wrap, .wrap { flex-wrap: wrap; }
.items-center, .align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.between, .justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }

.gap-1 { gap: 8px; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 20px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 48px; }
.m-0 { margin: 0; }
.p-0 { padding: 0; }

.lead { font-size: 1.1rem; color: var(--c-ink-light); }

/* ===== 兼容旧视图的栅格 (Legacy Grid) ===== */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -10px;
  margin-left: -10px;
}

.row > * {
  flex-shrink: 0;
  width: 100%;
  padding-right: 10px;
  padding-left: 10px;
}

.col { flex: 1 0 0%; }
.col-1 { width: 8.33333%; }
.col-2 { width: 16.66667%; }
.col-3 { width: 25%; }
.col-4 { width: 33.33333%; }
.col-5 { width: 41.66667%; }
.col-6 { width: 50%; }
.col-7 { width: 58.33333%; }
.col-8 { width: 66.66667%; }
.col-9 { width: 75%; }
.col-10 { width: 83.33333%; }
.col-11 { width: 91.66667%; }
.col-12 { width: 100%; }

/* 这套「兼容旧视图的栅格」原先没有断点变体，.col-8/.col-4 在手机上
   依旧是 66%/33%，课程详情页因此挤成两条窄栏。
   补上 col-lg-*，并让不带断点的 .col-N 在窄屏占满整行。 */
@media (min-width: 992px) {
  .col-lg-1  { width: 8.33333%; }
  .col-lg-2  { width: 16.66667%; }
  .col-lg-3  { width: 25%; }
  .col-lg-4  { width: 33.33333%; }
  .col-lg-5  { width: 41.66667%; }
  .col-lg-6  { width: 50%; }
  .col-lg-7  { width: 58.33333%; }
  .col-lg-8  { width: 66.66667%; }
  .col-lg-9  { width: 75%; }
  .col-lg-10 { width: 83.33333%; }
  .col-lg-11 { width: 91.66667%; }
  .col-lg-12 { width: 100%; }
}

@media (max-width: 767.98px) {
  .row > [class^="col-"]:not([class*="col-lg-"]),
  .row > [class*=" col-"]:not([class*="col-lg-"]) { width: 100%; }
}

/* 没有可播放视频时的占位块（课程详情） */
.course-noplay {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #140A06;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.course-noplay img { width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.course-noplay-note {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 12px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
  color: #f2e8dc;
  font-size: .88rem;
  text-align: center;
}
.course-noplay-note a { color: #f0c040; }

/* ===== 响应式 (Responsive) ===== */
@media (min-width: 640px) {
  .stats-bar { grid-template-columns: repeat(4, 1fr); }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.2fr; }
  .form-row { grid-template-columns: repeat(2, 1fr); }
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .stat-tiles { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) {
  .col-md-1 { width: 8.33333%; }
  .col-md-2 { width: 16.66667%; }
  .col-md-3 { width: 25%; }
  .col-md-4 { width: 33.33333%; }
  .col-md-5 { width: 41.66667%; }
  .col-md-6 { width: 50%; }
  .col-md-7 { width: 58.33333%; }
  .col-md-8 { width: 66.66667%; }
  .col-md-9 { width: 75%; }
  .col-md-10 { width: 83.33333%; }
  .col-md-11 { width: 91.66667%; }
  .col-md-12 { width: 100%; }
}

@media (min-width: 900px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .col-lg-1 { width: 8.33333%; }
  .col-lg-2 { width: 16.66667%; }
  .col-lg-3 { width: 25%; }
  .col-lg-4 { width: 33.33333%; }
  .col-lg-5 { width: 41.66667%; }
  .col-lg-6 { width: 50%; }
  .col-lg-7 { width: 58.33333%; }
  .col-lg-8 { width: 66.66667%; }
  .col-lg-9 { width: 75%; }
  .col-lg-10 { width: 83.33333%; }
  .col-lg-11 { width: 91.66667%; }
  .col-lg-12 { width: 100%; }
}

/* 小屏 */
@media (max-width: 640px) {
  /* 头部换行：品牌 + 三条线一行，搜索独占第二行，避免挤成一条缝 */
  .header-inner { flex-wrap: wrap; row-gap: 10px; }
  .site-header { height: auto; padding: 10px 0; }
  .brand { flex: 1; }
  .search-bar-top { order: 3; flex-basis: 100%; max-width: none; }

  .hero { padding: 64px 0 56px; }
  .section { padding: 40px 0; }
  .section-header { margin-bottom: 28px; }
  .section-header h2 { font-size: 1.5rem; }
  .brand-text span { display: none; }
  .brand img { width: 38px; height: 38px; }
  .brand-text h1 { font-size: 1.05rem; }
  .card { padding: 18px; }
  .hero-actions .btn { flex: 1 1 auto; }
}

/* 师承来源说明 */
.lineage-source { font-size: 0.82rem; margin-top: 4px; }

/* 未注册节点的标签样式 —— 可点击，但视觉上区分于已注册成员 */
.tag-stub {
  border-style: dashed;
  opacity: .85;
}

/* =====================================================================
   首页新增板块（参照 new_system_v2 的首页结构）
   核心模块卡片 / 段级体系 / 运营与考评主体
   ===================================================================== */

/* ── 核心模块卡片 ── */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.module-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 18px;
  background: var(--c-paper-2, #fff);
  border: 1px solid var(--c-border);
  border-radius: var(--radius, 10px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}
.module-card:hover {
  border-color: var(--c-red);
  box-shadow: 0 6px 20px rgba(139, 26, 26, .12);
  transform: translateY(-2px);
}
.module-icon  { font-size: 1.6rem; line-height: 1; }
.module-title { font-weight: 700; color: var(--c-ink); font-size: 1.02rem; }
.module-desc  { color: var(--c-muted); font-size: .84rem; line-height: 1.65; }

/* ── 段级体系 ── */
.rank-band {
  background: linear-gradient(135deg, #fff, #fdf6ec);
  border: 1px solid var(--c-border);
  border-radius: var(--radius, 10px);
  padding: 20px 22px;
}
.rank-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 0;
  flex-wrap: wrap;
}
.rank-row + .rank-row { border-top: 1px dashed var(--c-border); }
.rank-row-label {
  flex: none;
  min-width: 108px;
  font-weight: 700;
  color: var(--c-red);
  font-family: "Noto Serif SC", serif;
}
.rank-row-label small { color: var(--c-muted); font-weight: 400; font-size: .74rem; }
.rank-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rank-chip {
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--c-border);
  background: #fff;
  font-size: .78rem;
  color: var(--c-ink);
  font-variant-numeric: tabular-nums;
}
.rank-chip-gold { border-color: #d9b45c; background: #fdf6e6; color: #8a6a12; font-weight: 600; }

/* ── 运营与考评主体 ── */
.org-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
}
.org-card { padding: 22px 20px; }
.org-icon { font-size: 1.7rem; display: block; margin-bottom: 8px; }
.org-card h3 { font-size: 1.05rem; margin: 0 0 8px; color: var(--c-ink); }
.org-card p  { margin: 0; font-size: .86rem; line-height: 1.75; }

/* 商品详情：超出库存时的中文提示 */
.stock-warn {
  margin: 8px 0 0;
  padding: 7px 12px;
  border-radius: 6px;
  background: #fbeaea;
  border: 1px solid #e6b8b8;
  color: #a32c2c;
  font-size: .84rem;
}

/* =====================================================================
   门派列表 —— 参照 new_system_v2 的 member/schools.html
   横排卡片：左侧标识、右侧名称/简介/拳种徽章/规模
   ===================================================================== */
.school-list { display: flex; flex-direction: column; gap: 14px; }

.school-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 18px 20px;
  background: var(--c-paper-2, #fff);
  border: 1px solid var(--c-border);
  /* 参考站的门派卡顶部有一条 3px 朱红 */
  border-top: 3px solid var(--c-red);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}
.school-row:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(139, 26, 26, .14);
  border-color: var(--c-red);
}

.sr-logo {
  flex: none;
  width: 92px; height: 92px;
  border-radius: 10px;
  background: #faf6f0;
  border: 1px solid #e5d9c5;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  font-family: "Noto Serif SC", serif;
  font-size: 1.9rem;
  color: var(--c-red);
}
.sr-logo img { width: 100%; height: 100%; object-fit: cover; }

.sr-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.sr-name { font-size: 1.15rem; font-weight: 700; color: var(--c-red); }
.sr-name .badge { margin-left: 6px; vertical-align: middle; font-size: .68rem; }
.sr-desc { color: var(--c-muted); font-size: .84rem; line-height: 1.7; }
.sr-styles { display: flex; flex-wrap: wrap; gap: 5px; }
.sr-styles .badge { font-size: .7rem; }
.sr-meta { color: #999; font-size: .76rem; }

@media (max-width: 640px) {
  .school-row { flex-wrap: wrap; gap: 12px; }
  .sr-logo { width: 64px; height: 64px; font-size: 1.4rem; }
}

/* =====================================================================
   顶栏搜索：图标 + 弹层
   顶栏原先常驻一条输入框，挤占导航空间；改为一个图标，点开才出现。
   ===================================================================== */

.header-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border: none;
  background: transparent;
  border-radius: 50%;
  color: #e8d8c8;              /* 顶栏是深褐底 */
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}
.header-search-btn:hover,
.header-search-btn:focus-visible {
  background: rgba(240, 192, 64, .14);
  color: #f0c040;
}

/* ── 弹层 ── */
.search-dialog {
  /* 全局有 `* { margin: 0 }`，会把 <dialog> 用来居中的 margin:auto 冲掉，
     所以显式写回；这里让它靠上，符合搜索框的习惯位置。 */
  position: fixed;
  inset: 0;
  margin: 10vh auto auto;
  width: min(92vw, 640px);
  max-height: 80vh;
  padding: 0;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: var(--c-paper-2, #fff);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
  overflow: visible;           /* 让建议列表能垂下来 */
}
.search-dialog::backdrop {
  background: rgba(26, 22, 18, .5);
  backdrop-filter: blur(2px);
}

.search-dialog .sd-inner { padding: 18px 18px 14px; }

/* 弹层里的搜索框：回到浅色底（顶栏那套深色覆盖不适用） */
.search-dialog .search-bar-top { position: relative; width: 100%; }
.search-dialog .search-bar-top input[type="text"] {
  width: 100%;
  background: #fff;
  border: 1px solid var(--c-border);
  color: var(--c-ink);
  padding-left: 38px;
  padding-right: 40px;
  height: 44px;
  font-size: .98rem;
}
.search-dialog .search-bar-top input[type="text"]:focus {
  border-color: var(--c-red);
  box-shadow: 0 0 0 .15rem rgba(139, 26, 26, .12);
}
.search-dialog .search-bar-top > svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--c-muted);
  pointer-events: none;
}

.search-dialog .sd-close {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border: none; background: transparent;
  color: var(--c-muted);
  font-size: 1.3rem; line-height: 1;
  border-radius: 6px; cursor: pointer;
}
.search-dialog .sd-close:hover { background: var(--c-paper); color: var(--c-red); }

.search-dialog .sd-tip {
  margin: 10px 2px 0;
  font-size: .78rem;
  color: var(--c-muted);
}

/* 建议列表在弹层里跟着输入框走 */
.search-dialog .search-suggest {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 6px);
  max-height: 52vh;
  overflow: auto;
}
