/* Mocoding 云端平台 — Claude-inspired theme
   warm paper background, coral accent, serif headings. */
:root {
  --bg: #f3f1ea;
  --surface: #ffffff;
  --surface-2: #faf9f5;
  --border: #e7e3d9;
  --border-strong: #d9d4c7;
  --text: #2a2823;
  --muted: #6f6a5f;
  --faint: #97917f;
  --accent: #d97757;
  --accent-hover: #c4633f;
  --accent-soft: #f6e7df;
  --green: #4f7a52;
  --green-soft: #e4efe2;
  --amber: #b07d2a;
  --amber-soft: #f6ecd6;
  --gray-soft: #eceae3;
  --danger: #b5483a;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(60, 50, 30, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, serif;
  font-size: 19px;
  font-weight: 600;
}
.brand .dot {
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--accent);
  display: grid; place-items: center;
  color: #fff; font-size: 13px; font-family: sans-serif;
}
.topnav { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.topnav a { color: var(--muted); }
.topnav a:hover { color: var(--text); }
.topnav .who { color: var(--faint); }

/* ---------- Layout ---------- */
.center-wrap {
  min-height: calc(100vh - 65px);
  display: grid;
  place-items: center;
  padding: 40px 20px;
}
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 28px 60px;
}
.page-head { margin-bottom: 24px; }
.page-head h1 { margin: 0 0 4px; font-size: 26px; }
.page-head p { margin: 0; color: var(--muted); }

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 24px; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.auth-foot { margin-top: 18px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #fff;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border: none;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--accent-hover); }
.btn.block { width: 100%; }
.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border-strong);
}
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 7px; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #9b3d31; }

/* ---------- Alerts ---------- */
.alert {
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 14px;
  margin-bottom: 18px;
}
.alert.ok { background: var(--green-soft); color: var(--green); }
.alert.err { background: #f6e0dc; color: var(--danger); }

/* ---------- Stats grid ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}
.stat .num { font-family: Georgia, serif; font-size: 30px; font-weight: 600; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stat .num.accent { color: var(--accent); }

/* ---------- Table ---------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 16px; text-align: left; }
thead th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.badge.active { background: var(--green-soft); color: var(--green); }
.badge.expired { background: var(--amber-soft); color: var(--amber); }
.badge.disabled { background: var(--gray-soft); color: var(--muted); }
.badge.on { background: var(--accent-soft); color: var(--accent-hover); }
.badge.off { background: var(--gray-soft); color: var(--faint); }

/* ---------- Misc ---------- */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.inline-form { display: inline; }
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; align-items: center; }
.toolbar input { max-width: 280px; }
.muted { color: var(--muted); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; }
.kv .k { color: var(--muted); }
.tabs { display: flex; gap: 6px; margin-bottom: 24px; }
.tabs a {
  padding: 7px 14px; border-radius: 8px; color: var(--muted); font-size: 14px;
}
.tabs a.on { background: var(--accent-soft); color: var(--accent-hover); font-weight: 500; }
.hint { color: var(--faint); font-size: 13px; }
