/* ============================================================
   汉字吧 hanzi8.com 全站样式 —— 古风宣纸 / 黛青朱砂 / 桌面左右分栏
   ============================================================ */
:root {
    --paper: #efe8d6;          /* 宣纸底 */
    --paper-deep: #e7dfc9;     /* 深宣纸（页头/渐变） */
    --card: #faf6ea;           /* 卡片宣纸白 */
    --ink: #2f2a22;            /* 墨色 */
    --ink-soft: #55493a;       /* 淡墨 */
    --muted: #8a7e66;          /* 褐灰 */
    --line: #d8cdb0;           /* 界格线 */
    --line-soft: #e6dec8;
    --primary: #35566b;        /* 黛青 */
    --primary-dark: #25414f;
    --accent: #a23e2c;         /* 朱砂 */
    --seal: #9d2f22;           /* 印章红 */
    --radius: 4px;
    --serif: "KaiTi", "STKaiti", "楷体", var(--song);
    --song: "Noto Serif SC", "Source Han Serif SC", "SimSun", "宋体", serif;
    --sans: "PingFang SC", "Microsoft YaHei", "微软雅黑", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font: 15px/1.75 var(--song);
    color: var(--ink);
    background: var(--paper);
    /* 宣纸暗纹 */
    background-image: repeating-linear-gradient(0deg, rgba(120, 100, 60, 0.028) 0 1px, transparent 1px 28px),
                      repeating-linear-gradient(90deg, rgba(120, 100, 60, 0.028) 0 1px, transparent 1px 28px);
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }
ul, ol { list-style: none; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 14px; }

/* ---------- 头部 ---------- */
.site-header {
    background: linear-gradient(180deg, var(--card), var(--paper));
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 #fff inset;
    position: relative;
}
.site-header::after {                      /* 底部双界线 */
    content: ""; display: block; height: 3px;
    border-top: 1px solid var(--seal); border-bottom: 1px solid var(--line);
    background: transparent; margin-bottom: 2px;
}
.topbar { display: flex; align-items: center; gap: 24px; padding: 16px 0 12px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-zi {
    display: block; width: 46px; height: 46px;
    border-radius: 6px; object-fit: cover;
    box-shadow: 0 0 0 1px #7d241a, 0 0 0 3px rgba(157,47,34,.25);
    transform: rotate(-2deg);
}
.logo b { font-size: 30px; color: var(--ink); font-family: var(--serif); letter-spacing: 6px; }
.logo i { font-style: normal; color: var(--muted); font-size: 13px; letter-spacing: 1px; }
.searchbar {
    display: flex; align-items: center; flex: 0 1 540px; margin-left: auto;
    border: 1px solid var(--ink-soft); border-radius: var(--radius);
    overflow: hidden; background: #fffdf6; box-shadow: 0 0 0 2px rgba(47, 42, 34, .06);
}
.search-tabs { display: flex; border-right: 1px solid var(--line); }
.search-tabs label { padding: 0 10px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 3px; }
.search-tabs input { accent-color: var(--seal); }
.searchbar input[type="text"] { flex: 1; border: 0; outline: 0; padding: 9px 12px; font-size: 14px; min-width: 0; background: transparent; font-family: var(--song); color: var(--ink); }
.searchbar button {
    border: 0; background: var(--primary); color: #f4eedb; padding: 9px 24px;
    font-size: 15px; cursor: pointer; font-family: var(--serif); letter-spacing: 2px;
}
.searchbar button:hover { background: var(--primary-dark); }
.mainnav { border-top: 1px solid var(--line-soft); }
.mainnav ul { display: flex; flex-wrap: wrap; }
.mainnav a {
    display: block; padding: 10px 17.5px; font-size: 17px;
    color: var(--ink); font-family: var(--serif); letter-spacing: 2px;
    border-bottom: 3px solid transparent; margin-bottom: -3px;
}
.mainnav a:hover, .mainnav a.on {
    color: var(--seal); border-bottom-color: var(--seal); text-decoration: none;
}
.crumbs-wrap { padding: 10px 0 0; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs em { font-style: normal; color: var(--ink-soft); }

/* ---------- 主区：桌面左右分栏（主栏 + 侧栏） ---------- */
main.container { padding-top: 16px; padding-bottom: 34px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }

/* ---------- 区块卡片（古籍册页风） ---------- */
.box {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 20px 14px; margin-bottom: 18px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.6) inset, 0 2px 6px rgba(90, 73, 58, .07);
    position: relative;
}
.box-title {
    font-family: var(--serif);
    font-size: 19px; font-weight: 700; letter-spacing: 2px;
    color: var(--ink);
    padding-left: 12px; padding-bottom: 8px; margin-bottom: 12px;
    border-left: 4px solid var(--seal);
    border-bottom: 1px solid var(--line-soft);
    display: flex; align-items: center; justify-content: space-between;
}
.box-title .more { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; font-family: var(--sans); }
.box h3.sub { font-size: 15px; color: var(--seal); margin: 16px 0 8px; font-family: var(--serif); letter-spacing: 1px; }

/* ---------- 右侧栏面板 ---------- */
.layout-side .panel {
    background: var(--card);
    border: 1px solid var(--line); border-radius: var(--radius);
    margin-bottom: 18px;
    box-shadow: 0 2px 6px rgba(90, 73, 58, .07);
    overflow: hidden;
}
.panel-title {
    font-family: var(--serif); font-size: 16px; letter-spacing: 2px;
    color: #f4eedb; background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    padding: 7px 14px 6px;
}
.panel-body { padding: 10px 14px 12px; }
.panel-links { display: flex; flex-wrap: wrap; gap: 4px 0; }
.panel-links a {
    font-size: 13px; color: var(--ink-soft); font-family: var(--song);
    padding: 2px 10px 2px 0; margin-right: 10px; border-right: 1px solid var(--line-soft);
}
.panel-links a:last-child { border-right: 0; }
.side-query li { border-bottom: 1px dashed var(--line-soft); }
.side-query li:last-child { border-bottom: 0; }
.side-query a { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; }
.side-query a:hover { text-decoration: none; color: var(--accent); }
.side-query i { font-style: normal; font-size: 12px; color: var(--accent); min-width: 86px; }
.side-query b { font-weight: 400; font-size: 14px; color: var(--primary); }
.daily-side { text-align: center; }
.daily-side-zi { display: block; margin: 4px auto 2px; width: 110px; position: relative; }
.daily-side-zi .side-svg {
    width: 110px; height: 110px; color: var(--ink);
    /* 每日一字：同款带边框米字格 */
    background: url('/static/images/zibg.gif') center / 100% 100% no-repeat;
    border: 1px solid var(--line);
}
.daily-side-zi b { display: none; }
.daily-side .py { color: var(--accent); font-size: 17px; margin: 6px 0 8px; }

/* ---------- 单字 chip（字牌） ---------- */
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cchip {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 56px; padding: 4px 8px;
    border: 1px solid var(--line); border-radius: 3px;
    background: #fffdf4; text-decoration: none;
}
.cchip:hover { border-color: var(--seal); background: var(--paper); text-decoration: none; }
.cchip i { font-style: normal; font-size: 12px; color: var(--accent); line-height: 1.3; max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cchip b { font-size: 21px; color: var(--ink); font-family: var(--serif); line-height: 1.45; }

/* 词条 chip */
.wchip {
    display: inline-flex; align-items: baseline; gap: 5px;
    padding: 3px 11px; border: 1px solid var(--line); border-radius: 3px;
    background: #fffdf4;
}
.wchip:hover { border-color: var(--seal); background: var(--paper); text-decoration: none; }
.wchip i { font-style: normal; font-size: 12px; color: var(--muted); }
.wchip b { font-size: 15px; font-weight: 400; }

/* 普通链接列表 */
.link-list { display: flex; flex-wrap: wrap; gap: 6px 4px; }
.link-list a {
    display: inline-block; padding: 2px 12px; font-size: 14px;
    color: var(--primary); border-right: 1px solid var(--line-soft);
}
.link-list a:last-child { border-right: 0; }
.link-list.tight a { padding: 2px 8px; font-size: 13px; }

/* ---------- 分组列表 ---------- */
.group-list dl { display: flex; margin-bottom: 6px; }
.group-list dt { flex: 0 0 110px; color: var(--seal); font-weight: 700; font-size: 14px; padding-top: 3px; font-family: var(--serif); }
.group-list dd { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- 分页 ---------- */
.pager { display: flex; flex-wrap: wrap; gap: 6px; padding: 16px 0 4px; }
.pager a, .pager strong, .pager .gap {
    display: inline-block; min-width: 34px; text-align: center;
    padding: 5px 10px; border: 1px solid var(--line); border-radius: 3px;
    background: #fffdf4; font-size: 14px;
}
.pager strong { background: var(--seal); border-color: var(--seal); color: #f4eedb; }
.pager .gap { border: 0; }

/* ---------- 详情页 ---------- */
.detail-head { display: flex; gap: 26px; align-items: flex-start; }
.zi-card {
    flex: 0 0 195px; text-align: center;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 10px 12px;
    box-shadow: 0 0 0 3px rgba(47, 42, 34, .05) inset;
}
.zi-card .zi-svg {
    width: 152px; height: 152px;
    /* 米字格背景（static/images/zibg.gif，透明底虚线）+ 界格实线边框 */
    background: url('/static/images/zibg.gif') center / 100% 100% no-repeat;
    border: 1px solid var(--line);
}
.zi-card .zi-svg-txt { font-family: var(--serif); font-size: 120px; line-height: 1.2; color: var(--ink); }
.zi-card .py { font-size: 20px; color: var(--accent); margin-top: 6px; }
.zi-card .py small { font-size: 14px; color: var(--muted); display: block; }
.zi-card .acts { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.zi-card .acts a { font-size: 13px; }
.zi-meta { flex: 1; min-width: 0; }
.zi-meta h1 { font-size: 26px; color: var(--ink); font-family: var(--serif); margin-bottom: 10px; letter-spacing: 2px; }
.zi-meta h1 small {
    display: inline; font-size: 13px; font-weight: 400; letter-spacing: 1px;
    color: var(--ink-soft); margin-top: 6px; font-family: var(--sans, sans-serif);
}
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 4px 18px; font-size: 14px; }
.info-grid div { padding: 3px 0; border-bottom: 1px dashed var(--line-soft); }
.info-grid span { color: var(--muted); margin-right: 4px; }
.section-body { font-size: 15px; }
.section-body p { margin: 6px 0; }
.section-body dl.pron { margin: 4px 0 10px; }
.section-body dl.pron dt { font-size: 17px; color: var(--accent); font-weight: 600; margin-top: 8px; }
.section-body dl.pron dd { margin: 4px 0 4px 6px; }
.section-body .src { color: var(--muted); }
.kv-list li { padding: 5px 0; border-bottom: 1px dashed var(--line-soft); }
.kv-list li:last-child { border-bottom: 0; }

/* 百科解释：单行数据源拆出的「标签：值」键值排版 */
.bk-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 18px; margin: 4px 0 8px; font-size: 14px; }
.bk-kv dt { color: var(--muted); white-space: nowrap; }
.bk-kv dt::after { content: "："; }
.bk-kv dd { margin: 0; min-width: 0; word-break: break-word; }
.bk-kv dt, .bk-kv dd { padding: 4px 0; border-bottom: 1px dashed var(--line-soft); }
.bk-kv dt:last-of-type, .bk-kv dd:last-of-type { border-bottom: 0; }

/* 底部锚点 tab */
.anchor-tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    background: var(--card); border-top: 1px solid var(--line);
    box-shadow: 0 -2px 8px rgba(90, 73, 58, .12);
    overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch;
}
.anchor-tabs a { display: inline-block; padding: 10px 16px; font-size: 14px; color: var(--ink-soft); font-family: var(--serif); }
.anchor-tabs a:hover, .anchor-tabs a.on { color: var(--seal); text-decoration: none; font-weight: 700; }
body.has-anchors { padding-bottom: 46px; }

/* 表格 */
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
table.grid th { background: var(--paper); color: var(--ink); font-family: var(--serif); }

/* 列表页（时间序） */
.entry-list li { padding: 10px 2px; border-bottom: 1px dashed var(--line-soft); }
.entry-list li:last-child { border-bottom: 0; }
.entry-list h3 { font-size: 16px; font-weight: 600; font-family: var(--serif); }
.entry-list .py { color: var(--accent); font-size: 14px; margin-right: 8px; }
.entry-list .excerpt { color: var(--muted); font-size: 13px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* 搜索结果 */
.result-list li { padding: 12px 2px; border-bottom: 1px dashed var(--line-soft); }
.result-list h3 { font-size: 16px; }
.result-list p { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* 404 */
.box-404 { text-align: center; padding: 60px 20px; }
.box-404 h1 { font-size: 42px; color: var(--ink); margin-bottom: 12px; font-family: var(--serif); }
.box-404 p { color: var(--muted); margin-bottom: 20px; }
.box-404 .link-list { justify-content: center; }

/* ---------- 释义排版（参考汉语国学风格） ---------- */
.zi-svg { color: var(--ink); }
.zi-svg path { fill: currentColor; }
.pron-html dl { margin: 4px 0 10px; }
.pron-html dt { font-size: 17px; color: var(--ink); font-weight: 700; margin-top: 12px; font-family: var(--serif); }
.pron-html dt .pinyin-font, .pron-html dt a { color: var(--accent); }
.pron-html dd { margin: 6px 0 4px; }

/* 基本解释：带圈数字义项 ①②③，例词紧跟释义，悬挂缩进 */
.pron-html dl > dd { counter-reset: jb 0; }
.pron-html dl > dd > p {
    counter-increment: jb;
    padding-left: 30px; text-indent: -30px;
    margin: 6px 0;
}
.pron-html dl > dd > p::before {
    content: counter(jb, circled-decimal);
    color: var(--seal); font-weight: 700; margin-right: 5px; font-size: 15px;
}

/* 详细解释：义项 1.2.3. 编号；引文/又如等辅文缩进淡化 */
.pron-html ol { counter-reset: xj 0; margin: 8px 0; }
.pron-html ol > li { margin: 0 0 12px; }
.pron-html ol > li > p:first-child { counter-increment: xj; padding-left: 26px; text-indent: -26px; margin: 0; }
.pron-html ol > li > p:first-child::before {
    content: counter(xj) ".";
    color: var(--seal); font-weight: 700; margin-right: 9px;
}
.pron-html ol > li > p:not(:first-child) {
    color: var(--ink-soft); font-size: 14px;
    margin: 3px 0 3px 26px; line-height: 1.8;
}

/* 详细解释：词性行（〈动〉〈名〉）用中文序号，独立于条目 1.2.3. 计数 */
#xiangjie .pron-html dl > dd { counter-reset: xjpos 0; }
#xiangjie .pron-html dl > dd > p:has(> strong) {
    counter-increment: xjpos;
    padding-left: 0; text-indent: 0;
    margin: 14px 0 2px;
}
#xiangjie .pron-html dl > dd > p:has(> strong)::before {
    content: counter(xjpos, cjk-ideographic) "、";
}

.pron-html span { color: var(--primary); }
.pron-html hr { border: 0; border-top: 1px dashed var(--line); margin: 10px 0; }
.py-item { margin: 0 6px; }
.py-item .snd { font-size: 13px; text-decoration: none; margin-left: 2px; }
.hint { color: var(--muted); font-size: 13px; }

/* 字形图片（单张，嵌入各区块内容右侧浮动） */
.zi-gal { float: right; width: 110px; margin: -67px -17px 10px 18px; }
.zi-gal-item {
    background: #fffdf4; border: 1px solid var(--line); border-radius: 3px;
    padding: 8px 6px 4px; text-align: center;
}
.zi-gal-item img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.zi-gal-item figcaption { font-size: 12px; color: var(--muted); padding-top: 4px; border-top: 1px dashed var(--line-soft); margin-top: 4px; }
@media (max-width: 768px) {
    .zi-gal { float: none; width: auto; max-width: 200px; margin: 0 auto 12px; }
}

/* ---------- 字典详情：现代汉语词典第7版 / 文言文 / 两岸 / 中華大字典 ---------- */
.cd7-html .cd7-py {
    font-style: normal; font-weight: 700; color: var(--accent);
    margin-right: 8px; font-size: 17px; font-family: var(--serif);
}
.cd7-html p { line-height: 2; }

.wyw-html .py-line { margin: 10px 0 2px; color: var(--accent); font-size: 17px; font-family: var(--serif); }
.wyw-list { margin: 2px 0 6px; }
.wyw-list li {
    margin: 7px 0; padding: 2px 0 2px 14px; position: relative; line-height: 1.9;
    border-bottom: 1px dashed var(--line-soft);
}
.wyw-list li:last-child { border-bottom: 0; }
.wyw-list li::before { content: "◦"; position: absolute; left: 0; color: var(--seal); }
.wyw-html .fontred, .pron-html .fontred { color: var(--seal); font-weight: 600; }

.liangan-html .lg-entry { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px dashed var(--line-soft); }
.liangan-html .lg-entry:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.lg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.lg-tag {
    display: inline-block; padding: 0 8px; font-size: 12px; line-height: 21px;
    color: #f4eedb; background: var(--primary); border-radius: 3px; font-family: var(--sans);
}
.lg-word { font-family: var(--serif); font-size: 18px; }
.lg-tw { color: var(--muted); font-size: 13px; }
.lg-py { color: var(--accent); font-weight: 600; }
.lg-zy { color: var(--muted); font-size: 13px; }
.lg-body { line-height: 1.95; }
.lg-body .lg-item { margin: 2px 0; }

.zhdzd-html { line-height: 2; }
.zhdzd-html p { margin: 0; }

/* ---------- 字典详情：康熙字典（【又】分行 + 考證独立块） ---------- */
.kx-entry { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px dashed var(--line-soft); }
.kx-entry:last-of-type { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.kx-path { margin-bottom: 4px; }
.kx-attr { display: inline-block; margin-left: 10px; color: var(--ink-soft); }
.kx-jieshi { line-height: 2.05; }
.kx-you {
    display: inline-block; margin: 0 6px 0 2px; padding: 0 7px;
    font-size: 12px; line-height: 20px; letter-spacing: 1px;
    color: #f4eedb; background: var(--primary); border-radius: 3px;
    vertical-align: 2px; font-family: var(--serif);
}
.kx-kaozheng {
    margin-top: 10px; padding: 8px 12px; line-height: 1.9;
    background: var(--paper); border-left: 3px solid var(--line);
    color: var(--ink-soft); font-size: 14px;
}
.kx-kz-badge {
    display: inline-block; margin-right: 8px; padding: 0 7px;
    font-size: 12px; line-height: 20px; color: #f4eedb;
    background: var(--muted); border-radius: 3px; font-family: var(--serif);
}
.kx-pages { margin-top: 12px; font-size: 13px; }
.kx-pages span { display: block; margin: 2px 0; }

/* ---------- 字典详情：说文解字（全字段 enriched） ---------- */
.sw-pics {
    display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px;
    padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 3px;
}
.sw-pic { width: 96px; text-align: center; }
.sw-pic img {
    display: block; width: 84px; height: 84px; object-fit: contain; margin: 0 auto;
    background: #fffdf4; border: 1px solid var(--line-soft); border-radius: 3px; padding: 4px;
}
.sw-pic figcaption {
    font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 4px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sw-meta { margin-bottom: 4px; }
.sw-original { margin: 6px 0; font-size: 16px; line-height: 2; }
.sw-original strong { font-family: var(--serif); font-size: 20px; color: var(--seal); }
.sw-duyin { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.dy-chip {
    display: inline-flex; align-items: baseline; gap: 6px;
    padding: 3px 10px; border: 1px solid var(--line); border-radius: 3px;
    background: #fffdf4; font-size: 13px;
}
.dy-chip i { font-style: normal; color: var(--muted); }
.sw-versions dt {
    font-weight: 700; color: var(--primary); font-family: var(--serif);
    margin-top: 10px; padding-left: 10px; border-left: 3px solid var(--line);
}
.sw-versions dd { margin: 4px 0 0 12px; }
.sw-versions dd p { margin: 3px 0; line-height: 1.95; }
.sw-duan li { padding: 6px 0; border-bottom: 1px dashed var(--line-soft); line-height: 1.95; }
.sw-duan li:last-child { border-bottom: 0; }
.sw-duan strong { color: var(--seal); }
.sw-variants li { margin: 4px 0; }
.sw-variants .vzi { font-family: var(--serif); font-size: 17px; color: var(--accent); }
.sw-pages li { margin: 3px 0; font-size: 14px; }
.sw-pages li i { font-style: normal; color: var(--muted); margin-right: 8px; }

/* ---------- 英语单词栏目 /danci/ ---------- */
.en-font { font-family: Georgia, "Times New Roman", "Times", serif; }
.en-nav a.on { color: var(--seal); font-weight: 700; }
.en-letters a { text-transform: lowercase; min-width: 26px; text-align: center; }
.eword-list { display: flex; flex-wrap: wrap; gap: 8px; }
.eword-list li a {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 104px; max-width: 180px; padding: 5px 10px 4px;
    border: 1px solid var(--line); border-radius: 3px; background: #fffdf4;
}
.eword-list li a:hover { border-color: var(--seal); background: var(--paper); text-decoration: none; }
.eword-list i {
    font-style: normal; font-size: 12px; color: var(--muted); line-height: 1.5;
    max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.eword-list b {
    font-family: Georgia, "Times New Roman", serif; font-size: 15px; font-weight: 600;
    color: var(--primary); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.en-head { align-items: stretch; }
.en-card { flex-basis: 235px; }
.en-spelling {
    font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 700;
    color: var(--ink); margin: 6px 0 8px; word-break: break-all; line-height: 1.3;
}
.en-py { display: flex; flex-direction: column; gap: 5px; font-size: 15px; color: var(--ink-soft); }
.en-py span b { color: var(--muted); font-weight: 400; }
/* 英/美发音播放按钮（仿 ico5 UK/US 徽标钮） */
.en-audio-btn {
    display: inline-block; margin-left: 7px; padding: 0 10px;
    font: 700 12px/21px var(--sans); color: #f4eedb; letter-spacing: 1px;
    background: var(--primary); border: 0; border-radius: 11px; cursor: pointer;
    vertical-align: 1px;
}
.en-audio-btn.us { background: var(--accent); }
.en-audio-btn:hover { background: var(--primary-dark); }
.en-audio-btn.us:hover { background: #7d241a; }
.en-audio-btn:active { transform: translateY(1px); }
.en-freq { margin-top: 10px; font-size: 14px; color: var(--accent); letter-spacing: 2px; }
.en-freq em { font-style: normal; color: var(--muted); letter-spacing: 0; margin-left: 6px; font-size: 13px; }
.en-sub { margin-top: 0; }
.en-meaning p { margin: 8px 0; line-height: 2; }
.en-liju { margin: 4px 0; }
.en-liju li { padding: 10px 2px; border-bottom: 1px dashed var(--line-soft); }
.en-liju li:last-child { border-bottom: 0; }
.en-liju .en { font-family: Georgia, "Times New Roman", serif; font-size: 16px; color: var(--ink); line-height: 1.8; }
.en-liju .cn { color: var(--muted); font-size: 14px; margin-top: 3px; }
.en-chip b { font-family: Georgia, "Times New Roman", serif; }
.wchip.cur { background: var(--seal); border-color: var(--seal); }
.wchip.cur b { color: #f4eedb; font-weight: 700; }

/* ---------- 笔顺页 ---------- */
.bishun-head { display: flex; gap: 26px; align-items: flex-start; }
.bishun-anim { flex: 0 0 300px; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.hw-target { width: 260px; height: 260px; margin: 0 auto; background: #fffdf4; border-radius: 6px; }
.hw-btns { margin-top: 12px; display: flex; gap: 10px; justify-content: center; }
.hw-btns button { border: 1px solid var(--primary); background: #fffdf4; color: var(--primary); border-radius: 3px; padding: 6px 20px; cursor: pointer; font-size: 14px; font-family: var(--serif); }
.hw-btns button:hover { background: var(--primary); color: #f4eedb; }
.bishun-info { flex: 1; min-width: 0; }
.bishun-info h1 { font-size: 22px; color: var(--ink); font-family: var(--serif); margin-bottom: 8px; letter-spacing: 1px; }
.bh-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.bh-steps li { border: 1px solid var(--line); border-radius: 3px; padding: 3px 10px; font-size: 14px; background: #fffdf4; }
.bh-steps li i { font-style: normal; color: var(--seal); margin-right: 6px; font-weight: 700; }
.bishun-img { text-align: center; padding: 10px 0; }
.bishun-img img { max-width: 100%; height: auto; }
.zi-svg.big { width: 200px; height: 200px; }

/* 笔顺分步网格（服务端渲染的逐笔字形） */
.bh-steps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.bh-step { background: #fffdf4; border: 1px solid var(--line); border-radius: 3px; padding: 6px 6px 4px; text-align: center; }
.bh-step svg { display: block; width: 100%; height: auto; aspect-ratio: 1/1; }
.bh-step figcaption { font-size: 12px; color: var(--ink-soft); padding-top: 3px; border-top: 1px dashed var(--line-soft); margin-top: 2px; }
.bh-step figcaption i { font-style: normal; color: var(--seal); font-weight: 700; margin-right: 5px; }

/* 字典数据源分步图（83×109 米字格单元，仿百度汉语） */
.bh-steps-grid.bdhy { grid-template-columns: repeat(auto-fill, 87px); gap: 8px; }
.bh-steps-grid.bdhy .bh-step { background: transparent; border: 0; padding: 0; }
.bh-steps-grid.bdhy .bh-unit {
    width: 83px; height: 109px;
    background: url('/static/assets/img/stroke-grid.svg') no-repeat;
    background-size: 100% 100%;
}
.bh-steps-grid.bdhy .bh-unit svg { display: block; width: 83px; height: 83px; aspect-ratio: auto; }
.bh-part { font-size: 12px; line-height: 26px; text-align: center; font-weight: 700; color: var(--ink); }
.bh-part .num { color: #b8b8b8; margin-right: 5px; }
.bh-val { width: 83px; margin: 8px auto 0; font-size: 14px; text-align: center; color: var(--ink-soft); }

/* 笔画顺序 GIF 演示（bsbh） */
ul.bsbh { display: flex; flex-wrap: wrap; margin-top: 12px; }
ul.bsbh li {
    background: #fffdf4;
    border: 1px solid var(--line);
    display: block; width: 78px; margin: 0 6px 6px 0;
    text-align: center; overflow: hidden; border-radius: 3px;
    padding-bottom: 2px;
}
ul.bsbh li:hover { border-color: var(--seal); }
ul.bsbh li .bsshu { display: block; font-size: 15px; text-align: center; line-height: 28px; color: var(--seal); font-weight: 700; }
ul.bsbh li img { display: block; width: 34px; height: 34px; border: 0; margin: auto; }
ul.bsbh .bsname { display: block; width: 100%; line-height: 26px; font-size: 14px; color: var(--ink-soft); overflow: hidden; white-space: nowrap; }

/* ---------- 词语/成语详情 ---------- */
.word-head { display: flex; gap: 26px; align-items: flex-start; }
.word-card {
    flex: 0 0 225px; text-align: center;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px 12px 14px;
    box-shadow: 0 0 0 3px rgba(47, 42, 34, .05) inset;
}
.word-card h1 { font-size: 34px; color: var(--ink); font-family: var(--serif); letter-spacing: 2px; }
.word-card .py { margin: 8px 0; font-size: 18px; color: var(--accent); }
.word-card .acts { display: flex; flex-direction: column; gap: 6px; }
.word-card .acts a { font-size: 13px; }
.word-meta { flex: 1; min-width: 0; }
.gushi-title { font-size: 26px; color: var(--ink); font-family: var(--serif); margin-bottom: 8px; letter-spacing: 2px; }
.gushi-content p { margin: 10px 0; text-indent: 2em; line-height: 2; }
.zaoju-list { padding-left: 24px; list-style: decimal; }
.zaoju-list li { margin: 8px 0; line-height: 1.9; }

/* ---------- 接龙 ---------- */
.jl-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#jl-input {
    flex: 1; min-width: 220px; padding: 9px 12px; font-size: 15px;
    border: 1px solid var(--ink-soft); border-radius: 3px; background: #fffdf6; font-family: var(--song); outline: none;
}
.jl-controls button {
    border: 1px solid var(--primary); background: var(--primary); color: #f4eedb;
    border-radius: 3px; padding: 8px 20px; cursor: pointer; font-size: 14px; font-family: var(--serif);
}
.jl-controls button:hover { background: var(--primary-dark); }
.jl-mode { font-size: 13px; color: var(--muted); }
#jl-chain { margin: 14px 0 8px; padding-left: 24px; list-style: cjk-ideographic; }
#jl-chain li { margin: 6px 0; font-size: 16px; }
#jl-candidates a { display: inline-block; padding: 2px 12px; font-size: 14px; border-right: 1px solid var(--line-soft); }

/* ---------- 页脚 ---------- */
.site-footer { background: linear-gradient(180deg, var(--card), var(--paper)); border-top: 1px solid var(--line); margin-top: 12px; }
.site-footer::before { content: ""; display: block; height: 3px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--seal); }
.foot-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; padding: 22px 0 10px; }
.fl-block h4 { font-size: 14px; color: var(--ink); margin-bottom: 8px; font-family: var(--serif); letter-spacing: 1px; }
.fl-block p { display: flex; flex-wrap: wrap; gap: 2px 0; margin-bottom: 4px; }
.fl-block p a { font-size: 13px; color: var(--muted); padding: 2px 10px 2px 0; margin-right: 10px; border-right: 1px solid var(--line-soft); }
.fl-block p a:last-child { border-right: 0; }
.fl-block p.strokes a { padding: 2px 6px; margin-right: 0; border-right: 0; }
.foot-copy { border-top: 1px solid var(--line-soft); padding: 14px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- 页脚分列容器与友情链接 ---------- */
.fl-col { display: flex; flex-direction: column; gap: 14px; }
.friend-links { padding: 14px 0 4px; font-size: 13px; color: var(--muted); }
.friend-links strong { color: var(--ink); font-family: var(--serif); letter-spacing: 1px; margin-right: 8px; }
.friend-links a { color: var(--muted); margin-right: 16px; }
.friend-links a:hover { color: var(--accent); }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
    .layout { grid-template-columns: 1fr; }        /* 单栏，侧栏沉底 */
    .layout-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
    .layout-side .panel { margin-bottom: 0; }
}
@media (max-width: 768px) {
    .topbar { gap: 12px; padding: 10px 0; justify-content: center; }
    .searchbar { order: 3; flex-basis: 100%; max-width: none; }
    .mainnav ul { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
    .mainnav ul li { flex: 0 0 auto; }
    .mainnav a { padding: 9px 13px; font-size: 15px; }
    .detail-head, .word-head, .bishun-head { flex-direction: column; }
    .zi-card, .word-card { flex: none; width: 100%; }
    .info-grid { grid-template-columns: 1fr 1fr; }
    .group-list dl { flex-direction: column; }
    .group-list dt { flex: none; margin-bottom: 4px; }   /* 重置 basis：纵向下 110px 会变成高度 */
    .bishun-anim { flex: none; margin: 0 auto 14px; }    /* 移动端纵排时书写动画框居中 */
    .layout-side { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .info-grid { grid-template-columns: 1fr; }
    .cchip { min-width: 48px; }
    .cchip b { font-size: 18px; }
}

/* ---------- 字典详情：國語辭典（单字） ---------- */
.gy-head { margin-bottom: 6px; }
.gy-head strong { color: var(--ink); font-family: var(--serif); font-size: 16px; }
.gy-attr { color: var(--muted); margin-left: 12px; font-size: 13px; }
.guoyu-html .gy-entry { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px dashed var(--line-soft); }
.guoyu-html .gy-entry:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.gy-pos { color: var(--seal); font-weight: 700; font-family: var(--serif); margin: 8px 0 2px; }
.gy-item { padding-left: 26px; text-indent: -26px; margin: 5px 0; }
.gy-sub { margin: 3px 0 3px 26px; color: var(--ink-soft); font-size: 14px; }

/* 大家正在看（侧栏实时浏览记录，JS 填充） */
.side-views { list-style: none; margin: 0; padding: 0; }
.side-views li { border-bottom: 1px dashed var(--line-soft); }
.side-views li:last-child { border-bottom: 0; }
.side-views a {
    display: block; padding: 5px 0; font-size: 14px; color: var(--primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-views a:hover { text-decoration: none; color: var(--accent); }
.side-views a::before { content: '·'; color: var(--accent); margin-right: 6px; }

/* 诗词栏目（名句 / 词牌平仄谱） */
.mj-list { list-style: none; margin: 0; padding: 0; }
.mj-list li { border-bottom: 1px dashed var(--line-soft); }
.mj-list li:last-child { border-bottom: 0; }
.mj-list a { display: block; padding: 10px 4px; text-decoration: none; }
.mj-list a:hover { text-decoration: none; }
.mj-list a:hover .mj-ju { color: var(--accent); }
.mj-list .mj-ju { margin: 0 0 3px; font-size: 16px; color: var(--ink); font-family: var(--serif); }
.mj-list .mj-src { margin: 0; font-size: 13px; color: var(--ink-soft); }
.mj-detail-ju { margin: 6px 0 8px; font-size: 22px; color: var(--ink); font-family: var(--serif); line-height: 1.7; }
.mj-detail-src { margin: 0; color: var(--ink-soft); }
.yun-part { margin: 0 0 12px; }
.yun-part dt { font-weight: 700; color: var(--seal); margin: 6px 0 4px; font-family: var(--serif); }
.yun-part dd { margin: 0; }
.cp-format { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px dashed var(--line-soft); }
.cp-format:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.cp-pu { margin: 8px 0; line-height: 2; }
.cp-tune {
    display: inline-flex; flex-direction: column; align-items: center;
    min-width: 28px; margin: 2px 3px; padding: 5px 2px 2px;
    border: 1px solid var(--line); border-radius: 3px;
    font-family: var(--serif); font-size: 16px; line-height: 1.1;
}
.cp-tune i { font-style: normal; font-size: 11px; color: var(--accent); }
.cp-tune.z { color: var(--ink-soft); background: rgba(0,0,0,.03); }
.cp-tune.p { color: var(--accent); }
.cp-tune.s { color: var(--primary); }
.cp-intro, .cp-note { color: var(--ink-soft); line-height: 1.9; }

/* 古诗文（works/作者/标签） */
.sc-list { list-style: none; margin: 0; padding: 0; }
.sc-list li { border-bottom: 1px dashed var(--line-soft); }
.sc-list li:last-child { border-bottom: 0; }
.sc-list a { display: flex; align-items: baseline; gap: 12px; padding: 8px 4px; text-decoration: none; }
.sc-list a:hover { text-decoration: none; }
.sc-list a:hover .sc-title { color: var(--accent); }
.sc-list .sc-title { flex: 1; min-width: 0; margin: 0; font-size: 15px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-list .sc-src { margin: 0 0 0 auto; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.poem-body { font-family: var(--serif); font-size: 17px; line-height: 2; color: var(--ink); }

/* 辞书详情页说文区块（dicts/detail 上下文） */
.sw-html .sw-pic { margin: 0; }

/* 常见字词专题 */
.zt-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.zt-table th { text-align: left; font-size: 13px; color: var(--ink-soft); padding: 6px 10px; border-bottom: 2px solid var(--line); font-weight: 700; }
.zt-table td { padding: 8px 10px; border-bottom: 1px dashed var(--line-soft); font-size: 15px; vertical-align: top; }
.zt-table tr:last-child td { border-bottom: 0; }
.zt-wrong { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(162,62,44,.55); }
.zt-right { color: var(--ink); font-weight: 700; }
.zt-right a { color: var(--accent); }
.zt-zi { font-size: 17px; font-family: var(--serif); }
.zt-note { color: var(--ink-soft); font-size: 13px; }
.zt-pair { display: inline-block; margin: 2px 14px 2px 0; }
.zt-pair b { color: var(--accent); margin-right: 6px; }

/* 笔顺易错字专题：动画卡网格 */
.zt-anim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-top: 10px; }
.zt-anim-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; background: #fffdf6; }
.zt-hw { width: 120px; height: 120px; margin: 0 auto; background: #fffdf4; border: 1px solid var(--line-soft); border-radius: 4px; }
.zt-hw.zt-hw-nodata { display: flex; align-items: center; justify-content: center; }
.zt-hw.zt-hw-nodata .zi-svg { width: 90px; height: 90px; }
.zt-hw-play { display: block; margin: 8px auto 0; border: 1px solid var(--primary); background: #fffdf4; color: var(--primary); border-radius: 3px; padding: 4px 14px; cursor: pointer; font-size: 13px; font-family: var(--serif); }
.zt-hw-play:hover { background: var(--primary); color: #f4eedb; }
.zt-anim-zi { margin: 8px 0 2px; font-size: 16px; text-align: center; font-family: var(--serif); }
.zt-anim-zi a { color: var(--ink); }
.zt-anim-zi .more { font-size: 12px; color: var(--muted); margin-left: 8px; }
.zt-anim-order, .zt-anim-note { margin: 3px 0; font-size: 13px; color: var(--ink-soft); line-height: 1.7; }
.zt-anim-order b { color: var(--ink); }

/* 小学必背古诗词75首 */
.p75-entry { padding: 14px 0; border-bottom: 1px dashed var(--line-soft); }
.p75-entry:last-child { border-bottom: 0; }
.p75-title { font-size: 18px; color: var(--ink); font-family: var(--serif); margin: 0 0 6px; }
.p75-title a { color: var(--accent); }
.p75-src { font-size: 13px; color: var(--ink-soft); font-family: var(--sans, sans-serif); font-weight: 400; margin-left: 10px; }

/* ---------- 字形分解（makemeahanzi） ---------- */
.fj-head { display: flex; gap: 26px; align-items: flex-start; }
.fj-big { flex: 0 0 240px; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.fj-info { flex: 1; min-width: 0; }
.fj-info h1 { font-size: 22px; color: var(--ink); font-family: var(--serif); letter-spacing: 1px; margin-bottom: 8px; }

/* 分解树 */
.fj-tree { margin-top: 12px; display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.fj-op { font-size: 20px; color: var(--seal); font-family: var(--serif); border: 1px solid var(--line); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: #fffdf4; flex: 0 0 auto; }
.fj-branches { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.fj-leaf { display: flex; align-items: center; gap: 6px; }
.fj-chip { font-size: 22px; font-family: var(--serif); color: var(--ink); background: #fffdf4; border: 1px solid var(--line); border-radius: 4px; padding: 4px 12px; line-height: 1.4; }
.fj-chip a { color: var(--ink); }
.fj-chip a:hover { color: var(--seal); border-color: var(--seal); }
.fj-chip.unk { color: var(--muted); }
.fj-chip-sm { font-size: 15px; padding: 1px 8px; }
.fj-op-sm { color: var(--muted); font-size: 13px; }
.fj-sub { display: flex; gap: 6px; align-items: center; border-left: 2px solid var(--line-soft); padding-left: 8px; flex-wrap: wrap; }
.fj-sub .fj-chip { font-size: 15px; padding: 1px 8px; }

/* 部件构成图 + 图例 */
.fj-parts-wrap { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-top: 8px; }
.fj-parts-wrap svg.fj-parts { width: 260px; height: 260px; background: #fffdf4; border: 1px solid var(--line); border-radius: 6px; }
.fj-parts-sm svg.fj-parts { width: 200px; height: 200px; }
.fj-legend { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.fj-lg-item { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 3px; padding: 3px 8px; background: #fffdf4; font-size: 15px; }
.fj-lg-item i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }

/* 部件-笔画分组 */
table.fj-groups { margin-top: 14px; border-collapse: collapse; width: 100%; font-size: 14px; }
.fj-groups th, .fj-groups td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.fj-groups th { background: var(--paper); font-family: var(--serif); }
.fj-groups-inline { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.fj-gi { border: 1px dashed var(--line-soft); border-radius: 3px; padding: 3px 8px; font-size: 14px; color: var(--ink-soft); }
.fj-gi .fj-chip-sm { border: 0; padding: 0 2px 0 0; background: none; color: var(--ink); }

/* 彩色序号笔顺图（makemeahanzi svgs-still 内联，内部调色已剥离由本表接管，宣纸色系） */
.fj-still-wrap { text-align: center; margin-top: 8px; }
.fj-still-wrap svg.fj-still { width: 340px; max-width: 100%; height: auto; background: #fffdf4; border: 1px solid var(--line); border-radius: 6px; }
.fj-still text { font-family: var(--sans, sans-serif); font-size: 50px; fill: #fffdf4; paint-order: stroke; stroke: #3a332a; stroke-width: 4px; stroke-linecap: butt; stroke-linejoin: miter; font-weight: 800; }
.fj-still .stroke1 { fill: #a23e2c; } .fj-still .stroke2 { fill: #8c6239; } .fj-still .stroke3 { fill: #3d5a80; }
.fj-still .stroke4 { fill: #4a7c59; } .fj-still .stroke5 { fill: #b58b2a; } .fj-still .stroke6 { fill: #7d4e8e; }
.fj-still .stroke7 { fill: #2f6f8f; } .fj-still .stroke8 { fill: #9c6644; } .fj-still .stroke9 { fill: #a84d6f; }
.fj-still .stroke10 { fill: #5a6844; } .fj-still .stroke11 { fill: #a23e2c; } .fj-still .stroke12 { fill: #8c6239; }
.fj-still .stroke13 { fill: #3d5a80; } .fj-still .stroke14 { fill: #4a7c59; } .fj-still .stroke15 { fill: #b58b2a; }
.fj-still .stroke16 { fill: #7d4e8e; } .fj-still .stroke17 { fill: #2f6f8f; } .fj-still .stroke18 { fill: #9c6644; }
.fj-still .stroke19 { fill: #a84d6f; } .fj-still .stroke20 { fill: #5a6844; }

/* 字网格（反查/常用字） */
.fj-chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; margin-top: 12px; }
.fj-chars a { display: block; text-align: center; font-size: 20px; font-family: var(--serif); color: var(--ink); background: #fffdf4; border: 1px solid var(--line); border-radius: 4px; padding: 8px 0; }
.fj-chars a:hover { border-color: var(--seal); color: var(--seal); }

.fj-src { text-align: center; margin: 10px 0 0; }
.pg-cur { color: var(--seal); font-weight: 700; padding: 0 6px; }

@media (max-width: 760px) {
    .fj-head { flex-direction: column; }
    .fj-big { flex: none; width: 100%; }
}
