:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #19201c;
  --muted: #66716a;
  --line: #dfe6e1;
  --brand: #ff474d;
  --brand-dark: #d82f36;
  --soft: #eef6f0;
  --shadow: 0 18px 48px rgba(31, 41, 35, 0.08);
}

* { box-sizing: border-box; }
html { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, textarea, select { font: inherit; }

.shell { max-width: 860px; margin: 0 auto; padding: 22px 14px 48px; }
.shell.wide { max-width: 1120px; }
.hero {
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 18px 10px;
}
.hero.compact { min-height: 120px; }
.eyebrow { color: var(--brand); font-weight: 800; font-size: 12px; letter-spacing: 0; margin: 0 0 8px; }
h1 { font-size: clamp(32px, 8vw, 56px); line-height: 1; margin: 0 0 12px; letter-spacing: 0; }
h2 { font-size: 22px; margin: 0 0 10px; }
.sub, .muted { color: var(--muted); line-height: 1.7; }
.quota-pill, .button-link {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 14px 0;
}
.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--soft);
  border-radius: 8px;
  padding: 12px;
  color: #245236;
  line-height: 1.6;
}
.inline-actions, .topline, .copybar, .admin-grid { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topline { justify-content: space-between; margin-bottom: 12px; }

form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; font-weight: 700; color: #2d3832; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9faf9;
  color: var(--ink);
  outline: none;
}
textarea { min-height: 150px; resize: vertical; line-height: 1.7; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); background: #fff; }
.form-grid, .admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-grid { grid-template-columns: minmax(240px, 1fr) 120px; align-items: end; }

button, .secondary, .ghost {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.primary { background: var(--brand); border-color: var(--brand); color: white; font-weight: 800; }
.primary:hover { background: var(--brand-dark); }
.secondary { background: #eef3ef; }
.ghost { background: transparent; }
.full { width: 100%; }
button:disabled { opacity: 0.55; cursor: wait; }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  text-align: center;
  background: #f9faf9;
}
.tab input { width: auto; margin-right: 4px; }
.tab.active { border-color: var(--brand); color: var(--brand); background: #fff5f5; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 16px; }
.plan {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfb;
}
.plan strong { display: block; margin-bottom: 6px; }
.plan span { color: var(--muted); font-size: 14px; line-height: 1.5; }
.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin: 12px 0;
  background: #fbfcfb;
}
.result-text { white-space: pre-wrap; line-height: 1.85; }
.copybar { margin-top: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 10px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions input { max-width: 110px; padding: 9px; }
.hidden { display: none !important; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(80px);
  background: #17201b;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  opacity: 0;
  transition: 0.2s ease;
  max-width: calc(100vw - 28px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 720px) {
  .hero { align-items: flex-start; flex-direction: column; padding-top: 18px; min-height: 160px; }
  .form-grid, .plans, .tabs, .admin-grid { grid-template-columns: 1fr; }
  .notice { align-items: flex-start; flex-direction: column; }
  .panel { padding: 14px; }
}
