:root {
  --sidebar: #0f172a;
  --sidebar-dark: #020617;
  --sidebar-active: #2563eb;
  --header-h: 56px;
  --sidebar-w: 232px;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #3b82f6;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --warning: #d97706;
  --danger: #dc2626;
  --info-bg: #eff6ff;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .04);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
button, input, select, textarea { font: inherit; }

/* ========== 登录（若依/SaaS） ========== */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1000px 500px at 8% -8%, rgba(37,99,235,.35), transparent 55%),
    radial-gradient(800px 480px at 100% 0%, rgba(15,23,42,.7), transparent 50%),
    linear-gradient(145deg, #020617 0%, #0f172a 48%, #1e293b 100%);
}
.login-wrap {
  width: min(960px, 94vw);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.login-aside {
  background: linear-gradient(165deg, #2563eb 0%, #1d4ed8 45%, #0f172a 100%);
  color: #fff;
  padding: 52px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-brand-mini {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
}
.login-aside h2 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: .04em;
}
.login-aside p {
  margin: 0;
  opacity: .9;
  line-height: 1.7;
  font-size: 14px;
}
.login-aside .aside-badge {
  display: inline-block;
  margin-bottom: 16px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-size: 12px;
  letter-spacing: .06em;
}
.login-aside .aside-list {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.login-aside .aside-list li {
  position: relative;
  padding: 6px 0 6px 16px;
  font-size: 13px;
  opacity: .92;
}
.login-aside .aside-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}
.login-main .login-foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
}
.login-main .login-foot a { color: var(--muted); }
.login-main .login-foot a:hover { color: var(--primary); }

.login-aside .dots {
  margin-top: 36px;
  display: flex;
  gap: 8px;
}
.login-aside .dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.45);
}
.login-aside .dots span:first-child { background: #fff; width: 22px; border-radius: 8px; }
.login-main {
  padding: 48px 40px;
}
.login-main h1 {
  margin: 0 0 6px;
  font-size: 22px;
  color: #303133;
}
.login-main .sub {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13px;
}
.login-main label {
  display: block;
  margin: 0 0 8px;
  color: #606266;
  font-size: 13px;
}
.login-main .field { margin-bottom: 18px; }
.login-main input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  transition: border-color .15s;
}
.login-main input:focus {
  outline: none;
  border-color: var(--primary);
}
.login-main button {
  margin-top: 8px;
  width: 100%;
  height: 40px;
  border: none;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.login-main button:hover { background: var(--primary-hover); }
.login-main .error {
  margin: 0 0 14px;
  padding: 8px 12px;
  background: #fef0f0;
  color: var(--danger);
  border-radius: 4px;
  font-size: 13px;
}
@media (max-width: 760px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-aside { display: none; }
}

/* ========== 布局壳 ========== */
.layout {
  min-height: 100vh;
  display: flex;
}
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(148,163,184,.08);
}
.sidebar-logo {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: rgba(2,6,23,.55);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .02em;
  border-bottom: 1px solid rgba(148,163,184,.08);
}
.sidebar-env {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 14px 4px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(37,99,235,.12);
  color: #93c5fd;
  font-size: 12px;
}
.sidebar-env .env-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.2);
}
.sidebar-logo .logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.sidebar-logo .logo-text strong {
  font-size: 14px;
  font-weight: 650;
}
.sidebar-logo .logo-text em {
  font-style: normal;
  font-size: 11px;
  color: #64748b;
  font-weight: 400;
}
.sidebar-foot {
  padding: 16px 18px 20px;
  font-size: 11px;
  color: #64748b;
  border-top: 1px solid rgba(148,163,184,.08);
  line-height: 1.5;
}
.sidebar-foot .foot-ver {
  margin-top: 2px;
  color: #475569;
  letter-spacing: .04em;
}
.sidebar-logo .mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(37,99,235,.35);
}
.sidebar-menu {
  padding: 10px 0;
  flex: 1;
  overflow: auto;
}
.menu-group {
  padding: 14px 20px 8px;
  font-size: 11px;
  color: #64748b;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 3px 10px;
  padding: 11px 14px;
  border-radius: 10px;
  color: #94a3b8;
  font-size: 14px;
  transition: background .15s, color .15s;
}
.menu-item:hover {
  color: #fff;
  background: rgba(148,163,184,.1);
}
.menu-item.active {
  color: #fff;
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  box-shadow: 0 8px 18px rgba(37,99,235,.28);
}
.menu-item .ico {
  width: 16px;
  text-align: center;
  opacity: .9;
}
.menu-stat {
  margin: 4px 14px 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(15,23,42,.55);
  border: 1px solid rgba(148,163,184,.1);
}
.menu-stat-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  padding: 5px 0;
  color: #64748b;
}
.menu-stat-item strong {
  color: #cbd5e1;
  font-weight: 600;
}
.menu-stat-item strong.ok { color: #4ade80; }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 280px at 100% -10%, rgba(37,99,235,.06), transparent 55%),
    var(--bg);
}
.navbar {
  height: var(--header-h);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.breadcrumb {
  color: #64748b;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.breadcrumb .crumb-root { color: #94a3b8; }
.breadcrumb .crumb-sep { color: #cbd5e1; }
.breadcrumb b { color: #0f172a; font-weight: 650; }
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #475569;
  font-size: 13px;
}
.navbar-right .nav-link {
  color: #64748b;
  padding: 4px 8px;
  border-radius: 6px;
}
.navbar-right .nav-link:hover { color: var(--primary); background: #eff6ff; }
.nav-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(37,99,235,.3);
}

.content {
  padding: 22px 24px 32px;
  flex: 1;
}

.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.page-hero h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #0f172a;
}
.page-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #cbd5e1;
}

.page-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(226,232,240,.9);
}
.page-card .card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.page-card .card-hd h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}
.page-card .card-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.page-card .card-bd { padding: 16px 18px; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.search-bar {
  margin: 4px 0 16px;
}
.search-bar input[type="search"] {
  flex: 1;
  min-width: 220px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}
.search-bar input[type="search"]:focus {
  outline: none;
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
  transition: all .15s;
}
.btn:hover { border-color: #c6e2ff; color: var(--primary); background: #ecf5ff; }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}
.btn.success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.btn.danger-outline {
  color: var(--danger);
  border-color: #fbc4c4;
}
.btn.danger-outline:hover {
  background: #fef0f0;
  border-color: var(--danger);
}
.btn.plain {
  background: transparent;
  border-color: transparent;
  color: var(--primary);
  height: auto;
  padding: 0 6px;
}
.btn.plain.danger { color: var(--danger); }
.btn.block { width: 100%; height: 36px; margin-top: 8px; }

.alert {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
}
.alert.ok { background: var(--success-bg); color: #529b2e; border: 1px solid #e1f3d8; }
.alert.err { background: #fef0f0; color: var(--danger); border: 1px solid #fde2e2; }

.table-wrap { overflow: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.table th, .table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.table th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .02em;
}
.table tbody tr:hover {
  background: #f8fafc;
}
.ops {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}
.ops form { display: inline; margin: 0; }

.tag {
  display: inline-block;
  padding: 0 8px;
  height: 22px;
  line-height: 22px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid transparent;
}
.tag.on {
  background: var(--success-bg);
  color: #67c23a;
  border-color: #e1f3d8;
}
.tag.off {
  background: #f4f4f5;
  color: #909399;
  border-color: #e9e9eb;
}

.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
  line-height: 1.7;
}

.form-card .form-row { margin-bottom: 18px; }
.form-card label {
  display: block;
  margin-bottom: 8px;
  color: #606266;
  font-size: 13px;
}
.form-card .hint {
  margin-top: 6px;
  color: #c0c4cc;
  font-size: 12px;
}
.form-card input[type=text],
.form-card textarea,
.form-card select {
  width: 100%;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  padding: 8px 12px;
  color: #606266;
  transition: border-color .15s;
}
.form-card input[type=text],
.form-card select { height: 36px; }
.form-card textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.form-card input:focus,
.form-card textarea:focus,
.form-card select:focus {
  outline: none;
  border-color: var(--primary);
}
.form-actions {
  display: flex;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}

.keep-images {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.keep-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #909399;
}
.keep-item img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  background: #f5f7fa;
  border: 1px solid var(--line);
  border-radius: 4px;
}

/* 本地上传预览（选完即显 / 已保存常显） */
.upload-preview {
  margin-top: 10px;
  min-height: 120px;
  max-width: 220px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-sizing: border-box;
}
.upload-preview.has-image {
  border-style: solid;
  border-color: #e2e8f0;
  background: #fff;
}
.upload-preview img {
  max-width: 180px;
  max-height: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}
.upload-preview-empty {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  line-height: 1.5;
  padding: 8px;
}
.upload-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}
.upload-preview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100px;
}
.upload-preview-item img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  background: #f5f7fa;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.upload-preview-name {
  font-size: 11px;
  color: #909399;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.narrow { max-width: 760px; }

.page-card .card-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.stat-row:has(.stat-card:nth-child(3):last-child) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stat-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(226,232,240,.9);
}
.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #94a3b8;
}
.stat-card.accent-blue::before { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.stat-card.accent-green::before { background: linear-gradient(180deg, #4ade80, #16a34a); }
.stat-card.accent-cyan::before { background: linear-gradient(180deg, #22d3ee, #0891b2); }
.stat-card.accent-orange::before { background: linear-gradient(180deg, #fbbf24, #d97706); }
.stat-card .stat-top {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
  letter-spacing: .02em;
}
.stat-card .num {
  font-size: 28px;
  font-weight: 750;
  color: #0f172a;
  line-height: 1.15;
  letter-spacing: -.03em;
}
.stat-card .lab {
  margin-top: 6px;
  font-size: 12px;
  color: #94a3b8;
}
.info-banner {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: linear-gradient(90deg, #eff6ff, #f8fafc);
  border: 1px solid #dbeafe;
  border-radius: 10px;
  color: #1d4ed8;
  font-size: 13px;
  line-height: 1.6;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #334155;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}
.cell-title {
  font-weight: 600;
  color: #0f172a;
}
.req { color: #dc2626; margin-left: 2px; }
.empty {
  padding: 48px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}
.empty strong {
  display: block;
  margin-bottom: 8px;
  color: #475569;
  font-size: 15px;
}
@media (max-width: 1100px) {
  .stat-row,
  .stat-row:has(.stat-card:nth-child(3):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .page-hero { flex-direction: column; align-items: flex-start; }
  .stat-row,
  .stat-row:has(.stat-card:nth-child(3):last-child) {
    grid-template-columns: 1fr;
  }
  .sidebar { display: none; }
}
.keep-item img {
  object-fit: contain;
}

/* 使用说明与答疑 */
.help-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.help-toc {
  position: sticky;
  top: 16px;
}
.help-toc-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.9;
  color: #334155;
}
.help-toc-list a {
  color: #2563eb;
  text-decoration: none;
}
.help-toc-list a:hover { text-decoration: underline; }
.help-main { display: grid; gap: 14px; }
.help-section .card-hd h3 { margin: 0; font-size: 16px; }
.help-body {
  font-size: 14px;
  line-height: 1.7;
  color: #334155;
}
.help-body h4 {
  margin: 16px 0 8px;
  font-size: 14px;
  color: #0f172a;
}
.help-body p { margin: 0 0 10px; }
.help-body ul, .help-body ol { margin: 0 0 12px; padding-left: 20px; }
.help-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
}
.help-steps > li { margin-bottom: 12px; }
.help-steps p { margin: 4px 0 0; color: #64748b; font-size: 13px; }
.help-callout {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  font-size: 13px;
}
.help-callout.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.help-callout ul { margin: 8px 0 0; }
.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 12px;
}
.help-table th, .help-table td {
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  text-align: left;
}
.help-table th { background: #f8fafc; color: #475569; }
.help-body details {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fff;
}
.help-body summary {
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
}
.help-a {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
  color: #475569;
  font-size: 13px;
}
.help-script {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.help-check { list-style: none; padding-left: 0; }
.help-check li { margin-bottom: 6px; }
.help-foot {
  margin-top: 16px;
  font-size: 12px;
  color: #94a3b8;
}
@media (max-width: 960px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-toc { position: static; }
}
