:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #eef3f6;
  --ink: #15202b;
  --muted: #627080;
  --line: #d9e0e7;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --warn: #b45309;
  --danger: #b91c1c;
  --focus: rgba(15, 118, 110, 0.18);
  --shadow: 0 18px 50px rgba(20, 32, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 96px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 16px;
}

.brand img {
  width: 112px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

h3 {
  margin-bottom: 12px;
  font-size: 15px;
}

.status-strip {
  display: grid;
  grid-template-columns: auto auto 44px auto auto 44px auto auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.status-dot.active {
  border-color: var(--accent);
  background: var(--accent);
}

.status-dot.done {
  border-color: var(--accent);
  background: #ccfbf1;
}

.status-strip [data-step-label].active {
  color: var(--ink);
  font-weight: 800;
}

.status-strip [data-step-label].done {
  color: var(--accent);
  font-weight: 800;
}

.status-line {
  height: 1px;
  background: var(--line);
}

.status-line.done {
  background: var(--accent);
}

.language-toggle {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.language-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.workspace {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
}

.setup-panel,
.main-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.main-panel {
  padding: 20px;
}

.setup-panel {
  padding: 18px;
}

/* 材料手风琴（侧栏内，默认折叠） */
.materials-accordion {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.materials-accordion > summary {
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
}
.materials-accordion > summary:hover { color: var(--accent); }
.materials-accordion[open] > summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}
.materials-accordion .accordion-inner {
  padding: 14px;
}

/* 三列材料输入改为手风琴内的内联 tabs */
.materials-accordion .input-column {
  padding: 0;
  margin-bottom: 14px;
}
.materials-accordion .input-column:last-child { margin-bottom: 0; }
.materials-accordion .input-column + .input-column {
  border-left: 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

/* 密钥门覆盖层 */
.gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 32, 43, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.gate-overlay.hidden { display: none; }
.gate-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(20, 32, 43, 0.18);
  padding: 32px;
  max-width: 400px;
  width: calc(100% - 32px);
  text-align: center;
}
.gate-card h2 {
  margin-bottom: 8px;
  font-size: 22px;
}
.gate-card p {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.5;
}
.gate-card input {
  width: 100%;
  height: 48px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.gate-card button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}
.gate-card button:hover { background: var(--accent-strong); }
.gate-card button:disabled { opacity: .5; cursor: default; }
.gate-err {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin-top: 8px;
}

/* 会员状态条 */
.member-bar {
  background: var(--accent);
  color: #fff;
  padding: 8px 20px;
  border-radius: 8px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
  flex-wrap: wrap;
}
.member-bar.hidden { display: none; }
.member-bar .quota-used { color: #ffd78c; }
.member-bar button {
  border: 1px solid rgba(255,255,255,.4);
  background: transparent;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.member-bar button:hover { border-color: #fff; }

/* 新输出块：简历意见、参考答案、提升规划 */
.resume-feedback,
.reference-answers,
.improvement-plan {
  padding: 0;
}
.reference-answers .ref-item {
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: #f0fdfa;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.55;
}
.reference-answers .ref-item:last-child { margin-bottom: 0; }

/* 移动端 */
@media (max-width: 760px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .setup-panel { position: static; }
  .main-panel { min-height: auto; }
  .gate-card {
    padding: 24px;
    max-width: 100%;
  }
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .status-strip {
    grid-template-columns: auto auto 1fr;
    white-space: normal;
  }
  .tabs, .segmented {
    grid-auto-flow: row;
    grid-auto-columns: auto;
  }
  textarea { min-height: 180px; }
  .primary-action, input[type="text"], input[type="url"], input[type="password"], select {
    min-height: 48px;
  }
  .question-actions { flex-wrap: wrap; }
  .question-actions button { flex: 1; }
  .member-bar { border-radius: 0; margin: -4px -4px 14px; }
}
.panel-head,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title span,
.panel-head span,
.privacy-note,
.file-meta,
.empty-state {
  color: var(--muted);
  font-size: 13px;
}

label,
.field-group {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.field-label {
  font-size: 14px;
  font-weight: 650;
}

.hidden {
  display: none !important;
}

input[type="text"],
input[type="url"],
input[type="password"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input[type="text"],
input[type="url"],
input[type="password"],
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 330px;
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--focus);
}

.tabs,
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.tabs button,
.segmented button,
.icon-button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tabs button.selected,
.segmented button.selected {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(20, 32, 43, 0.1);
}

.icon-button {
  width: 36px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.tab-panel {
  display: none;
}

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

.dropzone {
  display: grid;
  position: relative;
  place-items: center;
  min-height: 236px;
  padding: 24px;
  border: 1px dashed #9aa7b5;
  border-radius: 8px;
  background: #fbfcfd;
  cursor: pointer;
  text-align: center;
}

.dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dropzone strong {
  margin-top: 12px;
  font-size: 16px;
}

.dropzone span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.file-meta {
  min-height: 34px;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
}

.primary-action {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.primary-action:hover {
  background: var(--accent-strong);
}

.privacy-note {
  margin: 12px 0 0;
  line-height: 1.5;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.metric {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  font-size: 22px;
}

.result-block {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.result-block ul {
  margin: 0;
  padding-left: 18px;
}

.result-block li {
  margin-bottom: 8px;
  line-height: 1.45;
}

.question-list,
.interview-stage {
  display: grid;
  gap: 10px;
}

.question-item,
.interview-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.question-item strong,
.interview-card strong {
  display: block;
  margin-bottom: 6px;
}

.question-item span,
.interview-card p {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.interview-meta {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.answer-input {
  min-height: 86px;
  margin-top: 10px;
  font-size: 13px;
}

.question-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.question-actions button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.question-actions button:hover {
  background: var(--accent-strong);
}

.inline-followup {
  margin-top: 10px;
  padding: 10px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #ecfdf5;
  font-size: 13px;
  line-height: 1.5;
}

.followup-box {
  min-height: 76px;
  padding: 12px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #ecfdf5;
  line-height: 1.5;
}

.followup-entry + .followup-entry {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 118, 110, 0.22);
}

.followup-entry strong {
  display: block;
  margin-bottom: 6px;
}

.followup-entry p {
  margin-bottom: 6px;
  font-size: 13px;
}

.followup-entry p:first-of-type {
  color: var(--muted);
}

.followup-entry p:last-child {
  margin-bottom: 0;
}

.followup-stack {
  display: grid;
  gap: 6px;
}

.followup-stack p {
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 260px minmax(420px, 1fr);
  }

  .output-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .brand,
  .panel-head,
  .section-title {
    align-items: flex-start;
  }

  .topbar,
  .workspace,
  .input-panel {
    display: grid;
    grid-template-columns: 1fr;
  }

  .status-strip {
    grid-template-columns: auto auto 1fr;
    white-space: normal;
  }

  .status-strip span:nth-child(n + 4) {
    display: none;
  }

  .input-column + .input-column {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .brand img {
    width: 86px;
    height: 52px;
  }
}
