:root {
  color-scheme: light;
  --bg: #f8f7f2;
  --surface: #ffffff;
  --ink: #24382f;
  --muted: #617068;
  --line: #dce2d8;
  --accent: #275840;
  --accent-hover: #1d4431;
  --accent-soft: #e9f1ea;
  --warn: #8c4b23;
  --warn-soft: #faefe7;
  --danger: #9b2c2c;
  --danger-soft: #fdf0f0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}
.shell-narrow { width: min(440px, calc(100% - 32px)); padding-top: 64px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: 0.04em; color: var(--ink); }
.brand span { color: var(--muted); font-weight: 400; }
.nav-links { display: flex; gap: 14px; font-size: 14px; align-items: center; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 18px;
}
h1 { margin: 0 0 8px; font-size: 24px; line-height: 1.3; }
h2 { margin: 0 0 14px; font-size: 18px; }
.sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; }

.field { margin-bottom: 14px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
input, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus { outline: 2px solid #9ab9a6; border-color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #7e2121; }
.btn-sm { padding: 6px 10px; font-size: 13px; }

.msg {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 14px;
  display: none;
}
.msg.show { display: block; }
.msg.error { background: var(--danger-soft); color: var(--danger); border: 1px solid #f2c6c6; }
.msg.ok { background: var(--accent-soft); color: var(--accent); border: 1px solid #c6dccb; }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 550;
  background: var(--accent-soft);
  color: var(--accent);
}
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-off { background: #eceee9; color: var(--muted); }

.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.site-link {
  display: block;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcf9;
  color: var(--ink);
}
.site-link:hover { border-color: var(--accent); text-decoration: none; background: var(--accent-soft); }
.site-link strong { display: block; font-size: 15px; margin-bottom: 3px; }
.site-link span { font-size: 12px; color: var(--muted); }

.row-list { display: flex; flex-direction: column; gap: 10px; }
.user-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfcf9;
}
.user-meta { font-size: 13px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hidden { display: none !important; }
.center-link { margin: 16px 0 0; text-align: center; }
.mt-12 { margin-top: 12px; }

@media (max-width: 600px) {
  .grid-2 { grid-template-columns: 1fr; }
  .shell-narrow { padding-top: 28px; }
}
