:root {
  --bg: #0e1014;
  --panel: #171a21;
  --panel2: #1f232c;
  --line: #2a2f3a;
  --text: #e8eaf0;
  --muted: #9aa3b2;
  --accent: #6d8bff;
  --accent2: #8a6dff;
  --ok: #36c281;
  --err: #ff5d6c;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "PingFang SC", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
button, .btn {
  cursor: pointer; border: none; border-radius: 10px; padding: 10px 16px;
  font-size: 14px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  transition: transform .06s ease, opacity .15s;
}
button:hover, .btn:hover { opacity: .92; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: var(--panel2); color: var(--text); border: 1px solid var(--line); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
input, textarea, select {
  width: 100%; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; color: var(--text); padding: 11px 13px; font-size: 14px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
textarea { resize: vertical; min-height: 90px; font-family: inherit; }

.topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 800; font-size: 17px; }
.navlinks { display: flex; gap: 6px; flex-wrap: wrap; }
.navlink { padding: 7px 13px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; }
.navlink:hover { background: var(--panel2); color: var(--text); }
.navlink.active { background: var(--panel2); color: var(--text); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px; }
.grid2 { display: grid; grid-template-columns: 380px 1fr; gap: 22px; align-items: start; }
@media (max-width: 880px) { .grid2 { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h2 { margin: 0 0 4px; font-size: 18px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.6; }
.row { display: flex; gap: 10px; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; }
.pill { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }

/* 图片卡 */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.gallery.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gallery.compact .imgcard .meta { padding: 7px 9px; }
.gallery.compact .imgcard .acts { padding: 0 9px 9px; }
.imgcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.imgcard .thumb {
  aspect-ratio: 3/2; background: var(--panel2); display: flex; align-items: center;
  justify-content: center; position: relative; overflow: hidden;
}
.imgcard .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imgcard .meta { padding: 10px 12px; }
.imgcard .acts { display: flex; gap: 6px; padding: 0 12px 12px; flex-wrap: wrap; }
.spinner {
  width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.failbox { color: var(--err); font-size: 12px; padding: 14px; text-align: center; }

.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 8px 14px; border-radius: 9px; background: var(--panel2); color: var(--muted); cursor: pointer; font-weight: 600; font-size: 14px; border: 1px solid transparent; }
.tab.active { color: var(--text); border-color: var(--accent); }

.count-display { font-size: 26px; font-weight: 800; color: var(--accent); min-width: 34px; text-align: center; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
td.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 12px 20px; border-radius: 10px; font-size: 14px; font-weight: 600; z-index: 100;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.toast.ok { background: var(--ok); color: #04210f; }
.toast.err { background: var(--err); color: #2a0207; }
.banner { background: #3a2a0a; border: 1px solid #6b4d12; color: #ffd591; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
