/* ============================================================
   TYNet 开发者工具箱 · 设计系统
   面向 .NET / C# 与前端开发者的在线工具库
   ============================================================ */

:root {
    --bg: #f5f7fb;
    --bg-soft: #eef2f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --line: #e3e8f0;
    --line-strong: #cbd5e1;
    --brand: #4f46e5;
    --brand-2: #7c3aed;
    --brand-soft: #eef0ff;
    --accent: #0ea5e9;
    --ok: #10b981;
    --warn: #f59e0b;
    --danger: #ef4444;
    --code-bg: #0f172a;
    --code-ink: #e2e8f0;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 6px 20px -8px rgba(15, 23, 42, .18);
    --shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, .35);
    --header-h: 60px;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", "Microsoft YaHei", monospace;
}

html[data-theme="dark"] {
    --bg: #0b1020;
    --bg-soft: #0e1526;
    --surface: #121a2e;
    --surface-2: #0f1727;
    --ink: #e8eeff;
    --ink-2: #c7d2fe;
    --muted: #94a3b8;
    --line: #1f2a42;
    --line-strong: #2b3a58;
    --brand: #8b87ff;
    --brand-2: #a78bfa;
    --brand-soft: #1c2340;
    --accent: #38bdf8;
    --code-bg: #070b16;
    --code-ink: #dbe4f5;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .7);
    --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }

::selection { background: rgba(79, 70, 229, .18); }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ============================ 顶栏 ============================ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}

.app-header-inner {
    max-width: 1320px;
    margin: 0 auto;
    height: 100%;
    padding: 0 0px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -.2px;
    white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2) 60%, var(--accent));
    color: #fff;
    display: grid; place-items: center;
    font-family: var(--mono);
    font-size: 15px; font-weight: 700;
    box-shadow: 0 6px 14px -6px rgba(79, 70, 229, .8);
}
.brand-sub { color: var(--muted); font-weight: 500; font-size: 12.5px; }

.header-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.header-nav a {
    color: var(--muted);
    font-size: 13.5px;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
}
.header-nav a:hover { color: var(--ink); background: var(--surface-2); }

/* 顶栏「运维专题」入口 + 「分类」下拉 */
.header-nav .nav-ops { color: var(--ink); font-weight: 600; }
.header-nav .nav-ops:hover { color: var(--brand); }
.nav-more { position: relative; display: inline-flex; }
.nav-more-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 9px;
    border: 0; border-radius: 8px; background: transparent;
    color: var(--muted); font-size: 13.5px; font-family: inherit; line-height: 1.4;
    cursor: pointer; transition: color .15s, background .15s;
}
.nav-more-btn:hover, .nav-more.open .nav-more-btn { color: var(--ink); background: var(--surface-2); }
.nav-more-btn svg { opacity: .6; transition: transform .18s ease; }
.nav-more.open .nav-more-btn svg { transform: rotate(180deg); }

.nav-more-panel {
    position: absolute; top: calc(100% + 10px); right: 0;
    display: none;
    /* 左列「工具分类」窄栏 + 右列「运维专题」2 列网格；
       右列固定宽度以确保每条「工具名 + 条数」都不会被 ellipsis 截断 */
    grid-template-columns: 150px 420px;
    gap: 8px 18px;
    padding: 14px;
    min-width: 600px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 110px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 60;
}
/* 悬停桥：面板与按钮之间有 10px 空隙，用一个不可见伪元素正好填满这段空隙，
   鼠标从按钮移向面板时仍停留在面板的悬停区域内，面板不会闪退。
   数值说明：::before 的定位基准是面板的 padding box，比面板 border-box 顶部还低 1px
   （面板有 1px 边框），所以 top: -11px + height: 10px 才正好覆盖
   [按钮底边, 面板边框顶] 这 10px 空隙；桥高不可加大，否则会盖住按钮底部条带导致点击不响应 */
.nav-more-panel::before {
    content: '';
    position: absolute;
    top: -11px;
    left: 0;
    right: 0;
    height: 10px;
}
.nav-more.open .nav-more-panel { display: grid; }
.nm-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nm-col h5 {
    margin: 0 0 6px; padding: 0 9px;
    font-size: 11px; font-weight: 600; letter-spacing: .08em;
    color: var(--muted); text-transform: uppercase;
}
.nav-more-panel .nm-col a {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 6px 9px; border-radius: 8px;
    color: var(--ink); font-size: 13px;
}
.nav-more-panel .nm-col a:hover { background: var(--surface-2); color: var(--brand); }
.nm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm-num { flex: none; color: var(--muted); font-size: 11.5px; font-family: var(--mono); }
.nm-col-ops {
    /* 运维专题改为 2 列网格（覆盖 .nm-col 的单列 flex 布局）：
       h5 标题与底部「查看运维专题分类」横跨两列，中间 18 个条目按行优先排布 */
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 2px 8px;
    border-left: 1px solid var(--line); padding-left: 18px;
    max-height: min(56vh, 424px);
    overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin;
}
.nm-col-ops h5, .nav-more-panel .nm-col a.nm-all { grid-column: 1 / -1; }
.nm-col-ops h5 { color: var(--brand); }
.nav-more-panel .nm-col a.nm-all {
    justify-content: flex-start; gap: 6px; margin-top: 4px;
    color: var(--brand); font-size: 12.5px;
}
.nav-more-panel .nm-col a.nm-all:hover { background: var(--brand-soft); }
.nm-empty { padding: 4px 9px; font-size: 12.5px; color: var(--muted); }

.search-trigger {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    min-width: 210px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s;
}
.search-trigger:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-trigger .kbd { margin-left: auto; }

.icon-btn {
    width: 36px; height: 36px;
    display: inline-grid; place-items: center;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-2);
    border-radius: 10px;
    cursor: pointer;
    transition: .18s;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }

.kbd {
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 5px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--muted);
}

/* ============================ 容器 ============================ */
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.page { padding: 26px 0 64px; }

/* ============================ 首页英雄区 ============================ */
.hero {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background:
        radial-gradient(1100px 320px at 12% -10%, rgba(124, 58, 237, .16), transparent 60%),
        radial-gradient(900px 300px at 92% 0%, rgba(14, 165, 233, .16), transparent 55%),
        var(--surface);
    padding: 40px 34px 32px;
    box-shadow: var(--shadow);
}
.hero::after {
    content: "";
    position: absolute; inset: 0;
    background-image: radial-gradient(var(--line) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: .5;
    mask-image: linear-gradient(180deg, #000, transparent 75%);
    pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 11px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--brand);
    font-size: 12.5px;
    font-weight: 600;
}
.hero h1 {
    margin: 16px 0 10px;
    font-size: clamp(26px, 3.4vw, 40px);
    line-height: 1.25;
    letter-spacing: -1px;
}
.hero h1 em {
    font-style: normal;
    background: linear-gradient(120deg, var(--brand), var(--brand-2) 55%, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p { margin: 0; max-width: 720px; color: var(--muted); font-size: 15.5px; }

.hero-search { margin-top: 22px; display: flex; gap: 10px; max-width: 660px; }
.hero-search input {
    flex: 1;
    height: 48px;
    padding: 0 16px 0 42px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink);
    font-size: 15px;
    outline: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>");
    background-repeat: no-repeat;
    background-position: 14px center;
    transition: .18s;
}
.hero-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

.hero-stats { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 22px; color: var(--muted); font-size: 13px; }
.hero-stats b { color: var(--ink); font-family: var(--mono); font-size: 16px; margin-right: 4px; }

/* ============================ 按钮 ============================ */
.btn-x {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 38px;
    padding: 0 15px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .12s, box-shadow .18s, background .18s, border-color .18s;
    white-space: nowrap;
    user-select: none;
}
.btn-x:active { transform: translateY(1px); }
.btn-x[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary-x {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    box-shadow: 0 8px 18px -10px rgba(79, 70, 229, .9);
}
.btn-primary-x:hover { color: #fff; box-shadow: 0 12px 24px -10px rgba(79, 70, 229, .9); }
.btn-soft-x { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.btn-soft-x:hover { border-color: var(--brand); color: var(--brand); }
.btn-line-x { background: var(--surface); color: var(--ink-2); border-color: var(--line-strong); }
.btn-line-x:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost-x { background: transparent; color: var(--muted); }
.btn-ghost-x:hover { background: var(--surface-2); color: var(--ink); }
.btn-sm-x { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-danger-x { background: #fef2f2; color: var(--danger); border-color: #fecaca; }
html[data-theme="dark"] .btn-danger-x { background: #2a1418; border-color: #4c1d24; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ============================ 分类与卡片 ============================ */
.section-head {
    display: flex; align-items: baseline; gap: 12px;
    margin: 34px 0 14px;
}
.section-head h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.3px;
    display: flex; align-items: center; gap: 10px;
}
.section-head h2::before {
    content: "";
    width: 4px; height: 16px; border-radius: 3px;
    background: linear-gradient(180deg, var(--brand), var(--accent));
}
.section-head .count { color: var(--muted); font-size: 12.5px; font-family: var(--mono); }
.section-head .spacer { margin-left: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px; }
.chip {
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    transition: .16s;
    display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--surface);
}
html[data-theme="dark"] .chip.active { background: var(--brand); border-color: var(--brand); color: #0b1020; }
.chip .n { font-family: var(--mono); font-size: 11px; opacity: .65; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
    gap: 14px;
}

.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px 16px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    transition: transform .16s, box-shadow .2s, border-color .2s;
    overflow: hidden;
}
.tool-card::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--brand), var(--accent));
    opacity: 0;
    transition: opacity .2s;
}
.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
    color: var(--ink);
}
.tool-card:hover::before { opacity: 1; }
.tool-card-top { display: flex; align-items: center; gap: 10px; }
.tool-mono {
    width: 34px; height: 34px;
    flex: 0 0 34px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: var(--brand-soft);
    color: var(--brand);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -.5px;
    border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
}
.tool-card h3 { margin: 0; font-size: 14.5px; font-weight: 650; letter-spacing: -.2px; }
.tool-card p { margin: 0; color: var(--muted); font-size: 12.8px; line-height: 1.55; }
.tool-card-tags { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.mini-tag {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 5px;
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--line);
    font-family: var(--mono);
}
.tool-card .fav {
    position: absolute; top: 10px; right: 10px;
    width: 24px; height: 24px;
    display: grid; place-items: center;
    border-radius: 7px;
    color: var(--line-strong);
    background: transparent;
    border: 0;
    cursor: pointer;
    opacity: 0;
    transition: .15s;
}
.tool-card:hover .fav { opacity: 1; }
.tool-card .fav:hover { color: var(--warn); background: var(--surface-2); }
.tool-card .fav.on { opacity: 1; color: var(--warn); }

/* ============================ 工具页布局 ============================ */
.tool-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 292px;
    gap: 22px;
    align-items: start;
}
@media (max-width: 1080px) {
    .tool-layout { grid-template-columns: minmax(0, 1fr); }
    .tool-aside { display: none; }
}

.breadcrumb-bar {
    display: flex; align-items: center; gap: 8px;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.breadcrumb-bar a { color: var(--muted); }
.breadcrumb-bar a:hover { color: var(--brand); }
.breadcrumb-bar span.sep { opacity: .5; }

.tool-head { margin-bottom: 18px; }
.tool-head h1 {
    font-size: clamp(22px, 2.4vw, 30px);
    letter-spacing: -.6px;
    margin: 0 0 8px;
    display: flex; align-items: center; gap: 12px;
    flex-wrap: wrap;
}
.tool-head h1 .tool-mono { width: 42px; height: 42px; flex-basis: 42px; font-size: 14px; border-radius: 11px; }
.tool-head .lead { margin: 0; color: var(--muted); max-width: 820px; }
.tool-head .head-actions { margin-left: auto; display: flex; gap: 6px; }
.badge-soft {
    font-size: 11.5px; font-weight: 600;
    padding: 2px 9px; border-radius: 999px;
    background: var(--brand-soft); color: var(--brand);
    border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
}

/* ---------- 面板 ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.panel + .panel { margin-top: 16px; }
.panel-head {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 15px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    min-height: 46px;
}
.panel-head h2, .panel-head h3 { margin: 0; font-size: 13.5px; font-weight: 650; letter-spacing: -.1px; }
.panel-head .sub { color: var(--muted); font-size: 12px; }
.panel-head .spacer { margin-left: auto; }
.panel-body { padding: 15px; }

/* ---------- 表单 ---------- */
.field { display: block; margin-bottom: 12px; }
.field > label, .field-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 6px;
}
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }

.input-x, .select-x, .textarea-x {
    width: 100%;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 14px;
    outline: none;
    transition: border-color .16s, box-shadow .16s;
    font-family: inherit;
}
.input-x:focus, .select-x:focus, .textarea-x:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.input-x.mono, .textarea-x.mono { font-family: var(--mono); font-size: 13px; }
.textarea-x { resize: vertical; min-height: 120px; line-height: 1.6; }
.input-row { display: flex; gap: 10px; flex-wrap: wrap; }
.input-row > * { flex: 1 1 180px; }

/* ---------- 代码区 ---------- */
.code-area {
    width: 100%;
    min-height: 300px;
    resize: vertical;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--code-bg);
    color: var(--code-ink);
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.65;
    padding: 14px;
    outline: none;
    tab-size: 2;
    white-space: pre;
    overflow: auto;
}
.code-area:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.code-out {
    min-height: 120px;
    max-height: 560px;
    overflow: auto;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: var(--code-bg);
    color: var(--code-ink);
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.65;
    white-space: pre;
    margin: 0;
    tab-size: 2;
}
.code-out.wrap-soft { white-space: pre-wrap; word-break: break-all; }

/* ---------- 分区标签 ---------- */
.tabs {
    display: inline-flex;
    padding: 3px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    gap: 2px;
    flex-wrap: wrap;
}
.tab {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    padding: 6px 13px;
    border-radius: 7px;
    cursor: pointer;
    transition: .15s;
    font-weight: 550;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
html[data-theme="dark"] .tab.active { background: var(--brand); color: #0b1020; }

/* ---------- 输出状态 ---------- */
.status {
    display: flex; align-items: center; gap: 8px;
    font-size: 12.5px;
    color: var(--muted);
    min-height: 22px;
    flex-wrap: wrap;
}
.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }
.status.warn { color: var(--warn); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 7px; }

/* ---------- 表格 ---------- */
.table-x { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-x th, .table-x td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-x th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--surface-2); position: sticky; top: 0; }
.table-x tr:hover td { background: var(--surface-2); }
.table-x code { font-family: var(--mono); font-size: 12px; }
.table-scroll { max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* ---------- 侧栏 ---------- */
.tool-aside { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 14px; }
.aside-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow-sm);
}
.aside-card h3 {
    margin: 0 0 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--muted);
}
.aside-link {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 8px;
    border-radius: 8px;
    color: var(--ink-2);
    font-size: 13px;
}
.aside-link:hover { background: var(--surface-2); color: var(--brand); }
.aside-link .tool-mono { width: 26px; height: 26px; flex-basis: 26px; font-size: 10px; border-radius: 7px; }

/* ---------- 文档 / SEO 内容 ---------- */
.doc-section { margin-top: 26px; }
.doc-section h2 { font-size: 17px; letter-spacing: -.3px; margin: 0 0 10px; }
.doc-section h3 { font-size: 14.5px; margin: 18px 0 8px; }
.doc-section p, .doc-section li { color: var(--ink-2); font-size: 14px; }
.doc-section ul { padding-left: 20px; margin: 8px 0; }
.doc-section code {
    font-family: var(--mono);
    font-size: 12.5px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 1px 5px;
    border-radius: 5px;
}

.faq details {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    background: var(--surface);
    margin-bottom: 8px;
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 13.5px;
    list-style: none;
    display: flex; align-items: center; gap: 8px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
    content: "+";
    font-family: var(--mono);
    color: var(--brand);
    font-size: 15px;
    width: 14px;
}
.faq details[open] summary::before { content: "–"; }
.faq details p { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; }

/* ============================ 命令面板 ============================ */
.cmdk-mask {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(3px);
    z-index: 200;
    display: none;
    padding: 10vh 16px 0;
}
.cmdk-mask.open { display: block; }
.cmdk {
    max-width: 640px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.cmdk input {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    padding: 16px 18px;
    font-size: 15.5px;
    outline: none;
}
.cmdk-list { max-height: 52vh; overflow: auto; padding: 8px; }
.cmdk-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 10px;
    border-radius: 9px;
    cursor: pointer;
    color: var(--ink);
}
.cmdk-item .path { color: var(--muted); font-size: 11.5px; margin-left: auto; font-family: var(--mono); }
.cmdk-item.active, .cmdk-item:hover { background: var(--brand-soft); color: var(--brand); }
.cmdk-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }
.cmdk-foot {
    display: flex; gap: 14px; align-items: center;
    padding: 8px 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 11.5px;
    background: var(--surface-2);
}

/* ============================ Toast ============================ */
.toast-host {
    position: fixed;
    right: 18px; bottom: 18px;
    z-index: 300;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    min-width: 200px;
    max-width: 380px;
    padding: 10px 14px;
    border-radius: 11px;
    background: var(--ink);
    color: var(--surface);
    font-size: 13px;
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 9px;
    animation: toast-in .22s ease-out;
}
.toast.ok { background: #0f766e; }
.toast.err { background: #b91c1c; }
.toast.warn { background: #b45309; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================ 空状态 ============================ */
.empty {
    padding: 34px 18px;
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
}
.empty b { display: block; color: var(--ink); margin-bottom: 4px; font-size: 14.5px; }

/* ============================ 页脚 ============================ */
.app-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding: 30px 0 22px;
    margin-top: 20px;
}
.footer-inner {
    max-width: 1320px; margin: 0 auto; padding: 0 20px;
    display: flex; flex-wrap: wrap; gap: 26px;
    justify-content: space-between;
    font-size: 12.8px;
    color: var(--muted);
}
.footer-cols { display: flex; gap: 40px; flex-wrap: wrap; }
.footer-col h4 { margin: 0 0 8px; font-size: 12px; color: var(--ink); letter-spacing: .3px; }
.footer-col a { display: block; color: var(--muted); padding: 2px 0; }
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
    max-width: 1320px; margin: 18px auto 0; padding: 14px 20px 0;
    border-top: 1px solid var(--line);
    color: var(--muted); font-size: 12px;
    display: flex; gap: 14px; flex-wrap: wrap; justify-content: space-between;
}

/* ============================ 工具类 ============================ */
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row-gap { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stack-8 > * + * { margin-top: 8px; }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .split-2 { grid-template-columns: 1fr; } }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-14 { margin-top: 14px; } .mt-20 { margin-top: 20px; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* 代码高亮（轻量） */
.tok-key { color: #c792ea; }
.tok-str { color: #c3e88d; }
.tok-num { color: #f78c6c; }
.tok-bool { color: #82aaff; }
.tok-null { color: #ff9cac; }

/* 中等宽度：收起常驻分类链接，仅保留「分类」下拉入口 */
@media (max-width: 1040px) {
    .header-nav > a { display: none; }
    .brand-sub { display: none; }
    /* 面板左锚点固定（x≈153）后必须让宽度随视口收缩，否则固定 618px 会把右边界
       顶到 x=771，761–770px 视口下溢出并出现横向滚动条。
       - 右列 minmax(0, 1fr)：空间不足时可压缩（原固定 420px 无法收缩）
       - 左列 max-content：内容自适应，实测自然宽 121px。写死 120px 会把
         「格式化与转换」截断；写死 132px 则让 761px 下右列可用宽恰好等于需求宽
         （171px==171px，余量 0），故取内容自适应，右列仍留 6px 余量
       - width: min(618px, calc(100vw - 176px))：176px = 左锚点 153 + 经典滚动条 17
         + 6px 余量。不用 160px 是因为 100vw 含滚动条宽度，17px 滚动条下右边界
         会到 100vw-7 > clientWidth，仍会撑出横向滚动条
       - min-width: 0 必须显式覆盖基础规则的 min-width: 600px，否则最小值仍会撑破 */
    .nav-more-panel {
        right: auto; left: 0;
        grid-template-columns: max-content minmax(0, 1fr);
        width: min(618px, calc(100vw - 176px));
        min-width: 0;
    }
}

@media (max-width: 760px) {
    .hero { padding: 28px 20px 24px; border-radius: 16px; }
    .header-nav { display: none; }
    .search-trigger { min-width: 0; }
    .search-trigger span.label { display: none; }
    .search-trigger { padding: 0 10px; }
    .tool-head .head-actions { margin-left: 0; }
}

@media print {
    .app-header, .app-footer, .tool-aside, .cmdk-mask, .toast-host, .head-actions { display: none !important; }
    body { background: #fff; }
}

/* ---------- 工具页反馈卡片 ---------- */
.fb-stars { display: flex; gap: 4px; margin-bottom: 8px; }
.fb-star {
    border: 0; background: transparent; cursor: pointer;
    font-size: 18px; line-height: 1; color: var(--line-strong); padding: 0 1px;
    transition: color .15s, transform .15s;
}
.fb-star:hover { transform: scale(1.1); }
.fb-star.on { color: var(--warn); }
.fb-text { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12.5px; padding: 7px 9px; resize: vertical; min-height: 58px; outline: none; font-family: inherit; }
.fb-text:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.fb-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

/* ---------- 工具页反馈卡片 ---------- */
.fb-stars { display: flex; gap: 4px; margin-bottom: 8px; }
.fb-star {
    border: 0; background: transparent; cursor: pointer;
    font-size: 18px; line-height: 1; color: var(--line-strong); padding: 0 1px;
    transition: color .15s, transform .15s;
}
.fb-star:hover { transform: scale(1.1); }
.fb-star.on { color: var(--warn); }
.fb-text { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12.5px; padding: 7px 9px; resize: vertical; min-height: 58px; outline: none; font-family: inherit; }
.fb-text:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.fb-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
