/* ==========================================================================
   Xunad Admin v3 · 设计系统
   浅色后台：白卡片 + 中性灰底 + 品牌蓝，12px 圆角，克制的阴影与描边
   ========================================================================== */

:root {
  --brand: #0A7CFF;
  --brand-600: #0066d4;
  --brand-050: #eff6ff;
  --brand-100: #dbeafe;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #fbfcfe;
  --border: #e6eaf0;
  --border-strong: #d5dbe4;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #8494a8;
  --green: #16a34a;
  --green-bg: #ecfdf3;
  --amber: #b45309;
  --amber-bg: #fffbeb;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-2: 0 8px 24px rgba(15, 23, 42, .08);
  --shadow-3: 0 24px 64px rgba(15, 23, 42, .18);
  --side-w: 232px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ============================ 布局 ============================ */
.app { display: flex; min-height: 100dvh; }

.sidebar {
  width: var(--side-w);
  flex: 0 0 var(--side-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px;
}
.brand-text { font-weight: 700; font-size: 15px; letter-spacing: .2px; display: flex; flex-direction: column; line-height: 1.2; }
.brand-text small { font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: 0; margin-top: 2px; }

.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  text-decoration: none; position: relative;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--brand-050); color: var(--brand); font-weight: 600; }
.nav a.active::before {
  content: ""; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; background: var(--brand); border-radius: 0 3px 3px 0;
}
.nav .ni { width: 18px; text-align: center; font-size: 14px; opacity: .85; }
.nav .nt { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700;
  min-width: 18px; height: 18px; line-height: 18px; text-align: center;
  border-radius: 9px; padding: 0 5px;
}

.side-foot { padding: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 9px 12px; border-radius: var(--radius-sm); color: var(--muted);
  font-size: 12.5px; cursor: pointer; text-decoration: none;
}
.side-link:hover { background: var(--surface-2); color: var(--text-2); text-decoration: none; }
.side-link.danger:hover { background: var(--red-bg); color: var(--red); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; flex: 0 0 56px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 22px; background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.icon-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.icon-btn:hover { background: var(--surface-2); }
.menu-btn { display: none; }
.crumb { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.crumb b { color: var(--text); font-weight: 600; font-size: 14px; }
.crumb .sep { color: var(--border-strong); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-2);
}

.view { padding: 22px; flex: 1; min-width: 0; }
.view:focus { outline: none; }

/* ============================ 页头 ============================ */
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: -.2px; }
.page-head .desc { color: var(--muted); font-size: 12.5px; margin: 0; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(10, 124, 255, .25); }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--red-bg); border-color: #fecaca; color: var(--red); }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-icon { width: 28px; padding: 0; }

/* ============================ 卡片 ============================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  overflow: hidden;
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 14px; margin: 0; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); display: flex; gap: 10px; align-items: center; }

/* ============================ KPI ============================ */
.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-1); position: relative; overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; inset: 0 0 auto auto; width: 72px; height: 72px;
  background: radial-gradient(circle at 100% 0, var(--brand-050), transparent 70%);
  pointer-events: none;
}
.k-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.k-value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.k-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.k-sub .up { color: var(--green); font-weight: 600; }
.k-sub .warn { color: var(--amber); font-weight: 600; }

/* ============================ 两栏 ============================ */
.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1180px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ============================ 表单 ============================ */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
input[type="text"], input[type="password"], input[type="email"], input[type="url"],
input[type="number"], input[type="date"], input:not([type]), select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  font-size: 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #c3ccd9; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10, 124, 255, .12); }
textarea { resize: vertical; line-height: 1.7; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238494a8' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.err-text { color: var(--red); font-size: 12px; min-height: 16px; }

/* 工具栏 / 搜索 / 分段控件 */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search input { padding-left: 32px; }
.search::before {
  content: "⌕"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 15px; pointer-events: none;
}
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button {
  border: none; background: none; padding: 5px 12px; border-radius: 7px;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; font-weight: 500;
}
.seg button.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-1); font-weight: 600; }
.seg.count button .n { color: var(--muted); font-size: 11px; margin-left: 3px; }

/* ============================ 表格 ============================ */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-weight: 600; font-size: 11.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  white-space: nowrap;
}
table.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
table.tbl tbody tr:hover { background: #fafbfd; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
table.tbl .title-cell { color: var(--text); font-weight: 500; }
table.tbl .title-cell small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; margin-top: 2px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.tbl-empty { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* 徽章 */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: #f1f5f9; color: var(--text-2);
}
.badge.blue { background: var(--brand-050); color: var(--brand-600); }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.gray { background: #f1f5f9; color: var(--muted); }

/* 分页 */
.pager { display: flex; align-items: center; gap: 6px; padding: 12px 18px; border-top: 1px solid var(--border); }
.pager .info { margin-right: auto; font-size: 12px; color: var(--muted); }
.pager button {
  min-width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 12.5px;
}
.pager button.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* ============================ 图表 ============================ */
.chart-box { padding: 8px 6px 0; }
.chart-svg { width: 100%; height: 220px; display: block; overflow: visible; }
.chart-legend { display: flex; gap: 16px; padding: 6px 12px 12px; font-size: 12px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.chart-grid line { stroke: var(--border); stroke-width: 1; }
.chart-axis text { fill: var(--muted); font-size: 10px; }

.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 12.5px; }
.bar-item .name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-item .val { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-item .track { grid-column: 1 / -1; height: 6px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.bar-item .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), #4faeff); }

/* ============================ 编辑器 ============================ */
.editor-page { display: flex; flex-direction: column; gap: 14px; }
.editor-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.editor-top .grow { flex: 1; min-width: 180px; }
.editor-top .dirty { font-size: 12px; color: var(--amber); font-weight: 600; }
.editor-top .saved { font-size: 12px; color: var(--muted); }

.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 1080px) { .editor-grid { grid-template-columns: 1fr; } }

.ed-toolbar {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.ed-toolbar button {
  border: none; background: none; color: var(--text-2); border-radius: 6px;
  min-width: 30px; height: 28px; padding: 0 7px; cursor: pointer; font-size: 12.5px;
}
.ed-toolbar button:hover { background: var(--border); color: var(--text); }
.ed-toolbar .divider { width: 1px; height: 18px; background: var(--border-strong); margin: 0 6px; }
.ed-toolbar .spacer { flex: 1; }

.ed-body { position: relative; }
.ed-area {
  width: 100%; min-height: 460px; border: none; border-radius: 0; padding: 18px;
  font-family: var(--mono); font-size: 13px; line-height: 1.8; color: var(--text);
  resize: vertical; background: var(--surface);
}
.ed-area:focus { box-shadow: none; }
.ed-foot {
  display: flex; align-items: center; gap: 14px; padding: 8px 16px;
  border-top: 1px solid var(--border); background: var(--surface-2);
  font-size: 11.5px; color: var(--muted);
}
.ed-split { display: grid; grid-template-columns: 1fr 1fr; }
.ed-split .ed-area { border-right: 1px solid var(--border); }
@media (max-width: 900px) { .ed-split { grid-template-columns: 1fr; } .ed-split .preview { display: none; } }

.preview { padding: 20px 24px; overflow-y: auto; max-height: 70vh; font-size: 14px; color: #1f2937; }
.preview h1, .preview h2, .preview h3 { margin: 18px 0 8px; line-height: 1.35; }
.preview h1 { font-size: 22px; } .preview h2 { font-size: 18px; } .preview h3 { font-size: 15px; }
.preview p, .preview li { line-height: 1.85; margin: 0 0 10px; }
.preview table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13px; }
.preview th, .preview td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; }
.preview th { background: var(--surface-2); }
.preview img { max-width: 100%; border-radius: 8px; }
.preview blockquote { margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--brand-100); color: var(--text-2); background: var(--surface-2); }
.preview code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-family: var(--mono); font-size: 12.5px; }

.meta-panel .card-body { padding: 16px; }
.meta-panel .field > label { display: flex; align-items: center; justify-content: space-between; }
.cover-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }
.lang-tag { font-size: 11px; color: var(--muted); font-weight: 500; }

/* ============================ 媒体库 ============================ */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.media-item { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.media-item .thumb { aspect-ratio: 4 / 3; background: #f1f5f9; display: block; }
.media-item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-meta { padding: 8px 10px; font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.media-meta .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.media-actions { display: flex; border-top: 1px solid var(--border); }
.media-actions button {
  flex: 1; border: none; background: var(--surface); padding: 7px 0; font-size: 12px;
  color: var(--text-2); cursor: pointer;
}
.media-actions button + button { border-left: 1px solid var(--border); }
.media-actions button:hover { background: var(--surface-2); color: var(--brand); }
.media-actions button.del:hover { color: var(--red); background: var(--red-bg); }
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  padding: 26px; text-align: center; color: var(--muted); font-size: 13px;
  background: var(--surface); margin-bottom: 16px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-050); color: var(--brand); }

/* ============================ 空状态 / 骨架 ============================ */
.empty { padding: 56px 24px; text-align: center; color: var(--muted); }
.empty .ico { font-size: 30px; opacity: .5; display: block; margin-bottom: 8px; }
.empty h3 { margin: 0 0 6px; font-size: 14px; color: var(--text-2); font-weight: 600; }
.empty p { margin: 0 0 14px; font-size: 12.5px; }

.skeleton-page { display: flex; flex-direction: column; gap: 16px; }
.sk { background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 37%, #eef2f7 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: var(--radius); }
.sk-title { height: 26px; width: 220px; border-radius: 6px; }
.sk-card { height: 96px; }
.sk-block { height: 280px; }
.sk-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ============================ Toast ============================ */
.toast-wrap {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  pointer-events: auto; min-width: 220px; max-width: 380px;
  padding: 11px 16px; border-radius: 10px; font-size: 13px;
  background: #0f172a; color: #f8fafc; box-shadow: var(--shadow-2);
  opacity: 0; transform: translateY(8px); transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { background: #0f2f1d; color: #dcfce7; }
.toast.err { background: #3f1113; color: #fee2e2; }

/* ============================ Modal / Drawer ============================ */
.modal-mask, .drawer-mask { position: fixed; inset: 0; z-index: 120; background: rgba(15, 23, 42, .45); }
.modal-mask { display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal {
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-3);
  width: 520px; max-width: 100%; max-height: 90dvh; overflow-y: auto;
  padding: 22px;
}
.modal h3 { margin: 0 0 4px; font-size: 16px; }
.modal .m-desc { color: var(--muted); font-size: 12.5px; margin: 0 0 16px; }
.modal-foot { display: flex; gap: 10px; margin-top: 18px; }
.modal-foot .btn { flex: 1; }

.drawer-mask { display: flex; justify-content: flex-end; }
.drawer {
  width: 520px; max-width: 100%; height: 100%; background: var(--surface);
  box-shadow: var(--shadow-3); display: flex; flex-direction: column;
  animation: slideIn .2s ease;
}
@keyframes slideIn { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 12px; }
.drawer-head h3 { margin: 0; font-size: 16px; }
.drawer-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.drawer-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; background: var(--surface-2); }

.kv { display: grid; grid-template-columns: 84px 1fr; gap: 10px 14px; font-size: 13px; margin-bottom: 18px; }
.kv dt { color: var(--muted); font-size: 12px; }
.kv dd { margin: 0; color: var(--text); word-break: break-all; }

/* ============================ 设置页 ============================ */
.settings-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-nav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { padding: 8px 12px; border-radius: 7px; color: var(--text-2); font-size: 13px; }
.settings-nav a:hover { background: var(--surface); text-decoration: none; }
.row-list { display: flex; flex-direction: column; gap: 8px; }
.row-item { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.row-item.two { grid-template-columns: 1fr 1fr; }
.row-item .btn-icon { align-self: center; }
.sticky-save {
  position: sticky; bottom: 0; margin-top: 16px; padding: 12px 16px;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-2);
}
.sticky-save .msg { font-size: 12.5px; color: var(--muted); }

/* ============================ 登录页 ============================ */
.login-body { background: radial-gradient(1200px 600px at 20% -10%, #e8f1ff 0%, var(--bg) 55%); }
.login-wrap { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 380px; max-width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-2); padding: 28px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand h1 { margin: 0; font-size: 17px; }
.login-brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.login-err { color: var(--red); font-size: 12.5px; min-height: 18px; margin: 4px 0 10px; }
.login-foot { margin: 18px 0 0; text-align: center; font-size: 11.5px; color: var(--muted); }

/* ============================ 响应式 ============================ */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: var(--shadow-3);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .view { padding: 16px; }
  .topbar { padding: 0 14px; }
  .sk-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .grid-kpi { grid-template-columns: 1fr 1fr; }
  .drawer { width: 100%; }
  .row-item { grid-template-columns: 1fr; }
}

/* 打印/降低动画偏好 */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
