/* ==========================================================================
   Desk 设计系统 v3 · 单文件（浅色 / 深色双主题，跟随系统 + 手动记忆）
   命名前缀 dk-，避免与站点旧样式冲突
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
    /* 表面与文字 */
    --dk-bg: #f5f6fa;
    --dk-bg-grad: radial-gradient(1200px 600px at 12% -10%, #e8ecff 0%, rgba(245, 246, 250, 0) 60%);
    --dk-surface: #ffffff;
    --dk-surface-2: #fbfcfe;
    --dk-surface-3: #f1f3f9;
    --dk-ink: #12151d;
    --dk-ink-2: #39404f;
    --dk-muted: #6a7284;
    --dk-line: #e3e7f0;
    --dk-line-strong: #cfd6e4;

    /* 强调色（各工具用 style="--dk-accent:#xxx" 覆盖） */
    --dk-accent: #4b5cf6;
    --dk-accent-2: #0f9d8f;
    --dk-accent-ink: #ffffff;
    --dk-accent-soft: color-mix(in srgb, var(--dk-accent) 10%, #ffffff);
    --dk-accent-line: color-mix(in srgb, var(--dk-accent) 28%, #ffffff);

    /* 状态色 */
    --dk-ok: #0d8a4f;
    --dk-ok-soft: #e6f6ed;
    --dk-warn: #a86400;
    --dk-warn-soft: #fdf3e2;
    --dk-err: #c92a2a;
    --dk-err-soft: #fdecec;

    /* 形态 */
    --dk-r-sm: 8px;
    --dk-r: 12px;
    --dk-r-lg: 18px;
    --dk-r-xl: 26px;
    --dk-shadow-1: 0 1px 2px rgba(15, 23, 42, .05);
    --dk-shadow-2: 0 2px 8px -2px rgba(15, 23, 42, .09), 0 12px 32px -18px rgba(15, 23, 42, .28);
    --dk-shadow-3: 0 24px 64px -28px rgba(15, 23, 42, .45);

    /* 排版 */
    --dk-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Source Han Sans SC", sans-serif;
    --dk-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --dk-fs-h1: clamp(30px, 4.4vw, 46px);
    --dk-fs-h2: clamp(21px, 2.6vw, 27px);
    --dk-fs-h3: 18px;
    --dk-fs-body: 16px;
    --dk-lh-body: 1.78;

    /* 栅格 */
    --dk-max: 1180px;
    --dk-gap: 24px;
}

[data-theme="dark"] {
    --dk-bg: #0a0d13;
    --dk-bg-grad: radial-gradient(1200px 620px at 8% -12%, #16203c 0%, rgba(10, 13, 19, 0) 62%);
    --dk-surface: #121722;
    --dk-surface-2: #161c28;
    --dk-surface-3: #1c2331;
    --dk-ink: #e9edf6;
    --dk-ink-2: #c2cadb;
    --dk-muted: #8b95a9;
    --dk-line: #232b3a;
    --dk-line-strong: #33405a;

    --dk-accent-soft: color-mix(in srgb, var(--dk-accent) 22%, #0f1520);
    --dk-accent-line: color-mix(in srgb, var(--dk-accent) 46%, #0f1520);

    --dk-ok: #4ade9b;
    --dk-ok-soft: #10261c;
    --dk-warn: #f0b355;
    --dk-warn-soft: #2a2113;
    --dk-err: #ff8080;
    --dk-err-soft: #2b1517;

    --dk-shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
    --dk-shadow-2: 0 2px 10px -2px rgba(0, 0, 0, .6), 0 16px 40px -22px rgba(0, 0, 0, .8);
    --dk-shadow-3: 0 28px 72px -32px rgba(0, 0, 0, .85);
}

/* ---------- 2. 基础重置与排版层级 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--dk-bg);
    background-image: var(--dk-bg-grad);
    background-repeat: no-repeat;
    color: var(--dk-ink);
    font-family: var(--dk-font);
    font-size: var(--dk-fs-body);
    line-height: var(--dk-lh-body);
    letter-spacing: .01em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    margin: 0;
    color: var(--dk-ink);
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: -.02em;
}

p { margin: 0 0 14px; }
a { color: var(--dk-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
strong, b { font-weight: 700; color: var(--dk-ink); }
em { font-style: normal; }
code, kbd, samp { font-family: var(--dk-mono); font-size: .92em; }
button, input, select, textarea { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--dk-line); margin: 28px 0; }

::selection { background: color-mix(in srgb, var(--dk-accent) 26%, transparent); }

.dk-inner { width: 100%; max-width: var(--dk-max); margin: 0 auto; padding: 0 20px; }

.dk-skip {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--dk-accent); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.dk-skip:focus { left: 0; }

/* ---------- 3. 顶栏与主题开关 ---------- */
.dk-top {
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--dk-surface) 86%, transparent);
    backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid var(--dk-line);
}
.dk-top-in { display: flex; align-items: center; gap: 18px; height: 62px; }

.dk-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--dk-ink); text-decoration: none; }
.dk-brand:hover { text-decoration: none; }
.dk-brand-mark {
    width: 30px; height: 30px; border-radius: 9px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--dk-accent), color-mix(in srgb, var(--dk-accent) 45%, var(--dk-accent-2)));
    color: #fff; font-weight: 800; font-size: 15px; letter-spacing: 0;
    box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--dk-accent) 70%, transparent);
}
.dk-brand-txt { display: flex; flex-direction: column; line-height: 1.15; font-weight: 700; font-size: 15px; }
.dk-brand-txt em { font-weight: 500; font-size: 11px; color: var(--dk-muted); letter-spacing: .08em; }

.dk-nav { display: flex; gap: 4px; margin-left: 6px; }
.dk-nav a {
    color: var(--dk-ink-2); font-size: 14px; padding: 7px 11px; border-radius: 8px;
    text-decoration: none; transition: background .16s, color .16s;
}
.dk-nav a:hover { background: var(--dk-surface-3); color: var(--dk-ink); text-decoration: none; }

.dk-top-act { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.dk-theme {
    display: inline-flex; align-items: center; gap: 8px;
    height: 36px; padding: 0 13px; border-radius: 999px;
    background: var(--dk-surface-2); border: 1px solid var(--dk-line);
    color: var(--dk-ink-2); font-size: 13px; cursor: pointer;
    transition: border-color .16s, background .16s, color .16s;
}
.dk-theme:hover { border-color: var(--dk-line-strong); color: var(--dk-ink); }
.dk-theme:focus-visible { outline: 2px solid var(--dk-accent); outline-offset: 2px; }
.dk-theme-ico { font-size: 15px; line-height: 1; }
.dk-theme-txt { white-space: nowrap; }

/* ---------- 4. 首屏 Hero ---------- */
.dk-hero { padding: 40px 0 8px; }
.dk-hero-in { display: grid; grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr); gap: 36px; align-items: start; }

.dk-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 13px; color: var(--dk-muted); margin-bottom: 16px; }
.dk-crumb a { color: var(--dk-muted); }
.dk-crumb a:hover { color: var(--dk-accent); }
.dk-crumb i { font-style: normal; opacity: .5; }

.dk-eyebrow {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 11px; border-radius: 999px; margin-bottom: 16px;
    background: var(--dk-accent-soft); border: 1px solid var(--dk-accent-line);
    color: color-mix(in srgb, var(--dk-accent) 72%, var(--dk-ink));
    font-size: 12.5px; font-weight: 600; letter-spacing: .04em;
}
[data-theme="dark"] .dk-eyebrow { color: color-mix(in srgb, var(--dk-accent) 55%, #ffffff); }

.dk-h1 { font-size: var(--dk-fs-h1); font-weight: 800; letter-spacing: -.035em; }
.dk-h1 .dk-h1-hl { color: var(--dk-accent); }

.dk-sub {
    margin-top: 14px; margin-bottom: 0;
    font-size: clamp(15px, 1.5vw, 17.5px);
    line-height: 1.7; color: var(--dk-ink-2);
    max-width: 46em;
}

.dk-points { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 9px; }
.dk-points li { position: relative; padding-left: 24px; font-size: 14.5px; color: var(--dk-ink-2); }
.dk-points li::before {
    content: ""; position: absolute; left: 4px; top: .55em;
    width: 8px; height: 8px; border-radius: 3px;
    background: var(--dk-accent); opacity: .85;
}
.dk-points b { font-weight: 700; }

/* ---------- 5. 工具面板与表单 ---------- */
.dk-tool {
    background: var(--dk-surface);
    border: 1px solid var(--dk-line);
    border-radius: var(--dk-r-xl);
    box-shadow: var(--dk-shadow-2);
    padding: 22px;
    scroll-margin-top: 78px;
}
.dk-tool-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dk-tool-head h2 { font-size: 15px; font-weight: 700; letter-spacing: .01em; color: var(--dk-ink); }
.dk-tool-head span { font-size: 12.5px; color: var(--dk-muted); }

.dk-field { margin-bottom: 16px; }
.dk-field:last-child { margin-bottom: 0; }
.dk-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 13.5px; font-weight: 600; color: var(--dk-ink-2); }
.dk-label .dk-label-note { font-weight: 400; color: var(--dk-muted); font-size: 12.5px; }

.dk-input, .dk-textarea, .dk-select {
    width: 100%; padding: 10px 12px;
    background: var(--dk-surface-2);
    border: 1px solid var(--dk-line);
    border-radius: var(--dk-r);
    color: var(--dk-ink);
    font-size: 14.5px;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.dk-input:hover, .dk-textarea:hover, .dk-select:hover { border-color: var(--dk-line-strong); }
.dk-input:focus, .dk-textarea:focus, .dk-select:focus {
    outline: none; background: var(--dk-surface);
    border-color: var(--dk-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--dk-accent) 16%, transparent);
}
.dk-textarea { min-height: 108px; resize: vertical; line-height: 1.7; }
.dk-textarea.dk-mono { font-family: var(--dk-mono); font-size: 13.5px; }
.dk-input.dk-mono { font-family: var(--dk-mono); }
.dk-input[type="color"] { padding: 4px; height: 42px; cursor: pointer; }
.dk-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--dk-muted); line-height: 1.6; }
.dk-err-text { margin: 6px 0 0; font-size: 12.5px; color: var(--dk-err); }

.dk-row { display: grid; gap: 12px; }
.dk-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dk-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dk-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dk-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* 分段控件 */
.dk-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--dk-surface-3); border-radius: 10px; border: 1px solid var(--dk-line); }
.dk-seg button {
    border: 0; background: transparent; color: var(--dk-ink-2);
    padding: 6px 12px; border-radius: 8px; font-size: 13px; cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}
.dk-seg button:hover { color: var(--dk-ink); }
.dk-seg button[aria-pressed="true"] {
    background: var(--dk-surface); color: var(--dk-ink); font-weight: 600;
    box-shadow: var(--dk-shadow-1); border: 1px solid var(--dk-line);
    margin: -1px; padding: 6px 12px;
}

/* 按钮 */
.dk-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; padding: 0 18px;
    border-radius: var(--dk-r); border: 1px solid var(--dk-line-strong);
    background: var(--dk-surface); color: var(--dk-ink);
    font-size: 14.5px; font-weight: 600; cursor: pointer;
    transition: transform .12s, box-shadow .16s, background .16s, border-color .16s, color .16s;
}
.dk-btn:hover { border-color: var(--dk-accent); color: var(--dk-accent); text-decoration: none; }
.dk-btn:active { transform: translateY(1px); }
.dk-btn:focus-visible { outline: 2px solid var(--dk-accent); outline-offset: 2px; }
.dk-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.dk-btn-primary {
    background: var(--dk-accent); border-color: var(--dk-accent); color: var(--dk-accent-ink);
    box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--dk-accent) 80%, transparent);
}
.dk-btn-primary:hover { background: color-mix(in srgb, var(--dk-accent) 88%, #000); color: #fff; border-color: transparent; }

.dk-btn-soft { background: var(--dk-accent-soft); border-color: var(--dk-accent-line); color: color-mix(in srgb, var(--dk-accent) 80%, var(--dk-ink)); }
.dk-btn-soft:hover { background: color-mix(in srgb, var(--dk-accent) 16%, var(--dk-surface)); color: var(--dk-accent); }

.dk-btn-ghost { background: transparent; border-color: transparent; color: var(--dk-ink-2); }
.dk-btn-ghost:hover { background: var(--dk-surface-3); color: var(--dk-ink); border-color: transparent; }

.dk-btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.dk-btn-lg { height: 48px; padding: 0 24px; font-size: 15.5px; }
.dk-btn-block { width: 100%; }

.dk-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* 开关 / 复选 */
.dk-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--dk-ink-2); cursor: pointer; }
.dk-check input { width: 16px; height: 16px; accent-color: var(--dk-accent); cursor: pointer; }

/* 滑块 */
.dk-range { width: 100%; accent-color: var(--dk-accent); height: 22px; }
.dk-range-val { font-family: var(--dk-mono); font-size: 13px; color: var(--dk-accent); font-weight: 600; }

/* ---------- 6. 结果区 ---------- */
.dk-card {
    background: var(--dk-surface);
    border: 1px solid var(--dk-line);
    border-radius: var(--dk-r-lg);
    padding: 20px;
    box-shadow: var(--dk-shadow-1);
}
.dk-card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dk-card-title h3 { font-size: 15.5px; }
.dk-card-sub { font-size: 13px; color: var(--dk-muted); }

.dk-out {
    display: grid; gap: 2px;
    background: var(--dk-surface-2);
    border: 1px solid var(--dk-line);
    border-radius: var(--dk-r);
    padding: 14px 16px;
}
.dk-out-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 7px 0; }
.dk-out-row + .dk-out-row { border-top: 1px dashed var(--dk-line); }
.dk-out-k { font-size: 13.5px; color: var(--dk-muted); }
.dk-out-v { font-family: var(--dk-mono); font-size: 15px; font-weight: 600; color: var(--dk-ink); text-align: right; word-break: break-all; }
.dk-out-v.dk-big { font-size: 22px; color: var(--dk-accent); }

.dk-code {
    position: relative;
    background: var(--dk-surface-3);
    border: 1px solid var(--dk-line);
    border-radius: var(--dk-r);
    padding: 14px 16px;
    font-family: var(--dk-mono);
    font-size: 13px;
    line-height: 1.65;
    color: var(--dk-ink-2);
    white-space: pre-wrap;
    word-break: break-all;
    overflow: auto;
    max-height: 320px;
}
.dk-code-copy { position: absolute; top: 8px; right: 8px; }

.dk-table-wrap { overflow-x: auto; border: 1px solid var(--dk-line); border-radius: var(--dk-r); }
.dk-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dk-table th, .dk-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--dk-line); white-space: nowrap; }
.dk-table th { background: var(--dk-surface-3); color: var(--dk-ink-2); font-weight: 600; font-size: 13px; position: sticky; top: 0; }
.dk-table tbody tr:last-child td { border-bottom: 0; }
.dk-table tbody tr:hover td { background: var(--dk-surface-2); }
.dk-table td.dk-num { font-family: var(--dk-mono); text-align: right; }
.dk-table .dk-mono { font-family: var(--dk-mono); }

.dk-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: var(--dk-surface-3); color: var(--dk-ink-2); border: 1px solid var(--dk-line);
}
.dk-badge-ok { background: var(--dk-ok-soft); color: var(--dk-ok); border-color: color-mix(in srgb, var(--dk-ok) 30%, transparent); }
.dk-badge-warn { background: var(--dk-warn-soft); color: var(--dk-warn); border-color: color-mix(in srgb, var(--dk-warn) 30%, transparent); }
.dk-badge-err { background: var(--dk-err-soft); color: var(--dk-err); border-color: color-mix(in srgb, var(--dk-err) 30%, transparent); }
.dk-badge-accent { background: var(--dk-accent-soft); color: var(--dk-accent); border-color: var(--dk-accent-line); }

.dk-note {
    display: flex; gap: 10px;
    padding: 12px 14px; border-radius: var(--dk-r);
    background: var(--dk-surface-2); border: 1px solid var(--dk-line);
    font-size: 13.5px; color: var(--dk-ink-2); line-height: 1.7;
}
.dk-note-ico { flex: 0 0 auto; font-weight: 700; color: var(--dk-accent); }
.dk-note-warn { background: var(--dk-warn-soft); border-color: color-mix(in srgb, var(--dk-warn) 26%, transparent); color: var(--dk-warn); }
.dk-note-warn .dk-note-ico { color: var(--dk-warn); }

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

/* ---------- 7. 正文内容区（长文阅读） ---------- */
.dk-section { padding: 46px 0 0; }
.dk-section:last-of-type { padding-bottom: 10px; }
.dk-section-head { max-width: 760px; margin-bottom: 22px; }
.dk-section-head h2 { font-size: var(--dk-fs-h2); }
.dk-section-head p { margin: 10px 0 0; color: var(--dk-muted); font-size: 15px; }

.dk-prose { max-width: 820px; color: var(--dk-ink-2); font-size: 15.5px; line-height: 1.86; }
.dk-prose h3 { margin: 30px 0 10px; font-size: var(--dk-fs-h3); }
.dk-prose h3:first-child { margin-top: 0; }
.dk-prose p { margin: 0 0 15px; }
.dk-prose ul, .dk-prose ol { margin: 0 0 16px; padding-left: 22px; }
.dk-prose li { margin-bottom: 7px; }
.dk-prose li::marker { color: var(--dk-accent); }
.dk-prose b, .dk-prose strong { color: var(--dk-ink); }
.dk-prose table { margin: 18px 0; }

.dk-grid { display: grid; gap: 16px; }
.dk-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dk-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dk-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.dk-tile {
    display: flex; flex-direction: column; gap: 6px;
    padding: 16px 18px; border-radius: var(--dk-r-lg);
    background: var(--dk-surface); border: 1px solid var(--dk-line);
    box-shadow: var(--dk-shadow-1);
    transition: transform .16s, box-shadow .16s, border-color .16s;
}
.dk-tile h3 { font-size: 15px; }
.dk-tile p { margin: 0; font-size: 13.5px; color: var(--dk-muted); line-height: 1.65; }
.dk-tile-ico { font-size: 20px; line-height: 1; }
a.dk-tile:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--dk-accent-line); box-shadow: var(--dk-shadow-2); }

.dk-faq { border-top: 1px solid var(--dk-line); }
.dk-faq details {
    border-bottom: 1px solid var(--dk-line);
    padding: 16px 2px;
}
.dk-faq summary {
    cursor: pointer; font-weight: 600; font-size: 15.5px; color: var(--dk-ink);
    list-style: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
}
.dk-faq summary::-webkit-details-marker { display: none; }
.dk-faq summary::after {
    content: "+"; flex: 0 0 auto; color: var(--dk-accent); font-weight: 700; font-size: 18px; line-height: 1;
    transition: transform .2s;
}
.dk-faq details[open] summary::after { content: "−"; }
.dk-faq .dk-faq-body { padding-top: 10px; color: var(--dk-ink-2); font-size: 14.5px; line-height: 1.8; max-width: 780px; }
.dk-faq .dk-faq-body p:last-child { margin-bottom: 0; }

/* ---------- 8. 页脚 / 提示 ---------- */
.dk-foot { margin-top: 64px; border-top: 1px solid var(--dk-line); background: color-mix(in srgb, var(--dk-surface) 70%, transparent); }
.dk-foot-in { padding: 30px 20px 42px; display: grid; gap: 8px; }
.dk-foot-brand { margin: 0; font-weight: 700; font-size: 14px; }
.dk-foot-tip { margin: 0; font-size: 12.5px; color: var(--dk-muted); max-width: 70ch; line-height: 1.7; }
.dk-foot-nav { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 6px; font-size: 13px; }
.dk-foot-nav a { color: var(--dk-muted); }
.dk-foot-nav a:hover { color: var(--dk-accent); }

.dk-toast {
    position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 14px);
    z-index: 90; max-width: min(86vw, 460px);
    padding: 11px 18px; border-radius: 12px;
    background: #12151d; color: #fff; font-size: 14px; line-height: 1.5;
    box-shadow: var(--dk-shadow-3);
    opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s;
}
.dk-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 9. AI 区块 ---------- */
.dk-ai {
    margin-top: 22px; padding: 18px;
    border-radius: var(--dk-r-lg);
    border: 1px dashed var(--dk-accent-line);
    background: linear-gradient(180deg, var(--dk-accent-soft), transparent 70%);
}
.dk-ai-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dk-ai-head h3 { font-size: 15px; }
.dk-ai p { font-size: 13.5px; color: var(--dk-muted); margin: 0 0 12px; }
.dk-ai-out {
    margin-top: 14px; padding: 14px 16px; border-radius: var(--dk-r);
    background: var(--dk-surface); border: 1px solid var(--dk-line);
    font-size: 14px; line-height: 1.85; color: var(--dk-ink-2);
    white-space: pre-wrap; word-break: break-word;
}
.dk-ai-out[hidden] { display: none; }
.dk-ai-loading { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dk-muted); }
.dk-spin {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid var(--dk-line-strong); border-top-color: var(--dk-accent);
    animation: dk-spin .8s linear infinite;
}
@keyframes dk-spin { to { transform: rotate(360deg); } }

/* ---------- 10. 通用小组件 ---------- */
.dk-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.dk-swatch {
    border-radius: var(--dk-r); border: 1px solid var(--dk-line);
    overflow: hidden; background: var(--dk-surface); cursor: pointer;
    text-align: left; padding: 0; transition: transform .14s, box-shadow .14s;
}
.dk-swatch:hover { transform: translateY(-2px); box-shadow: var(--dk-shadow-2); }
.dk-swatch-chip { height: 62px; display: block; }
.dk-swatch-meta { padding: 7px 9px; display: grid; gap: 1px; }
.dk-swatch-hex { font-family: var(--dk-mono); font-size: 12.5px; font-weight: 600; color: var(--dk-ink); }
.dk-swatch-name { font-size: 11.5px; color: var(--dk-muted); }

.dk-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--dk-line); margin-bottom: 16px; overflow-x: auto; }
.dk-tab {
    border: 0; background: transparent; cursor: pointer;
    padding: 9px 13px; font-size: 14px; color: var(--dk-muted);
    border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.dk-tab:hover { color: var(--dk-ink); }
.dk-tab[aria-selected="true"] { color: var(--dk-accent); border-bottom-color: var(--dk-accent); font-weight: 600; }
.dk-tabpanel[hidden] { display: none; }

.dk-checklist { display: grid; gap: 8px; }
.dk-check-item { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--dk-ink-2); }
.dk-check-item .dk-check-mark { flex: 0 0 auto; font-weight: 700; }
.dk-check-item.is-ok .dk-check-mark { color: var(--dk-ok); }
.dk-check-item.is-bad .dk-check-mark { color: var(--dk-err); }

.dk-muted { color: var(--dk-muted); }
.dk-small { font-size: 13px; }
.dk-mono { font-family: var(--dk-mono); }
.dk-nowrap { white-space: nowrap; }
.dk-center { text-align: center; }
.dk-mt-8 { margin-top: 8px; }
.dk-mt-16 { margin-top: 16px; }
.dk-mt-24 { margin-top: 24px; }
.dk-mb-0 { margin-bottom: 0; }
.dk-hidden { display: none !important; }
.dk-scroll-x { overflow-x: auto; }

/* ---------- 11. 响应式 ---------- */
@media (max-width: 1000px) {
    .dk-hero-in { grid-template-columns: 1fr; gap: 26px; }
    .dk-hero { padding-top: 26px; }
    .dk-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dk-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dk-nav { display: none; }
}
@media (max-width: 720px) {
    body { font-size: 15.5px; }
    .dk-inner { padding: 0 15px; }
    .dk-tool { padding: 16px; border-radius: var(--dk-r-lg); }
    .dk-row-2, .dk-row-3, .dk-row-4, .dk-grid-2, .dk-grid-3, .dk-grid-4 { grid-template-columns: 1fr; }
    .dk-theme-txt { display: none; }
    .dk-theme { padding: 0 11px; }
    .dk-hero { padding-top: 20px; }
    .dk-section { padding-top: 34px; }
    .dk-actions .dk-btn { flex: 1 1 auto; }
}

/* ---------- 12. 打印 ---------- */
@media print {
    @page { margin: 12mm; }
    .dk-noprint, .dk-top, .dk-foot, .dk-ai, .dk-toast, .dk-theme { display: none !important; }
    body { background: #fff !important; color: #000; }
    .dk-tool, .dk-card, .dk-table-wrap { box-shadow: none !important; border-color: #bbb !important; }
    .dk-hero { padding: 0 0 10px; }
    .dk-h1 { font-size: 22pt; }
    .dk-section { padding-top: 14px; page-break-inside: avoid; }
    a { color: #000; text-decoration: none; }
}

/* ---------- 13. 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
