:root {
  --bg: #f8f6f1;
  --surface: #ffffff;
  --surface-soft: #f3efe7;
  --border: #e6dfd3;
  --border-strong: #d5cbb9;
  --text: #222624;
  --text-muted: #626b66;
  --text-light: #89918c;

  --primary: #2c5248;
  --primary-hover: #213f37;
  --primary-soft: #e9f1ee;
  --accent: #b96b4b;
  --accent-soft: #fbf1ec;

  --red: #b93838;
  --red-bg: #fdf2f2;
  --red-border: #f3c8c8;
  --yellow: #a47018;
  --yellow-bg: #fef9ec;
  --yellow-border: #f0dbab;
  --green: #256850;
  --green-bg: #edf7f2;
  --green-border: #bfe0d1;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(34, 38, 36, 0.04), 0 4px 14px rgba(34, 38, 36, 0.03);
  --shadow-md: 0 6px 24px rgba(34, 38, 36, 0.07);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

/* Progress Bar */
.progress-bar-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 246, 241, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
}

.progress-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #49796b);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}

/* Main Container */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.container-wide {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

/* Hero / Counselor Bio */
.hero-card {
  background: linear-gradient(155deg, #2c5248 0%, #1f3c35 100%);
  color: #f9f7f2;
  border: none;
  padding: 30px 26px;
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.14);
  color: #e9f2ef;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 14px;
}

.hero-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

.hero-subtitle {
  font-size: 14px;
  color: rgba(249, 247, 242, 0.85);
  margin-bottom: 20px;
}

.counselor-box {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.counselor-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.counselor-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 17px;
  color: #fff;
  flex-shrink: 0;
}

.counselor-name {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.counselor-role {
  font-size: 12.5px;
  color: rgba(249, 247, 242, 0.78);
}

.counselor-bio {
  font-size: 13.5px;
  color: rgba(249, 247, 242, 0.9);
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.hero-badge {
  font-size: 12px;
  color: rgba(249, 247, 242, 0.88);
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.section-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.section-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Form Controls */
.field {
  margin-bottom: 22px;
}

.field:last-child {
  margin-bottom: 0;
}

.field-label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.5;
}

.req {
  color: var(--accent);
  margin-left: 3px;
}

.field-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 82, 72, 0.12);
}

.textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.65;
}

.char-counter {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.char-counter.ok {
  color: var(--green);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Option Cards (Radio / Checkbox) */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 9px;
}

.opt-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  user-select: none;
}

.opt-item:hover {
  border-color: var(--primary);
  background: #fcfdfb;
}

.opt-item input {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}

.opt-item.checked {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.opt-item.risk-checked {
  border-color: var(--red-border);
  background: var(--red-bg);
}

.opt-text {
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.5;
}

/* Readiness Scale 1-10 */
.scale-wrap {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

.scale-btn {
  height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.scale-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.scale-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.scale-legend {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Notice Box */
.notice-soft {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-border);
}

.btn-danger:hover {
  background: #fbe4e4;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
}

/* Error Banner */
.error-banner {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: var(--red);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

/* Result Screens */
.result-card {
  text-align: left;
  padding: 32px 26px;
}

.result-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 16px;
}

.result-icon.green {
  background: var(--green-bg);
  color: var(--green);
}

.result-icon.warm {
  background: var(--accent-soft);
  color: var(--accent);
}

.hotline-box {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 18px 0;
}

.hotline-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 8px;
}

.hotline-call {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  margin-top: 8px;
  margin-right: 10px;
}

.wechat-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 16px 0;
}

/* Admin Layout */
.admin-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.admin-topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.kpi-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.kpi-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(44, 82, 72, 0.14);
}

.kpi-label {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.kpi-val {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.kpi-val.red { color: var(--red); }
.kpi-val.yellow { color: var(--yellow); }
.kpi-val.green { color: var(--green); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-red { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow-border); }
.badge-green { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.badge-neutral { background: var(--surface-soft); color: var(--text-muted); border: 1px solid var(--border); }

/* Filters */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar .input {
  flex: 1;
  min-width: 200px;
}

.toolbar .select {
  width: auto;
  min-width: 140px;
}

/* Submission List */
.sub-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sub-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sub-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.sub-item.level-red {
  border-left: 4px solid var(--red);
}

.sub-item.level-yellow {
  border-left: 4px solid var(--yellow);
}

.sub-item.level-green {
  border-left: 4px solid var(--green);
}

.sub-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.sub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.sub-snippet {
  font-size: 14px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Modal / Drawer */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 26, 24, 0.48);
  z-index: 100;
  display: none;
  justify-content: flex-end;
}

.modal-backdrop.open {
  display: flex;
}

.drawer {
  width: min(680px, 100vw);
  height: 100vh;
  background: var(--bg);
  overflow-y: auto;
  padding: 24px 22px 48px;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.16);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: -24px;
  background: var(--bg);
  padding-top: 8px;
  z-index: 5;
}

.detail-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.detail-block h4 {
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 10px;
  font-weight: 600;
}

.kv-row {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}

.kv-row:last-child {
  border-bottom: none;
}

.kv-k {
  width: 120px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.kv-v {
  flex: 1;
  color: var(--text);
  word-break: break-word;
}

.script-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  margin-top: 8px;
  color: var(--text);
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1f2926;
  color: #fff;
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.footer-note {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-light);
  margin-top: 24px;
}

/* Minimal Header & 4-Step Guided Flow */
.minimal-header {
  margin-bottom: 18px;
  padding: 6px 2px 0;
}

.minimal-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.minimal-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.step-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
}

.step-pill .step-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-pill.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.step-pill.active .step-dot {
  background: var(--primary);
  color: #fff;
}

.step-pill.done {
  border-color: var(--green-border);
  color: var(--green);
}

.step-pill.done .step-dot {
  background: var(--green);
  color: #fff;
}

.step-panel {
  display: none;
  animation: fadeSlide 0.2s ease;
}

.step-panel.active {
  display: block;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Fast Compact Pill Chips */
.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.chip-item:hover {
  border-color: var(--primary);
  background: #fafdfb;
}

.chip-item input {
  display: none;
}

.chip-item.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 500;
}

/* Segmented Calendar Switch + Optional Birth Row */
.birth-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
}

.seg-switch {
  display: inline-flex;
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 3px;
  flex-shrink: 0;
}

.seg-btn {
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.seg-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.opt-tag {
  display: inline-block;
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 99px;
  margin-left: 6px;
  font-weight: 400;
  vertical-align: middle;
}

.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.draft-status {
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Responsive */
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .scale-wrap { grid-template-columns: repeat(5, 1fr); }
  .card { padding: 20px 16px; }
  .hero-card { padding: 24px 18px; }
  .kv-row { flex-direction: column; gap: 2px; }
  .kv-k { width: auto; font-size: 12.5px; }
  .stepper { gap: 5px; }
  .step-pill { flex-direction: column; gap: 3px; font-size: 11.5px; padding: 8px 4px; }
  .birth-row { flex-direction: column; }
  .seg-switch { width: 100%; }
  .seg-btn { flex: 1; }
}
