:root {
  --background: #f9fafc;
  --foreground: #101826;
  --card: #fff;
  --primary: #245fd4;
  --primary-foreground: #fafafa;
  --secondary: #edf2f9;
  --muted: #f1f4f7;
  --muted-foreground: #6b727e;
  --accent: #e6effc;
  --accent-fg: #1a469d;
  --destructive: #e40014;
  --success: #00a05b;
  --warning: #e49e22;
  --border: #e2e5e9;
  --radius: .7rem;
  --sidebar: #131b29;
  --sidebar-foreground: #dadee5;
  --sidebar-primary: #3c79f0;
  --sidebar-accent: #1e293d;
  --sidebar-accent-foreground: #f1f5fc;
  --sidebar-border: #2a3342;
  --shadow: 0 8px 30px rgba(16, 24, 38, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif; background: var(--background); color: var(--foreground); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
svg { display: block; }
.app { display: flex; min-height: 100vh; background: var(--background); }
.side { width: 16rem; flex-shrink: 0; display: flex; flex-direction: column; background: var(--sidebar); color: var(--sidebar-foreground); border-right: 1px solid var(--sidebar-border); }
.brand { display: flex; align-items: center; gap: 10px; padding: 20px; }
.brand-mark { width: 36px; height: 36px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.brand-mark svg { width: 20px; height: 20px; }
.brand b { display: block; font-size: 13px; font-weight: 600; letter-spacing: -.02em; color: #fff; }
.site-dd { position: relative; padding: 0 12px 12px; }
.site-dd > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; border: 1px solid var(--sidebar-border); background: var(--sidebar-accent); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.site-dd > summary::-webkit-details-marker { display: none; }
.overflow-hidden { overflow: hidden; min-width: 0; }
.site-dd > summary svg { width: 16px; height: 16px; opacity: .5; flex-shrink: 0; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--success); flex-shrink: 0; }
.dot.off { background: var(--muted-foreground); }
.site-dd .ttl { display: block; font-size: 13px; font-weight: 500; color: var(--sidebar-accent-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-dd .sub { display: block; font-size: 12px; color: color-mix(in srgb, var(--sidebar-foreground) 50%, transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-dd-menu { position: absolute; left: 12px; right: 12px; z-index: 30; margin-top: 6px; max-height: 280px; overflow: auto; border: 1px solid var(--sidebar-border); background: var(--sidebar); border-radius: 8px; box-shadow: 0 16px 40px rgba(0,0,0,.35); }
.site-dd-menu a { display: block; padding: 10px 12px; color: var(--sidebar-foreground); }
.site-dd-menu a:hover { background: var(--sidebar-accent); }
.site-dd-menu .ttl { color: #fff; }
.site-dd-menu .cap { padding: 6px 12px; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--sidebar-foreground) 40%, transparent); border-top: 1px solid var(--sidebar-border); }
.side nav { flex: 1; padding: 0 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-label { padding: 8px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--sidebar-foreground) 40%, transparent); }
.side nav a { display: flex; align-items: center; gap: 12px; border-radius: 8px; padding: 10px 12px; font-size: 14px; font-weight: 500; color: color-mix(in srgb, var(--sidebar-foreground) 70%, transparent); }
.side nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.side nav a:hover { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); }
.side nav a.on { background: var(--primary); color: var(--primary-foreground); }
.side-user { margin-top: auto; border-top: 1px solid var(--sidebar-border); padding: 12px; display: flex; align-items: center; gap: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 20%, transparent); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.side-user .who { flex: 1; min-width: 0; }
.side-user .who b { display: block; font-size: 13px; color: var(--sidebar-accent-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who span { display: block; font-size: 12px; color: color-mix(in srgb, var(--sidebar-foreground) 50%, transparent); }
.ico-btn { width: 32px; height: 32px; border: 0; background: transparent; color: color-mix(in srgb, var(--sidebar-foreground) 60%, transparent); border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.ico-btn:hover { background: var(--sidebar-accent); color: #fff; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--background) 80%, transparent); backdrop-filter: blur(10px); }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted-foreground); }
.crumb b { color: var(--foreground); font-weight: 600; }
.crumb i { color: color-mix(in srgb, var(--muted-foreground) 40%, transparent); font-style: normal; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted-foreground); }
.search input { width: 220px; padding: 8px 12px 8px 32px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--foreground); font-size: 13px; }
.wrap { padding: 24px 32px 56px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 6px 0 0; font-size: 14px; color: var(--muted-foreground); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { border: 1px solid var(--border); background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 2px rgba(16,24,38,.04); }
.stat-top { display: flex; justify-content: space-between; align-items: center; }
.stat-top span { margin: 0; font-size: 13px; font-weight: 500; color: var(--muted-foreground); }
.stat-ico { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; }
.stat-ico svg { width: 18px; height: 18px; }
.stat-ico.primary { background: #245fd41a; color: var(--primary); }
.stat-ico.success { background: #00a05b1a; color: var(--success); }
.stat-ico.warning { background: #e49e221f; color: #c4841a; }
.stat b { display: block; margin-top: 12px; font-size: 30px; font-weight: 600; letter-spacing: -.04em; }
.stat em { display: block; margin-top: 4px; font-size: 12px; color: var(--muted-foreground); font-style: normal; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border: 1px solid var(--border); background: #f1f4f766; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.filters select, .filters input { height: 36px; min-width: 140px; }
.panel { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(16,24,38,.04); }
.panel table { border: 0; border-radius: 0; }
.panel .foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted-foreground); }
.empty { text-align: center; padding: 64px 20px; color: var(--muted-foreground); }
.empty .btn { margin-top: 12px; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -.03em; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 22px 0 12px; }
.lead { color: var(--muted-foreground); margin: 0 0 18px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: 0 1px 2px rgba(16,24,38,.04); }
.card span { color: var(--muted-foreground); font-size: 13px; font-weight: 500; }
.card b { display: block; font-size: 30px; margin-top: 10px; letter-spacing: -.04em; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted-foreground); font-weight: 500; background: #f1f4f766; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #f9fafc; }
.title-cell { font-weight: 500; color: var(--foreground); }
.title-cell:hover { color: var(--primary); }
.ops { display: flex; gap: 14px; white-space: nowrap; align-items: center; }
.ops form { display: inline; margin: 0; }
.ops a, .ops button { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; font-size: 13px; }
.ops .del { color: var(--destructive); }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--primary); color: #fff; border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer; font-size: 13px; font-weight: 500; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: #fff; border: 1px solid var(--border); color: var(--foreground); }
.btn.sm { padding: 8px 12px; }
.btn.danger { background: var(--destructive); }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.form { max-width: 860px; display: grid; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: 0 1px 2px rgba(16,24,38,.04); }
.form.wide { max-width: 1100px; }
.editor-hint { margin: 6px 0 8px; font-size: 12px; color: var(--muted-foreground); }
.editor-toast { margin: 0 0 8px; font-size: 12px; color: var(--primary); }
.form label { display: grid; gap: 6px; color: var(--muted-foreground); font-size: 13px; }
.form input, .form textarea, .form select, select, input, textarea { background: #fff; color: var(--foreground); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font: inherit; }
.form input, .form textarea, .form select { width: 100%; }
.form input:focus, .form textarea:focus, .form select:focus, .search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px #245fd433; }
.flash { margin: 12px 32px 0; padding: 10px 14px; border-radius: 8px; }
.flash.ok { background: #e8f8f0; color: #0d6b40; }
.flash.err { background: #fde8e8; color: #b42318; }
.muted { color: var(--muted-foreground); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--secondary); color: var(--muted-foreground); }
.tag:before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.tag.ok { background: #e8f8f0; color: #0d6b40; }
.tag.warn { background: #fff6e5; color: #9a6700; }
.tag.err { background: #fde8e8; color: #b42318; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--sidebar); position: relative; overflow: hidden; }
.login-wrap:before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 44px 44px; }
.login-inner { position: relative; width: min(420px, 92vw); }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 24px; color: #fff; font-weight: 600; font-size: 18px; }
.login { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); padding: 32px; border-radius: 16px; backdrop-filter: blur(18px); box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.login h1 { color: #fff; text-align: center; font-size: 24px; margin-bottom: 6px; }
.login p { color: rgba(255,255,255,.6); text-align: center; margin: 0 0 22px; }
.login .form { background: none; border: 0; padding: 0; max-width: none; }
.login label { color: rgba(255,255,255,.8); display: block; margin-bottom: 6px; }
.login input { background: #fff; border-color: transparent; color: #101826; }
.login input::placeholder { color: #98a0ac; }
.login .btn { width: 100%; justify-content: center; padding: 11px; }
.pick-wrap { width: min(860px, 92vw); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 22px 0; }
.pick-card { display: grid; gap: 6px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 22px; color: var(--foreground); box-shadow: var(--shadow); }
.pick-card:hover { border-color: var(--primary); }
.pick-card b { font-size: 18px; }
.pick-card span { color: var(--primary); }
.pick-card em { color: var(--muted-foreground); font-style: normal; font-size: 13px; }
.login .flash { margin: 0 0 16px; }
@media (max-width: 900px) {
  .side { display: none; }
  .stats, .cards { grid-template-columns: 1fr; }
}
