/* 视觉复刻 ai_code（static/app.css）：紫蓝渐变品牌色 + 固定侧边栏 + 毛玻璃页面头。
   结构保持「侧边栏 / 页面头 / 卡片 / 表格」四件套，窄屏侧边栏折叠为顶部导航。 */

:root {
    /* 中性色 */
    --bg: #eef0f6;
    --card: #ffffff;
    --border: #e9ecf3;
    --text: #141a2c;
    --dim: #8a94a8;
    --accent: #4f46e5;
    --green: #12a06a;
    --yellow: #c9821a;
    --red: #e04a3d;
    --blue: #0ea5e9;

    /* 品牌渐变 */
    --brand: #4f46e5;
    --brand-2: #7c5cff;
    --brand-3: #b14ae8;
    --brand-grad: linear-gradient(135deg, #4f46e5 0%, #7c5cff 52%, #b14ae8 100%);
    --brand-grad-soft: linear-gradient(135deg, #eef0ff 0%, #f3ecff 60%, #fbeaff 100%);
    --brand-soft: #eef0fe;
    --brand-ring: rgba(79, 70, 229, .16);

    --line: #e9ecf3;
    --line-strong: #d8deeb;
    --panel-2: #f8f9fd;
    --panel-3: #f2f4fb;
    --muted: #8a94a8;
    --text-2: #46536b;

    --sidebar-w: 236px;
    --radius-lg: 20px;

    --shadow-sm: 0 1px 2px rgba(20, 26, 44, .04), 0 1px 3px rgba(20, 26, 44, .05);
    --shadow-md: 0 8px 24px rgba(20, 26, 44, .08), 0 2px 6px rgba(20, 26, 44, .05);
    --shadow-pop: 0 16px 44px rgba(20, 26, 44, .14), 0 4px 12px rgba(20, 26, 44, .08);
    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ================= 基础 ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(1200px 600px at 85% -10%, rgba(124, 92, 255, .10), transparent 60%),
        radial-gradient(900px 500px at -10% 20%, rgba(99, 102, 241, .08), transparent 55%);
    background-attachment: fixed;
    color: var(--text);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    padding: 24px 24px 24px calc(var(--sidebar-w) + 24px);
    min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: #4338ca; }
code, .mono { font-family: 'SF Mono', ui-monospace, Menlo, monospace; font-size: .92em; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb {
    background: #cfd5e2; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #b6bdd0; background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ================= 侧边栏 ================= */
.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background-color: #fff;
    background-image: linear-gradient(180deg, #ffffff 0%, #fbfbfe 100%);
    border-right: 1px solid var(--line);
    box-shadow: 0 0 40px rgba(20, 26, 44, .05);
    z-index: 50;
}
.app-sidebar .brand {
    display: flex; align-items: center; gap: 11px;
    padding: 22px 20px 20px;
    border-bottom: 1px solid var(--line);
}
.app-sidebar .brand .logo {
    width: 38px; height: 38px; flex: 0 0 38px;
    filter: drop-shadow(0 5px 12px rgba(105, 84, 238, .34));
}
.app-sidebar .brand .logo svg { display: block; width: 100%; height: 100%; }
.app-sidebar .brand .txt { line-height: 1.25; min-width: 0; }
.app-sidebar .brand .txt b {
    display: block; font-size: 15px; font-weight: 700; letter-spacing: .2px;
    background: linear-gradient(90deg, #312e81, #6d28d9);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.app-sidebar .brand .txt span {
    display: block; font-size: 11px; color: var(--muted); margin-top: 1px;
}

.app-nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.app-nav .group-label {
    font-size: 11px; color: var(--muted);
    text-transform: uppercase; letter-spacing: .07em;
    padding: 12px 12px 7px; font-weight: 700;
}
.app-nav .group-label:first-child { padding-top: 2px; }
.app-nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; border-radius: 10px;
    color: var(--text-2); font-size: 13.5px; font-weight: 500;
    margin-bottom: 3px; position: relative;
    transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.app-nav a svg {
    width: 18px; height: 18px; flex: 0 0 18px;
    opacity: .85; transition: opacity .18s;
}
.app-nav a:hover {
    background: var(--panel-2); color: var(--text);
    transform: translateX(2px); text-decoration: none;
}
.app-nav a:hover svg { opacity: 1; }
.app-nav a.active {
    background: var(--brand-grad-soft);
    color: #4f46e5; font-weight: 650;
    box-shadow: inset 0 0 0 1px rgba(124, 92, 255, .14);
    transform: none;
}
.app-nav a.active svg { opacity: 1; color: var(--brand); }
.app-nav a.active::before {
    content: ""; position: absolute;
    left: -12px; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--brand-grad);
    box-shadow: 0 0 8px rgba(124, 92, 255, .6);
}

/* 侧边栏语言切换 */
.lang-switch {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--line);
}
.lang-switch > label {
    font-size: 11px; color: var(--muted);
    font-weight: 650; white-space: nowrap;
}
.lang-switch select {
    flex: 1; min-width: 0; height: 30px; padding: 0 8px;
    font-size: 12px; font-family: inherit; color: var(--text-2);
    border: 1px solid var(--line-strong); border-radius: 8px; background: #fff;
}
.lang-switch select:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}

/* ================= 页面头：吸顶 + 毛玻璃 ================= */
.page-head {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 20px; flex-wrap: wrap;
    margin: -24px -24px 24px;
    padding: 26px 34px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .72);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    box-shadow: 0 1px 0 rgba(20, 26, 44, .02), 0 6px 20px -12px rgba(20, 26, 44, .12);
}
.page-head h1 {
    font-size: 21px; font-weight: 750; letter-spacing: .2px; line-height: 1.35;
    background: linear-gradient(90deg, #1e1b4b, #4f46e5);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.page-head h1 span {
    background: linear-gradient(90deg, #4f46e5, #b14ae8);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.page-head .sub {
    font-size: 13px; color: var(--text-2);
    margin-top: 5px; max-width: 720px; opacity: .9; line-height: 1.7;
}
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }

/* ================= 卡片 ================= */
.card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 22px 24px;
    margin-bottom: 22px;
    transition: box-shadow .22s var(--ease), border-color .22s;
}
.card::before {
    content: ""; position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #4f46e5, #7c5cff, #b14ae8, transparent 92%);
    opacity: 0; transition: opacity .22s; z-index: 1;
}
.card:hover::before { opacity: .85; }
.card:hover { box-shadow: var(--shadow-md); }
.card > h2 {
    display: flex; align-items: center; gap: 8px;
    margin: -22px -24px 18px;
    padding: 17px 24px;
    font-size: 15px; font-weight: 700; letter-spacing: .1px;
    background: linear-gradient(180deg, #ffffff, #fdfdff);
    border-bottom: 1px solid var(--line);
}
.card > h2::before {
    content: ""; flex: 0 0 auto;
    width: 4px; height: 15px; border-radius: 3px;
    background: var(--brand-grad);
    box-shadow: 0 0 6px rgba(124, 92, 255, .45);
}
.card > h2 .sub { font-size: 12px; font-weight: 400; color: var(--muted); }
.card > h2 .grow { flex: 1; }

.grid2 {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 22px;
    align-items: stretch;
    margin-bottom: 22px;
}
.grid2 > .card { margin-bottom: 0; }

/* ================= KPI ================= */
.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px; margin-bottom: 22px;
}
.kpi {
    background: #fff; border: 1px solid var(--line);
    border-radius: 16px; padding: 15px 18px;
    box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
    transition: box-shadow .22s var(--ease), transform .22s var(--ease);
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi::before {
    content: ""; position: absolute;
    left: 0; top: 0; bottom: 0; width: 4px;
    background: var(--brand-grad);
    border-radius: 0 4px 4px 0;
}
.kpi .k { font-size: 11px; letter-spacing: .05em; color: var(--muted); font-weight: 650; }
.kpi .v {
    font-size: 1.45rem; font-weight: 780; line-height: 1.25;
    margin-top: 4px; letter-spacing: -.4px;
}
.kpi .v small { font-size: .72rem; font-weight: 500; color: var(--muted); }
.v.green { color: var(--green); }
.v.yellow { color: var(--yellow); }
.v.red { color: var(--red); }
.v.blue { color: var(--blue); }
.v.accent { color: var(--accent); }

/* ================= 图表 ================= */
.chart-box {
    position: relative;
    height: 250px;
}
.chart-box canvas { display: block; }

/* ================= 按钮 ================= */
.btn, .mini-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-family: inherit;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--text-2);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(20, 26, 44, .04);
    transition: all .16s var(--ease);
    text-decoration: none;
}
.btn { padding: 9px 16px; font-size: 13px; white-space: nowrap; }
.mini-btn { padding: 5px 11px; border-radius: 8px; font-size: 12px; white-space: nowrap; }
.btn:hover, .mini-btn:hover {
    border-color: var(--brand); color: var(--brand); background: #fff;
    box-shadow: 0 3px 8px -2px var(--brand-ring);
    transform: translateY(-1px);
}
.btn:active, .mini-btn:active { transform: translateY(0); }
.btn:disabled, .mini-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.primary {
    background: var(--brand-grad);
    background-size: 160% 100%;
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 12px -2px rgba(94, 84, 245, .5);
}
.btn.primary:hover {
    background-position: 100% 0; color: #fff; border-color: transparent;
    box-shadow: 0 6px 18px -2px rgba(94, 84, 245, .55);
}
.btn.green {
    background: linear-gradient(135deg, #12a06a, #22c55e);
    border-color: transparent; color: #fff;
    box-shadow: 0 3px 12px -2px rgba(18, 160, 106, .4);
}
.btn.green:hover { color: #fff; border-color: transparent; }
.btn.danger {
    background: linear-gradient(135deg, #e04a3d, #ef4444);
    border-color: transparent; color: #fff;
    box-shadow: 0 3px 12px -2px rgba(224, 74, 61, .35);
}
.btn.danger:hover { color: #fff; border-color: transparent; }
.mini-btn.danger { background: #fff; color: var(--red); border-color: #f5c6c1; }
.mini-btn.danger:hover { background: #fdecea; border-color: var(--red); color: var(--red); }
.btn.ghost, .mini-btn.ghost {
    background: transparent; border-color: transparent;
    color: var(--muted); box-shadow: none;
}
.btn.ghost:hover, .mini-btn.ghost:hover {
    background: var(--panel-2); color: var(--text); border-color: transparent;
}

/* ================= 表单 ================= */
input[type=text], input[type=number], input[type=search], select, textarea {
    font-family: inherit;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 8px 11px;
    font-size: 13px;
    color: var(--text);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
::placeholder { color: #b6bdcb; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.muted { color: var(--muted); }

/* ================= 筛选条 ================= */
.table-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 22px;
}
.table-card > .table-wrap { border: none; border-radius: 0; box-shadow: none; }

.filter-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-2);
}
.filter-bar input[type=search], .filter-bar input[type=text] {
    flex: 1 1 220px; height: 34px; padding: 0 12px; border-radius: 10px;
    background: #fff;
}
.filter-bar .hint { margin-left: auto; font-size: 12px; white-space: nowrap; }

.chip {
    font-family: inherit; font-size: 13px; font-weight: 600;
    height: 34px; padding: 0 14px; border-radius: 10px;
    border: 1px solid var(--line-strong); background: #fff; color: var(--text-2);
    box-shadow: 0 1px 2px rgba(20, 26, 44, .04);
    cursor: pointer; transition: all .16s var(--ease);
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active {
    background: var(--brand-grad-soft);
    border-color: rgba(124, 92, 255, .38);
    color: #4f46e5;
}

/* 批量操作条 */
.batchbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 9px 18px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}
.batchbar .count { font-size: 12.5px; color: var(--muted); }
.batchbar .count b { color: var(--text); font-weight: 700; }
.batchbar .grow { flex: 1; }

.chk {
    width: 15px; height: 15px;
    accent-color: var(--brand);
    cursor: pointer; vertical-align: middle;
}
.c-check { width: 42px; text-align: center; }
tbody td.c-check { text-align: center; }

/* ================= 表格 ================= */
.table-wrap {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}
/* 卡片内自带表格：去掉外层容器质感，只保留横向滚动 */
.table-wrap.plain {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
    text-align: left; white-space: nowrap;
    padding: 12px 16px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: var(--text-2);
    background: linear-gradient(180deg, #f5f6fc, #f8f9fd);
    border-bottom: 1px solid var(--line-strong);
}
tbody td {
    padding: 12px 16px; border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(91, 110, 225, .045); }
/* 整行可点选：点行即勾选 */
tbody tr.selectable { cursor: pointer; }
tbody tr.selected { background: var(--brand-soft); }
tbody tr.selected:hover { background: #e6e9ff; }
.cell-title { font-weight: 600; font-size: 13.5px; }
.cell-sub {
    font-size: 12px; color: var(--dim); margin-top: 3px;
    max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.time { color: var(--dim); font-size: 12.5px; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.empty-state, .empty {
    text-align: center; color: var(--muted);
    padding: 44px 16px; font-size: 13px;
}

/* ================= 徽章 ================= */
.badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge.green { background: rgba(18, 160, 106, .14); color: #0f8a5c; }
.badge.yellow { background: rgba(201, 130, 26, .16); color: #b0740f; }
.badge.blue { background: rgba(79, 70, 229, .12); color: #4f46e5; }
.badge.gray { background: rgba(138, 148, 168, .16); color: var(--muted); }

/* ================= 接口速览 ================= */
.api-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.api-list li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.api-list code { font-size: 12px; color: var(--text); }
.api-list .muted { margin-left: auto; font-size: 11.5px; text-align: right; }
.method {
    flex-shrink: 0; min-width: 46px; text-align: center;
    font-size: 10px; font-weight: 700; letter-spacing: .04em;
    padding: 3px 7px; border-radius: 6px;
}
.method.get { background: rgba(14, 165, 233, .12); color: #0369a1; }
.method.post { background: rgba(18, 160, 106, .14); color: #0f8a5c; }
.method.patch { background: rgba(201, 130, 26, .16); color: #b0740f; }
.method.delete { background: rgba(224, 74, 61, .12); color: var(--red); }

.footnote { text-align: center; color: var(--muted); font-size: 12px; margin-top: 8px; }

/* ================= 图标示例 ================= */
.icons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
}
.icon-tile {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 9px; padding: 16px 8px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    font-family: inherit;
    cursor: pointer;
    transition: all .16s var(--ease);
}
.icon-tile svg {
    width: 24px; height: 24px;
    color: var(--text-2);
    transition: color .16s;
}
.icon-tile .icon-name {
    font-family: 'SF Mono', ui-monospace, Menlo, monospace;
    font-size: 11px;
    color: var(--muted);
}
.icon-tile:hover {
    border-color: var(--brand);
    box-shadow: 0 4px 14px -6px var(--brand-ring);
    transform: translateY(-1px);
}
.icon-tile:hover svg { color: var(--brand); }
.icon-tile:active { transform: translateY(0); }
.icon-tile.copied { border-color: var(--green); background: rgba(18, 160, 106, .06); }
.icon-tile.copied svg { color: var(--green); }

.icon-sizes, .icon-colors { display: flex; flex-wrap: wrap; gap: 26px; }
.size-item, .color-item {
    display: flex; flex-direction: column;
    align-items: center; justify-content: flex-end;
    gap: 8px;
}
.size-item span, .color-item span { font-size: 11px; color: var(--muted); }
.icon-sizes svg, .icon-colors svg { display: block; }

.code-block {
    margin: 0;
    padding: 14px 16px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    font-family: 'SF Mono', ui-monospace, Menlo, monospace;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-2);
    overflow-x: auto;
    white-space: pre;
}
.card > h2 .hint { font-weight: 400; }

/* ================= SweetAlert2 主题（与站点同一套设计） ================= */
/* SweetAlert 的默认样式是运行时插入 <head> 末尾的，所以统一用更高的选择器权重覆盖。 */
.swal2-container.swal2-backdrop-show,
.swal2-container.swal2-noanimation {
    background: rgba(20, 26, 44, .38);
}
.swal2-container.swal2-backdrop-show {
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.swal2-container .swal2-popup {
    font-family: inherit;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    padding: 26px 26px 22px;
    /* 让图标配色跟随站点色板 */
    --swal2-success: #12a06a;
    --swal2-success-border: rgba(18, 160, 106, .3);
    --swal2-error: #e04a3d;
    --swal2-warning: #c9821a;
    --swal2-info: #0ea5e9;
    --swal2-question: #4f46e5;
}
.swal2-container .swal2-popup .swal2-title {
    padding: 0;
    font-size: 19px;
    font-weight: 750;
    letter-spacing: .1px;
    color: var(--text);
}
.swal2-container .swal2-popup .swal2-html-container {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-2);
}
/* 图标按 em 缩放：.82rem → 直径约 66px，比默认 80px 更紧凑；toast 里的图标不缩 */
.swal2-container .swal2-popup:not(.swal2-toast) .swal2-icon {
    font-size: .82rem;
    margin: 8px auto 18px;
    border-width: .22em;
}
.swal2-container .swal2-popup .swal2-actions { gap: 10px; margin-top: 22px; }
.swal2-container .swal2-popup .swal2-styled {
    margin: 0;
    padding: 9px 22px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: all .16s var(--ease);
}
.swal2-container .swal2-popup .swal2-styled:focus {
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.swal2-container .swal2-popup .swal2-confirm {
    background: var(--brand-grad);
    background-size: 160% 100%;
    color: #fff;
    box-shadow: 0 3px 12px -2px rgba(94, 84, 245, .5);
}
.swal2-container .swal2-popup .swal2-confirm:hover {
    background-position: 100% 0;
    box-shadow: 0 6px 18px -2px rgba(94, 84, 245, .55);
}
.swal2-container .swal2-popup .swal2-cancel {
    background: #fff;
    border: 1px solid var(--line-strong);
    color: var(--text-2);
}
.swal2-container .swal2-popup .swal2-cancel:hover {
    border-color: var(--brand);
    color: var(--brand);
    box-shadow: 0 3px 8px -2px var(--brand-ring);
}
/* 危险操作：confirm 按钮加 .swal-danger */
.swal2-container .swal2-popup .swal2-confirm.swal-danger,
.swal2-container .swal2-popup .swal2-confirm.swal-danger:hover,
.swal2-container .swal2-popup .swal2-confirm.swal-danger:focus {
    background: linear-gradient(135deg, #e04a3d, #ef4444);
    box-shadow: 0 3px 12px -2px rgba(224, 74, 61, .4);
}
.swal2-container .swal2-popup .swal2-close {
    color: var(--muted);
    border-radius: 8px;
}
.swal2-container .swal2-popup .swal2-close:hover { color: var(--brand); }
.swal2-container .swal2-popup .swal2-validation-message {
    margin-top: 12px;
    padding: 8px 12px;
    border: 1px solid #f5c6c1;
    border-radius: 8px;
    background: rgba(224, 74, 61, .08);
    color: var(--red);
    font-size: 12.5px;
}
.swal2-container .swal2-popup .swal2-validation-message::before { background-color: var(--red); }

/* toast：跟站点的浮层一致 */
.swal2-container .swal2-popup.swal2-toast {
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: var(--shadow-pop);
    /* 只留列间距：SweetAlert 的 toast 内部用大量 0 高度的行占位，
       row-gap 会被撑成几十条空白（实测能到 900px+） */
    gap: 0 10px;
}
.swal2-container .swal2-popup.swal2-toast .swal2-title {
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.swal2-container .swal2-popup.swal2-toast .swal2-html-container { margin: 0; }
.swal2-container .swal2-popup.swal2-toast .swal2-timer-progress-bar { background: var(--brand-grad); }

/* 弹窗内的自定义表单 */
.swal-form { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; text-align: left; }
.swal-form label {
    display: flex; flex-direction: column; gap: 6px;
    font-size: 12px; color: var(--text-2); font-weight: 600;
}
.swal-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.swal-form input, .swal-form select, .swal-form textarea {
    width: 100%; font-family: inherit; font-size: 13px; color: var(--text);
    padding: 9px 11px; background: #fff;
    border: 1px solid var(--line-strong); border-radius: 10px;
}
.swal-form textarea { min-height: 74px; resize: vertical; line-height: 1.6; }
.swal-form input:focus, .swal-form select:focus, .swal-form textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}

/* ================= 解析下载页 ================= */
.parse-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.parse-row input[type=text] { flex: 1 1 320px; height: 40px; padding: 0 14px; font-size: 13.5px; }
.parse-row textarea {
    flex: 1 1 320px; min-height: 44px; max-height: 150px; resize: vertical;
    padding: 11px 14px; font-family: inherit; font-size: 13.5px; line-height: 1.6;
    color: var(--text); background: #fff;
    border: 1px solid var(--line-strong); border-radius: 12px;
}
.parse-row textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.parse-row .btn { height: 40px; padding: 0 24px; }

.parse-tools { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.parse-tools .hint { font-size: 12px; }

.advanced-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.advanced-row > label { font-size: 12.5px; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.advanced-row input[type=text] { flex: 1 1 260px; height: 34px; }
.check {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: var(--text-2); font-weight: 600; white-space: nowrap;
}
.check input { width: 15px; height: 15px; accent-color: var(--brand); }

.platform-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.platform-row .hint { margin-right: 2px; }

/* 使用说明 / FAQ */
.steps { margin: 8px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.9; color: var(--text-2); }
.steps li { margin-bottom: 10px; }
.steps b { display: block; color: var(--text); }
.steps .hint { display: block; }
.faq-q { font-size: 13px; font-weight: 650; margin: 12px 0 2px; }
.faq-q:first-of-type { margin-top: 4px; }

.bili-detail { display: grid; grid-template-columns: 250px 1fr; gap: 20px; }
.bili-cover {
    width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
    border-radius: 14px; border: 1px solid var(--line);
    background: var(--panel-2); box-shadow: var(--shadow-sm);
}
.bili-title { font-size: 15px; font-weight: 700; line-height: 1.5; }
.bili-meta { min-width: 0; }
.field-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.field-row > label { flex: 0 0 60px; font-size: 12.5px; color: var(--muted); font-weight: 650; }
.field-row select { min-width: 250px; height: 34px; }
.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.estimate { margin-top: 14px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.bili-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

/* 任务进度条 */
.progress {
    width: 100%; min-width: 120px; height: 8px;
    background: var(--panel-3); border-radius: 999px; overflow: hidden;
}
.progress > i {
    display: block; height: 100%; width: 0;
    background: var(--brand-grad); border-radius: 999px;
    transition: width .3s var(--ease);
}
.progress.done > i { background: linear-gradient(135deg, #12a06a, #22c55e); }
.progress.error > i { background: linear-gradient(135deg, #e04a3d, #ef4444); }
.task-title { font-weight: 600; font-size: 13px; }
.task-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.task-cell { min-width: 180px; }

/* ================= 响应式 ================= */
@media (max-width: 1180px) {
    .grid2 { grid-template-columns: 1fr; }
    .bili-detail { grid-template-columns: 1fr; }
    .bili-cover { max-width: 420px; }
}

@media (max-width: 1080px) {
    body { padding: 16px; }
    .app-sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--line);
        box-shadow: 0 6px 20px -12px rgba(20, 26, 44, .14);
    }
    .app-sidebar .brand { padding: 14px 16px 12px; border-bottom: none; }
    .app-nav {
        display: flex; flex-wrap: wrap; gap: 6px;
        padding: 8px 14px 12px;
        overflow-x: auto; overflow-y: visible;
    }
    .app-nav a { flex: 0 0 auto; margin: 0; padding: 8px 11px; white-space: nowrap; font-size: 13px; }
    .app-nav .group-label { display: none; }
    .app-nav a:hover { transform: none; }
    .app-nav a.active::before { display: none; }
    .lang-switch {
        margin: 0 14px 10px; padding: 0;
        border-top: none;
    }
    .lang-switch > label { display: none; }
    .lang-switch select { flex: 0 0 160px; }

    .page-head {
        position: static;
        margin: 0 0 18px;
        padding: 18px 0 14px;
        background: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
    }
}

@media (max-width: 560px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-bar { padding: 10px 14px; }
    .filter-bar input[type=search], .filter-bar input[type=text] { flex: 1 1 100%; }
    .filter-bar .hint { margin-left: 0; }
}

/* SEO 内容区（各工具页底部说明 + 常见问题） */
.seo { margin-top: 24px; }
.seo h3 { font-size: 15px; margin: 18px 0 6px; color: var(--text); }
.seo details { margin-top: 8px; padding: 10px 12px; background: var(--panel-2); border-radius: 10px; }
.seo details summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text); }
.seo details p { margin: 8px 0 0; }
