/*
 * dsh.css — DeepSeek Harness 在线工作台（/tools/dsh）
 * ------------------------------------------------------------------
 * 1. --dsh-* 变量定义在 :root（抽屉 / 遮罩 / toast 挂在 body 下）
 * 2. 所有用 hidden 控制显隐的元素必须补 [hidden] 兜底
 * 3. 站点 body{overflow-y:scroll} 会让页内 sticky 失效 → 本页 overflow:visible
 * 4. 断点降序：≥1920 / ≥1600 / ≤1400 / ≤1100 / ≤900 / ≤767 / ≤420
 * 5. 文字色 --dsh-accent 与填充色 --dsh-accent-fill 分离，保证白字按钮达 AA 对比度
 */

:root {
    --dsh-bg: #0b0e14;
    --dsh-card: #131822;
    --dsh-card-2: #1a2130;
    --dsh-card-3: #202a3b;
    --dsh-border: #283244;
    --dsh-border-2: #3a485f;
    --dsh-text: #e9eef7;
    --dsh-sub: #b3bfd0;
    --dsh-faint: #96a3b7;
    --dsh-faint-2: #7d8ba1;
    --dsh-accent: #6b91ff;
    --dsh-accent-fill: #3f63d8;
    --dsh-accent-soft: rgba(107, 145, 255, .14);
    --dsh-blue: #63b3ed;
    --dsh-blue-soft: rgba(96, 165, 250, .13);
    --dsh-ok: #55d095;
    --dsh-ok-soft: rgba(78, 201, 138, .13);
    --dsh-warn: #e8bb52;
    --dsh-warn-soft: rgba(227, 179, 65, .13);
    --dsh-err: #f0837c;
    --dsh-err-soft: rgba(239, 119, 112, .13);
    --dsh-shadow: 0 16px 40px -24px rgba(0, 0, 0, .9);
    --dsh-shadow-sm: 0 4px 16px -10px rgba(0, 0, 0, .8);
    --dsh-zebra: rgba(127, 127, 127, .055);
    --dsh-r: 14px;
    --dsh-r-s: 9px;
    --dsh-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

[data-theme="light"] {
    --dsh-bg: #f4f6fb;
    --dsh-card: #ffffff;
    --dsh-card-2: #f2f5fa;
    --dsh-card-3: #e9eef7;
    --dsh-border: #dde4ef;
    --dsh-border-2: #c4cfe0;
    --dsh-text: #1b2433;
    --dsh-sub: #475367;
    --dsh-faint: #5e697c;
    --dsh-faint-2: #6d7787;
    --dsh-accent: #2b52bf;
    --dsh-accent-fill: #2c4fb0;
    --dsh-accent-soft: rgba(49, 89, 201, .09);
    --dsh-blue: #1d68b3;
    --dsh-blue-soft: rgba(37, 99, 235, .09);
    --dsh-ok: #167545;
    --dsh-ok-soft: rgba(26, 127, 75, .09);
    --dsh-warn: #8a6006;
    --dsh-warn-soft: rgba(150, 105, 10, .10);
    --dsh-err: #ad322c;
    --dsh-err-soft: rgba(185, 59, 53, .09);
    --dsh-shadow: 0 14px 34px -24px rgba(20, 32, 60, .5);
    --dsh-shadow-sm: 0 3px 12px -8px rgba(20, 32, 60, .4);
    --dsh-zebra: rgba(15, 20, 25, .038);
}

/* 满屏（保留左侧导航）：解除站点 .app / 内容容器的限宽 */
body.page-dsh-full { overflow: visible; }
body.page-dsh-full.dsh-drawer-open { overflow: hidden; }
body.page-dsh-full .app,
body.page-dsh-full .main-content,
body.page-dsh-full .page-container { max-width: 100%; width: 100%; }
body.page-dsh-full .main-content { border-right: 0; min-width: 0; }

.dsh {
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 24px 28px 80px;
    color: var(--dsh-text);
    font-size: 14.5px;
    line-height: 1.68;
}
.dsh *, .dsh *::before, .dsh *::after { box-sizing: border-box; }
.dsh [hidden], .dsh-mask[hidden], .dsh-drawer[hidden], .dsh-toast[hidden] { display: none !important; }
.dsh a { color: var(--dsh-accent); text-decoration: none; }
.dsh a:hover { text-decoration: underline; }
.dsh button, .dsh input, .dsh select, .dsh textarea { font-family: inherit; }
.dsh :focus-visible { outline: 2px solid var(--dsh-accent); outline-offset: 2px; }

/* ---------------- Hero ---------------- */
.dsh-hero {
    position: relative;
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 22px 24px;
    border: 1px solid var(--dsh-border);
    border-radius: var(--dsh-r);
    background: var(--dsh-card);
    background-image: linear-gradient(135deg, var(--dsh-accent-soft), transparent 58%);
    box-shadow: var(--dsh-shadow-sm);
    margin-bottom: 16px;
}
.dsh-hero-ic {
    flex: 0 0 auto; width: 50px; height: 50px; border-radius: 14px;
    display: grid; place-items: center; font-size: 26px;
    background: var(--dsh-accent-soft); border: 1px solid var(--dsh-border-2);
}
.dsh-hero-tx { flex: 1 1 auto; min-width: 0; }
.dsh-hero-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dsh-hero-t { margin: 0; font-size: 22px; line-height: 1.35; font-weight: 700; letter-spacing: .2px; }
.dsh-hero-badge {
    font-size: 11.5px; padding: 2px 10px; border-radius: 999px; white-space: nowrap;
    color: var(--dsh-accent); background: var(--dsh-accent-soft);
    border: 1px solid var(--dsh-border-2);
}
.dsh-hero-sub { margin: 8px 0 0; color: var(--dsh-sub); font-size: 13.5px; max-width: 86ch; }
.dsh-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.dsh-tag {
    font-size: 12px; padding: 3px 11px; border-radius: 999px;
    border: 1px solid var(--dsh-border); color: var(--dsh-sub); background: var(--dsh-card-2);
}
.dsh-hero-acts { display: flex; gap: 7px; flex: 0 0 auto; align-items: center; }
.dsh-hero.is-collapsed .dsh-hero-extra { display: none; }
.dsh-hero.is-collapsed { padding: 12px 18px; }

/* ---------------- 通用控件 ---------------- */
.dsh-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 36px; padding: 7px 14px; border-radius: var(--dsh-r-s);
    border: 1px solid var(--dsh-border-2); background: var(--dsh-card-2);
    color: var(--dsh-text); font-size: 13px; cursor: pointer; white-space: nowrap;
    transition: background .16s, border-color .16s, transform .16s;
}
.dsh-btn:hover { background: var(--dsh-card-3); border-color: var(--dsh-accent); }
.dsh-btn:disabled { opacity: .5; cursor: not-allowed; }
.dsh-btn-pri { background: var(--dsh-accent-fill); border-color: var(--dsh-accent-fill); color: #fff; font-weight: 600; }
.dsh-btn-pri:hover { background: var(--dsh-accent-fill); border-color: var(--dsh-accent-fill); filter: brightness(1.12); }
.dsh-btn-ghost { background: transparent; }
.dsh-btn-danger { color: var(--dsh-err); border-color: var(--dsh-err); }
.dsh-btn-sm { min-height: 32px; padding: 4px 11px; font-size: 12.5px; }
.dsh-btn-icon {
    width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 9px;
    border: 1px solid var(--dsh-border); background: transparent; color: var(--dsh-sub);
    display: inline-grid; place-items: center; cursor: pointer;
}
.dsh-btn-icon:hover { color: var(--dsh-accent); border-color: var(--dsh-accent); }
.dsh-btn-icon svg { width: 15px; height: 15px; transition: transform .18s; }
.dsh-btn-icon[aria-expanded="false"] svg { transform: rotate(-90deg); }
.dsh-in, .dsh-sel, .dsh-ta {
    width: 100%; min-height: 36px; padding: 7px 11px; border-radius: var(--dsh-r-s);
    border: 1px solid var(--dsh-border-2); background: var(--dsh-card-2);
    color: var(--dsh-text); font-size: 13.5px; outline: none;
}
.dsh-in:focus, .dsh-sel:focus, .dsh-ta:focus { border-color: var(--dsh-accent); box-shadow: 0 0 0 3px var(--dsh-accent-soft); }
.dsh-ta { resize: vertical; min-height: 80px; line-height: 1.65; }
.dsh-sel { cursor: pointer; }
.dsh-label { display: block; font-size: 12.5px; color: var(--dsh-sub); margin-bottom: 5px; font-weight: 600; }
.dsh-hint { font-size: 12px; color: var(--dsh-faint); margin-top: 5px; }
.dsh-card {
    border: 1px solid var(--dsh-border); border-radius: var(--dsh-r);
    background: var(--dsh-card); box-shadow: var(--dsh-shadow-sm); padding: 18px 20px;
}
.dsh-card-t { margin: 0 0 13px; font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.dsh-card-t .dsh-n { font-size: 11.5px; font-weight: 500; color: var(--dsh-faint); }
.dsh-row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.dsh-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dsh-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dsh-sep { height: 1px; background: var(--dsh-border); margin: 14px 0; }
.dsh-pill {
    display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
    padding: 2px 10px; border-radius: 999px; border: 1px solid var(--dsh-border);
    background: var(--dsh-card-2); color: var(--dsh-sub); white-space: nowrap;
}
.dsh-pill.is-ok { color: var(--dsh-ok); background: var(--dsh-ok-soft); border-color: transparent; }
.dsh-pill.is-warn { color: var(--dsh-warn); background: var(--dsh-warn-soft); border-color: transparent; }
.dsh-pill.is-err { color: var(--dsh-err); background: var(--dsh-err-soft); border-color: transparent; }
.dsh-pill.is-acc { color: var(--dsh-accent); background: var(--dsh-accent-soft); border-color: transparent; }
.dsh-code {
    font-family: var(--dsh-mono); font-size: 12.5px; line-height: 1.75;
    white-space: pre-wrap; word-break: break-word; color: var(--dsh-text);
    background: var(--dsh-card-2); border: 1px solid var(--dsh-border);
    border-radius: var(--dsh-r-s); padding: 11px 13px; margin: 0;
}
.dsh-mono { font-family: var(--dsh-mono); font-size: .92em; }
.dsh-empty { padding: 30px 16px; text-align: center; color: var(--dsh-faint); font-size: 13px; }

/* ---------------- Tabs ---------------- */
.dsh-tabs {
    position: sticky; top: 0; z-index: 20; display: flex; gap: 4px;
    overflow-x: auto; scrollbar-width: none; padding: 6px;
    border: 1px solid var(--dsh-border); border-radius: 12px;
    background: var(--dsh-card);
    background: color-mix(in srgb, var(--dsh-card) 92%, transparent);
    backdrop-filter: blur(10px);
    margin-bottom: 16px;
}
.dsh-tabs::-webkit-scrollbar { display: none; }
.dsh-tab {
    flex: 0 0 auto; min-height: 38px; padding: 6px 16px; border: 0; border-radius: 8px;
    background: transparent; color: var(--dsh-sub); font-size: 13.5px; cursor: pointer;
    white-space: nowrap; transition: background .16s, color .16s;
}
.dsh-tab:hover { background: var(--dsh-card-2); color: var(--dsh-text); }
.dsh-tab.is-on { background: var(--dsh-accent-fill); color: #fff; font-weight: 600; }
.dsh-pane { min-width: 0; animation: dsh-fade .18s ease-out; }
@keyframes dsh-fade { from { opacity: .5; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------- 统计条 ---------------- */
.dsh-stat {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--dsh-border); border-radius: var(--dsh-r);
    background: var(--dsh-card); margin-bottom: 14px; overflow: hidden;
}
.dsh-stat-i { padding: 13px 18px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dsh-stat-i + .dsh-stat-i { border-left: 1px solid var(--dsh-border); }
.dsh-stat-i b { font-size: 22px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.dsh-stat-i em { font-style: normal; font-size: 12px; color: var(--dsh-faint); }
.dsh-stat-i:nth-child(1) b { color: var(--dsh-accent); }
.dsh-stat-i:nth-child(2) b { color: var(--dsh-ok); }
.dsh-stat-i:nth-child(3) b { color: var(--dsh-blue); }
.dsh-stat-i:nth-child(4) b { color: var(--dsh-warn); }

/* ---------------- 概览 ---------------- */
.dsh-arch { display: grid; gap: 9px; }
.dsh-arch-l {
    display: grid; grid-template-columns: minmax(0, 196px) minmax(0, 1fr);
    gap: 12px; align-items: stretch; border: 1px solid var(--dsh-border);
    border-radius: var(--dsh-r-s); background: var(--dsh-card-2); padding: 11px 13px;
    cursor: pointer; transition: border-color .16s, transform .16s;
}
.dsh-arch-l:hover { border-color: var(--dsh-accent); transform: translateX(2px); }
.dsh-arch-l.is-on { border-color: var(--dsh-accent); background: var(--dsh-accent-soft); }
.dsh-arch-n { font-weight: 700; font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.dsh-arch-n small { font-family: var(--dsh-mono); font-size: 11px; font-weight: 400; color: var(--dsh-faint); word-break: break-all; }
.dsh-arch-c { min-width: 0; }
.dsh-arch-c p { margin: 0 0 7px; color: var(--dsh-sub); font-size: 13px; max-width: 76ch; }
.dsh-arch-items { display: flex; flex-wrap: wrap; gap: 5px; }
.dsh-arch-items span { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--dsh-card-3); color: var(--dsh-sub); }
.dsh-concept {
    border: 1px solid var(--dsh-border); border-radius: var(--dsh-r-s);
    background: var(--dsh-card-2); padding: 13px 15px; transition: border-color .16s, transform .16s;
}
.dsh-concept:hover { border-color: var(--dsh-accent); transform: translateY(-1px); }
.dsh-concept b { display: block; font-size: 13.5px; margin-bottom: 5px; }
.dsh-concept p { margin: 0; color: var(--dsh-sub); font-size: 13px; line-height: 1.7; max-width: 76ch; }
.dsh-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.dsh-kv > div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--dsh-border); padding: 6px 0; font-size: 13px; }
.dsh-kv span { color: var(--dsh-faint); }
.dsh-kv strong { font-weight: 600; text-align: right; word-break: break-all; }

/* ---------------- 插件工作台 ---------------- */
.dsh-tools {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    padding: 12px 14px; margin-bottom: 12px;
    border: 1px solid var(--dsh-border); border-radius: var(--dsh-r);
    background: var(--dsh-card);
}
.dsh-search { position: relative; flex: 1 1 250px; min-width: 170px; max-width: 360px; }
.dsh-search .dsh-in { padding-left: 32px; }
.dsh-search::before {
    content: '⌕'; position: absolute; left: 10px; top: 50%; transform: translateY(-52%);
    color: var(--dsh-faint); font-size: 18px; pointer-events: none;
}
.dsh-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.dsh-chip {
    min-height: 34px; padding: 5px 13px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--dsh-border); background: var(--dsh-card-2);
    color: var(--dsh-sub); font-size: 12.5px; white-space: nowrap;
    transition: border-color .16s, color .16s;
}
.dsh-chip:hover { border-color: var(--dsh-accent); color: var(--dsh-text); }
.dsh-chip.is-on { background: var(--dsh-accent-fill); border-color: var(--dsh-accent-fill); color: #fff; font-weight: 600; }
.dsh-pgrid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(256px, 1fr));
    gap: 12px; align-content: start;
}
.dsh-pcard {
    display: flex; flex-direction: column; gap: 9px; min-width: 0;
    border: 1px solid var(--dsh-border); border-radius: var(--dsh-r-s);
    background: var(--dsh-card-2); padding: 14px 15px;
    transition: border-color .16s, box-shadow .16s, transform .16s;
}
.dsh-pcard:hover { border-color: var(--dsh-border-2); box-shadow: var(--dsh-shadow-sm); transform: translateY(-1px); }
.dsh-pcard.is-on { border-color: var(--dsh-accent); background: var(--dsh-card); box-shadow: inset 3px 0 0 var(--dsh-accent); }
.dsh-pcard.is-fav { box-shadow: inset 3px 0 0 var(--dsh-warn); }
.dsh-pcard.is-on.is-fav { box-shadow: inset 3px 0 0 var(--dsh-accent), inset 0 -3px 0 var(--dsh-warn); }
.dsh-pc-top { display: flex; gap: 9px; align-items: flex-start; }
.dsh-pc-name { font-weight: 700; font-size: 14px; flex: 1 1 auto; min-width: 0; }
.dsh-pc-pkg { display: block; font-family: var(--dsh-mono); font-size: 11px; color: var(--dsh-faint); font-weight: 400; word-break: break-all; margin-top: 3px; }
.dsh-switch {
    flex: 0 0 auto; width: 44px; height: 26px; padding: 0; border-radius: 999px;
    border: 1px solid var(--dsh-border-2); background: var(--dsh-card-3);
    cursor: pointer; position: relative; transition: background .18s;
}
.dsh-switch::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
    border-radius: 50%; background: var(--dsh-sub); transition: transform .18s, background .18s;
}
.dsh-switch.is-on { background: var(--dsh-accent-fill); border-color: var(--dsh-accent-fill); }
.dsh-switch.is-on::after { transform: translateX(18px); background: #fff; }
.dsh-pc-desc { margin: 0; color: var(--dsh-sub); font-size: 13px; line-height: 1.68; min-height: 44px; }
.dsh-pc-tags { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.dsh-pc-tags span { font-size: 11px; padding: 2px 8px; border-radius: 5px; background: var(--dsh-card-3); color: var(--dsh-faint); font-family: var(--dsh-mono); }
.dsh-pc-foot { display: flex; gap: 7px; align-items: center; margin-top: auto; }
.dsh-pc-foot .dsh-btn { flex: 1 1 auto; }
.dsh-star {
    flex: 0 0 auto; width: 36px; height: 36px; border: 1px solid var(--dsh-border);
    border-radius: 9px; background: transparent; color: var(--dsh-faint);
    cursor: pointer; font-size: 17px; line-height: 1;
}
.dsh-star:hover { border-color: var(--dsh-warn); }
.dsh-star.is-on { color: var(--dsh-warn); border-color: var(--dsh-warn); }
.dsh-warnbar {
    display: flex; gap: 8px; align-items: flex-start; padding: 10px 13px; margin-bottom: 12px;
    border: 1px solid var(--dsh-warn); border-radius: var(--dsh-r-s);
    background: var(--dsh-warn-soft); color: var(--dsh-warn); font-size: 13px;
}

/* ---------------- 抽屉 / 遮罩 / toast ---------------- */
.dsh-mask { position: fixed; inset: 0; z-index: 100000; background: rgba(4, 8, 15, .62); display: flex; align-items: stretch; justify-content: flex-end; }
.dsh-drawer {
    width: min(500px, 92vw); height: 100%; overflow-y: auto; background: var(--dsh-card);
    border-left: 1px solid var(--dsh-border); box-shadow: var(--dsh-shadow);
    padding: 20px 22px 34px; animation: dsh-slide .2s ease-out;
    scrollbar-width: thin; overscroll-behavior: contain;
}
@keyframes dsh-slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.dsh-dr-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.dsh-dr-head h3 { margin: 0; font-size: 18px; flex: 1 1 auto; }
.dsh-dr-sec { margin-top: 15px; }
.dsh-dr-sec h4 { margin: 0 0 7px; font-size: 12px; color: var(--dsh-faint); text-transform: uppercase; letter-spacing: .6px; }
.dsh-dr-sec p { margin: 0; font-size: 13.5px; color: var(--dsh-sub); line-height: 1.8; }
.dsh-dr-list { display: flex; flex-wrap: wrap; gap: 6px; }
.dsh-toast {
    position: fixed; z-index: 100001; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%); max-width: min(90vw, 460px); padding: 11px 19px;
    border-radius: 10px; background: var(--dsh-card-3); color: var(--dsh-text);
    border: 1px solid var(--dsh-border-2); box-shadow: var(--dsh-shadow); font-size: 13.5px;
}
.dsh-toast.is-err { border-color: var(--dsh-err); color: var(--dsh-err); }
.dsh-toast.is-ok { border-color: var(--dsh-ok); color: var(--dsh-ok); }

/* ---------------- 生成器 ---------------- */
.dsh-gen { display: grid; grid-template-columns: clamp(300px, 25vw, 370px) minmax(0, 1fr); gap: 16px; align-items: start; }
.dsh-gen-form { display: grid; gap: 12px; }
.dsh-field { display: grid; gap: 6px; min-width: 0; }
.dsh-field-t { font-size: 12.5px; font-weight: 600; color: var(--dsh-sub); }
.dsh-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dsh-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dsh-sub); cursor: pointer; min-height: 32px; }
.dsh-check input { accent-color: var(--dsh-accent); width: 16px; height: 16px; }
.dsh-out-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 11px; }
.dsh-out-tabs { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 11px; }
.dsh-out-tab {
    min-height: 32px; padding: 4px 12px; border-radius: 8px;
    border: 1px solid var(--dsh-border); background: var(--dsh-card-2);
    color: var(--dsh-sub); font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.dsh-out-tab:hover { border-color: var(--dsh-accent); }
.dsh-out-tab.is-on { background: var(--dsh-accent-fill); border-color: var(--dsh-accent-fill); color: #fff; font-weight: 600; }
.dsh-out {
    margin: 0; min-height: 330px; max-height: min(62vh, 640px); overflow: auto;
    font-family: var(--dsh-mono); font-size: 12.5px; line-height: 1.78;
    white-space: pre; tab-size: 2; color: var(--dsh-text);
    background: var(--dsh-card-2); border: 1px solid var(--dsh-border);
    border-radius: var(--dsh-r-s); padding: 14px 16px;
    scrollbar-width: thin; overscroll-behavior: contain;
}
.dsh-out::-webkit-scrollbar { width: 9px; height: 9px; }
.dsh-out::-webkit-scrollbar-thumb { background: var(--dsh-border-2); border-radius: 6px; }

/* ---------------- 模拟器 ---------------- */
.dsh-sim { display: grid; grid-template-columns: minmax(0, 252px) minmax(0, 1fr) minmax(0, 300px); gap: 14px; align-items: start; }
.dsh-sim-col { min-width: 0; display: grid; gap: 12px; }
.dsh-sim-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.dsh-prog { height: 7px; border-radius: 999px; background: var(--dsh-card-3); overflow: hidden; margin-bottom: 6px; }
.dsh-prog > i { display: block; height: 100%; width: 0; background: var(--dsh-accent-fill); transition: width .25s; }
.dsh-events {
    display: grid; gap: 9px; min-height: 210px; max-height: min(64vh, 680px);
    overflow-y: auto; padding-right: 5px; scrollbar-width: thin; overscroll-behavior: contain;
}
.dsh-ev {
    border: 1px solid var(--dsh-border); border-left: 3px solid var(--dsh-border-2);
    border-radius: var(--dsh-r-s); background: var(--dsh-card-2);
    padding: 10px 12px; animation: dsh-fade .2s ease-out;
}
.dsh-ev-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.dsh-ev-k { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--dsh-faint); }
.dsh-ev-tool { font-family: var(--dsh-mono); font-size: 12px; padding: 2px 8px; border-radius: 5px; background: var(--dsh-blue-soft); color: var(--dsh-accent); }
.dsh-ev-tx { margin: 0; font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.dsh-ev-args { margin: 7px 0 0; font-family: var(--dsh-mono); font-size: 11.5px; color: var(--dsh-sub); white-space: pre-wrap; word-break: break-all; background: var(--dsh-card-3); border-radius: 6px; padding: 7px 9px; }
.dsh-ev-meta { font-size: 11.5px; color: var(--dsh-faint); margin-top: 6px; }
.dsh-ev.is-user { border-left-color: var(--dsh-accent); background: var(--dsh-accent-soft); }
.dsh-ev.is-thought { border-left-color: var(--dsh-faint-2); }
.dsh-ev.is-tool { border-left-color: var(--dsh-accent); }
.dsh-ev.is-observation { border-left-color: var(--dsh-ok); }
.dsh-ev.is-approval { border-left-color: var(--dsh-warn); background: var(--dsh-warn-soft); }
.dsh-ev.is-denied { border-left-color: var(--dsh-err); background: var(--dsh-err-soft); }
.dsh-ev.is-final { border-left-color: var(--dsh-ok); background: var(--dsh-ok-soft); }
.dsh-ev.is-plan { border-left-color: var(--dsh-warn); }
.dsh-approval-acts { display: flex; gap: 7px; margin-top: 8px; }
.dsh-files { display: grid; gap: 5px; max-height: 228px; overflow-y: auto; scrollbar-width: thin; }
.dsh-file {
    display: flex; gap: 8px; align-items: center; min-width: 0; min-height: 36px; padding: 7px 10px;
    border-radius: 8px; border: 1px solid transparent; background: var(--dsh-card-2);
    font-family: var(--dsh-mono); font-size: 12px; cursor: pointer; color: var(--dsh-sub);
}
.dsh-file:hover { border-color: var(--dsh-border-2); }
.dsh-file.is-on { border-color: var(--dsh-accent); color: var(--dsh-text); background: var(--dsh-accent-soft); }
.dsh-file.is-new { color: var(--dsh-ok); }
.dsh-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsh-ws-ta { min-height: 220px; font-family: var(--dsh-mono); font-size: 12.5px; }
.dsh-mini-stat { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--dsh-sub); padding: 5px 0; border-bottom: 1px dashed var(--dsh-border); }
.dsh-mini-stat b { color: var(--dsh-text); font-variant-numeric: tabular-nums; }

/* ---------------- 知识 / 安全 ---------------- */
.dsh-docgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); gap: 9px; }
.dsh-doc {
    display: flex; gap: 8px; align-items: center; min-width: 0; min-height: 42px; padding: 10px 12px;
    border: 1px solid var(--dsh-border); border-radius: var(--dsh-r-s);
    background: var(--dsh-card-2); color: var(--dsh-text); font-size: 13px;
}
.dsh-doc:hover { border-color: var(--dsh-accent); text-decoration: none; }
.dsh-doc small { margin-left: auto; font-size: 11px; color: var(--dsh-faint); white-space: nowrap; }
.dsh-terms { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.dsh-terms th, .dsh-terms td { padding: 9px 11px; border-bottom: 1px solid var(--dsh-border); text-align: left; vertical-align: top; }
.dsh-terms th { position: sticky; top: 0; z-index: 2; background: var(--dsh-card); color: var(--dsh-faint); font-size: 12px; }
.dsh-terms tbody tr:nth-child(even) { background: var(--dsh-zebra); }
.dsh-terms td:first-child { font-family: var(--dsh-mono); color: var(--dsh-accent); white-space: nowrap; }
.dsh-faq { border: 1px solid var(--dsh-border); border-radius: var(--dsh-r-s); background: var(--dsh-card-2); margin-bottom: 8px; }
.dsh-faq summary { padding: 11px 14px; cursor: pointer; font-weight: 600; font-size: 13.5px; list-style: none; min-height: 42px; }
.dsh-faq summary::-webkit-details-marker { display: none; }
.dsh-faq summary::after { content: '▾'; float: right; color: var(--dsh-faint); transition: transform .18s; }
.dsh-faq[open] summary::after { transform: rotate(180deg); }
.dsh-faq p { margin: 0; padding: 0 14px 13px; color: var(--dsh-sub); font-size: 13px; line-height: 1.8; max-width: 76ch; }
.dsh-safety { border: 1px solid var(--dsh-border); border-left: 3px solid var(--dsh-border-2); border-radius: var(--dsh-r-s); background: var(--dsh-card-2); padding: 11px 14px; margin-bottom: 9px; }
.dsh-safety b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.dsh-safety p { margin: 0; font-size: 13px; color: var(--dsh-sub); line-height: 1.75; max-width: 76ch; }
.dsh-safety.is-danger { border-left-color: var(--dsh-err); }
.dsh-safety.is-warn { border-left-color: var(--dsh-warn); }
.dsh-safety.is-ok { border-left-color: var(--dsh-ok); }
.dsh-note { font-size: 12px; color: var(--dsh-faint); line-height: 1.75; max-width: 90ch; }

/* ---------------- 响应式（min-width 升序在前，max-width 降序在后） ---------------- */
@media (min-width: 1920px) {
    .dsh { padding: 32px 52px 96px; }
    .dsh-hero-sub { max-width: 96ch; }
    .dsh-pgrid { grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); }
    .dsh-grid-3 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .dsh-arch-l { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); }
    .dsh-out { max-height: min(68vh, 780px); }
    .dsh-docgrid { grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); }
}

@media (min-width: 1600px) {
    .dsh { padding: 28px 40px 88px; }
    .dsh-pgrid { grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); }
    .dsh-sim { grid-template-columns: minmax(0, 264px) minmax(0, 1fr) minmax(0, 328px); }
    .dsh-out { max-height: min(66vh, 720px); }
}

@media (max-width: 1400px) {
    .dsh { padding: 22px 22px 72px; }
    .dsh-sim { grid-template-columns: minmax(0, 232px) minmax(0, 1fr); }
    .dsh-sim > .dsh-sim-col:last-child { grid-column: 1 / -1; }
    .dsh-files { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dsh-gen { grid-template-columns: minmax(0, 310px) minmax(0, 1fr); }
}

@media (max-width: 1100px) {
    .dsh-gen { grid-template-columns: minmax(0, 1fr); }
    .dsh-gen-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dsh-sim { grid-template-columns: minmax(0, 1fr); }
    .dsh-sim > .dsh-sim-col:last-child { grid-column: auto; }
    .dsh-sim > .dsh-sim-col:nth-child(2) { order: -1; }
    .dsh-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dsh-pgrid { grid-template-columns: repeat(auto-fill, minmax(234px, 1fr)); }
    .dsh-out { max-height: min(56vh, 560px); }
}

@media (max-width: 900px) {
    .dsh { padding: 18px 18px 72px; }
    .dsh-hero { flex-wrap: wrap; }
    .dsh-hero-acts { width: 100%; justify-content: flex-end; }
    .dsh-arch-l { grid-template-columns: minmax(0, 1fr); gap: 7px; }
    .dsh-stat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dsh-stat-i:nth-child(3) { border-left: 0; }
    .dsh-stat-i:nth-child(n+3) { border-top: 1px solid var(--dsh-border); }
    .dsh-grid-3, .dsh-grid-2 { grid-template-columns: minmax(0, 1fr); }
    .dsh-kv { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
    .dsh { padding: 14px 12px 76px; font-size: 15px; }
    .dsh-hero { padding: 15px; gap: 12px; }
    .dsh-hero-ic { width: 40px; height: 40px; font-size: 22px; border-radius: 11px; }
    .dsh-hero-t { font-size: 18.5px; }
    .dsh-hero-sub { font-size: 13px; }
    .dsh-hero-acts {
        display: grid; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px; justify-content: stretch;
    }
    .dsh-hero-acts .dsh-btn { width: 100%; padding: 8px 4px; font-size: 12.5px; }
    .dsh-tabs { top: 53px; border-radius: 10px; padding: 4px; margin-bottom: 14px; }
    .dsh-tab { min-height: 44px; padding: 6px 14px; font-size: 14px; }
    .dsh-btn { min-height: 44px; padding: 9px 14px; font-size: 14px; }
    .dsh-btn-sm { min-height: 40px; padding: 7px 12px; font-size: 13px; }
    .dsh-btn-icon { width: 44px; height: 44px; min-height: 44px; }
    .dsh-chip { min-height: 40px; padding: 7px 14px; font-size: 13px; }
    .dsh-in, .dsh-sel, .dsh-ta { font-size: 16px; min-height: 46px; }
    .dsh-ta { min-height: 96px; }
    .dsh-search { max-width: none; flex: 1 1 100%; }
    .dsh-chips {
        flex-wrap: nowrap; overflow-x: auto; width: 100%;
        scrollbar-width: none; padding-bottom: 2px;
    }
    .dsh-chips::-webkit-scrollbar { display: none; }
    .dsh-tools { gap: 7px; padding: 11px; }
    .dsh-tools > .dsh-btn { flex: 1 1 calc(50% - 7px); }
    .dsh-tools > .dsh-sel { flex: 1 1 100%; }
    .dsh-pgrid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .dsh-pcard { padding: 14px; }
    .dsh-pc-desc { min-height: 0; }
    .dsh-stat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dsh-stat-i { padding: 11px 13px; }
    .dsh-stat-i b { font-size: 19px; }
    .dsh-switch { width: 48px; height: 28px; }
    .dsh-switch::after { width: 22px; height: 22px; }
    .dsh-switch.is-on::after { transform: translateX(20px); }
    .dsh-star { width: 44px; height: 44px; font-size: 19px; }
    .dsh-gen-form { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .dsh-field-row { grid-template-columns: minmax(0, 1fr); }
    .dsh-out-tabs {
        flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
        padding-bottom: 2px; margin-bottom: 10px;
    }
    .dsh-out-tabs::-webkit-scrollbar { display: none; }
    .dsh-out-tab { min-height: 40px; padding: 6px 13px; font-size: 13px; }
    .dsh-out { font-size: 12px; min-height: 250px; max-height: 52vh; padding: 11px; }
    .dsh-out-head .dsh-btn { flex: 1 1 calc(50% - 8px); }
    .dsh-files { grid-template-columns: minmax(0, 1fr); }
    .dsh-file { min-height: 44px; font-size: 13px; padding: 9px 11px; }
    .dsh-ws-ta { min-height: 200px; }
    .dsh-sim-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .dsh-sim-bar > .dsh-sel { grid-column: 1 / -1; width: 100%; }
    .dsh-sim-bar .dsh-btn { width: 100%; padding: 8px 6px; font-size: 13px; white-space: normal; }
    .dsh-events { max-height: 58vh; gap: 8px; }
    .dsh-ev-args { font-size: 11px; }
    .dsh-approval-acts .dsh-btn { flex: 1 1 auto; }
    .dsh-faq summary { min-height: 44px; padding: 12px 14px; }
    .dsh-doc { min-height: 44px; }
    .dsh-mask { align-items: flex-end; }
    .dsh-drawer {
        width: 100%; max-height: 88vh; height: auto; border-left: 0;
        border-top: 1px solid var(--dsh-border); border-radius: 18px 18px 0 0;
        padding: 14px 18px calc(30px + env(safe-area-inset-bottom, 0px));
    }
    .dsh-drawer::before {
        content: ''; display: block; width: 42px; height: 4px; border-radius: 999px;
        background: var(--dsh-border-2); margin: 0 auto 12px;
    }
    .dsh-docgrid { grid-template-columns: minmax(0, 1fr); }
    .dsh-terms td:first-child { white-space: normal; }
    .dsh-toast { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); font-size: 13px; }
}

@media (max-width: 420px) {
    .dsh { padding: 12px 10px 72px; }
    .dsh-hero-t { font-size: 17px; }
    .dsh-hero-badge { display: none; }
    .dsh-hero-ic { display: none; }
    .dsh-tag { font-size: 11px; padding: 2px 8px; }
    .dsh-stat-i b { font-size: 17px; }
    .dsh-tab { padding: 6px 11px; font-size: 13px; }
    .dsh-card { padding: 15px 14px; }
    .dsh-sim-bar { grid-template-columns: minmax(0, 1fr); }
    .dsh-sim-bar > .dsh-sel { grid-column: auto; }
}

@media (hover: none) {
    .dsh-pcard:hover, .dsh-arch-l:hover, .dsh-concept:hover, .dsh-btn:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .dsh *, .dsh *::before, .dsh *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media print {
    .dsh-tabs, .dsh-hero-acts, .dsh-tools, .dsh-sim-bar, .dsh-btn, .dsh-toast, .dsh-mask { display: none !important; }
    .dsh { padding: 0; font-size: 12px; }
    .dsh-card, .dsh-pcard { box-shadow: none; break-inside: avoid; }
    .dsh-pane { display: block !important; }
    .dsh-out, .dsh-events { max-height: none; overflow: visible; }
}


