:root {
  --ink: #0a0f18; --panel: #121a28; --panel2: #0f1622; --line: #212d3c;
  --line2: #2a3647; --fg: #e9eef5; --mist: #c1ccda; --muted: #8996a9;
  --dim: #5a6a7d; --accent: #ff3b30; --sky: #2aa9e6; --ok: #6fc04d; --amber: #ffb300;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--ink); color: var(--fg);
  font-family: "Space Grotesk", -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; line-height: 1.5;
}
a { color: var(--sky); text-decoration: none; }
a:hover { color: var(--fg); }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---- layout ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; background: var(--panel2);
  border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand img { height: 30px; }
.brand-sub { font-size: 10px; letter-spacing: .12em; color: var(--dim); }
.nav-group { font-size: 10px; letter-spacing: .12em; color: var(--dim); padding: 16px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px;
  color: var(--mist); font-size: 14px; transition: .12s;
}
.nav-link:hover { background: var(--panel); color: var(--fg); }
.nav-link.active { background: var(--panel); color: var(--fg); box-shadow: inset 2px 0 0 var(--accent); }
.nav-link .ico { width: 20px; text-align: center; }
.nav-count { margin-left: auto; font-size: 11px; color: var(--dim); }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  justify-content: space-between; padding: 0 26px; position: sticky; top: 0; background: rgba(10,15,24,.92);
  backdrop-filter: blur(8px); z-index: 10;
}
.topbar h1 { font-size: 18px; font-weight: 600; }
.crumb { font-size: 12px; color: var(--dim); }
.content { padding: 26px; max-width: 1100px; width: 100%; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--line2); background: var(--panel); color: var(--fg); cursor: pointer;
  font-size: 14px; font-weight: 500; transition: .12s;
}
.btn:hover { border-color: var(--dim); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 600; }
.btn-primary:hover { box-shadow: 0 10px 26px -12px rgba(255,59,48,.8); }
.btn-ghost { background: transparent; }
.btn-danger { color: #ff6b62; border-color: #45262a; }
.btn-danger:hover { background: #2a1618; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---- cards / lists ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.grid { display: grid; gap: 14px; }
.stat-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.stat { padding: 18px 20px; }
.stat .n { font-size: 30px; font-weight: 600; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 2px; }
.stat .ico { font-size: 20px; margin-bottom: 8px; display: block; }

.list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-item {
  display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line);
  background: var(--panel); transition: .1s;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #16202f; }
.list-item .title { font-weight: 500; }
.list-item .slug { font-size: 12px; color: var(--dim); }
.badge {
  font-size: 10.5px; padding: 3px 8px; border-radius: 20px; border: 1px solid var(--line2);
  color: var(--muted); font-family: "IBM Plex Mono", monospace;
}
.badge.zh-ok { color: var(--ok); border-color: #2c4030; }
.badge.zh-no { color: var(--amber); border-color: #4a3a1a; }
.badge.feat { color: var(--sky); border-color: #1c3a4a; }

/* ---- forms ---- */
.locale-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.locale-tab {
  padding: 8px 18px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel);
  color: var(--muted); cursor: pointer; font-weight: 500;
}
.locale-tab.active { background: var(--panel); color: var(--fg); border-color: var(--sky); }
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 12px; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; }
.field .hint { font-size: 12px; color: var(--dim); margin-top: 4px; text-transform: none; letter-spacing: 0; }
.field .count { float: right; font-size: 11px; color: var(--dim); }
.field .count.over { color: var(--accent); }
input[type=text], input[type=date], input[type=number], input[type=password], select, textarea {
  width: 100%; background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px;
  padding: 10px 12px; color: var(--fg); outline: none; transition: .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--sky); }
textarea { resize: vertical; min-height: 76px; line-height: 1.6; }
textarea.md { min-height: 320px; font-family: "IBM Plex Mono", monospace; font-size: 13px; }
.check { display: flex; align-items: center; gap: 9px; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

.subcard { border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 10px; background: var(--panel2); }
.subcard .subhead { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.subcard .subhead .idx { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--dim); }
.list-rows .lr { display: flex; gap: 8px; margin-bottom: 8px; }
.list-rows .lr input, .list-rows .lr textarea { flex: 1; }
.icon-btn {
  width: 34px; height: 38px; flex-shrink: 0; border: 1px solid var(--line2); background: var(--panel);
  border-radius: 8px; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--accent); border-color: var(--line2); }
.add-btn { font-size: 13px; color: var(--sky); background: none; border: 1px dashed var(--line2); padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.add-btn:hover { border-color: var(--sky); }

.img-field { display: flex; gap: 12px; align-items: flex-start; }
.img-preview { width: 120px; height: 76px; border-radius: 8px; border: 1px solid var(--line2); object-fit: cover; background: var(--panel2); }
.img-preview.empty { display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 11px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } .sidebar { display: none; } }
.col-head { font-size: 13px; font-weight: 600; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.flag { font-size: 11px; padding: 2px 8px; border-radius: 5px; background: var(--panel); border: 1px solid var(--line2); color: var(--muted); }

/* ---- toast / banner ---- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; padding: 12px 20px;
  box-shadow: 0 20px 50px -20px #000; opacity: 0; transition: .25s; pointer-events: none;
}
.toast.show { opacity: 1; bottom: 32px; }
.toast.ok { border-color: #2c4030; }
.toast.err { border-color: #45262a; color: #ff8078; }
.banner { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 13.5px; }
.banner.info { background: #10202c; border: 1px solid #1c3a4a; color: var(--mist); }
.banner.warn { background: #241d10; border: 1px solid #4a3a1a; color: #f0d9a8; }

/* ---- auth ---- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; padding: 34px; }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card p.sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.auth-card .field { margin-bottom: 16px; }
.auth-logo { height: 40px; margin-bottom: 22px; }

/* media */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; }
.media-item { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.media-item img { width: 100%; height: 110px; object-fit: cover; display: block; background: var(--panel2); }
.media-item .meta { padding: 8px 10px; font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.media-item .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone { border: 2px dashed var(--line2); border-radius: 10px; padding: 30px; text-align: center; color: var(--muted); cursor: pointer; transition: .12s; }
.dropzone:hover, .dropzone.drag { border-color: var(--sky); color: var(--fg); background: #10202c; }
