/* ============================================================
   UserScript 分发中心 · 全站样式表
   ------------------------------------------------------------
   目录
     01. 设计令牌（颜色 / 尺寸 / 阴影 / 排版）
     02. 基础重置
     03. 布局容器
     04. 顶栏导航
     05. Hero 区块
     06. 搜索栏
     07. 分类 Chips
     08. 卡片网格
     09. 按钮
     10. 提示 / 空态 / 代码
     11. 详情页
     12. 分页
     13. 后台 · 通用面板
     14. 后台 · 登录
     15. 后台 · 上传
     16. 后台 · 脚本列表
     17. 表单字段
     18. 页脚
     19. 响应式
     20. 动效降级
   ============================================================ */


/* ============================================================
   01. 设计令牌
   ============================================================ */
:root {
    /* ---- 颜色 ---- */
    --bg:            #f4f5f7;
    --bg-soft:       #eceef2;
    --panel:         #ffffff;
    --panel-hover:   #fafbfc;
    --line:          #e4e6eb;
    --line-strong:   #d4d7dd;
    --fg:            #1a1d24;
    --fg-soft:       #4a4f5a;
    --muted:         #8a8f9a;

    --brand:         #2f6bff;
    --brand-hover:   #1a52e0;
    --brand-soft:    rgba(47, 107, 255, .10);
    --brand-ring:    rgba(47, 107, 255, .18);

    --danger:        #e5484d;
    --danger-hover:  #c93a3f;
    --danger-soft:   rgba(229, 72, 77, .10);

    --ok:            #17a673;
    --ok-soft:       rgba(23, 166, 115, .10);

    --code-bg:       #f2f3f5;
    --code-fg:       #383a42;

    /* ---- 尺寸 ---- */
    --radius-sm:   8px;
    --radius:      12px;
    --radius-lg:   16px;
    --radius-full: 999px;

    /* ---- 阴影 ---- */
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-md: 0 4px 14px rgba(16, 24, 40, .08), 0 2px 4px rgba(16, 24, 40, .04);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .10), 0 4px 8px rgba(16, 24, 40, .04);

    /* ---- 排版 ---- */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
            "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
                 "Liberation Mono", monospace;

    /* ---- 布局 ---- */
    --wrap: 1120px;
    --topbar-h: 64px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg:            #101014;
        --bg-soft:       #16161b;
        --panel:         #1a1a20;
        --panel-hover:   #202027;
        --line:          #2a2a32;
        --line-strong:   #3a3a44;
        --fg:            #eceef2;
        --fg-soft:       #b8bcc6;
        --muted:         #7e828d;

        --brand:         #4d80ff;
        --brand-hover:   #6b96ff;
        --brand-soft:    rgba(77, 128, 255, .14);
        --brand-ring:    rgba(77, 128, 255, .28);

        --code-bg:       #232329;
        --code-fg:       #d4d7dd;

        --shadow-xs: 0 1px 2px rgba(0, 0, 0, .30);
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, .35);
        --shadow-md: 0 4px 14px rgba(0, 0, 0, .40);
        --shadow-lg: 0 12px 32px rgba(0, 0, 0, .50);
    }
}


/* ============================================================
   02. 基础重置
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--fg);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color .15s ease;
}
a:hover { color: var(--brand-hover); }

img, svg { display: block; max-width: 100%; }

/* 统一所有表单控件的字体继承 —— 修复按钮 / 输入框字体错乱 */
button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

/* 去掉 Chrome 原生搜索清除按钮，避免与自定义样式冲突 */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
}


/* ============================================================
   03. 布局容器
   ============================================================ */
.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 24px;
}

.main {
    padding: 32px 24px 72px;
    min-height: calc(100vh - var(--topbar-h) - 120px);
}


/* ============================================================
   04. 顶栏导航
   ============================================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--topbar-h);
    background: color-mix(in srgb, var(--panel) 88%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
}

.bar {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--fg);
}
.brand:hover { color: var(--fg); }

.logo {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--brand), #6a3aff);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 4px 12px var(--brand-ring);
}

.nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav a {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--fg-soft);
    transition: background .15s, color .15s;
}
.nav a:hover {
    background: var(--bg-soft);
    color: var(--fg);
}
.nav a.on {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 500;
}


/* ============================================================
   05. Hero 区块
   ============================================================ */
.hero {
    padding: 24px 0 28px;
    text-align: center;
}
.hero h1 {
    margin: 0 0 10px;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.25;
    background: linear-gradient(135deg, var(--fg) 40%, var(--brand));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p {
    margin: 0 auto;
    max-width: 620px;
    font-size: 14.5px;
    color: var(--muted);
    line-height: 1.7;
}


/* ============================================================
   06. 搜索栏
   ============================================================ */
.searchbar {
    display: flex;
    gap: 10px;
    margin: 0 auto 22px;
    max-width: 620px;
}
.searchbar input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--fg);
    font-size: 14.5px;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.searchbar input[type="search"]::placeholder { color: var(--muted); }
.searchbar input[type="search"]:hover { border-color: var(--line-strong); }
.searchbar input[type="search"]:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-ring);
    background: var(--panel);
}
.searchbar button {
    height: 46px;
    padding: 0 26px;
    border: 0;
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    font-size: 14.5px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 2px 8px var(--brand-ring);
}
.searchbar button:hover {
    background: var(--brand-hover);
    box-shadow: 0 4px 14px var(--brand-ring);
}
.searchbar button:active { transform: translateY(1px); }


/* ============================================================
   07. 分类 Chips
   ============================================================ */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    justify-content: center;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    background: var(--panel);
    color: var(--fg-soft);
    font-size: 13px;
    line-height: 1.4;
    transition: all .15s ease;
}
.chip:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-soft);
}
.chip.on {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 2px 8px var(--brand-ring);
}
.chip b {
    font-weight: 500;
    opacity: .65;
    font-size: 12px;
}
.chip.on b { opacity: .85; }


/* ============================================================
   08. 卡片网格
   ============================================================ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
}

.card-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}
.card-head h2 {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -.01em;
}
.card-head h2 a {
    color: var(--fg);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.card-head h2 a:hover { color: var(--brand); }

.ver {
    flex: none;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-soft);
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font-mono);
}

.desc {
    flex: 1;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.6;
    min-height: 44px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}
.tag {
    display: inline-block;
    max-width: 100%;
    padding: 3px 9px;
    border-radius: 6px;
    background: var(--code-bg);
    color: var(--code-fg);
    font-family: var(--font-mono);
    font-size: 11.5px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tag.soft {
    background: var(--brand-soft);
    color: var(--brand);
    font-family: var(--font);
    font-weight: 500;
}

.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.meta {
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ============================================================
   09. 按钮
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background .15s, box-shadow .15s, transform .1s, border-color .15s;
    box-shadow: 0 1px 2px var(--brand-ring);
    text-decoration: none;
}
.btn:hover {
    background: var(--brand-hover);
    color: #fff;
    box-shadow: 0 3px 10px var(--brand-ring);
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--brand-ring);
}
.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn.block {
    width: 100%;
    height: 46px;
    font-size: 15px;
    border-radius: var(--radius);
}

.btn.sm {
    height: 32px;
    padding: 0 14px;
    font-size: 13px;
}

.btn.danger {
    background: var(--danger);
    box-shadow: 0 1px 2px var(--danger-soft);
}
.btn.danger:hover {
    background: var(--danger-hover);
    box-shadow: 0 3px 10px var(--danger-soft);
}

.btn.ghost {
    background: var(--panel);
    color: var(--fg);
    border-color: var(--line);
    box-shadow: var(--shadow-xs);
}
.btn.ghost:hover {
    background: var(--panel-hover);
    border-color: var(--line-strong);
    color: var(--fg);
}

.link {
    font-size: 13px;
    color: var(--muted);
    transition: color .15s;
}
.link:hover { color: var(--brand); }


/* ============================================================
   10. 提示 / 空态 / 代码
   ============================================================ */
.flash {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
    border-radius: var(--radius);
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 14px;
}
.flash.err {
    border-color: color-mix(in srgb, var(--danger) 25%, transparent);
    background: var(--danger-soft);
    color: var(--danger);
}
.flash.ok {
    border-color: color-mix(in srgb, var(--ok) 25%, transparent);
    background: var(--ok-soft);
    color: var(--ok);
}

.empty {
    padding: 72px 24px;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
    background: var(--panel);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
}
.empty code { margin: 0 4px; }

.hint {
    margin: 10px 0 0;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.6;
}

code {
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--code-bg);
    color: var(--code-fg);
    font-family: var(--font-mono);
    font-size: .88em;
}


/* ============================================================
   11. 详情页
   ============================================================ */
.crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--muted);
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.crumbs span:last-child {
    color: var(--fg-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}

.detail-main {
    padding: 28px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}
.detail-main h1 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.3;
}
.detail-desc {
    margin: 0 0 14px;
    font-size: 14.5px;
    color: var(--fg-soft);
    line-height: 1.7;
}

.detail-side {
    position: sticky;
    top: calc(var(--topbar-h) + 20px);
    padding: 22px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}
.detail-side .btn.block { margin-bottom: 10px; }
.detail-side .hint { text-align: center; margin-bottom: 4px; }

.side-title {
    margin: 22px 0 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

.kv {
    width: 100%;
    margin-top: 18px;
    border-collapse: collapse;
    font-size: 13px;
}
.kv th {
    width: 88px;
    padding: 7px 0;
    text-align: left;
    font-weight: 400;
    color: var(--muted);
    vertical-align: top;
}
.kv td {
    padding: 7px 0;
    color: var(--fg-soft);
    word-break: break-all;
}

/* 源码折叠区 */
.source {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.source summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--brand);
    list-style: none;
    padding: 6px 0;
    user-select: none;
}
.source summary::-webkit-details-marker { display: none; }
.source summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform .2s ease;
}
.source[open] summary::before { transform: rotate(90deg); }
.source pre {
    margin: 14px 0 0;
    padding: 18px;
    max-height: 560px;
    overflow: auto;
    background: var(--code-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--code-fg);
    tab-size: 4;
}
.source pre code {
    padding: 0;
    background: none;
    color: inherit;
    font-size: inherit;
}

/* 源码区自定义滚动条 */
.source pre::-webkit-scrollbar { width: 10px; height: 10px; }
.source pre::-webkit-scrollbar-track { background: transparent; }
.source pre::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border: 3px solid var(--code-bg);
    border-radius: 999px;
}
.source pre::-webkit-scrollbar-thumb:hover { background: var(--muted); }


/* ============================================================
   12. 分页
   ============================================================ */
.pager {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
}
.pager a,
.pager .cur {
    display: grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--fg-soft);
    font-size: 13.5px;
    transition: all .15s;
}
.pager a:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-soft);
}
.pager .cur {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 500;
    box-shadow: 0 2px 8px var(--brand-ring);
}


/* ============================================================
   13. 后台 · 通用面板
   ============================================================ */
.panel {
    padding: 24px;
    margin-bottom: 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}
.panel h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.01em;
}
.panel.narrow {
    max-width: 420px;
    margin: 72px auto;
    padding: 32px;
}

.count {
    padding: 2px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}


/* ============================================================
   14. 后台 · 登录
   ============================================================ */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}


/* ============================================================
   15. 后台 · 上传
   ============================================================ */
.upload-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: stretch;
}

.upload-form input[type="file"] {
    flex: 1;
    min-width: 240px;
    min-height: 44px;
    padding: 9px 14px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--bg-soft);
    color: var(--fg-soft);
    font-size: 13.5px;
    line-height: 1.6;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.upload-form input[type="file"]:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
}
.upload-form input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 5px 12px;
    border: 0;
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s;
}
.upload-form input[type="file"]::file-selector-button:hover {
    background: var(--brand-hover);
}

.upload-form .btn {
    height: 44px;
    padding: 0 26px;
}


/* ============================================================
   16. 后台 · 脚本列表
   ============================================================ */
.admin-item {
    padding: 18px;
    margin-bottom: 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color .15s, box-shadow .15s;
}
.admin-item:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}
.admin-item:last-child { margin-bottom: 0; }

/* 消除卡片内表单默认间距，避免撑开内边距 */
.admin-item form,
form.admin-item {
    margin: 0;
}

/* 标题行 */
.ai-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.ai-head strong {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.01em;
}
.ai-head .spacer {
    flex: 1;
    min-width: 8px;
}
.ai-head .meta {
    font-family: var(--font-mono);
    font-size: 12px;
}

/* 编辑区四列 */
.ai-body {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    margin: 16px 0;
}

/* 操作行 */
.ai-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}
.ai-foot .link { margin-left: auto; }


/* ============================================================
   17. 表单字段
   ============================================================ */
.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
}

.field input[type="text"],
.field input[type="password"],
.field input[type="search"],
.field select,
.field textarea {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--fg);
    font-size: 14px;
    font-weight: 400;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.field textarea {
    height: auto;
    min-height: 84px;
    padding: 10px 12px;
    line-height: 1.6;
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--muted); }

.field input:hover,
.field textarea:hover { border-color: var(--line-strong); }

.field input:focus,
.field textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-ring);
}

/* 后台卡片里的输入框稍微紧凑一点 */
.admin-item .field input[type="text"] {
    font-size: 13.5px;
}

/* 复选框字段 —— 与相邻输入框等高对齐 */
.field.ck {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--fg-soft);
    font-size: 13.5px;
    font-weight: 400;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.field.ck:hover { border-color: var(--line-strong); }

.field.ck input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--brand);
    cursor: pointer;
}

/* ai-body 底部的复选框与输入框底部对齐 */
.ai-body .field.ck {
    height: 38px;
    margin-top: auto;
}


/* ============================================================
   18. 页脚
   ============================================================ */
.foot {
    padding: 28px 0;
    margin-top: 60px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}


/* ============================================================
   19. 响应式
   ============================================================ */
@media (max-width: 900px) {
    .detail { grid-template-columns: 1fr; }
    .detail-side { position: static !important; }
}

@media (max-width: 820px) {
    .ai-body { grid-template-columns: 1fr 1fr; }
    .ai-body .field.ck { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
    .grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    :root { --topbar-h: 56px; }

    .wrap { padding: 0 16px; }
    .main { padding: 20px 16px 56px; }

    .hero { padding: 12px 0 22px; }
    .hero h1 { font-size: 22px; }
    .hero p { font-size: 13.5px; }

    .searchbar { flex-direction: column; }
    .searchbar button { width: 100%; }

    .detail-main { padding: 20px; }
    .panel { padding: 18px; }
    .panel.narrow { margin: 32px auto; padding: 24px; }
}

@media (max-width: 520px) {
    .ai-body { grid-template-columns: 1fr; }
}


/* ============================================================
   20. 动效降级
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}