@charset "utf-8";
/* ============================================
   非凡词典 · 高端扁平化设计系统
   明亮 · 靛蓝紫渐变 · 大圆角 · 柔和阴影
   （风格参考古诗词前端）
   ============================================ */

:root {
  /* 主色：靛蓝 → 紫罗兰渐变 */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #eef2ff;
  --accent: #8b5cf6;
  --accent-light: #f5f3ff;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

  /* 文字 */
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;

  /* 背景与卡片 */
  --bg: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --line-2: #f1f5f9;

  /* 尺寸 */
  --header-h: 68px;
  --max: 1200px;
  --gap: 24px;
  --radius: 16px;
  --radius-sm: 12px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow: 0 2px 8px rgba(15,23,42,.05), 0 10px 28px rgba(15,23,42,.07);
  --shadow-lg: 0 16px 40px rgba(79,70,229,.18);

  /* 字体 */
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --serif: "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", Georgia, serif;
  --kai: "KaiTi", "楷体", "STKaiti", "华文楷体", "Kaiti SC", "DFKai-SB", "Noto Serif CJK SC", "SimSun", serif;

  /* 动效 */
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; transition: color .2s var(--ease); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
code { font-family: Menlo, Consolas, monospace; font-size: .92em; }

/* ===== Layout ===== */
.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gap); }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.row-center { display: flex; align-items: center; justify-content: center; }
.mt30 { margin-top: 30px; }

/* ===== Header（玻璃拟态） ===== */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(226,232,240,.8);
  height: var(--header-h);
}
.header-main {
  max-width: var(--max); height: 100%; margin: 0 auto;
  padding: 0 var(--gap);
  display: flex; align-items: center; justify-content: space-between;
}

.logo-box { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.logo-mark {
  width: 38px; height: 38px;
  background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 20px; font-weight: 700;
  border-radius: 11px;
  box-shadow: 0 6px 16px rgba(99,102,241,.35);
}
.logo-text { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: 2px; }
.logo-text span { display: block; font-size: 10px; font-weight: 500; color: var(--ink-3); letter-spacing: 3px; margin-top: -2px; }

.nav { display: flex; align-items: center; gap: 6px; height: 100%; }
.nav a {
  position: relative; display: inline-flex; align-items: center;
  height: 36px; padding: 0 18px;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  letter-spacing: 1px; border-radius: 10px;
  transition: all .2s var(--ease);
}
.nav a:hover { color: var(--primary); background: var(--primary-light); }
.nav a.hover { color: #fff; background: var(--grad); box-shadow: 0 6px 14px rgba(99,102,241,.32); }

/* 搜索框 */
.search-box { display: flex; align-items: center; position: relative; flex-shrink: 0; }
.search-box input {
  width: 220px; height: 38px; padding: 0 40px 0 16px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); font-size: 13px; color: var(--ink);
  outline: none; transition: all .2s var(--ease);
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12); width: 260px; }
.search-box button {
  position: absolute; right: 4px; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); border-radius: 9px; transition: all .2s;
}
.search-box button:hover { color: var(--primary); background: var(--primary-light); }

/* Mobile header */
.wap-header { display: none; position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.wap-header-main { padding: 12px 16px; gap: 12px; }
.wap-header .logo-mark { width: 34px; height: 34px; font-size: 18px; }
.wap-header .logo-text { font-size: 16px; }
.wap-search { flex: 1; }
.wap-search input { width: 100%; }
.wap-nav { display: flex; gap: 8px; padding: 0 16px 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wap-nav::-webkit-scrollbar { display: none; }
.wap-nav a {
  flex-shrink: 0; display: inline-flex; align-items: center;
  height: 34px; padding: 0 16px; font-size: 13px; color: var(--ink-2);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  transition: all .2s var(--ease);
}
.wap-nav a.hover { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(99,102,241,.3); }

/* ===== Main ===== */
.main { min-height: 45vh; padding: 40px 0; }

/* ===== Hero（渐变） ===== */
.hero {
  position: relative; background: var(--grad);
  border-radius: 24px; padding: 48px 48px; margin-bottom: 40px;
  overflow: hidden; box-shadow: var(--shadow-lg);
}
.hero::before {
  content: ""; position: absolute; right: -60px; top: -60px;
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 62%);
  pointer-events: none;
}
.hero::after {
  content: "典"; position: absolute; right: 56px; bottom: -44px;
  font-family: var(--serif); font-size: 220px; line-height: 1;
  color: rgba(255,255,255,.14); pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 560px; }
.hero h1 { color: #fff; font-size: 40px; font-weight: 800; line-height: 1.25; letter-spacing: 2px; }
.hero h1 em { font-style: normal; color: #ffd66b; }
.hero-desc { color: rgba(255,255,255,.9); font-size: 15px; margin: 16px 0 26px; line-height: 1.8; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-search { display: flex; gap: 10px; margin-top: 20px; max-width: 460px; }
.hero-search input {
  flex: 1; height: 48px; padding: 0 20px;
  border: none; border-radius: 14px; font-size: 15px;
  outline: none; box-shadow: 0 8px 24px rgba(0,0,0,.16);
}
.hero-search button {
  height: 48px; padding: 0 26px; border-radius: 14px;
  background: var(--ink); color: #fff; font-size: 15px; font-weight: 600;
  transition: all .2s;
}
.hero-search button:hover { background: #1e293b; transform: translateY(-1px); }

/* ===== 按钮 ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 22px; border-radius: 12px; font-size: 14px; font-weight: 600; transition: all .2s var(--ease); }
.btn-primary { background: #fff; color: var(--primary-dark); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.btn-ghost { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.28); }

/* ===== 区块标题 ===== */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: 1px; }
.section-title .num { color: var(--primary); font-size: 16px; font-weight: 800; }
.section-more { font-size: 13px; color: var(--ink-3); transition: color .2s; }
.section-more:hover { color: var(--primary); }

/* ===== 卡片 ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 26px 30px; margin-bottom: 20px; transition: box-shadow .25s var(--ease); }
.card:hover { box-shadow: var(--shadow); }
.card-title { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 16px; }

/* ===== 词条网格 ===== */
.entry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.entry-grid a {
  display: flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 8px 14px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; font-size: 15px; color: var(--ink-2);
  transition: all .2s var(--ease);
}
.entry-grid a:hover {
  color: var(--primary); border-color: var(--primary);
  background: var(--primary-light); transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99,102,241,.16);
}
.entry-grid a .zi { font-size: 15px; font-weight: 400; color: var(--ink); }
.entry-grid a:hover .zi { color: var(--primary); }

/* ===== 字母导航 ===== */
.letter-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.letter-nav a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; font-size: 14px; font-weight: 600;
  color: var(--ink-2); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; transition: all .2s var(--ease);
}
.letter-nav a:hover, .letter-nav a.on {
  background: var(--grad); color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(99,102,241,.3); transform: translateY(-2px);
}

/* ===== 分类标签 ===== */
.tag-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-grid a {
  display: inline-flex; align-items: center; padding: 8px 18px;
  font-size: 14px; color: var(--ink-2); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px;
  transition: all .2s var(--ease);
}
.tag-grid a:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

/* ===== 详情页 ===== */
.detail-head { text-align: center; padding: 40px 0 30px; }
.detail-char {
  font-family: var(--kai); font-size: 88px; font-weight: 700;
  color: var(--ink); line-height: 1.1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.detail-head .detail-word { font-family: var(--kai); font-size: 44px; font-weight: 700; color: var(--ink); letter-spacing: 4px; }
.detail-pinyin { margin-top: 14px; font-size: 18px; color: var(--primary); letter-spacing: 2px; }
.detail-info { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.detail-info .info-pill {
  padding: 6px 16px; font-size: 13px; color: var(--ink-2);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
}
.detail-info .info-pill b { color: var(--ink); font-weight: 600; }

.explain-block { margin-top: 16px; padding: 20px 22px; background: var(--bg); border-radius: 12px; }
.explain-block .eb-title { font-size: 14px; font-weight: 700; color: var(--primary); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.explain-block .eb-content { font-size: 15px; color: var(--ink-2); line-height: 1.9; word-break: break-word; }

/* ===== 面包屑 ===== */
.crumb { font-size: 13px; color: var(--ink-3); margin-bottom: 20px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.crumb a { color: var(--ink-3); transition: color .2s; }
.crumb a:hover { color: var(--primary); }
.crumb .sep { color: var(--line); }

/* ===== 分页 ===== */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 28px 0 8px; }
.pager a, .pager span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 12px;
  font-size: 14px; color: var(--ink-2); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px;
  transition: all .2s var(--ease);
}
.pager a:hover { color: var(--primary); border-color: var(--primary); }
.pager span.current { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(99,102,241,.3); }

/* ===== 搜索结果 ===== */
.search-count { font-size: 14px; color: var(--ink-3); margin-bottom: 16px; }
.search-count b { color: var(--primary); }
.empty { text-align: center; padding: 60px 0; color: var(--ink-3); }
.empty .empty-icon { font-size: 56px; margin-bottom: 16px; }

/* ===== Footer ===== */
.footer { margin-top: 40px; padding: 40px 0 30px; background: var(--card); border-top: 1px solid var(--line); text-align: center; }
.footer .f-title { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: 4px; }
.footer .f-beian { margin-top: 8px; font-size: 13px; }
.footer .f-beian a { color: var(--ink-3); }
.footer .f-beian a:hover { color: var(--primary); }
.footer .f-copy { margin-top: 4px; font-size: 12px; color: var(--ink-3); }

/* 返回顶部 */
.back-top {
  position: fixed; right: 28px; bottom: 40px; z-index: 90;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all .25s var(--ease); cursor: pointer;
}
.back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { color: var(--primary); border-color: var(--primary); }

/* ===== 动效 ===== */
.fade-in-up { animation: fadeInUp .6s var(--ease) both; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .header { display: none; }
  .wap-header { display: block; }
  .main { padding: 20px 0; }
  .hero { padding: 32px 24px; border-radius: 18px; }
  .hero h1 { font-size: 30px; }
  .hero::after { font-size: 150px; }
  .card { padding: 20px 18px; }
  .entry-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .detail-char { font-size: 64px; }
  .detail-head .detail-word { font-size: 32px; }
  .section-title { font-size: 16px; }
  .container { padding: 0 16px; }
  .back-top { right: 16px; bottom: 24px; }
}

/* ============================================
   详情页精细排版
   ============================================ */

/* 详情页布局：左侧主内容 + 右侧边栏 */
.detail-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 20px; align-items: start; }
.detail-main { min-width: 0; }

/* 标题区 */
.detail-head { text-align: center; padding: 30px 20px 24px; }
.detail-char { font-family: var(--kai); font-size: 84px; font-weight: 700; line-height: 1.15; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.detail-head .detail-word { font-family: var(--kai); font-size: 42px; font-weight: 700; color: var(--ink); letter-spacing: 4px; line-height: 1.3; }
.detail-pinyin { margin-top: 12px; font-size: 16px; color: var(--primary); letter-spacing: 1px; font-weight: 400; }
.detail-pinyin span { display: inline-block; margin: 0 4px; }

/* 字图（书写图片） */
.char-figure { margin-top: 16px; display: flex; justify-content: center; }
.char-figure img.char-img { max-width: 200px; max-height: 200px; border-radius: 14px; background: var(--bg); }

/* 音频按钮 */
.tts-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin-left: 8px; vertical-align: middle; border-radius: 50%; background: var(--primary-light); color: var(--primary); transition: all .2s; }
.tts-btn:hover { background: var(--primary); color: #fff; }
.tts-btn.playing { animation: ttsPulse 1s ease-in-out infinite; }
@keyframes ttsPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(99,102,241,.4); } 50% { box-shadow: 0 0 0 10px rgba(99,102,241,0); } }

/* 字段表格（键值对） */
.field-table { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 20px; }
.field-item { display: flex; align-items: baseline; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); }
.field-item:nth-child(2n) { border-right: none; }
.field-item:nth-last-child(-n+2) { border-bottom: none; }
.field-item.span2 { grid-column: 1 / -1; border-right: none; }
.field-label { flex-shrink: 0; min-width: 54px; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.field-value { font-size: 14px; color: var(--ink-2); word-break: break-word; line-height: 1.6; }
.field-value a { color: var(--primary); }
.field-value a:hover { text-decoration: underline; }

/* 笔顺展示 */
.stroke-box { margin-top: 16px; }
.stroke-text { font-family: var(--kai); font-size: 18px; letter-spacing: 5px; color: var(--ink); }
.stroke-figure { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.stroke-figure img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.stroke-figure img.stroke-step { max-width: 260px; }
.stroke-figure img.stroke-anim { max-width: 160px; }

/* 分字解释 */
.fenzi-group { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.fenzi { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 16px; min-width: 68px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; transition: all .2s var(--ease); }
.fenzi:hover { border-color: var(--primary); background: var(--primary-light); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(99,102,241,.16); }
.fenzi .py { font-size: 12px; color: var(--ink-3); }
.fenzi .zi { font-family: var(--kai); font-size: 18px; font-weight: 500; color: var(--ink); line-height: 1.3; }

/* 组词 / 成语链接 */
.group-link { display: inline-flex; align-items: center; gap: 3px; padding: 8px 16px; margin: 4px 6px 4px 0; background: var(--accent-light); color: var(--accent); border-radius: 999px; font-size: 14px; transition: all .2s var(--ease); }
.group-link em { font-style: normal; font-weight: 500; }
.group-link:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }

/* 释义块 */
.explain-block { margin-top: 14px; padding: 20px 22px; background: var(--bg); border-radius: 12px; }
.explain-block .eb-title { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.explain-block .eb-content { font-size: 15px; color: var(--ink-2); line-height: 1.9; word-break: break-word; }
.explain-block .eb-content p { margin-bottom: 8px; }

/* 造句 */
.sentence-list { margin-top: 10px; }
.sentence-list .sen { padding: 8px 0; font-size: 14px; color: var(--ink-2); border-bottom: 1px dashed var(--line); }
.sentence-list .sen:last-child { border-bottom: none; }
.sentence-list .sen b { color: var(--primary); margin-right: 6px; }

/* 相关成语表格 */
.rel-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.rel-table th, .rel-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-2); }
.rel-table th { background: var(--bg); color: var(--ink-3); font-weight: 600; font-size: 13px; }
.rel-table td a { color: var(--primary); font-weight: 500; }
.rel-table td .jieshi { color: var(--ink-3); font-size: 13px; }

/* 侧边栏卡片 */
.side-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.side-card .sc-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.side-card .sc-list { display: flex; flex-wrap: wrap; gap: 8px; }
.side-card .sc-list a { padding: 6px 12px; font-size: 13px; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; transition: all .2s; }
.side-card .sc-list a:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

/* 手机端 */
@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-char { font-size: 64px; }
  .detail-head .detail-word { font-size: 32px; letter-spacing: 2px; }
  .field-table { grid-template-columns: 1fr; }
  .field-item { border-right: none; }
  .field-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--line-2); }
  .field-item:last-child { border-bottom: none; }
  .stroke-figure img.stroke-step { max-width: 100%; }
}

/* ============================================
   首页精细化设计（覆盖/增强）
   ============================================ */

/* 首屏 Hero 修复错位 */
.hero { padding: 60px 56px; display: flex; align-items: center; }
.hero::after { display: none; }  /* 去掉水印，避免错位 */
.hero-content { max-width: 680px; }
.hero h1 { font-size: 40px; line-height: 1.4; font-weight: 800; }
.hero h1 em { font-style: normal; color: #ffd66b; }
.hero-desc { max-width: 520px; }

/* Hero 搜索框（form 语义化 + 移动端兼容） */
.hero-search { display: flex; gap: 10px; margin-top: 26px; max-width: 520px; }
.hero-search input { flex: 1; min-width: 0; height: 52px; padding: 0 22px; border: none; border-radius: 14px; font-size: 15px; outline: none; box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.hero-search button { flex-shrink: 0; height: 52px; padding: 0 28px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 600; transition: all .2s; }
.hero-search button:hover { background: #1e293b; transform: translateY(-1px); }

/* Hero 快捷标签 */
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.hero-tags a { padding: 6px 14px; font-size: 13px; color: rgba(255,255,255,.92); background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); border-radius: 999px; transition: all .2s; }
.hero-tags a:hover { background: rgba(255,255,255,.28); }

/* 三大模块入口卡片 */
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 24px; }
.module-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; text-align: center; transition: all .25s var(--ease); }
.module-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); border-color: var(--primary); }
.module-card .mc-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 26px; font-weight: 700; box-shadow: 0 8px 18px rgba(99,102,241,.3); }
.module-card .mc-title { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.module-card .mc-desc { font-size: 13px; color: var(--ink-3); line-height: 1.7; margin-bottom: 12px; min-height: 44px; }
.module-card .mc-count { font-size: 13px; color: var(--primary); font-weight: 400; }

/* SEO 介绍文本 */
.seo-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 30px; }
.seo-box h3 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 16px 0 8px; }
.seo-box h3:first-child { margin-top: 0; }
.seo-box p { font-size: 14px; color: var(--ink-2); line-height: 1.9; margin-bottom: 10px; }
.seo-box a { color: var(--primary); }
.seo-box a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .hero { padding: 36px 22px; }
  .hero h1 { font-size: 27px; }
  .hero-search { flex-direction: column; }
  .hero-search button { width: 100%; height: 46px; }
  .hero-search input { height: 46px; }
  .module-grid { grid-template-columns: 1fr; gap: 14px; }
  .module-card { padding: 22px 20px; }
  .module-card .mc-desc { min-height: 0; }
  .seo-box { padding: 20px 18px; }
}

/* ============ LOGO 重新设计（田字格图标） ============ */
.logo-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(99,102,241,.32);
}
.logo-text { font-size: 19px; font-weight: 800; color: var(--ink); letter-spacing: 1px; line-height: 1.15; white-space: nowrap; }
.logo-text span { display: block; font-size: 10px; font-weight: 500; color: var(--ink-3); letter-spacing: 1.5px; margin-top: 2px; }
.wap-header .logo-icon { width: 34px; height: 34px; border-radius: 10px; }
.wap-header .logo-icon svg { width: 22px; height: 22px; }
.wap-header .logo-text { font-size: 16px; }
.wap-header .logo-text span { display: none; }

/* ============================================
   移动端错位修复
   ============================================ */
@media (max-width: 768px) {
  /* 移动端 header：搜索框自适应剩余空间，避免 logo+固定宽度溢出 */
  .wap-header-main { gap: 10px; }
  .wap-search { flex: 1; min-width: 0; }
  .wap-search input { width: 100%; }

  /* 笔顺文字：长字符串换行，避免溢出 */
  .stroke-text { font-size: 16px; letter-spacing: 3px; line-height: 2; word-break: break-all; }

  /* 书写动图/笔顺图自适应 */
  .stroke-figure img.stroke-anim { max-width: 100%; }
  .stroke-figure img.stroke-step { max-width: 100%; }

  /* 详情拼音换行，避免长拼音溢出 */
  .detail-pinyin { word-break: break-all; letter-spacing: 1px; }

  /* 字段表格/释义块内边距收紧 */
  .field-item { padding: 11px 14px; }
  .field-label { min-width: 48px; }
  .explain-block { padding: 16px 15px; }

  /* 分字块自适应 */
  .fenzi { min-width: 56px; padding: 8px 10px; }
  .fenzi .zi { font-size: 16px; }

  /* 组词链接换行 */
  .group-link { margin: 3px 4px 3px 0; }
}

/* 释义富文本内容样式（basic_info/kangxizidian 等含旧站 HTML） */
.explain-block .eb-content h3 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 14px 0 6px; }
.explain-block .eb-content h3:first-child { margin-top: 0; }
.explain-block .eb-content p { margin-bottom: 8px; }
.explain-block .eb-content .indent { padding-left: 1.6em; }
.explain-block .eb-content .pinyin { color: var(--primary); }
.explain-block .eb-content .ml { margin-left: 6px; }
.explain-block .eb-content strong { font-weight: 700; }
@media (max-width: 768px) {
  .explain-block .eb-content { font-size: 14px; line-height: 1.85; }
}

/* ============================================
   栏目页精细化设计
   ============================================ */

/* 栏目页头部（渐变 Hero） */
.cat-hero {
  background: var(--grad);
  border-radius: var(--radius);
  padding: 32px 32px;
  margin-bottom: 20px;
  color: #fff;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.cat-hero::after {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 65%);
  pointer-events: none;
}
.cat-hero h1 { font-size: 26px; font-weight: 800; letter-spacing: 2px; position: relative; z-index: 1; }
.cat-hero .cat-desc { font-size: 14px; color: rgba(255,255,255,.92); margin-top: 8px; line-height: 1.7; position: relative; z-index: 1; }
.cat-hero .cat-desc b { color: #ffd66b; font-weight: 700; }
.cat-hero .cat-search { display: flex; gap: 10px; margin-top: 18px; max-width: 480px; position: relative; z-index: 1; }
.cat-hero .cat-search input { flex: 1; min-width: 0; height: 44px; padding: 0 18px; border: none; border-radius: 12px; font-size: 14px; outline: none; box-shadow: 0 6px 18px rgba(0,0,0,.15); }
.cat-hero .cat-search button { flex-shrink: 0; height: 44px; padding: 0 24px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; transition: all .2s; }
.cat-hero .cat-search button:hover { background: #1e293b; }

/* 部首分组 */
.bushou-group { margin-bottom: 18px; }
.bushou-group:last-child { margin-bottom: 0; }
.bushou-group .bg-title { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 10px; }

/* 修复移动端搜索框变形 */
@media (max-width: 768px) {
  .hero-search input { flex: none; width: 100%; }
  .cat-hero { padding: 24px 20px; }
  .cat-hero h1 { font-size: 22px; }
  .cat-hero .cat-search { flex-direction: column; }
  .cat-hero .cat-search input { flex: none; width: 100%; }
  .cat-hero .cat-search button { flex: none; width: 100%; }
  .tag-grid { gap: 8px; }
  .tag-grid a { padding: 7px 14px; font-size: 13px; }
}
