/* ==========================================================
   汉字图谱 · 样式（水墨古韵，与平台视觉一致）
   ========================================================== */
.hg-container { box-sizing: border-box; width: min(var(--brand-content-width), calc(100% - 32px)); margin: 0 auto; padding: 0 0 60px; }

/* 检索条 */
.hg-toolbar-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0 18px; flex-wrap: wrap; }
.hg-toolbar { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 260px; }
.hg-input {
    flex: 1; max-width: 320px; padding: 11px 16px; font-family: var(--brand-title-font), inherit; font-size: 17px;
    letter-spacing: 2px; 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;
}
.hg-input:focus { border-color: var(--accent-gold); box-shadow: 0 0 0 3px rgba(139,105,20,.08); }
.hg-btn {
    padding: 11px 24px; font-family: inherit; font-size: 14px; letter-spacing: 2px; cursor: pointer;
    color: #fff; border: none; border-radius: 10px;
    background: linear-gradient(140deg, #b83a2b, #922c21);
    box-shadow: 0 6px 16px rgba(184,58,43,.26);
    transition: transform .2s, box-shadow .2s;
}
.hg-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(184,58,43,.34); }
.hg-btn:active { transform: translateY(0); }

.hg-examples { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hg-examples-label { font-size: 12.5px; color: var(--text-muted); letter-spacing: 1px; }
.hg-chip {
    width: 40px; height: 40px; font-family: var(--brand-title-font); font-size: 19px; cursor: pointer;
    color: #6b5a42; background: #fffdf8; border: 1px solid rgba(139,105,20,.22); border-radius: 9px;
    transition: all .2s;
}
.hg-chip:hover { color: #fff; background: linear-gradient(135deg,#8b7355,#a08b6a); border-color: transparent; transform: translateY(-2px); }

/* 舞台 */
.hg-stage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: stretch; }
.hg-graph-wrap {
    position: relative; border-radius: 12px; overflow: hidden; min-height: 560px;
    border: 1px solid rgba(139,105,20,.22); background: #fffdf8;
    box-shadow: 0 12px 36px rgba(60,50,35,.08);
}
.hg-graph-wrap::before { content: ''; position: absolute; inset: 10px; border: 1px solid rgba(139,105,20,.12); border-radius: 8px; pointer-events: none; z-index: 1; }
.hg-graph { position: absolute; inset: 0; width: 100%; height: 100%; }
.hg-graph-tip {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 2;
    font-size: 14px; letter-spacing: 2px; color: var(--text-muted); pointer-events: none;
}
.hg-graph-tip[hidden] { display: none; }

/* 图例 */
.hg-legend {
    position: absolute; left: 16px; bottom: 14px; z-index: 3; pointer-events: none;
    padding: 10px 12px; border-radius: 10px; max-width: 220px;
    background: rgba(255,253,248,.9); border: 1px solid rgba(139,105,20,.2);
    box-shadow: 0 6px 18px rgba(60,50,35,.08);
}
.hg-legend-title { font-size: 12px; font-weight: 700; letter-spacing: 2px; color: var(--accent-gold); margin-bottom: 7px; }
.hg-legend-row { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-secondary); line-height: 1.9; }
.hg-legend-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 1px solid rgba(0,0,0,.08); }
.hg-legend-note { font-size: 11px; color: var(--text-muted); line-height: 1.6; margin-top: 7px; border-top: 1px dashed rgba(139,105,20,.25); padding-top: 6px; }

/* 信息面板 */
.hg-panel {
    border-radius: 12px; padding: 20px 18px; background: #fffdf8;
    border: 1px solid rgba(139,105,20,.22); box-shadow: 0 12px 36px rgba(60,50,35,.08);
    max-height: 560px; overflow-y: auto;
}
.hg-panel-empty { padding: 40px 8px; text-align: center; font-size: 13.5px; line-height: 1.9; color: var(--text-muted); }
.hg-panel-head { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px dashed rgba(139,105,20,.28); margin-bottom: 14px; }
.hg-panel-char {
    width: 58px; height: 58px; flex: none; display: flex; align-items: center; justify-content: center;
    font-family: var(--brand-title-font); font-size: 32px; color: #fff; border-radius: 12px;
    background: linear-gradient(140deg, #b83a2b, #922c21); box-shadow: 0 6px 16px rgba(184,58,43,.26);
}
.hg-panel-meta h3 { font-family: var(--brand-title-font); font-size: 22px; font-weight: 400; letter-spacing: 2px; color: #3a3025; margin: 0 0 4px; }
.hg-panel-pinyin { font-size: 13px; color: var(--accent-gold); letter-spacing: 1px; }
.hg-level-badge {
    display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 20px;
    font-size: 11.5px; color: #fff; letter-spacing: .5px;
}
.hg-panel-sec-title { font-size: 12.5px; font-weight: 700; letter-spacing: 2px; color: var(--accent-gold); margin: 16px 0 8px; }
.hg-def { font-size: 13.5px; line-height: 1.85; color: var(--text-secondary); }
.hg-def p { margin: 0 0 4px; padding-left: 14px; position: relative; }
.hg-def p::before { content: '·'; position: absolute; left: 2px; color: #b83a2b; }
.hg-def .hg-def-none { color: var(--text-muted); font-style: normal; }

.hg-rel { display: flex; flex-direction: column; gap: 6px; }
.hg-rel-item {
    display: flex; align-items: baseline; gap: 9px; padding: 8px 10px; border-radius: 9px;
    background: #fbf6ec; border: 1px solid rgba(139,105,20,.14); cursor: pointer; text-align: left;
    font-family: inherit; transition: border-color .2s, transform .2s, box-shadow .2s;
}
.hg-rel-item:hover { border-color: rgba(139,105,20,.4); transform: translateX(2px); box-shadow: 0 4px 12px rgba(60,50,35,.07); }
.hg-rel-char { font-family: var(--brand-title-font); font-size: 20px; color: #3a3025; flex: none; }
.hg-rel-words { font-size: 12px; color: var(--text-muted); line-height: 1.6; flex: 1; }
.hg-rel-lv { font-size: 11px; color: #fff; padding: 1px 7px; border-radius: 20px; flex: none; }

@media (max-width: 780px) {
    .hg-stage { grid-template-columns: 1fr; }
    .hg-graph-wrap { min-height: 440px; }
    .hg-panel { max-height: none; }
    .hg-input { max-width: none; }
    .hg-toolbar { flex-wrap: wrap; }
}