/* ============================================================
   国民经济行业分类查询 /tools/industry
   四级树形浏览 + 全文搜索 + 完整注释详情
   主题：复用站点变量，--ind-* 局部变量定义在 .ind 上，
        [data-theme="light"] 覆盖浅色（toast 挂 body 需 fallback）

   2026-10-20 排版与健壮性轮（改动前必读）：
   ★`.ind [hidden]{display:none!important}` 全局守卫——本仓库老坑：
     凡用 hidden 属性控制显隐的元素，选择器一旦设了 display（flex/grid），
     UA 的 [hidden]{display:none} 就会被作者样式覆盖导致「常显」。
     历史上 .ind-search-clear（display:grid）与 .ind-recent（display:flex）
     正是因此常显，现已由该全局守卫兜底（各组件处的守卫保留作双保险）。
   ★断点科学化（桌面 / 平板横竖 / 手机三端）：
     ≥1600  超宽桌面：左栏 460px、字号与留白同步放大
     1100-1599 桌面：左栏 400px（双栏 + 左栏 sticky 占满视口）
     900-1099 平板（含横屏）：双栏 330px + 1fr，一屏放下目录与详情
     ≤899   平板竖屏 / 小窗：单栏堆叠，左栏 52vh 内部滚动
     ≤767   手机：详情改底部抽屉（抓手条 + 背景滚动锁 + safe-area），
             全部可点元素触控目标 ≥30px（chips 34px / toggle 28px / 行 5px padding）
     ≤420   超小屏：压缩统计条与标签

   2026-10-21 手机端高度 + 头部折叠轮（改动前必读）：
   ★.ind-hero 极简折叠按钮 #indHeroFold（默认展开，JS 持久化 yicool_industry_hero_v1）：
     标题行右侧 30px（手机 34px）无描边按钮 + chevron，.ind-hero.is-collapsed 时
     chevron 旋转 180°；副标题与标签整体收进 #indHeroExtra（hidden 由全局守卫兜底）。
     手机端收起 hero 可让出约 130px 高度，配合下面的目录面板提升，折叠态
     20 个门类一行不落、无内部滚动条。
   ★手机端 .ind-left 由 46vh 提升为 calc(100dvh - 24px)：原高度一屏只能看到
     约 7 个门类、必须内部滚动；提升后折叠目录（20 行 ≈ 720px）占满视口完整展示。
   ============================================================ */

/* ---------- 桌面满屏（保留左侧导航，站点规范） ---------- */
body.page-industry-full .app { max-width: 100%; }
body.page-industry-full .main-content { max-width: 100%; width: 100%; border-right: 0; }
body.page-industry-full .page-container { max-width: 100%; }

.ind {
    --ind-card: var(--bg-secondary);
    --ind-card-2: var(--bg-hover);
    --ind-line: var(--border-color);
    --ind-line-2: color-mix(in srgb, var(--text-primary) 14%, transparent);
    --ind-fg: var(--text-primary);
    --ind-fg-2: var(--text-secondary);
    --ind-accent: var(--accent);
    --ind-accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
    --ind-gold: #e3b341;
    --ind-green: #3fb950;
    --ind-red: #f85149;
    --ind-radius: 14px;
    --ind-shadow: 0 1px 3px rgba(0, 0, 0, .18);
    max-width: none;
    margin: 0;
    padding: 20px 24px 56px;
    box-sizing: border-box;
    color: var(--ind-fg);
    font-size: 15px;
}

[data-theme="light"] .ind {
    --ind-line-2: rgba(15, 20, 25, .16);
    --ind-gold: #9a6700;
    --ind-green: #1a7f37;
    --ind-red: #cf222e;
}

.ind * { box-sizing: border-box; }

/* ★hidden 属性全局守卫：任何设了 display 的组件也不能盖掉 [hidden] */
.ind [hidden] { display: none !important; }

/* 搜索框原生清除按钮与自建清空按钮重复，隐藏之 */
.ind-search .ind-input::-webkit-search-cancel-button,
.ind-search .ind-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

/* ---------- 头部 ---------- */
.ind-hero {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 18px 20px;
    background: var(--ind-card);
    border: 1px solid var(--ind-line);
    border-radius: var(--ind-radius);
    box-shadow: var(--ind-shadow);
}
.ind-hero-ic {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    font-size: 28px;
    border-radius: 14px;
    background: var(--ind-accent-soft);
}
.ind-hero-tx { flex: 1 1 auto; min-width: 0; }
.ind-hero-t { margin: 2px 0 6px; font-size: 22px; line-height: 1.25; text-wrap: balance; }
.ind-hero-sub { margin: 0 0 10px; color: var(--ind-fg-2); font-size: 13.5px; line-height: 1.65; }
.ind-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ind-tag {
    padding: 3px 10px;
    font-size: 12px;
    color: var(--ind-fg-2);
    background: var(--ind-card-2);
    border: 1px solid var(--ind-line);
    border-radius: 999px;
    white-space: nowrap;
}

/* ---------- 头部极简折叠按钮（默认展开；手机端收起可让出高度给行业目录） ---------- */
.ind-hero-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.ind-hero-fold {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-left: auto;
    border: 0;
    border-radius: 8px;
    background: var(--ind-card-2);
    color: var(--ind-fg-2);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.ind-hero-fold:hover { background: var(--ind-line); color: var(--ind-fg); }
.ind-hero-caret { transition: transform .18s ease; }
.ind-hero.is-collapsed .ind-hero-caret { transform: rotate(180deg); }
.ind-hero.is-collapsed .ind-hero-t { margin-bottom: 2px; }

/* ---------- 统计条 ---------- */
.ind-stat {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.ind-stat-i {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 7px 14px;
    background: var(--ind-card);
    border: 1px solid var(--ind-line);
    border-radius: 10px;
}
.ind-stat-i b { font-size: 17px; color: var(--ind-accent); font-variant-numeric: tabular-nums; }
.ind-stat-i em { font-style: normal; font-size: 12.5px; color: var(--ind-fg-2); }

/* ---------- 工具栏 ---------- */
.ind-tools {
    margin-top: 12px;
    padding: 14px 16px;
    background: var(--ind-card);
    border: 1px solid var(--ind-line);
    border-radius: var(--ind-radius);
    box-shadow: var(--ind-shadow);
}
.ind-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.ind-search {
    position: relative;
    flex: 1 1 320px;
    min-width: 240px;
    display: flex;
    align-items: center;
}
.ind-search-ic {
    position: absolute;
    left: 11px;
    font-size: 13px;
    opacity: .55;
    pointer-events: none;
}
.ind-search .ind-input { padding-left: 34px; padding-right: 32px; }
.ind-search-clear {
    position: absolute;
    right: 6px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--ind-card-2);
    color: var(--ind-fg-2);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}
.ind-search-clear:hover { background: var(--ind-line); color: var(--ind-fg); }

.ind-input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ind-fg);
    background: var(--bg-primary);
    border: 1px solid var(--ind-line-2);
    border-radius: 10px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.ind-input:focus {
    border-color: var(--ind-accent);
    box-shadow: 0 0 0 3px var(--ind-accent-soft);
}
.ind-input::placeholder { color: var(--ind-fg-2); opacity: .8; }

.ind-scope {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--ind-fg-2);
    white-space: nowrap;
}
.ind-scope select { width: auto; min-width: 96px; cursor: pointer; }

.ind-code {
    display: flex;
    gap: 8px;
    flex: 0 1 300px;
    min-width: 240px;
}
.ind-code .ind-input { flex: 1 1 auto; }

.ind-btn {
    height: 38px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13.5px;
    font-family: inherit;
    color: #fff;
    background: var(--ind-accent);
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: filter .15s, background .15s;
}
.ind-btn:hover { filter: brightness(1.08); }
.ind-btn:active { filter: brightness(.94); }
.ind-btn-ghost {
    color: var(--ind-fg);
    background: transparent;
    border-color: var(--ind-line-2);
}
.ind-btn-ghost:hover { background: var(--ind-card-2); filter: none; }
.ind-btn-ghost.is-on {
    color: var(--ind-accent);
    border-color: var(--ind-accent);
    background: var(--ind-accent-soft);
}

.ind-code-msg {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--ind-fg-2);
}
.ind-code-msg b { color: var(--ind-accent); font-weight: 600; }
.ind-code-msg.is-err { color: var(--ind-red); }

.ind-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}
.ind-chip {
    height: 30px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-family: inherit;
    color: var(--ind-fg-2);
    background: transparent;
    border: 1px solid var(--ind-line);
    border-radius: 999px;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}
.ind-chip:hover { color: var(--ind-fg); border-color: var(--ind-line-2); }
.ind-chip.is-on {
    color: #fff;
    background: var(--ind-accent);
    border-color: var(--ind-accent);
}
.ind-chip-fav b {
    font-size: 11.5px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--ind-card-2);
    color: var(--ind-fg-2);
}
.ind-chip-fav.is-on b { background: rgba(255, 255, 255, .25); color: #fff; }
.ind-chip-fav.has-fav:not(.is-on) { color: var(--ind-gold); border-color: var(--ind-gold); }

.ind-chips-sector { margin-top: 8px; }
.ind-chips-sector .ind-chip {
    height: 27px;
    padding: 0 10px;
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}
.ind-chips-sector .ind-chip .ind-sec-n { opacity: .65; font-size: 11.5px; }

.ind-recent {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--ind-line);
    overflow-x: auto;
    scrollbar-width: thin;
}
.ind-recent-t { flex: 0 0 auto; font-size: 12px; color: var(--ind-fg-2); }
.ind-recent-list { display: flex; gap: 6px; flex: 1 1 auto; }
.ind-recent-item {
    flex: 0 0 auto;
    max-width: 220px;
    padding: 3px 10px;
    font-size: 12.5px;
    color: var(--ind-fg-2);
    background: var(--ind-card-2);
    border: 1px solid var(--ind-line);
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ind-recent-item:hover { color: var(--ind-accent); border-color: var(--ind-accent); }
.ind-recent-item code { font-family: inherit; color: var(--ind-accent); margin-right: 4px; }
.ind-recent-clear {
    flex: 0 0 auto;
    border: 0;
    background: none;
    color: var(--ind-fg-2);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    padding: 2px 4px;
}
.ind-recent-clear:hover { color: var(--ind-red); }

/* ---------- 主区布局 ---------- */
.ind-main {
    display: grid;
    grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
    gap: 12px;
    margin-top: 12px;
    align-items: start;
}

.ind-left, .ind-right {
    background: var(--ind-card);
    border: 1px solid var(--ind-line);
    border-radius: var(--ind-radius);
    box-shadow: var(--ind-shadow);
}

.ind-left {
    position: sticky;
    top: 12px;
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 24px);
    overflow: hidden;
}
.ind-left-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--ind-line);
}
.ind-left-title { font-size: 14px; font-weight: 600; }
.ind-left-btns { display: flex; gap: 6px; }
.ind-left-btns .ind-btn { height: 28px; padding: 0 10px; font-size: 12.5px; }

.ind-count {
    margin: 0;
    padding: 7px 14px;
    font-size: 12.5px;
    color: var(--ind-fg-2);
    border-bottom: 1px solid var(--ind-line);
}
.ind-count b { color: var(--ind-fg); font-variant-numeric: tabular-nums; }

.ind-tree, .ind-list {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px;
    scrollbar-width: thin;
}
.ind-tree::-webkit-scrollbar, .ind-list::-webkit-scrollbar, .ind-right::-webkit-scrollbar { width: 8px; }
.ind-tree::-webkit-scrollbar-thumb, .ind-list::-webkit-scrollbar-thumb, .ind-right::-webkit-scrollbar-thumb {
    background: var(--ind-line);
    border-radius: 999px;
}
.ind-tree[hidden], .ind-list[hidden] { display: none !important; }

/* ---------- 数据加载骨架屏 ---------- */
.ind-loading { padding: 10px 6px 14px; }
.ind-sk-row {
    height: 14px;
    margin: 10px 4px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--ind-card-2) 25%, var(--ind-line) 50%, var(--ind-card-2) 75%);
    background-size: 200% 100%;
    animation: ind-sk 1.15s ease-in-out infinite;
}
.ind-sk-t { margin: 14px 0 4px; text-align: center; font-size: 12.5px; color: var(--ind-fg-2); }
@keyframes ind-sk {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

/* ---------- 树形节点 ---------- */
.ind-node {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    line-height: 1.45;
}
.ind-node:hover { background: var(--ind-card-2); }
.ind-node.is-cur { background: var(--ind-accent-soft); }
.ind-node.is-cur .ind-node-name { color: var(--ind-accent); font-weight: 600; }

.ind-toggle {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 5px;
    background: none;
    color: var(--ind-fg-2);
    font-size: 9px;
    cursor: pointer;
    transition: transform .15s;
}
.ind-toggle:hover { background: var(--ind-line); color: var(--ind-fg); }
.ind-node.is-open > .ind-toggle { transform: rotate(90deg); }
.ind-toggle.is-leaf { visibility: hidden; }

.ind-node-code {
    flex: 0 0 auto;
    min-width: 34px;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--ind-fg-2);
    text-align: right;
    padding-right: 2px;
}
.ind-kind-sector > .ind-node-code { color: var(--ind-gold); font-weight: 700; }
.ind-kind-division > .ind-node-code { color: var(--ind-accent); font-weight: 600; }
.ind-kind-group > .ind-node-code { color: var(--ind-green); }
.ind-kind-class > .ind-node-code { color: var(--ind-fg-2); }

.ind-node-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ind-kind-sector > .ind-node-name { font-weight: 700; font-size: 14px; }
.ind-kind-division > .ind-node-name { font-weight: 600; }

.ind-node-n {
    flex: 0 0 auto;
    font-size: 11.5px;
    color: var(--ind-fg-2);
    padding: 0 5px;
    border-radius: 999px;
    background: var(--ind-card-2);
}
.ind-node-star { flex: 0 0 auto; color: var(--ind-gold); font-size: 11px; }
.ind-children { display: none; }
.ind-node.is-open + .ind-children, .ind-children.is-open { display: block; }
.ind-children .ind-children { padding-left: 14px; }
.ind-tree > .ind-children { padding-left: 0; }

/* ---------- 列表视图 ---------- */
.ind-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
}
.ind-row:hover { background: var(--ind-card-2); }
.ind-row.is-cur { background: var(--ind-accent-soft); }
.ind-row-code {
    flex: 0 0 auto;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--ind-accent);
}
.ind-row-name { flex: 1 1 auto; min-width: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ind-row-path { flex: 0 1 auto; min-width: 0; font-size: 11.5px; color: var(--ind-fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl; text-align: right; }
.ind-row-star { flex: 0 0 auto; color: var(--ind-gold); font-size: 11px; }

.ind-more {
    display: block;
    width: 100%;
    margin: 6px 0 2px;
    padding: 8px;
    font-size: 12.5px;
    color: var(--ind-fg-2);
    background: var(--ind-card-2);
    border: 1px dashed var(--ind-line);
    border-radius: 8px;
    cursor: pointer;
}
.ind-more:hover { color: var(--ind-accent); border-color: var(--ind-accent); }

/* ---------- 空态 ---------- */
.ind-empty { padding: 40px 20px; text-align: center; }
.ind-empty[hidden] { display: none !important; }
.ind-empty-ic { font-size: 30px; opacity: .5; }
.ind-empty-t { margin: 8px 0 4px; font-size: 14px; font-weight: 600; }
.ind-empty-tip { margin: 0; font-size: 12.5px; color: var(--ind-fg-2); }

/* ---------- 详情面板 ---------- */
.ind-right { position: relative; min-height: 480px; padding: 18px 22px 24px; }
.ind-d-close { display: none; }

.ind-d-empty { padding: 60px 20px; text-align: center; }
.ind-d-empty[hidden] { display: none !important; }
.ind-d-empty-ic { font-size: 34px; opacity: .5; }
.ind-d-empty-t { margin: 10px 0 4px; font-size: 15px; font-weight: 600; }
.ind-d-empty-tip { margin: 0 auto; max-width: 340px; font-size: 12.5px; color: var(--ind-fg-2); line-height: 1.7; }

.ind-d-body[hidden] { display: none !important; }

.ind-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--ind-fg-2);
    margin-bottom: 10px;
}
.ind-crumb a {
    color: var(--ind-fg-2);
    text-decoration: none;
    padding: 1px 5px;
    border-radius: 6px;
    cursor: pointer;
}
.ind-crumb a:hover { color: var(--ind-accent); background: var(--ind-accent-soft); }
.ind-crumb a code { font-family: inherit; }
.ind-crumb .ind-crumb-sep { opacity: .5; }
.ind-crumb a.is-last { color: var(--ind-fg); font-weight: 600; pointer-events: none; }

.ind-d-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.ind-d-code {
    padding: 3px 10px;
    font-size: 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 700;
    color: #fff;
    background: var(--ind-accent);
    border-radius: 8px;
    letter-spacing: .5px;
}
.ind-d-name { margin: 0; font-size: 21px; line-height: 1.3; text-wrap: balance; }
.ind-d-kind {
    padding: 2px 9px;
    font-size: 12px;
    color: var(--ind-fg-2);
    background: var(--ind-card-2);
    border: 1px solid var(--ind-line);
    border-radius: 999px;
}

.ind-d-stats { margin: 8px 0 0; font-size: 13px; color: var(--ind-fg-2); }
.ind-d-stats b { color: var(--ind-fg); font-variant-numeric: tabular-nums; }

/* 操作条桌面端吸顶：长「包括」列表滚动时按钮始终可达 */
.ind-d-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 4px;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px 0;
    background: var(--ind-card);
}
.ind-d-actions .ind-btn { height: 32px; padding: 0 13px; font-size: 13px; }
.ind-d-actions .ind-btn:disabled { opacity: .45; cursor: default; }
.ind-d-actions .ind-btn:disabled:hover { filter: none; }
#indFav.is-on { color: var(--ind-gold); border-color: var(--ind-gold); background: color-mix(in srgb, var(--ind-gold) 12%, transparent); }

.ind-d-desc {
    margin: 12px 0 0;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.85;
    color: var(--ind-fg);
    background: var(--ind-card-2);
    border-left: 3px solid var(--ind-accent);
    border-radius: 0 10px 10px 0;
}
.ind-d-desc[hidden] { display: none !important; }
.ind-d-desc p { margin: 0; }
.ind-d-desc p + p { margin-top: 6px; }

.ind-d-sec { margin-top: 18px; }
.ind-d-sec[hidden] { display: none !important; }
.ind-d-sec-h {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14.5px;
    font-weight: 700;
    margin-bottom: 8px;
}
.ind-d-sec-h .ind-d-sec-sym { font-size: 15px; }
.ind-d-sec--inc .ind-d-sec-h { color: var(--ind-green); }
.ind-d-sec--exc .ind-d-sec-h { color: var(--ind-red); }
.ind-d-sec-tip { font-size: 12px; font-weight: 400; color: var(--ind-fg-2); }
.ind-d-sec-block + .ind-d-sec-block { margin-top: 14px; }
.ind-d-grp {
    margin: 6px 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ind-fg);
}
.ind-d-grp::before { content: "▸ "; color: var(--ind-fg-2); font-weight: 400; }
.ind-d-items { margin: 0; padding: 0; list-style: none; }
.ind-d-items li {
    position: relative;
    padding: 3px 0 3px 20px;
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--ind-fg);
}
.ind-d-items li::before {
    content: "—";
    position: absolute;
    left: 2px;
    color: var(--ind-fg-2);
}
.ind-d-sec--inc .ind-d-items li::before { color: var(--ind-green); }
.ind-d-sec--exc .ind-d-items li::before { color: var(--ind-red); }

.ind-d-kids { margin-top: 18px; }
.ind-d-kids[hidden] { display: none !important; }
.ind-d-kids-t { font-size: 13px; font-weight: 600; color: var(--ind-fg-2); margin-bottom: 8px; }
.ind-d-kids-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ind-d-kid {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 5px 11px;
    font-size: 13px;
    color: var(--ind-fg);
    background: var(--ind-card-2);
    border: 1px solid var(--ind-line);
    border-radius: 999px;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.ind-d-kid:hover { color: var(--ind-accent); border-color: var(--ind-accent); }
.ind-d-kid code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--ind-fg-2); }
.ind-d-kid:hover code { color: var(--ind-accent); }
.ind-d-kid-more { cursor: default; color: var(--ind-fg-2); }

/* ---------- 高亮 ---------- */
.ind mark {
    padding: 0 1px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--ind-gold) 38%, transparent);
    color: inherit;
}

/* ---------- 使用说明 ---------- */
.ind-about {
    margin-top: 14px;
    background: var(--ind-card);
    border: 1px solid var(--ind-line);
    border-radius: var(--ind-radius);
    box-shadow: var(--ind-shadow);
    overflow: hidden;
}
.ind-about-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 13px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.ind-about-title::-webkit-details-marker { display: none; }
.ind-about-title::marker { content: ''; }
.ind-about-title:hover { color: var(--ind-accent); }
.ind-about-title:focus-visible { outline: 2px solid var(--ind-accent); outline-offset: -3px; }
.ind-about[open] .ind-about-title { border-bottom: 1px solid var(--ind-line); }
.ind-about-caret { flex: 0 0 auto; transition: transform .18s; }
.ind-about[open] .ind-about-caret { transform: rotate(180deg); }
.ind-about-body { padding: 14px 18px 18px; }
.ind-about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}
.ind-about-card {
    padding: 13px 15px;
    background: var(--ind-card-2);
    border: 1px solid var(--ind-line);
    border-radius: 12px;
}
.ind-about-card h3 { margin: 0 0 6px; font-size: 13.5px; }
.ind-about-card p { margin: 0; font-size: 12.5px; line-height: 1.75; color: var(--ind-fg-2); }
.ind-about-card kbd {
    padding: 0 5px;
    font-size: 11px;
    font-family: inherit;
    border: 1px solid var(--ind-line-2);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: var(--ind-card);
}

/* ---------- Toast ---------- */
.ind-toast {
    position: fixed;
    left: 50%;
    bottom: calc(36px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 100000;
    max-width: min(86vw, 460px);
    padding: 9px 18px;
    font-size: 13.5px;
    color: #fff;
    background: rgba(20, 22, 26, .94);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .32);
    pointer-events: none;
}
.ind-toast[hidden] { display: none !important; }

/* ---------- 键盘焦点可见性（无障碍） ---------- */
.ind-btn:focus-visible,
.ind-chip:focus-visible,
.ind-toggle:focus-visible,
.ind-node:focus-visible,
.ind-row:focus-visible,
.ind-d-kid:focus-visible,
.ind-recent-item:focus-visible,
.ind-recent-clear:focus-visible,
.ind-search-clear:focus-visible,
.ind-input:focus-visible {
    outline: 2px solid var(--ind-accent);
    outline-offset: 2px;
}

/* ============================================================
   响应式（桌面 ≥1100 为默认双栏；向下逐档收敛）
   ============================================================ */

/* ---------- 超宽桌面 ≥1600：加宽左栏与正文，充分利用屏幕 ---------- */
@media (min-width: 1600px) {
    .ind { padding: 24px 32px 64px; font-size: 15.5px; }
    .ind-main { grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 14px; }
    .ind-hero { padding: 22px 24px; }
    .ind-hero-t { font-size: 24px; }
    .ind-hero-sub { font-size: 14px; }
    .ind-d-name { font-size: 23px; }
    .ind-node-name { font-size: 14px; }
    .ind-d-items li { font-size: 14px; }
    .ind-about-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
}

/* ---------- 平板（含横屏）900~1099：双栏 330px，一屏放下目录与详情 ---------- */
@media (max-width: 1099px) and (min-width: 900px) {
    .ind { padding: 16px 18px 44px; }
    .ind-main { grid-template-columns: minmax(0, 330px) minmax(0, 1fr); }
    .ind-hero-t { font-size: 20px; }
    .ind-left { max-height: calc(100dvh - 24px); }
    .ind-about-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

/* ---------- 平板竖屏 / 小窗 ≤899：单栏堆叠 ---------- */
@media (max-width: 899px) {
    .ind { padding: 14px 14px 40px; }
    .ind-main { grid-template-columns: minmax(0, 1fr); }
    .ind-left { position: static; max-height: 52vh; }
    .ind-right { min-height: 420px; }
    .ind-about-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

/* ---------- 手机 ≤767：底部抽屉 + 大触控目标 ---------- */
@media (max-width: 767px) {
    .ind { padding: 12px 12px 40px; font-size: 14px; }
    .ind-hero { padding: 14px; gap: 12px; }
    .ind-hero-ic { width: 42px; height: 42px; font-size: 22px; border-radius: 12px; }
    .ind-hero-t { font-size: 18px; }
    .ind-hero-sub { font-size: 12.5px; }
    .ind-hero-fold { width: 34px; height: 34px; }
    .ind-tools { padding: 12px; }
    .ind-search, .ind-code { flex: 1 1 100%; min-width: 0; }
    .ind-input { font-size: 16px; } /* 防 iOS 聚焦缩放 */
    .ind-stat-i { padding: 5px 11px; }
    .ind-stat-i b { font-size: 15px; }
    /* 目录面板占满视口高度：折叠态 20 个门类一行不落，无需内部滚动条 */
    .ind-left { max-height: calc(100dvh - 24px); }
    .ind-left-head { flex-wrap: wrap; padding: 9px 12px; }
    .ind-count { padding: 5px 12px; }

    /* 触控目标加大（≥30px，符合移动端可用性下限） */
    .ind-chip { height: 34px; padding: 0 14px; }
    .ind-chips-sector .ind-chip { height: 30px; padding: 0 11px; }
    .ind-toggle { width: 28px; height: 28px; font-size: 10px; }
    .ind-node { padding: 4px 6px; }
    .ind-row { padding: 9px 8px; }
    .ind-left-btns .ind-btn { height: 32px; padding: 0 12px; }
    .ind-left-btns { flex-wrap: wrap; }
    .ind-search-clear { width: 28px; height: 28px; right: 8px; }
    .ind-recent-item { padding: 6px 12px; }
    .ind-more { padding: 11px; }
    .ind-d-kid { min-height: 36px; padding: 7px 12px; }
    .ind-d-actions .ind-btn { height: 38px; padding: 0 15px; }
    .ind-about-title { padding: 15px 16px; }

    /* 手机端详情改为底部抽屉 */
    .ind-right {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100001;
        max-height: 88dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 16px 16px 0 0;
        border-bottom: 0;
        transform: translateY(102%);
        transition: transform .22s ease;
        padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    }
    .ind-right.is-open { transform: translateY(0); }
    /* 抽屉抓手条 */
    .ind-right::before {
        content: "";
        display: block;
        width: 40px;
        height: 4px;
        margin: 2px auto 10px;
        border-radius: 999px;
        background: var(--ind-line);
    }
    .ind-d-close {
        display: grid;
        place-items: center;
        position: absolute;
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        border: 0;
        border-radius: 50%;
        background: var(--ind-card-2);
        color: var(--ind-fg-2);
        font-size: 18px;
        cursor: pointer;
        z-index: 2;
    }
    .ind-d-close:hover { color: var(--ind-fg); background: var(--ind-line); }
    /* 抽屉内操作条不吸顶（避免盖住抓手条） */
    .ind-d-actions { position: static; padding: 12px 0 2px; }
    .ind-d-name { font-size: 18px; }
    .ind-about-grid { grid-template-columns: 1fr; }
    /* 抽屉打开时锁定背景滚动（JS 切 body.ind-drawer-open） */
    body.ind-drawer-open { overflow: hidden; }
}

/* ---------- 超小屏 ≤420 ---------- */
@media (max-width: 420px) {
    .ind-hero-tags .ind-tag:nth-child(n+5) { display: none; }
    .ind-stat-i:nth-child(n+5) { display: none; }
    .ind-d-items li { font-size: 13px; }
    .ind-d-actions { gap: 6px; }
    .ind-d-actions .ind-btn { padding: 0 12px; }
}

/* ---------- 无悬停设备（触屏）按压缩放反馈 ---------- */
@media (hover: none) {
    .ind-btn:hover, .ind-chip:hover, .ind-d-kid:hover, .ind-more:hover { filter: none; }
    .ind-node:hover, .ind-row:hover { background: transparent; }
    .ind-node.is-cur, .ind-row.is-cur { background: var(--ind-accent-soft); }
}

/* 打印：只保留详情正文 */
@media print {
    body.page-industry-full .app, body.page-industry-full .main-content { max-width: none; }
    .ind-hero, .ind-stat, .ind-tools, .ind-left, .ind-about, .ind-d-actions, .ind-d-close, .ind-crumb, .ind-toast, .ind-d-kids { display: none !important; }
    .ind-right { position: static; transform: none; border: 0; box-shadow: none; max-height: none; min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .ind * { transition: none !important; }
    .ind-sk-row { animation: none; }
}
