:root {
  --bg: #f3efe6;
  --panel: #fffdf8;
  --ink: #1f2a24;
  --muted: #5d6b63;
  --line: #d7cfc0;
  --accent: #2f7d5b;
  --accent-2: #c45c26;
  --danger: #b42318;
  --ok: #1b7f4a;
  --shadow: 0 10px 30px rgba(31, 42, 36, 0.08);
  --radius: 14px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, #ffe8c8 0%, transparent 40%),
    radial-gradient(circle at 90% 10%, #d7f0e2 0%, transparent 35%),
    var(--bg);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side {
  background: #20352c;
  color: #e8f2ec;
  padding: 24px 16px;
}
.side .brand {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.side .sub { color: #9fb5aa; font-size: 12px; margin-bottom: 28px; }
.side nav a {
  display: block;
  color: #d7e8df;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 4px;
}
.side nav a:hover, .side nav a.active {
  background: rgba(255,255,255,0.1);
  text-decoration: none;
}
.main { padding: 28px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
h1 { margin: 0; font-size: 24px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.stat {
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(160deg, #fff, #f7f1e6);
  border: 1px solid var(--line);
}
.stat .n { font-size: 28px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }

.btn, button, .button {
  display: inline-block;
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
}
.btn.secondary { background: #4a5d54; }
.btn.danger { background: var(--danger); }
.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
}
input, select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
}
label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 4px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.flash { padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.flash.ok { background: #e7f7ee; color: var(--ok); }
.flash.err { background: #fdeceb; color: var(--danger); }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef4f0;
}
.tag.bad { background: #fdeceb; color: var(--danger); }
.tag.good { background: #e7f7ee; color: var(--ok); }
.muted { color: var(--muted); font-size: 13px; }
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card { width: min(400px, 100%); }
.codebox {
  width: 100%;
  min-height: 420px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}
.file-list { max-height: 520px; overflow: auto; }
.file-list a { display: block; padding: 6px 8px; border-radius: 8px; }
.file-list a:hover, .file-list a.active { background: #eef4f0; text-decoration: none; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.check input { width: auto; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { padding-bottom: 8px; }
}
