/* =============================================================
   软件维护记录管理系统  样式表（浅色主题 / 零外部依赖）
   ============================================================= */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --border: #e4e9f2;
  --border-strong: #d3dbe8;
  --text: #16202f;
  --text-2: #5b6b82;
  --text-3: #93a1b5;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-weak: #eef4ff;
  --brand-weak-2: #dbe8ff;
  --ok: #10b981;
  --ok-weak: #e8f8f1;
  --warn: #f59e0b;
  --warn-weak: #fef5e4;
  --danger: #ef4444;
  --danger-weak: #fdeced;
  --info: #0ea5e9;
  --info-weak: #e7f6fe;
  --purple: #8b5cf6;
  --purple-weak: #f1edfe;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 32, 47, .05);
  --shadow: 0 4px 16px rgba(16, 32, 47, .07);
  --shadow-lg: 0 12px 32px rgba(16, 32, 47, .12);
  --sidebar-w: 250px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC",
          "Hiragino Sans GB", "Helvetica Neue", Arial, 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 { color: var(--brand-dark); }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }

svg.ico { width: 18px; height: 18px; flex: 0 0 18px; }

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

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.content { flex: 1 1 auto; padding: 22px 26px 40px; }

.footer {
  padding: 14px 26px 22px;
  color: var(--text-3);
  font-size: 12.5px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.footer .sep { color: var(--border-strong); }

/* ------------------------------------------------ 备案信息 */
.beian-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px 14px; line-height: 1.7;
}
.beian-row .beian-item { display: inline-flex; align-items: center; gap: 5px; color: inherit; text-decoration: none; }
.beian-row a.beian-item:hover { color: #2563eb; text-decoration: underline; }
.beian-row .beian-icon { width: 14px; height: 14px; flex: 0 0 14px; display: block; }
.beian-row .beian-sep { width: 1px; height: 12px; background: currentColor; opacity: .28; }
.footer .beian-row { flex: 1 1 100%; justify-content: flex-start; margin-top: 2px; }
.auth-wrap .beian-row { margin-top: 18px; font-size: 12.5px; color: var(--text-3); }
.beian-preview {
  margin-top: 16px; padding: 12px 14px; border: 1px dashed var(--border-strong);
  border-radius: 10px; background: var(--surface-2, #f7f9fc); font-size: 12.5px; color: var(--text-3);
}
.beian-preview .beian-preview-t { display: block; margin-bottom: 8px; color: var(--text-3); }
.beian-preview .beian-row { justify-content: flex-start; }

/* ------------------------------------------------ 品牌 */
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  display: grid; place-items: center;
  font-size: 16px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .28);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--text-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------ 导航 */
.nav { padding: 12px 10px 4px; flex: 1 1 auto; }
.nav-group {
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  color: var(--text-3); text-transform: uppercase;
  padding: 14px 10px 6px;
}
.nav-group:first-child { padding-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13.5px; font-weight: 500;
  transition: background .14s, color .14s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--brand-weak);
  color: var(--brand-dark);
  font-weight: 650;
  box-shadow: inset 2px 0 0 var(--brand);
}
.nav-badge {
  margin-left: auto;
  background: var(--danger); color: #fff;
  font-size: 11px; font-style: normal; font-weight: 600;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 10px; display: grid; place-items: center;
}
.nav-item.active .nav-badge { background: var(--brand); }
.portal-link { margin: 6px 10px 14px; border: 1px dashed var(--border-strong); color: var(--text-2); }

/* ------------------------------------------------ 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 13px 26px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.page-head { min-width: 0; }
.page-head h1 { font-size: 17px; }
.crumb { margin: 1px 0 0; font-size: 12.5px; color: var(--text-3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.icon-btn {
  border: 1px solid var(--border); background: var(--surface);
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: grid; place-items: center; cursor: pointer; color: var(--text-2);
}
.only-mobile { display: none; }

.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 40px; padding: 4px 12px 4px 4px; cursor: pointer;
  font-family: inherit;
}
.user-btn:hover { border-color: var(--border-strong); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff; display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
}
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.user-meta b { font-size: 13px; }
.user-meta small { font-size: 11px; color: var(--text-3); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 158px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60;
}
.menu-pop.open { display: block; }
.menu-pop a {
  display: block; padding: 8px 11px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13px;
}
.menu-pop a:hover { background: var(--surface-2); color: var(--text); }
.menu-pop a.danger:hover { background: var(--danger-weak); color: var(--danger); }

/* ------------------------------------------------ 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; font-size: 13.5px; font-weight: 550;
  font-family: inherit; line-height: 1.4;
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background .14s, border-color .14s, box-shadow .14s, transform .08s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #c3cee0; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .22);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ------------------------------------------------ 卡片 */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-bottom: 18px; overflow: hidden;
}
.card-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.card-hd h3 { font-size: 14.5px; }
.card-hd .sub { font-size: 12.5px; color: var(--text-3); }
.card-hd .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-bd { padding: 18px; }
.card-bd.tight { padding: 0; }
.card-ft {
  padding: 12px 18px; border-top: 1px solid var(--border);
  background: var(--surface-2); display: flex; align-items: center; gap: 10px;
}

/* ------------------------------------------------ 统计卡 */
.stat-grid {
  display: grid; gap: 14px; margin-bottom: 18px;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
}
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 17px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; right: -22px; top: -22px;
  width: 74px; height: 74px; border-radius: 50%; background: var(--brand-weak); opacity: .7;
}
.stat .lbl { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; position: relative; z-index: 1; }
.stat .val { font-size: 27px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; position: relative; z-index: 1; }
.stat .val small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.stat .foot { font-size: 12px; color: var(--text-3); margin-top: 4px; position: relative; z-index: 1; }
.stat.is-warn::after { background: var(--warn-weak); }
.stat.is-danger::after { background: var(--danger-weak); }
.stat.is-ok::after { background: var(--ok-weak); }
.stat.is-info::after { background: var(--info-weak); }
.stat.is-purple::after { background: var(--purple-weak); }
.stat.is-warn .val { color: #b45309; }
.stat.is-danger .val { color: #b91c1c; }
.stat.is-ok .val { color: #047857; }
.stat.is-info .val { color: #0369a1; }
.stat.is-purple .val { color: #6d28d9; }

.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid-3 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ------------------------------------------------ 表单 */
.form-grid { display: grid; gap: 16px 20px; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); }
.form-grid .col-2 { grid-column: span 2; }
.form-grid .col-full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid .col-2 { grid-column: 1 / -1; } }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .req::after { content: ' *'; color: var(--danger); }

input[type=text], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], input[type=email], input[type=tel], input[type=search],
select, textarea {
  width: 100%; padding: 8.5px 11px; font-family: inherit; font-size: 13.5px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .14s, box-shadow .14s; outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { resize: vertical; min-height: 88px; line-height: 1.7; }
select { appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a1b5' stroke-width='2.4'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 15px; padding-right: 30px; }
.hint { font-size: 12px; color: var(--text-3); }

.check-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.check-row input[type=checkbox], .check-row input[type=radio] { width: 16px; height: 16px; accent-color: var(--brand); }
.chk-group { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 3px; }

.form-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 16px 18px; border-top: 1px solid var(--border);
  background: var(--surface-2); position: sticky; bottom: 0; z-index: 20;
}
.form-actions .spacer { flex: 1 1 auto; }

/* 筛选条 */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  padding: 15px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.filter-bar .field { flex: 0 1 168px; }
.filter-bar .field.wide { flex: 1 1 240px; }
.filter-bar .field.narrow { flex: 0 1 120px; }
.filter-bar .actions { display: flex; gap: 8px; margin-left: auto; }
.quick-dates { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-dates a {
  font-size: 12px; padding: 3px 9px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
}
.quick-dates a:hover { border-color: var(--brand); color: var(--brand); }
.quick-dates a.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ------------------------------------------------ 表格 */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.table th {
  text-align: left; font-size: 12.5px; font-weight: 650; color: var(--text-2);
  background: var(--surface-2); padding: 11px 14px;
  border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
table.table th a { color: inherit; display: inline-flex; align-items: center; gap: 3px; }
table.table th a:hover { color: var(--brand); }
table.table td {
  padding: 11px 14px; border-bottom: 1px solid #f0f3f8; vertical-align: middle;
}
table.table tbody tr:hover { background: #f8fafd; }
table.table tbody tr:last-child td { border-bottom: 0; }
table.table .num { text-align: right; font-variant-numeric: tabular-nums; }
table.table .mono { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
table.table .nowrap { white-space: nowrap; }
table.table .actions { white-space: nowrap; display: flex; gap: 6px; }
table.table td .sub { display: block; font-size: 12px; color: var(--text-3); margin-top: 1px; }
table.table.compact td, table.table.compact th { padding: 8px 12px; }

.empty { padding: 54px 20px; text-align: center; color: var(--text-3); }
.empty svg { width: 46px; height: 46px; stroke-width: 1.4; color: #cbd5e1; margin-bottom: 10px; }
.empty p { margin: 0 0 4px; font-size: 14px; color: var(--text-2); font-weight: 550; }
.empty small { font-size: 12.5px; }

/* ------------------------------------------------ 徽章 */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2.5px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  background: #eef2f7; color: var(--text-2);
}
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.st-pending    { background: var(--warn-weak);   color: #b45309; }
.st-processing { background: var(--info-weak);   color: #0369a1; }
.st-resolved   { background: var(--ok-weak);     color: #047857; }
.st-closed     { background: #eef2f7;            color: #64748b; }
.sv-low        { background: #eef2f7;            color: #64748b; }
.sv-normal     { background: var(--brand-weak);  color: var(--brand-dark); }
.sv-high       { background: var(--warn-weak);   color: #b45309; }
.sv-urgent     { background: var(--danger-weak); color: #b91c1c; }
.badge-vip     { background: linear-gradient(135deg,#fde68a,#fbbf24); color: #7c4a03; }
.badge-new     { background: var(--purple-weak); color: #6d28d9; }
.badge-over    { background: var(--danger-weak); color: #b91c1c; }
.badge-soon    { background: var(--warn-weak);   color: #b45309; }
.badge-ok      { background: var(--ok-weak);     color: #047857; }

/* ------------------------------------------------ 提示条 */
.alert {
  padding: 11px 15px; border-radius: var(--radius-sm);
  font-size: 13.5px; margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-success { background: var(--ok-weak);     border-color: #b6e8d3; color: #046c4e; }
.alert-danger  { background: var(--danger-weak); border-color: #f8cdd0; color: #a11f22; }
.alert-warning { background: var(--warn-weak);   border-color: #f6dfb0; color: #8a5a06; }
.alert-info    { background: var(--info-weak);   border-color: #b9e4f9; color: #075985; }

/* ------------------------------------------------ 分页 */
.pager {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 13px 18px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.pager-info { font-size: 12.5px; color: var(--text-3); }
.pager-info b { color: var(--text-2); }
.pager-links { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.pg {
  min-width: 30px; height: 30px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 7px; font-size: 13px; color: var(--text-2);
}
.pg:hover { border-color: var(--brand); color: var(--brand); }
.pg.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pg.disabled { opacity: .45; pointer-events: none; }
.pg.dots { border: 0; background: transparent; }

/* ------------------------------------------------ 图表 */
.chart { width: 100%; height: auto; display: block; }
.chart-empty { padding: 46px 10px; text-align: center; color: var(--text-3); font-size: 13px; }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut { flex: 0 0 160px; }
.legend { list-style: none; margin: 0; padding: 0; flex: 1 1 190px; min-width: 180px; }
.legend li {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; font-size: 13px; border-bottom: 1px dashed #f0f3f8;
}
.legend li:last-child { border-bottom: 0; }
.legend .dot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 9px; }
.legend .lg-name { flex: 1 1 auto; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend .lg-val { font-weight: 650; font-variant-numeric: tabular-nums; }
.legend .lg-pct { width: 48px; text-align: right; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }

.hbar { list-style: none; margin: 0; padding: 0; }
.hbar li { display: flex; align-items: center; gap: 11px; padding: 7px 0; font-size: 13px; }
.hbar .hb-name { flex: 0 0 78px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .hb-track { flex: 1 1 auto; height: 9px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.hbar .hb-fill { display: block; height: 100%; border-radius: 6px; transition: width .5s ease; }
.hbar .hb-val { flex: 0 0 56px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------ 详情页 */
.detail-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 22px; }
.detail-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #eef2f7; font-size: 13.5px; }
.detail-item .k { flex: 0 0 88px; color: var(--text-3); }
.detail-item .v { flex: 1 1 auto; color: var(--text); word-break: break-word; }
.section-title {
  font-size: 13.5px; font-weight: 650; color: var(--text-2);
  margin: 20px 0 8px; padding-left: 9px; border-left: 3px solid var(--brand);
}
.section-title:first-child { margin-top: 0; }
.text-block {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 15px;
  font-size: 13.5px; line-height: 1.85; color: var(--text); word-break: break-word;
}
.text-block em { color: var(--text-3); font-style: normal; }

/* 时间线 */
.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--border); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; left: -7px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2.5px solid var(--border-strong);
}
.timeline li.done::before { border-color: var(--ok); background: var(--ok); }
.timeline li.now::before { border-color: var(--brand); background: var(--brand); box-shadow: 0 0 0 4px var(--brand-weak); }
.timeline .tl-t { font-weight: 600; font-size: 13.5px; }
.timeline .tl-d { font-size: 12.5px; color: var(--text-3); }

/* 附件 */
.attach-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.attach {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface); position: relative;
}
.attach .thumb {
  height: 104px; background: #f1f5f9; display: grid; place-items: center;
  overflow: hidden; color: var(--text-3);
}
.attach .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach .meta { padding: 8px 10px; font-size: 12px; }
.attach .meta .fn { display: block; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach .meta .fs { color: var(--text-3); }
.attach .ops { display: flex; border-top: 1px solid var(--border); }
.attach .ops a, .attach .ops button {
  flex: 1; padding: 6px; text-align: center; font-size: 12px;
  background: var(--surface); border: 0; border-right: 1px solid var(--border);
  cursor: pointer; color: var(--text-2); font-family: inherit;
}
.attach .ops a:last-child, .attach .ops button:last-child { border-right: 0; }
.attach .ops a:hover { background: var(--brand-weak); color: var(--brand); }
.attach .ops button:hover { background: var(--danger-weak); color: var(--danger); }

.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: 22px; text-align: center; color: var(--text-3); font-size: 13px;
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-weak); color: var(--brand); }
.dropzone b { display: block; color: var(--text-2); font-size: 13.5px; margin-bottom: 3px; }

/* ------------------------------------------------ 登录页 */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 30px 18px;
  background:
    radial-gradient(1100px 520px at 12% -8%, #dbe8ff 0%, rgba(219,232,255,0) 62%),
    radial-gradient(900px 460px at 92% 108%, #d9f2ff 0%, rgba(217,242,255,0) 60%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 396px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow-lg); padding: 32px 30px 26px;
}
.auth-logo {
  width: 50px; height: 50px; border-radius: 14px; margin: 0 auto 14px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  display: grid; place-items: center; color: #fff; font-size: 21px; font-weight: 700;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .3);
}
.auth-card h1 { text-align: center; font-size: 19px; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--text-3); font-size: 13px; margin-bottom: 24px; }
.auth-card .field { margin-bottom: 15px; }
.auth-card .btn { margin-top: 6px; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--text-3); }
.auth-links { display: flex; justify-content: center; gap: 14px; margin-top: 14px; font-size: 12.5px; }

/* ------------------------------------------------ 其他 */
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.page-actions .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--text-3); }
.strong { font-weight: 650; }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb0 { margin-bottom: 0; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.flex { display: flex; } .items-center { align-items: center; } .gap8 { gap: 8px; } .gap12 { gap: 12px; }
.wrap { flex-wrap: wrap; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a {
  padding: 9px 15px; font-size: 13.5px; color: var(--text-2); font-weight: 550;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

.kv-inline { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.kv-inline b { color: var(--text); font-weight: 650; }

.progress { height: 8px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 6px; }

/* 自检项 */
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 0; border-bottom: 1px solid #f0f3f8; font-size: 13.5px;
}
.check-list li:last-child { border-bottom: 0; }
.check-list .ico-wrap {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 24px;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.check-list .pass .ico-wrap { background: var(--ok-weak); color: #047857; }
.check-list .fail .ico-wrap { background: var(--danger-weak); color: #b91c1c; }
.check-list .warn .ico-wrap { background: var(--warn-weak); color: #b45309; }
.check-list .c-body { flex: 1 1 auto; }
.check-list .c-body b { display: block; }
.check-list .c-body small { color: var(--text-3); }

/* 响应式 */
@media (max-width: 980px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 90;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .only-mobile { display: grid; }
  .only-desktop { display: none !important; }
  .content { padding: 16px 14px 32px; }
  .topbar { padding: 11px 14px; }
  .footer { padding: 12px 14px 18px; }
  .filter-bar { padding: 12px 14px; }
  .filter-bar .field, .filter-bar .field.wide { flex: 1 1 100%; }
  .form-actions { padding: 12px 14px; }
  .dash-backdrop {
    position: fixed; inset: 0; background: rgba(16,32,47,.35); z-index: 80;
  }
}
@media (max-width: 620px) {
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(142px, 1fr)); gap: 10px; }
  .stat .val { font-size: 22px; }
  .card-bd { padding: 14px; }
  .detail-item .k { flex: 0 0 74px; }
}

@media print {
  .sidebar, .topbar, .footer, .form-actions, .page-actions, .pager { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  body { background: #fff; }
}
