:root {
  color-scheme: light;
  --blue: #1677ff;
  --blue-dark: #0f5ed7;
  --blue-soft: #eaf3ff;
  --page: #ffffff;
  --card: #ffffff;
  --line: #dbe8f7;
  --text: #18324d;
  --muted: #6f8297;
  --green: #14945b;
  --green-soft: #e9f8f1;
  --red: #d83b4d;
  --red-soft: #fff0f2;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font: 400 16px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
a { color: inherit; }
button, input { font: inherit; }
code { color: var(--blue-dark); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.shell { width: min(880px, calc(100% - 32px)); margin-inline: auto; }

.site-header {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: max(16px, calc((100% - 940px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
}
.brand {
  color: var(--blue);
  font-size: 1.18rem;
  font-weight: 750;
  text-decoration: none;
}
.forum-link, .back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
}
.forum-link:hover, .back-link:hover { color: var(--blue); }

.home { padding-block: 20px 60px; }
.example-list {
  width: 100%;
}
.example-item {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 6px;
  align-items: center;
  min-height: 64px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background .16s ease;
}
.example-item:hover { background: var(--blue-soft); }
.example-number { color: var(--blue); font-weight: 700; }
.example-name { color: #173e68; font-size: 1.02rem; }

.method {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font: 750 .72rem/1.25 ui-monospace, monospace;
  letter-spacing: .05em;
}

.page { padding-block: 30px 64px; }
.page-title { margin: 36px 0 20px; }
.page-title h1 {
  margin: 12px 0 5px;
  color: #102e4e;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -.04em;
}
.page-title p { margin: 0; color: var(--muted); }
.demo-card {
  max-width: 560px;
  padding: clamp(22px, 5vw, 32px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 10px 30px rgba(43, 91, 140, .07);
}
.demo-form { display: grid; gap: 8px; }
.demo-form label {
  margin-top: 5px;
  color: #38536e;
  font-size: .9rem;
  font-weight: 650;
}
.demo-form input {
  width: 100%;
  height: 46px;
  padding: 9px 12px;
  border: 1px solid #c7d9ec;
  border-radius: 8px;
  outline: none;
  background: white;
  color: var(--text);
}
.demo-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, .12);
}
.primary-button {
  height: 46px;
  margin-top: 12px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  font-weight: 750;
  cursor: pointer;
}
.primary-button:hover { background: var(--blue-dark); }
.primary-button:disabled { opacity: .6; cursor: wait; }

.result {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  font-size: .9rem;
}
.result span { color: var(--muted); text-align: right; }
.result.success { border-color: #b9e9d3; background: var(--green-soft); }
.result.success strong { color: var(--green); }
.result.error { border-color: #f1c5ca; background: var(--red-soft); }
.result.error strong { color: var(--red); }
.logout-form button {
  width: 100%;
  height: 44px;
  border: 1px solid #c7d9ec;
  border-radius: 8px;
  background: white;
  color: var(--muted);
  cursor: pointer;
}
.logout-form button:hover { color: var(--blue); border-color: var(--blue); }

.success-page { padding-block: 64px; }
.success-card {
  max-width: 560px;
  padding: 48px 34px;
  border-radius: 18px;
  background: linear-gradient(145deg, #1677ff, #0f5ed7);
  box-shadow: 0 18px 45px rgba(22, 119, 255, .22);
  color: white;
  text-align: center;
}
.success-check {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: var(--blue);
  font-size: 2rem;
  font-weight: 800;
}
.success-card p { margin: 0; color: rgba(255, 255, 255, .78); }
.success-card h1 { margin: 7px 0 2px; font-size: clamp(2rem, 6vw, 3rem); }
.success-card > strong { font-weight: 500; }
.success-actions { display: flex; justify-content: center; gap: 10px; margin-top: 30px; }
.success-actions a, .success-actions button {
  display: inline-flex;
  min-height: 42px;
  padding: 9px 16px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 8px;
  background: transparent;
  color: white;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.success-actions a { background: white; color: var(--blue-dark); }
.success-actions form { margin: 0; }

@media (max-width: 640px) {
  .home { padding-block: 14px 46px; }
  .example-item { min-height: 60px; }
  .result { align-items: flex-start; flex-direction: column; }
  .result span { text-align: left; }
  .success-page { padding-block: 38px; }
  .success-card { padding: 40px 22px; }
  .success-actions { align-items: stretch; flex-direction: column; }
  .success-actions form, .success-actions button, .success-actions a { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
