:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --panel: #fff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(29, 29, 31, .1);
  --accent: #ff9900;
  --accent-tint: rgba(255, 153, 0, .12);
  --danger: #c7392f;
  --shadow: 0 18px 48px -28px rgba(15, 23, 42, .22);
}

* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}
a { color: inherit; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 245, 247, .92);
  backdrop-filter: blur(18px) saturate(1.15);
}
.topbar-inner, .page-shell, .result-shell { width: min(1120px, calc(100vw - 32px)); margin: 0 auto; }
.topbar-inner { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; }
.brand-logo { display: block; width: auto; height: 38px; max-width: min(190px, 52vw); object-fit: contain; }
.nav-links, .header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.nav-links { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.nav-links a, .secondary-button { text-decoration: none; }
.nav-links a:hover, .secondary-button:hover { color: var(--accent); }
.page-shell { display: grid; min-height: calc(100vh - 68px); place-items: center; padding: 40px 0; }
.submit-panel, .result-header, .status-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.submit-panel { width: min(820px, 100%); padding: 38px; }
.eyebrow { margin-bottom: 10px; color: var(--accent); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.eyebrow::before { display: inline-block; width: 26px; height: 1px; margin-right: 10px; vertical-align: middle; background: var(--accent); content: ""; }
h1 { margin: 0; font-size: clamp(28px, 4vw, 34px); line-height: 1.18; }
.lead { margin: 16px 0 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.member-usage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
  padding: 16px;
  border: 1px solid rgba(255, 153, 0, .22);
  border-radius: 8px;
  background: var(--accent-tint);
}
.member-usage strong { display: block; font-size: 14px; }
.member-usage p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.analysis-form { margin-top: 30px; }
label { display: block; margin-bottom: 9px; font-weight: 800; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  text-transform: uppercase;
}
input:focus { border-color: var(--accent); outline: 3px solid rgba(255, 153, 0, .14); }
button, .secondary-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
button { background: var(--accent); color: var(--ink); }
button:hover { background: #e88a00; }
button:disabled { cursor: wait; opacity: .72; }
.secondary-button { border-color: var(--line); background: #fff; }
.small-button { min-height: 38px; padding: 0 14px; font-size: 13px; }
.form-error { display: none; margin: 12px 0 0; color: var(--danger); font-weight: 700; }
.form-error.is-visible { display: block; }
.result-shell { padding: 28px 0 44px; }
.result-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px; }
.status-card { display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 18px 20px; }
.status-card p { margin: 5px 0 0; color: var(--muted); }
.error-card { border-color: rgba(199, 57, 47, .28); color: var(--danger); }
.spinner { width: 30px; height: 30px; flex: 0 0 auto; border: 3px solid rgba(255, 153, 0, .22); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
.report-frame { display: block; width: 100%; min-height: 100vh; margin-top: 16px; border: 0; background: transparent; overflow: hidden; }
.is-hidden { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .submit-panel { padding: 26px 20px; }
  .topbar-inner { min-height: 64px; }
  .nav-links { gap: 12px; font-size: 12.5px; }
  .input-row, .result-header { display: grid; grid-template-columns: 1fr; }
  .member-usage { align-items: flex-start; flex-direction: column; }
  button, .secondary-button, .header-actions { width: 100%; }
}
