:root {
  color-scheme: light;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-soft: #eef2f8;
  --ink: #172033;
  --muted: #677087;
  --line: #dfe4ee;
  --accent: #2457d6;
  --accent-soft: #e7edff;
  --danger: #b42318;
  --success: #16794f;
  --warning: #9a6700;
  --radius: 14px;
  --shadow: 0 16px 50px rgba(44, 60, 92, 0.09);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); background: var(--bg); min-width: 320px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app-shell { min-height: 100dvh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; padding: 24px 18px; background: #172033; color: white; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: #fff; color: #172033; font-weight: 800; }
.brand strong { display: block; font-size: 17px; }
.brand small { display: block; color: #aab4c8; margin-top: 2px; }
.nav { display: grid; gap: 7px; }
.nav button { border: 0; border-radius: 10px; color: #bdc6d8; background: transparent; padding: 11px 12px; text-align: left; display: flex; align-items: center; gap: 11px; }
.nav button:hover, .nav button.active { color: white; background: rgba(255,255,255,.1); }
.nav-icon { width: 20px; text-align: center; font-size: 16px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: 18px 8px 0; }
.user-email { font-size: 12px; color: #aab4c8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.privacy-note { margin-top: 12px; font-size: 11px; line-height: 1.5; color: #7f8ba3; }

.main { min-width: 0; }
.topbar { height: 74px; padding: 0 34px; background: rgba(244,246,250,.92); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); }
.topbar h1 { font-size: 19px; margin: 0; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.content { padding: 30px 34px 60px; max-width: 1440px; margin: 0 auto; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.toolbar-actions { display: flex; gap: 10px; align-items: center; }

.button { border: 1px solid transparent; border-radius: 10px; padding: 10px 15px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 650; color: var(--ink); background: white; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--accent); color: white; box-shadow: 0 8px 20px rgba(36,87,214,.18); }
.button-secondary { border-color: var(--line); }
.button-ghost { background: transparent; color: var(--muted); }
.button-danger { color: var(--danger); border-color: #f0cbc7; background: #fff8f7; }
.button-sm { padding: 7px 10px; min-height: 34px; font-size: 13px; }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }

.search { position: relative; min-width: min(380px, 100%); }
.search input { width: 100%; height: 42px; padding: 0 14px 0 39px; border: 1px solid var(--line); background: white; border-radius: 10px; color: var(--ink); }
.search span { position: absolute; left: 14px; top: 10px; color: var(--muted); }
.search input:focus, input:focus, textarea:focus, select:focus { outline: 3px solid rgba(36,87,214,.15); border-color: var(--accent); }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 26px; background: var(--line); }
.metric { background: white; padding: 18px 20px; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 7px; font-size: 25px; letter-spacing: -.04em; }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list-head, .interview-row { display: grid; grid-template-columns: minmax(160px, 1.2fr) minmax(150px, 1fr) 110px 120px 110px 42px; gap: 16px; align-items: center; }
.list-head { padding: 12px 18px; color: var(--muted); background: #f9fafc; font-size: 12px; font-weight: 700; }
.interview-row { padding: 17px 18px; border-top: 1px solid var(--line); transition: background .16s ease; }
.interview-row:hover { background: #fafbfe; }
.company { font-weight: 750; }
.company small { display: block; color: var(--muted); font-weight: 400; margin-top: 4px; }
.row-link { border: 0; background: transparent; padding: 0; text-align: left; color: inherit; }
.badge { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 700; background: var(--surface-soft); color: var(--muted); }
.badge.completed, .badge.excellent { background: #e7f6ef; color: var(--success); }
.badge.processing { background: var(--accent-soft); color: var(--accent); }
.badge.failed, .badge.risk { background: #fff0ee; color: var(--danger); }
.badge.improve { background: #fff7db; color: var(--warning); }
.kebab { border: 0; background: transparent; color: var(--muted); font-size: 20px; padding: 6px; }

.empty { min-height: 360px; display: grid; place-items: center; padding: 40px; text-align: center; background: white; border: 1px dashed #cbd3e1; border-radius: var(--radius); }
.empty-visual { width: 76px; height: 76px; margin: 0 auto 20px; border-radius: 22px; display: grid; place-items: center; font-size: 28px; background: var(--accent-soft); color: var(--accent); }
.empty h2 { margin: 0 0 8px; font-size: 21px; }
.empty p { margin: 0 auto 20px; color: var(--muted); max-width: 460px; line-height: 1.7; }

.panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-panel { padding: 26px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px; }
.intake-upload { border: 1px dashed #b8c7e7; border-radius: 14px; padding: 18px; background: #f8faff; transition: border-color .18s ease, background .18s ease; }
.intake-upload.dragging { border-color: var(--accent); background: #eef3ff; }
.intake-copy { display: flex; align-items: center; gap: 13px; }
.intake-copy strong { display: block; font-size: 14px; }
.intake-copy p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.intake-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: #e8efff; color: var(--accent); font-weight: 800; flex: 0 0 auto; }
.intake-actions { display: flex; gap: 8px; margin-top: 14px; }
.intake-previews { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.intake-preview { position: relative; margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: white; }
.intake-preview img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.intake-preview figcaption { padding: 7px 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.intake-preview button { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border: 0; border-radius: 8px; background: rgba(23,32,51,.82); color: white; font-size: 17px; line-height: 1; }
.intake-status { margin-top: 10px; color: var(--muted); font-size: 12px; }
.field { display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 700; }
.required { color: var(--danger); }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--ink); background: white; }
.field textarea { min-height: 116px; resize: vertical; line-height: 1.65; }
.field textarea.transcript { min-height: 300px; font-family: "Cascadia Code", "Microsoft YaHei", monospace; font-size: 13px; }
.field-help { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.notice { padding: 12px 14px; margin-bottom: 20px; border-radius: 10px; background: #fff8e5; color: #6f4f00; line-height: 1.55; font-size: 13px; }

.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.detail-header h2 { margin: 0 0 6px; font-size: 27px; letter-spacing: -.03em; }
.detail-meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.tabs { display: flex; gap: 4px; padding: 5px; width: fit-content; background: #e9edf4; border-radius: 11px; margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; padding: 9px 13px; border-radius: 8px; background: transparent; color: var(--muted); white-space: nowrap; }
.tabs button.active { color: var(--ink); background: white; box-shadow: 0 2px 8px rgba(31,44,72,.09); font-weight: 700; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: 20px; align-items: start; }
.document { padding: 28px; min-height: 560px; }
.document-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.document h3 { margin: 30px 0 14px; font-size: 18px; }
.dialogue { margin: 0 0 14px; padding-left: 16px; border-left: 2px solid var(--line); }
.dialogue.interviewer { border-color: #9ca8bc; }
.dialogue.me { border-color: var(--accent); }
.dialogue strong { display: block; margin-bottom: 5px; font-size: 13px; }
.dialogue p { margin: 0; line-height: 1.75; white-space: pre-wrap; }
.editable { width: 100%; min-height: 480px; border: 0; resize: vertical; line-height: 1.75; color: var(--ink); }
.markdown-plain { white-space: pre-wrap; line-height: 1.75; color: #334057; }

.side-panel { padding: 20px; position: sticky; top: 94px; }
.side-panel h3 { margin: 0 0 14px; font-size: 15px; }
.outline { display: grid; gap: 4px; }
.outline button { border: 0; background: transparent; text-align: left; color: var(--muted); border-radius: 8px; padding: 8px 9px; font-size: 13px; }
.outline button:hover { background: var(--surface-soft); color: var(--ink); }

.review-list { display: grid; gap: 16px; }
.review-card { padding: 22px; }
.review-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.review-card h3 { margin: 0; font-size: 17px; line-height: 1.55; }
.answer-quote { margin: 16px 0; padding: 14px; background: #f7f9fc; border-radius: 10px; color: #4f596d; line-height: 1.65; font-size: 13px; }
.review-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.review-block { padding-top: 14px; border-top: 1px solid var(--line); }
.review-block h4 { margin: 0 0 8px; font-size: 13px; }
.review-block p, .review-block li { color: #4f596d; line-height: 1.65; font-size: 13px; }
.review-block ul { margin: 0; padding-left: 18px; }
.reference-answer { grid-column: 1 / -1; background: var(--accent-soft); border: 0; border-radius: 10px; padding: 15px; }

.summary-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: 20px; }
.summary-main, .summary-side { padding: 24px; }
.summary-main h3, .summary-side h3 { margin: 0 0 14px; }
.summary-main > p { color: #4f596d; line-height: 1.8; }
.insight-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.insight { padding: 17px; border-radius: 10px; background: #f7f9fc; }
.insight h4 { margin: 0 0 10px; }
.insight ol, .insight ul { padding-left: 19px; margin: 0; }
.insight li { margin: 7px 0; color: #4f596d; line-height: 1.55; }
.signal { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.6; }
.signal:last-child { border: 0; }

.bank-grid { display: grid; gap: 12px; }
.bank-item { padding: 18px 20px; display: grid; grid-template-columns: minmax(0,1fr) 120px 120px 60px; gap: 14px; align-items: center; }
.bank-item h3 { margin: 0 0 5px; font-size: 15px; }
.bank-item p { margin: 0; color: var(--muted); font-size: 12px; }
.bank-item select { border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: white; }

.login-page { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; background: white; }
.login-story { padding: clamp(38px, 7vw, 100px); background: #172033; color: white; display: flex; flex-direction: column; justify-content: space-between; }
.login-story .brand { padding: 0; }
.login-copy { max-width: 560px; }
.login-copy h1 { font-size: clamp(38px, 5vw, 68px); line-height: 1.03; letter-spacing: -.055em; margin: 0 0 24px; }
.login-copy p { color: #b8c2d5; font-size: 17px; line-height: 1.75; max-width: 45ch; }
.login-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 38px; }
.login-step { border-top: 1px solid rgba(255,255,255,.2); padding-top: 13px; color: #b8c2d5; font-size: 13px; }
.login-step strong { display: block; color: white; font-size: 20px; margin-bottom: 6px; }
.login-form-wrap { display: grid; place-items: center; padding: 34px; background: #f7f8fb; }
.login-form { width: min(430px, 100%); padding: 32px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.login-form h2 { margin: 0 0 8px; font-size: 25px; }
.login-form > p { margin: 0 0 24px; color: var(--muted); line-height: 1.6; }
.login-form .button { width: 100%; margin-top: 12px; }
.login-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.password-field { position: relative; margin-top: 16px; }
.password-field input { padding-right: 58px; }
.password-toggle { position: absolute; right: 9px; bottom: 8px; border: 0; background: transparent; color: var(--accent); padding: 7px; font-size: 12px; }
.demo-login { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.demo-login p { font-size: 12px; color: var(--muted); }

.panel.processing { min-height: 520px; display: grid; place-items: center; padding: 40px; text-align: center; }
.processing-bars { width: 260px; display: grid; gap: 8px; margin: 24px auto; }
.processing-bar { height: 8px; border-radius: 5px; background: linear-gradient(90deg, #dbe2ef 20%, #2457d6 50%, #dbe2ef 80%); background-size: 220% 100%; animation: loading 1.6s ease infinite; }
.processing-bar:nth-child(2) { width: 82%; animation-delay: .18s; }
.processing-bar:nth-child(3) { width: 64%; animation-delay: .34s; }
@keyframes loading { to { background-position: -120% 0; } }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; background: #172033; color: white; border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; max-width: 360px; }
.toast.show { opacity: 1; transform: translateY(0); }
.mobile-menu { display: none; }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 82px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .brand span, .nav-label, .sidebar-foot { display: none; }
  .brand { justify-content: center; padding-inline: 0; }
  .nav button { justify-content: center; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .detail-grid, .summary-layout { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .list-head, .interview-row { grid-template-columns: minmax(160px, 1.3fr) minmax(150px, 1fr) 90px 100px 42px; }
  .list-head > :nth-child(4), .interview-row > :nth-child(4) { display: none; }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: 68px; z-index: 30; padding: 8px 12px; display: block; border-top: 1px solid rgba(255,255,255,.15); }
  .sidebar .brand, .sidebar-foot { display: none; }
  .nav { display: grid; grid-template-columns: repeat(3, 1fr); }
  .nav button { flex-direction: column; gap: 2px; padding: 5px; font-size: 10px; }
  .nav-label { display: block; }
  .main { padding-bottom: 72px; }
  .topbar { height: 64px; padding: 0 18px; }
  .topbar p { display: none; }
  .content { padding: 20px 16px 34px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { justify-content: space-between; }
  .search { min-width: 0; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric { padding: 14px; }
  .metric strong { font-size: 21px; }
  .list-head { display: none; }
  .interview-row { grid-template-columns: 1fr auto; gap: 12px; padding: 16px; }
  .interview-row > :nth-child(2), .interview-row > :nth-child(3), .interview-row > :nth-child(4) { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .intake-previews { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intake-actions { flex-wrap: wrap; }
  .field.full { grid-column: auto; }
  .form-panel { padding: 18px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .detail-header { display: block; }
  .detail-header .toolbar-actions { margin-top: 16px; overflow-x: auto; }
  .document, .review-card, .summary-main, .summary-side { padding: 18px; }
  .review-columns, .insight-row { grid-template-columns: 1fr; }
  .reference-answer { grid-column: auto; }
  .bank-item { grid-template-columns: 1fr 110px; }
  .bank-item > :nth-child(3) { display: none; }
  .login-page { grid-template-columns: 1fr; }
  .login-story { min-height: 43dvh; padding: 28px 24px; }
  .login-copy h1 { font-size: 39px; }
  .login-copy p { font-size: 14px; }
  .login-steps { display: none; }
  .login-form-wrap { padding: 24px 16px; }
  .login-form { padding: 23px; }
  .login-actions { grid-template-columns: 1fr; }
  .toast { left: 16px; right: 16px; bottom: 82px; max-width: none; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
