:root {
  color-scheme: dark;
  --bg: #07120f;
  --panel: rgba(9, 24, 21, 0.78);
  --panel-strong: rgba(238, 255, 247, 0.08);
  --text: #f2fff9;
  --muted: #9ab2aa;
  --line: rgba(227, 255, 242, 0.15);
  --brand: #42d79b;
  --brand-2: #b6ff6a;
  --violet: #a497ff;
  --danger: #ff6b6b;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; letter-spacing: 0; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(66, 215, 155, 0.22), transparent 34rem),
    radial-gradient(circle at 95% 12%, rgba(164, 151, 255, 0.18), transparent 32rem),
    linear-gradient(135deg, #06100e 0%, #0f1918 50%, #151109 100%);
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
svg { width: 18px; height: 18px; }
#field-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; opacity: .95; }
#app { min-height: 100vh; }

.survey-shell { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: 100vh; }
.survey-rail {
  position: sticky; top: 0; height: 100vh; padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(5, 14, 12, .68);
  backdrop-filter: blur(24px);
}
.brand-lockup, .hero-meta span, .confirm, .toolbar, .search, .choice, .admin-top, .login-card button, .action-bar button {
  display: flex; align-items: center; gap: 10px;
}
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px;
  border: 1px solid var(--line); background: var(--panel-strong); border-radius: 8px;
}
.brand-lockup strong { display: block; font-size: 16px; }
.brand-lockup small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.progress-orbit {
  margin: 42px 0 30px; padding: 24px;
  border: 1px solid var(--line); border-radius: 8px;
  background: linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.03));
}
.progress-orbit span { font-size: clamp(42px, 7vw, 68px); font-weight: 800; line-height: 1; }
.progress-orbit p { color: var(--muted); margin: 8px 0 18px; }
.progress-track { height: 8px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .45s cubic-bezier(.22,1,.36,1); }
.progress-track.subtle i { background: linear-gradient(90deg, var(--violet), var(--brand)); }
.step-list { display: grid; gap: 10px; }
.step-list button {
  width: 100%; border: 1px solid transparent; background: transparent; color: var(--muted);
  padding: 12px; border-radius: 8px; text-align: left; display: flex; gap: 10px; align-items: center;
}
.step-list button.current { color: var(--text); border-color: var(--line); background: rgba(255,255,255,.07); }
.step-list button.done { color: var(--brand-2); }

.survey-stage { padding: min(6vw, 70px); max-width: 1180px; width: 100%; margin: 0 auto; }
.hero-panel {
  position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 8px;
  padding: clamp(28px, 5vw, 64px); min-height: 290px;
  background:
    linear-gradient(110deg, rgba(255,255,255,.14), rgba(255,255,255,.04)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 56px);
}
.hero-panel:after {
  content: ""; position: absolute; right: -10%; top: -30%; width: 44%; aspect-ratio: 1;
  border: 1px solid rgba(182,255,106,.25); transform: rotate(18deg);
  background: linear-gradient(135deg, rgba(66,215,155,.24), rgba(164,151,255,.12));
}
.eyebrow { margin: 0 0 12px; color: var(--brand-2); text-transform: uppercase; font-size: 13px; font-weight: 700; }
h1 { margin: 0; font-size: clamp(34px, 6vw, 78px); line-height: .98; max-width: 920px; }
.hero-panel p:not(.eyebrow) { max-width: 720px; color: #cfe4dc; line-height: 1.8; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; color: var(--muted); }
.notes { margin: 22px 0; display: grid; gap: 10px; }
.notes p { margin: 0; padding: 16px 18px; border-left: 2px solid var(--brand); background: rgba(255,255,255,.06); }
.form-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field {
  display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(7, 18, 15, .74); box-shadow: 0 18px 80px rgba(0,0,0,.22);
}
.field.compact, .matrix-field, .image-question { grid-column: 1 / -1; }
.field-label { display: flex; justify-content: space-between; gap: 12px; color: #edfdf7; line-height: 1.6; }
.field-label b { color: var(--brand-2); font-size: 12px; white-space: nowrap; }
.input-shell { display: flex; align-items: center; border: 1px solid var(--line); background: rgba(255,255,255,.06); border-radius: 8px; }
input, textarea {
  width: 100%; border: 0; outline: none; color: var(--text); background: transparent; padding: 14px 14px;
}
textarea { border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.06); resize: vertical; }
.input-shell em { color: var(--muted); font-style: normal; padding-right: 14px; }
.choice-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.choice, .matrix-options button, .toolbar button, .action-bar button, .admin-top button, .drawer button {
  border: 1px solid var(--line); color: var(--text); background: rgba(255,255,255,.06); border-radius: 8px; padding: 11px 14px;
}
.choice.active, .matrix-options button.active, .confirm.active { border-color: rgba(182,255,106,.68); background: rgba(66,215,155,.15); color: #f6fff8; }
.choice-mark { width: 10px; height: 10px; border: 1px solid currentColor; border-radius: 50%; }
.confirm { width: 100%; justify-content: flex-start; border: 0; background: transparent; color: var(--text); padding: 0; }
.score-row { display: grid; grid-template-columns: minmax(140px, 1fr) 92px 48px; align-items: center; gap: 12px; }
.score-row input[type="range"] { accent-color: var(--brand); }
.score-row input[type="number"] { border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.06); }
.matrix { display: grid; gap: 8px; }
.matrix-head, .matrix-row { display: grid; grid-template-columns: minmax(240px, 1.4fr) repeat(5, minmax(72px, .45fr)); gap: 8px; align-items: center; }
.matrix-head { color: var(--muted); font-size: 13px; padding: 0 10px; }
.matrix-row { padding: 12px; border: 1px solid rgba(255,255,255,.09); border-radius: 8px; background: rgba(255,255,255,.04); }
.matrix-row p { margin: 0; line-height: 1.6; }
.matrix-options { display: contents; }
.image-question img { width: min(100%, 740px); border-radius: 8px; border: 1px solid var(--line); background: #fff; padding: 10px; }
.field-error { margin: 0; color: var(--danger); font-size: 13px; }
.is-error { border-color: rgba(255, 107, 107, .65); }
.action-bar { position: sticky; bottom: 0; z-index: 5; margin-top: 24px; justify-content: space-between; padding: 14px 0; backdrop-filter: blur(18px); }
.primary { border: 0; color: #06100e; background: linear-gradient(90deg, var(--brand), var(--brand-2)); font-weight: 800; border-radius: 8px; padding: 13px 18px; }
.ghost { border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text); border-radius: 8px; padding: 12px 16px; }

.completion, .login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.completion-card, .login-card {
  width: min(520px, 100%); border: 1px solid var(--line); border-radius: 8px; padding: 34px;
  background: rgba(7, 18, 15, .82); backdrop-filter: blur(20px);
}
.completion-card svg, .login-card > svg { width: 42px; height: 42px; color: var(--brand-2); }
.login-card { display: grid; gap: 16px; }
.login-card label { display: grid; gap: 8px; color: var(--muted); }
.login-card input { border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.06); }
.admin-shell { padding: min(5vw, 56px); max-width: 1360px; margin: 0 auto; }
.admin-top { justify-content: space-between; margin-bottom: 24px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.stats-grid article, .data-panel {
  border: 1px solid var(--line); border-radius: 8px; background: rgba(7,18,15,.76); padding: 20px;
}
.stats-grid span { display: block; font-size: 42px; font-weight: 800; margin-top: 12px; }
.stats-grid p { color: var(--muted); margin: 4px 0 0; }
.toolbar { flex-wrap: wrap; margin-bottom: 16px; }
.search { flex: 1 1 280px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.06); padding-left: 12px; }
.danger { border-color: rgba(255,107,107,.45) !important; color: #ffd2d2 !important; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { border-bottom: 1px solid var(--line); padding: 13px 12px; text-align: left; }
th { color: var(--muted); font-weight: 600; }
td button { display: inline-flex; align-items: center; gap: 8px; }
.empty { color: var(--muted); text-align: center; padding: 40px; }
.drawer {
  position: fixed; top: 18px; right: 18px; bottom: 18px; width: min(520px, calc(100vw - 36px)); z-index: 20;
  border: 1px solid var(--line); border-radius: 8px; padding: 22px; overflow: auto;
  background: rgba(6,16,14,.96); box-shadow: 0 24px 90px rgba(0,0,0,.5);
}
.drawer dl { display: grid; gap: 8px; }
.drawer dt { color: var(--brand-2); }
.drawer dd { margin: 0 0 8px; color: #d7eee6; word-break: break-word; }

@media (max-width: 920px) {
  .survey-shell { display: block; }
  .survey-rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 18px; }
  .step-list { grid-template-columns: repeat(2, 1fr); }
  .progress-orbit { margin: 18px 0; }
  .survey-stage { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .matrix-head { display: none; }
  .matrix-row { display: block; }
  .matrix-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
  .stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  h1 { font-size: 36px; }
  .hero-panel { padding: 24px; min-height: 220px; }
  .step-list { grid-template-columns: 1fr; }
  .score-row { grid-template-columns: 1fr 86px 44px; }
  .choice-grid { display: grid; grid-template-columns: 1fr; }
  .action-bar { display: grid; grid-template-columns: 1fr; gap: 10px; }
}
