:root {
  --bg: #f3f5f7;
  --panel: #ffffff;
  --ink: #1a1f26;
  --muted: #667085;
  --line: #e6eaf0;
  --brand: #ffc300;
  --brand-ink: #1a1a1a;
  --accent: #0f6b4c;
  --danger: #c0392b;
  --ok: #1f8a4c;
  --shadow: 0 10px 30px rgba(26, 31, 38, 0.06);
  --radius: 14px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(255, 195, 0, 0.22), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(15, 107, 76, 0.08), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--brand), #ffda4a);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.08);
}
.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.nav a, .nav button.linkish {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}
.nav a:hover, .nav a.active {
  background: rgba(26, 31, 38, 0.06);
  color: var(--ink);
}

.hero {
  padding: 28px 0 8px;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
}
.hero p {
  margin: 0;
  color: var(--muted);
  max-width: 46ch;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 24px 0 40px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.card .meta {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
}
.badge.ok { background: #e8f7ee; color: var(--ok); }
.badge.danger { background: #fdeeee; color: var(--danger); }
.badge.muted { background: #eef2f6; color: var(--muted); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 16px 0 28px;
}
.panel h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.stat .n {
  font-size: 28px;
  font-weight: 700;
  margin-top: 4px;
}
.stat .l { color: var(--muted); font-size: 13px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; font-size: 12px; }

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 84px; resize: vertical; }
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}
button, .btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--brand);
  color: var(--brand-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button.secondary, .btn.secondary {
  background: #eef2f6;
  color: var(--ink);
}
button.danger {
  background: #fdeeee;
  color: var(--danger);
}
.flash {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 14px;
}
.flash.error { background: #fdeeee; color: var(--danger); }
.flash.ok { background: #e8f7ee; color: var(--ok); }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px;
}
.login-card h1 {
  margin: 0 0 6px;
  font-size: 28px;
}
.login-card .sub {
  color: var(--muted);
  margin-bottom: 20px;
  font-size: 14px;
}

.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
}
.inline-form input { width: auto; min-width: 100px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.footer {
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 720px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  table { display: block; overflow-x: auto; }
}
