/* ==========================================================
   新华字典 · 样式（朱红金褐，与平台视觉一致）
   ========================================================== */
.xh-container { box-sizing: border-box; width: min(var(--brand-content-width), calc(100% - 32px)); margin: 0 auto; padding: 0 0 60px; }

/* 区块标题 */
.xh-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 0 18px; flex-wrap: wrap; }
.xh-section-title { font-family: var(--brand-title-font); font-size: 22px; font-weight: 400; letter-spacing: 4px; color: #5b4c37; position: relative; padding-left: 14px; }
.xh-section-title::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 20px; border-radius: 2px; background: linear-gradient(180deg, #b83a2b, #8b6914); }
.xh-section-sub { font-size: 13px; color: var(--text-muted); letter-spacing: 1px; }

/* 库卡片 */
.xh-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.xh-cat-card {
    position: relative; text-align: left; cursor: pointer; overflow: hidden;
    padding: 20px 18px 18px; border-radius: 10px;
    border: 1px solid rgba(139,105,20,.22);
    background: radial-gradient(ellipse 80% 100% at 15% 0%, rgba(184,58,43,.05), transparent 60%), linear-gradient(168deg,#fbf6ec,#f4e9d6);
    box-shadow: 0 6px 20px rgba(60,50,35,.06);
    transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s, border-color .25s;
}
.xh-cat-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(60,50,35,.12); border-color: rgba(139,105,20,.42); }
.xh-cat-card .seal {
    position: absolute; right: 12px; top: 12px;
    width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    font-family: var(--brand-title-font); font-size: 20px; color: #fff;
    background: linear-gradient(140deg, #b83a2b, #922c21); border-radius: 8px;
    box-shadow: 0 4px 12px rgba(184,58,43,.28); opacity: .92;
}
.xh-cat-card h4 { font-family: var(--brand-title-font); font-size: 20px; font-weight: 400; letter-spacing: 2px; color: #3a3025; margin: 0 46px 6px 0; }
.xh-cat-card p { font-size: 12.5px; line-height: 1.7; color: var(--text-secondary); margin: 0 0 12px; min-height: 34px; }
.xh-cat-card .stat { font-size: 12px; color: var(--accent-gold); letter-spacing: .5px; }
.xh-cat-card .stat b { font-size: 15px; font-weight: 700; color: #8b6914; }

/* 库浏览条 */
.xh-catbar { display: flex; align-items: center; gap: 16px; margin: 4px 0 18px; flex-wrap: wrap; }
.xh-backbtn {
    background: transparent; border: 1.5px solid rgba(139,105,20,.3); color: #8b7355;
    padding: 8px 16px; border-radius: 20px; font-size: 13px; cursor: pointer; font-family: inherit;
    transition: all .25s;
}
.xh-backbtn:hover { background: rgba(139,105,20,.08); transform: translateY(-1px); }
.xh-catbar-title { display: flex; align-items: center; gap: 12px; }
.xh-catbar-seal { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-family: var(--brand-title-font); font-size: 23px; color: #fff; background: linear-gradient(140deg,#b83a2b,#922c21); border-radius: 10px; box-shadow: 0 4px 12px rgba(184,58,43,.28); }
.xh-catbar-title h3 { font-family: var(--brand-title-font); font-size: 21px; font-weight: 400; letter-spacing: 3px; color: #3a3025; margin: 0; }
.xh-catbar-title p { font-size: 12.5px; color: var(--text-muted); margin: 2px 0 0; }

/* 工具条 */
.xh-toolbar { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; flex-wrap: wrap; }
.xh-search {
    flex: 1; min-width: 200px; padding: 11px 16px; font-family: inherit; font-size: 14px;
    color: var(--text-primary); background: #fffdf8;
    border: 1.5px solid rgba(139,105,20,.25); border-radius: 10px; outline: none;
    transition: border-color .25s, box-shadow .25s;
}
.xh-search:focus { border-color: var(--accent-gold); box-shadow: 0 0 0 3px rgba(139,105,20,.08); }
.xh-mode {
    padding: 11px 12px; font-family: inherit; font-size: 13.5px; color: #6b5a42;
    background: #fffdf8; border: 1.5px solid rgba(139,105,20,.25); border-radius: 10px; outline: none; cursor: pointer;
}
.xh-mode:focus { border-color: var(--accent-gold); }
.xh-hint { font-size: 12.5px; color: var(--text-muted); }

/* 列表 */
.xh-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.xh-item {
    text-align: left; cursor: pointer; font-family: inherit;
    padding: 14px 16px; border-radius: 10px; background: #fffdf8;
    border: 1px solid rgba(139,105,20,.16); box-shadow: 0 3px 12px rgba(60,50,35,.04);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.xh-item:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(60,50,35,.1); border-color: rgba(139,105,20,.36); }
.xh-item-title { font-size: 16px; font-weight: 600; color: #3a3025; letter-spacing: .5px; word-break: break-all; }
.xh-item-title .sub { font-size: 12.5px; font-weight: 400; color: var(--accent-gold); margin-left: 8px; }
.xh-item-snippet { font-size: 12.5px; color: var(--text-muted); line-height: 1.7; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.xh-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* 分页 */
.xh-pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 26px 0 0; flex-wrap: wrap; }
.xh-pager button {
    min-width: 38px; padding: 7px 12px; font-family: inherit; font-size: 13px; cursor: pointer;
    color: #6b5a42; background: #fffdf8; border: 1px solid rgba(139,105,20,.22); border-radius: 8px;
    transition: all .2s;
}
.xh-pager button:hover:not(:disabled) { background: rgba(139,105,20,.08); }
.xh-pager button.on { background: linear-gradient(135deg,#8b7355,#a08b6a); color: #fff; border-color: transparent; box-shadow: 0 3px 10px rgba(139,115,85,.28); }
.xh-pager button:disabled { opacity: .4; cursor: not-allowed; }
.xh-pager .pg-info { font-size: 12.5px; color: var(--text-muted); margin: 0 6px; }

/* 详情 */
.xh-entry {
    padding: 34px 34px 40px; border-radius: 12px; background: #fffdf8;
    border: 1px solid rgba(139,105,20,.22); box-shadow: 0 12px 36px rgba(60,50,35,.08);
    position: relative;
}
.xh-entry::before { content: ''; position: absolute; inset: 10px; border: 1px solid rgba(139,105,20,.14); border-radius: 8px; pointer-events: none; }
.xh-entry-head { text-align: center; padding-bottom: 20px; border-bottom: 1px dashed rgba(139,105,20,.28); margin-bottom: 22px; }
.xh-entry-word { font-family: var(--brand-title-font); font-size: 52px; line-height: 1.15; font-weight: 400; letter-spacing: 6px; color: #3a3025; margin: 0; }
.xh-entry-word.long { font-size: 32px; letter-spacing: 3px; }
.xh-entry-pinyin { font-size: 16px; color: var(--accent-gold); letter-spacing: 2px; margin: 8px 0 0; }
.xh-entry-meta { font-size: 13px; color: var(--text-muted); letter-spacing: 1px; margin-top: 8px; }
.xh-entry-meta span { margin: 0 8px; }

.xh-field { margin: 0 0 20px; }
.xh-field-title { font-size: 13px; font-weight: 700; color: var(--accent-gold); letter-spacing: 3px; margin-bottom: 8px; }
.xh-field-body { font-size: 15px; line-height: 2; letter-spacing: .5px; color: #33302a; white-space: pre-wrap; word-break: break-word; }
.xh-field-body.lead { font-size: 16.5px; line-height: 1.9; color: #2f2c26; }

.xh-loading { padding: 50px 20px; text-align: center; color: var(--text-muted); font-size: 14px; }
.xh-more {
    margin-top: 10px; padding: 12px 16px; background: rgba(139,105,20,.05);
    border: 1px dashed rgba(139,105,20,.28); border-radius: 8px; font-size: 13.5px; line-height: 1.95;
    color: var(--text-secondary); white-space: pre-wrap; word-break: break-word;
}

@media (max-width: 640px) {
    .xh-entry { padding: 24px 16px 28px; }
    .xh-entry-word { font-size: 40px; letter-spacing: 4px; }
    .xh-list { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}