:root {
  color-scheme: light;
  --bg: #f7f7f2;
  --surface: #ffffff;
  --ink: #12171a;
  --muted: #687076;
  --line: #dde1e2;
  --line-strong: #c8ced0;
  --gold: #d2a94b;
  --gold-soft: #fff4d2;
  --mint: #eef8f6;
  --green: #00bebd;
  --green-deep: #009a98;
  --green-ink: #0b6766;
  --shadow: 0 30px 90px rgba(18, 23, 26, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Aptos", "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(90deg, rgba(18, 23, 26, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #fbfbf7 0%, var(--bg) 100%);
  background-size: auto, 56px 56px, auto;
  color: var(--ink);
}

body.interview-page {
  overflow: hidden;
}

button,
textarea,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 44px));
  margin: 0 auto;
  padding: 26px 0 52px;
}

.interview-page .shell {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  padding: 0;
}

.hero,
.panel,
.interview-layout {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero {
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(440px, 1.14fr);
  gap: 0;
  overflow: clip;
  background: var(--surface);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: auto;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--mint);
  color: var(--green-ink);
  font-weight: 900;
}

.eyebrow {
  margin: 0;
  color: var(--green-ink);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  padding: 48px;
  background:
    linear-gradient(180deg, #f8f8f3, #f0f2f1),
    linear-gradient(90deg, rgba(18, 23, 26, 0.04) 1px, transparent 1px);
  background-size: auto, 36px 36px;
  color: var(--ink);
  text-align: left;
}

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

h1 {
  max-width: 580px;
  margin: 88px 0 18px;
  font-size: clamp(3.4rem, 7vw, 7.4rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.lede {
  max-width: 540px;
  margin-bottom: 38px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.signal-strip span {
  padding: 14px 12px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.signal-strip span + span {
  border-left: 1px solid var(--line-strong);
}

.job-form {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 34px;
  background: rgba(255, 255, 255, 0.94);
}

.field-block {
  display: grid;
  gap: 10px;
}

label {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

textarea {
  width: 100%;
  min-height: 236px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfffe;
  padding: 17px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.7;
  outline: none;
  transition: min-height 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 114, 94, 0.12);
}

.paste-zone {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  min-height: 128px;
  border: 1px dashed rgba(0, 154, 152, 0.5);
  border-radius: 8px;
  background: rgba(226, 245, 241, 0.52);
  padding: 18px;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease;
}

.paste-zone:hover,
.paste-zone:focus {
  background: rgba(226, 245, 241, 0.9);
  outline: none;
  transform: translateY(-1px);
}

.paste-zone.has-image {
  border-style: solid;
}

.paste-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--green-ink);
  border: 1px solid rgba(0, 154, 152, 0.22);
  font-weight: 950;
}

.paste-zone strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 900;
}

.paste-zone p,
.status,
.panel-head p,
.skill-card p,
.answer-actions small {
  color: var(--muted);
}

.paste-zone p {
  margin-bottom: 0;
  line-height: 1.6;
}

.paste-zone input[type="file"] {
  grid-column: 1 / -1;
  width: 100%;
  color: var(--muted);
}

.preview-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfffe;
}

.preview-card img {
  display: block;
  width: 100%;
  height: 236px;
  max-height: none;
  object-fit: contain;
  background: #f0f1f2;
}

.preview-card figcaption {
  border-top: 1px solid var(--line-strong);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.form-actions {
  display: grid;
  gap: 10px;
}

.input-frame {
  display: grid;
}

.input-frame.is-previewing textarea {
  display: none;
}

.job-form.has-preview {
  gap: 12px;
}

.job-form.has-preview .paste-zone {
  min-height: 96px;
}

.job-form.has-preview .preview-card img {
  height: 236px;
}

button,
.mock-button,
.text-link {
  border-radius: 8px;
}

button {
  border: 1px solid var(--green-deep);
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  color: #fff;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 154, 152, 0.24);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(0, 154, 152, 0.28);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.status {
  min-height: 24px;
  margin-bottom: 0;
  font-size: 0.92rem;
}

.panel {
  padding: 34px;
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.panel h1,
.panel-head h1 {
  max-width: none;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.95;
}

.panel:has(.skills-grid) .panel-head h1 {
  font-size: clamp(2.2rem, 3.4vw, 3.25rem);
  line-height: 1;
}

.panel-head p {
  max-width: 440px;
  margin-bottom: 0;
  line-height: 1.6;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  padding: 0 12px;
  color: var(--green-ink);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 900;
}

.back-link::before {
  content: "←";
  margin-right: 8px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.skill-card {
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-height: 146px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 247, 0.98));
  box-shadow: 0 10px 26px rgba(18, 23, 26, 0.05);
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.skill-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--green);
}

.skill-card:hover {
  border-color: rgba(0, 154, 152, 0.38);
  box-shadow: 0 24px 60px rgba(0, 154, 152, 0.12);
  transform: translateY(-3px);
}

.skill-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.skill-index {
  color: rgba(18, 23, 26, 0.32);
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.skill-state {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0, 154, 152, 0.18);
  border-radius: 999px;
  background: var(--mint);
  padding: 0 8px;
  color: var(--green-ink);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.skill-main {
  display: grid;
  gap: 5px;
}

.skill-card h2 {
  margin: 0;
  font-size: 1.24rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.skill-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.9rem;
  line-height: 1.45;
}

.skill-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 0;
}

.text-link,
.mock-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  padding: 7px 10px;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 900;
}

.text-link {
  color: var(--ink);
  background: #fff;
}

.mock-button {
  color: #fff;
  border-color: var(--green-deep);
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  box-shadow: 0 10px 22px rgba(0, 154, 152, 0.18);
}

.interview-layout {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(260px, 22vw) minmax(0, 1fr);
  min-height: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}

.question-rail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  padding: 18px;
  background:
    linear-gradient(150deg, var(--green-deep), #246d5f);
  color: #fffdf8;
}

.panel-head.compact {
  display: block;
  margin-bottom: 0;
  border-bottom-color: rgba(255, 255, 255, 0.24);
}

.dark-back {
  min-height: 30px;
  margin-bottom: 10px;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fffdf8;
}

.panel-head.compact h1 {
  margin-top: 8px;
  margin-bottom: 12px;
  color: #fffdf8;
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  line-height: 1;
}

.eyebrow.dark {
  color: var(--gold);
}

.question-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.rail-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.86rem;
  line-height: 1.5;
}

.panel-head.compact > .rail-note {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(5, 55, 54, 0.28);
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.weakness-summary {
  min-height: 0;
}

.summary-card {
  border: 1px solid rgba(255, 253, 248, 0.28);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 253, 248, 0.12);
  color: #fffdf8;
  line-height: 1.5;
}

.summary-card p {
  margin: 8px 0;
}

.summary-card ul {
  margin: 0;
  padding-left: 18px;
}

.question-item {
  width: 100%;
  border: 1px solid rgba(255, 253, 248, 0.28);
  background: transparent;
  box-shadow: none;
  color: #fffdf8;
  padding: 11px 12px;
  font-size: 0.92rem;
  text-align: left;
  line-height: 1.42;
}

.question-item:hover {
  transform: none;
  box-shadow: none;
}

.question-item.active,
.question-item:hover {
  background: var(--gold-soft);
  color: var(--green-deep);
}

.chat-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid var(--line-strong);
  background: #fffdf8;
}

.chat-thread {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 20px 24px;
}

.chat-message {
  max-width: min(72%, 760px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
}

.chat-message span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.chat-message p {
  margin: 0;
  line-height: 1.6;
}

.chat-message.interviewer {
  box-shadow: 6px 6px 0 var(--gold-soft);
}

.chat-message.candidate {
  justify-self: end;
  background: var(--green-deep);
  color: #fff;
}

.chat-message.candidate span {
  color: #ffe5a0;
}

.chat-message.coach {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.answer-box {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line-strong);
  padding: 12px 18px 14px;
  background: #fff8e8;
}

.answer-box textarea {
  min-height: 108px;
  max-height: 24vh;
  resize: vertical;
}

.answer-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 860px;
  margin: -6px auto 18px;
}

.doc-actions button,
.doc-actions .text-link {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.86rem;
  line-height: 1.2;
  box-shadow: none;
}

.doc-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 154, 152, 0.16);
}

.doc-error {
  margin-bottom: 18px;
  border: 1px solid #e59b9b;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff0f0;
  color: #8a2d2d;
  line-height: 1.6;
}

.markdown-body {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 34px 38px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.82;
  box-shadow: 8px 8px 0 var(--gold-soft);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  color: var(--ink);
  letter-spacing: 0;
}

.markdown-body h1 {
  margin: 0 0 22px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--line-strong);
  font-size: 2.1rem;
  line-height: 1.18;
}

.markdown-body h2 {
  margin: 34px 0 12px;
  padding-left: 12px;
  border-left: 5px solid var(--green);
  font-size: 1.34rem;
  line-height: 1.32;
}

.markdown-body h3 {
  margin: 24px 0 8px;
  font-size: 1.06rem;
  line-height: 1.35;
}

.markdown-body p,
.markdown-body li {
  color: var(--ink);
}

.markdown-body p {
  margin: 10px 0 14px;
}

.markdown-body ul,
.markdown-body ol {
  margin: 10px 0 18px;
  padding-left: 24px;
}

.markdown-body li {
  margin: 7px 0;
  padding-left: 2px;
}

.markdown-body strong {
  font-weight: 900;
}

.markdown-body blockquote {
  margin: 16px 0;
  border-left: 5px solid var(--gold);
  padding: 10px 14px;
  background: #fff8e8;
}

.markdown-body pre {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 14px;
  background: #10231f;
  color: #fffdf8;
  line-height: 1.6;
}

.markdown-body code {
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 1px 5px;
  background: var(--gold-soft);
}

.markdown-body pre code {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
}

.markdown-body table {
  width: 100%;
  margin: 16px 0 22px;
  border-collapse: collapse;
  font-size: 0.96rem;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--line-strong);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.markdown-body th {
  background: var(--gold-soft);
  font-weight: 900;
}

@media (max-width: 940px) {
  .shell {
    width: min(100vw - 28px, 760px);
    padding: 18px 0 34px;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .job-form {
    padding: 28px;
  }

  h1 {
    margin-top: 46px;
    font-size: 4rem;
  }

  .interview-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 56px);
  }

  .interview-page .shell {
    width: 100vw;
    height: 100vh;
    padding: 0;
  }

  .interview-page .interview-layout {
    height: 100vh;
    min-height: 0;
    grid-template-rows: 224px minmax(0, 1fr);
  }

  .question-rail {
    max-height: 420px;
  }

  .interview-page .question-rail {
    max-height: none;
    gap: 8px;
    padding: 10px 16px 12px;
  }

  .interview-page .question-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 8px;
    scrollbar-gutter: stable;
  }

  .interview-page .question-item {
    flex: 0 0 min(84vw, 420px);
    min-height: 50px;
    padding: 10px 12px;
    white-space: normal;
  }

  .interview-page .dark-back {
    min-height: 28px;
    margin-bottom: 6px;
  }

  .interview-page .eyebrow.dark {
    font-size: 0.7rem;
  }

  .interview-page .panel-head.compact h1 {
    margin-top: 4px;
    margin-bottom: 6px;
    font-size: 1.55rem;
  }

  .interview-page .panel-head.compact > .rail-note {
    display: none;
  }

  .interview-page .question-list .rail-note {
    font-size: 0.82rem;
  }

  .interview-page .chat-thread {
    padding: 12px 16px;
  }

  .interview-page .chat-message {
    max-width: 92%;
  }

  .interview-page .answer-box {
    padding: 10px 16px 12px;
  }

  .interview-page .answer-box textarea {
    min-height: 96px;
  }

  .panel-head {
    display: block;
  }

  .panel-head p {
    margin-top: 12px;
  }

  .markdown-body {
    padding: 28px 30px;
  }

  .markdown-body h1 {
    font-size: 1.82rem;
  }
}

@media (max-width: 560px) {
  .shell {
    width: 100vw;
    padding: 0;
  }

  .hero-copy,
  .job-form {
    padding: 18px;
  }

  .panel {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    padding: 16px 14px 22px;
    box-shadow: none;
  }

  h1 {
    font-size: 3rem;
  }

  .panel-head {
    margin-bottom: 14px;
    padding-bottom: 14px;
  }

  .panel h1,
  .panel-head h1 {
    font-size: 2.1rem;
    line-height: 1;
  }

  .panel-head p {
    margin-top: 8px;
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .doc-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: -2px;
  }

  .doc-actions button,
  .doc-actions .text-link {
    width: 100%;
    justify-content: center;
    min-height: 38px;
    padding: 8px 6px;
    font-size: 0.82rem;
  }

  .markdown-body {
    padding: 22px 18px;
    font-size: 0.98rem;
    line-height: 1.76;
    box-shadow: 4px 4px 0 var(--gold-soft);
  }

  .markdown-body h1 {
    margin-bottom: 18px;
    padding-bottom: 12px;
    font-size: 1.58rem;
    line-height: 1.22;
    overflow-wrap: anywhere;
  }

  .markdown-body h2 {
    margin-top: 28px;
    padding-left: 10px;
    font-size: 1.16rem;
  }

  .markdown-body h3 {
    font-size: 1rem;
  }

  .markdown-body ul,
  .markdown-body ol {
    padding-left: 20px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .skill-card {
    min-height: 138px;
    padding: 13px;
  }

  .skill-card-top {
    gap: 8px;
  }

  .skill-index {
    font-size: 0.82rem;
  }

  .skill-state {
    min-height: 24px;
    padding: 0 8px;
    font-size: 0.7rem;
  }

  .skill-main {
    gap: 6px;
  }

  .skill-card h2 {
    font-size: 1.18rem;
    line-height: 1.15;
  }

  .skill-card p {
    -webkit-line-clamp: 2;
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .skill-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 0;
  }

  .text-link,
  .mock-button {
    min-height: 40px;
    padding: 8px;
    font-size: 0.84rem;
  }

  .signal-strip {
    grid-template-columns: 1fr;
    border-radius: 8px;
  }

  .signal-strip span + span {
    border-left: 0;
    border-top: 1px solid var(--line-strong);
  }

  .paste-zone {
    grid-template-columns: 1fr;
  }

  .answer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-message {
    max-width: 100%;
  }
}
