:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #657084;
  --primary: #0dbd8b;
  --primary-dark: #07966e;
  --line: #e3e8ef;
  --danger: #d64545;
  --ok-bg: #e8f8f2;
  --ok-text: #067a5a;
  --error-bg: #fff0f0;
  --error-text: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(13, 189, 139, 0.16), transparent 34rem),
    linear-gradient(180deg, #f9fbfe 0%, var(--bg) 100%);
  min-height: 100vh;
}

a { color: inherit; }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-weight: 800;
  font-size: 20px;
  text-decoration: none;
}

.topbar nav {
  display: flex;
  gap: 18px;
}

.topbar nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 15px;
}

.hero,
.center-wrap,
.admin-wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  flex: 1;
}

.hero {
  display: grid;
  place-items: center;
  padding: 40px 0 80px;
}

.hero-card,
.card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(227, 232, 239, 0.82);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(33, 51, 83, 0.08);
  backdrop-filter: blur(10px);
}

.hero-card {
  padding: 56px;
  width: min(820px, 100%);
}

.badge {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok-text);
  font-weight: 700;
  margin-bottom: 22px;
}

h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.08; margin: 0 0 18px; }
h2 { margin: 0 0 16px; }
.lead { font-size: 20px; color: var(--muted); line-height: 1.8; max-width: 720px; }
.muted { color: var(--muted); line-height: 1.7; }
.small { font-size: 14px; }

.actions { display: flex; gap: 14px; flex-wrap: wrap; margin: 30px 0; }
.actions.vertical { flex-direction: column; }
.button {
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.button.primary { background: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-dark); }
.button.secondary { background: #eef3f8; color: #26344d; }
.button.full { width: 100%; }

.tips { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.tips li { margin: 10px 0; color: var(--muted); }
code {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 2px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.center-wrap { display: grid; place-items: center; padding: 34px 0 80px; }
.card { padding: 34px; width: 100%; }
.form-card { max-width: 620px; }
.narrow { max-width: 480px; }
.form { display: grid; gap: 18px; margin-top: 24px; }
.form label { display: grid; gap: 8px; font-weight: 700; }
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 16px;
  outline: none;
  background: #fff;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(13, 189, 139, 0.12); }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.6; }
.alert { padding: 14px 16px; border-radius: 14px; margin: 18px 0; line-height: 1.6; }
.alert.error { background: var(--error-bg); color: var(--error-text); }
.alert.ok { background: var(--ok-bg); color: var(--ok-text); }

.success-card { max-width: 620px; text-align: center; }
.success-icon {
  width: 76px; height: 76px; border-radius: 999px;
  display: grid; place-items: center; margin: 0 auto 20px;
  background: var(--ok-bg); color: var(--ok-text); font-size: 42px; font-weight: 900;
}
.user-id {
  font-size: 22px;
  font-weight: 800;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 18px 0 28px;
  word-break: break-all;
}

.admin-wrap { padding: 30px 0 80px; display: grid; gap: 22px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.inline-form { display: flex; gap: 12px; align-items: center; }
.inline-form input { max-width: 420px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); text-align: center; padding: 28px; }
.tag { border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 800; }
.tag.on { background: var(--ok-bg); color: var(--ok-text); }
.tag.off { background: #eef0f4; color: #647084; }
.tag.done { background: #fff5db; color: #9a6700; }
.mini-form { display: inline; }
.link-button { border: 0; background: transparent; cursor: pointer; color: var(--primary-dark); font-weight: 800; }
.link-button.danger { color: var(--danger); }

.footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 30px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .topbar, .admin-header, .inline-form { flex-direction: column; align-items: stretch; }
  .hero-card, .card { padding: 26px; border-radius: 22px; }
  .lead { font-size: 17px; }
  .actions { flex-direction: column; }
}

.next-panel {
  margin-top: 30px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fbfdff;
  text-align: left;
}
.next-panel h2 { margin-bottom: 8px; }
.compact-actions { margin: 20px 0 0; }
.login-tip {
  margin-top: 24px;
  padding: 16px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.8;
  text-align: left;
}
.guide-card { max-width: 920px; }
.info-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0;
}
.info-box > div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fafc;
  display: grid;
  gap: 8px;
}
.label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}
.guide-section {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  background: #fff;
}
.steps {
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.9;
}
.steps li { margin: 8px 0; }
@media (max-width: 720px) {
  .info-box, .guide-grid { grid-template-columns: 1fr; }
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.lang-switch a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
}
.lang-switch a.active {
  color: var(--primary-dark);
}

@media (max-width: 720px) {
  .lang-switch { justify-content: center; }
}
