:root {
  color-scheme: dark;
  --background: #080c15;
  --background-raised: #0b111e;
  --panel: #101827;
  --panel-raised: #131e31;
  --panel-deep: #0a111d;
  --border: #202c40;
  --border-strong: #33435d;
  --text: #f4f7fc;
  --text-soft: #ced7e5;
  --muted: #8694aa;
  --blue: #3b82f6;
  --blue-strong: #2563eb;
  --cyan: #22d3ee;
  --green: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --radius: 14px;
  --shadow: 0 18px 45px rgba(0, 0, 0, .24);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  font-size: 15px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--background); scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 12% -20%, rgba(37, 99, 235, .17), transparent 34rem),
    radial-gradient(circle at 95% 8%, rgba(14, 165, 233, .08), transparent 30rem),
    var(--background);
  color: var(--text);
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: .13;
  background-image: linear-gradient(rgba(148, 163, 184, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, .07) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { outline-offset: 3px; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
a { color: var(--blue); }
::selection { color: white; background: var(--blue-strong); }
:focus-visible { outline: 2px solid #60a5fa; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 {
  max-width: 920px;
  margin-bottom: 15px;
  font-size: clamp(30px, 3.2vw, 48px);
  font-weight: 735;
  line-height: 1.18;
  letter-spacing: -.035em;
}
h2 { font-size: 21px; line-height: 1.42; letter-spacing: -.02em; }
h3 { font-size: 15px; line-height: 1.5; }
h4 { line-height: 1.55; }
p { line-height: 1.76; }
.muted, small { color: var(--muted); }
small { line-height: 1.62; }

.app-shell { min-height: 100vh; }
.application-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 22px;
  min-height: 70px;
  padding: 10px 22px;
  border-bottom: 1px solid rgba(51, 65, 85, .72);
  background: rgba(8, 12, 21, .88);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .12);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 235px;
  color: white;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid rgba(147, 197, 253, .38);
  border-radius: 11px;
  background: linear-gradient(145deg, #2563eb, #4f46e5 58%, #0891b2);
  box-shadow: 0 10px 28px rgba(37, 99, 235, .24), inset 0 1px rgba(255, 255, 255, .25);
  color: white;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 19px;
  font-weight: 800;
}
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 15px; letter-spacing: -.02em; }
.brand-copy em { color: #60a5fa; font-style: normal; }
.brand-copy small {
  color: #71819a;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .12em;
}
.nav-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid rgba(51, 65, 85, .58);
  border-radius: 11px;
  background: rgba(15, 23, 42, .72);
  scrollbar-width: none;
}
.nav-group::-webkit-scrollbar { display: none; }
.nav-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #8492a7;
  font-size: 10px;
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease;
}
.nav-button:hover { color: #dbe6f5; background: #182237; }
.nav-button.active {
  border-color: rgba(96, 165, 250, .35);
  background: linear-gradient(135deg, #2563eb, #3156ce);
  color: white;
  box-shadow: 0 7px 20px rgba(37, 99, 235, .22);
}
.nav-label { display: flex; align-items: center; gap: 7px; padding: 7px 9px; white-space: nowrap; }
.nav-index {
  color: #5f7089;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8px;
  font-weight: 700;
}
.nav-button.active .nav-index { color: #bfdbfe; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.model-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #77869b;
  font-size: 10px;
  white-space: nowrap;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 0 4px rgba(100, 116, 139, .09);
}
.model-state.available { color: #a7f3d0; }
.model-state.available .status-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(52, 211, 153, .09), 0 0 13px rgba(52, 211, 153, .5); }

.workspace { min-width: 0; }
main { width: 100%; max-width: 1380px; min-height: calc(100vh - 132px); margin: 0 auto; padding: 34px 28px 62px; }
footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px max(28px, calc((100vw - 1380px) / 2 + 28px));
  border-top: 1px solid var(--border);
  color: #637188;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
}
.loading-message { padding: 42px 0; color: var(--muted); }
.eyebrow, .step-number, .dialog-kicker {
  margin-bottom: 10px;
  color: #60a5fa;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(285px, .75fr);
  gap: 28px;
  margin-bottom: 22px;
  padding: 34px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: linear-gradient(145deg, rgba(19, 30, 49, .97), rgba(11, 17, 30, .96));
  box-shadow: var(--shadow);
}
.hero::before {
  position: absolute;
  top: -265px;
  right: 22%;
  width: 370px;
  height: 370px;
  border: 1px solid rgba(59, 130, 246, .17);
  border-radius: 50%;
  box-shadow: 0 0 95px rgba(37, 99, 235, .16);
  content: "";
}
.hero-copy { position: relative; z-index: 1; max-width: 770px; }
.hero-copy h1 { white-space: pre-line; }
.hero-copy p { max-width: 720px; }
.hero-aside {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 23px;
  border: 1px solid rgba(59, 130, 246, .17);
  border-radius: 14px;
  background:
    linear-gradient(rgba(59, 130, 246, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, .028) 1px, transparent 1px),
    rgba(9, 17, 31, .92);
  background-size: 20px 20px;
}
.hero-aside h3 { margin-bottom: 13px; color: #e4ebf6; }
.hero-aside p { margin: 0; color: #a6b4c7; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.hero-aside small { margin-top: 11px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 10px; }

.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 14px 0 19px; }
.button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid #3578e5;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--blue), var(--blue-strong));
  color: white;
  box-shadow: 0 8px 24px rgba(37, 99, 235, .16);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, filter .16s ease, background .16s ease;
}
.button:hover { filter: brightness(1.1); transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.secondary { border-color: var(--border-strong); background: rgba(15, 23, 42, .92); color: #d6e0ef; box-shadow: none; }
.button.secondary:hover { border-color: #4d6282; background: #172238; }
.button.quiet { min-height: auto; padding: 5px 0; border-color: transparent; background: transparent; color: #60a5fa; box-shadow: none; }
.button.danger { border-color: #be425c; background: #9f2944; }
.button.small { min-height: 33px; padding: 6px 10px; font-size: 10px; }

.card {
  min-width: 0;
  padding: 21px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(17, 27, 44, .97), rgba(13, 21, 35, .98));
  box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
}
.card p { margin-bottom: 11px; color: var(--muted); font-size: 12px; }
.card small { display: block; }
.card.interactive { cursor: pointer; transition: transform .16s ease, border-color .16s ease; }
.card.interactive:hover { border-color: rgba(96, 165, 250, .45); transform: translateY(-2px); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card-foot { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; line-height: 1.65; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 28px 0 15px; }
.section-head h2 { margin: 0; }
.tag, .badge, .status-pill {
  display: inline-flex;
  align-items: center;
  margin-right: 5px;
  padding: 4px 8px;
  border: 1px solid rgba(96, 165, 250, .22);
  border-radius: 6px;
  background: rgba(37, 99, 235, .1);
  color: #93c5fd;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
}
.tag.neutral { border-color: var(--border); background: #172135; color: #94a3b8; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; align-items: start; }
.review-grid { display: grid; grid-template-columns: 1.3fr .95fr; gap: 15px; align-items: start; }
.body-grid { display: grid; gap: 15px; }
.field { display: grid; gap: 8px; margin-bottom: 15px; color: var(--text-soft); font-size: 11px; }
.field > span { font-weight: 650; }
.field small { font-weight: 400; }
input:not([type="range"]):not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #09111f;
  color: var(--text);
  caret-color: #60a5fa;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input::placeholder, textarea::placeholder { color: #526078; }
input:focus, select:focus, textarea:focus { border-color: #3e72bb; box-shadow: 0 0 0 3px rgba(59, 130, 246, .09); background: #0b1423; }
select { color-scheme: dark; }
textarea { min-height: 108px; resize: vertical; line-height: 1.72; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--blue); }
input[type="file"] { padding: 5px; color: #8d9bb0; }
input[type="file"]::file-selector-button { margin-right: 10px; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: #172238; color: #d6e0ef; cursor: pointer; }
input[type="file"]::-webkit-file-upload-button { margin-right: 10px; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: #172238; color: #d6e0ef; cursor: pointer; }
.workspace-text { width: 100%; min-height: 430px; resize: vertical; font-family: inherit; font-size: 12px; line-height: 1.76; }
.jd-text { min-height: 245px; }
.row-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.requirement-row { display: grid; grid-template-columns: 1fr 110px 54px; gap: 9px; margin: 8px 0; }
.requirement-row textarea { min-height: 60px; line-height: 1.62; }
.choice, .question-option { display: flex; align-items: flex-start; gap: 9px; margin: 13px 0; color: #b3c0d1; font-size: 11px; line-height: 1.68; }
.choice input, .question-option input { flex: 0 0 auto; margin-top: 4px; }

.notice {
  margin: 11px 0;
  padding: 12px 14px;
  border: 1px solid rgba(59, 130, 246, .22);
  border-radius: 9px;
  background: rgba(37, 99, 235, .075);
  color: #b8c7dc;
  font-size: 11px;
  line-height: 1.72;
  white-space: pre-line;
}
.notice.error { border-color: rgba(251, 113, 133, .32); background: rgba(159, 18, 57, .12); color: #fda4af; }
.notice.warning { border-color: rgba(251, 191, 36, .29); background: rgba(146, 64, 14, .11); color: #f7d78a; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(195px, 1fr)); gap: 11px; margin: 14px 0; }
.metric { position: relative; min-width: 0; padding: 16px; overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: rgba(10, 17, 29, .94); }
.metric::before { position: absolute; inset: 0 auto 0 0; width: 2px; background: linear-gradient(var(--blue), var(--cyan)); content: ""; }
.metric-label { min-height: 20px; margin-bottom: 6px; color: #8493a9; font-size: 10px; }
.metric-value { color: white; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 24px; font-weight: 730; font-variant-numeric: tabular-nums; }
.metric details { margin-top: 10px; }
.metric-progress { height: 5px; margin: 12px 0 8px; overflow: hidden; border-radius: 999px; background: #070e1a; }
.metric-progress span { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.issue { padding: 15px 0; border-bottom: 1px solid var(--border); }
.issue:last-child { border-bottom: 0; }
.issue h3 { margin: 8px 0; }
.issue p { margin-bottom: 7px; }
.evidence-quote { margin: 10px 0; padding: 11px 14px; border: 1px solid rgba(51, 65, 85, .55); border-left: 3px solid #334155; border-radius: 0 7px 7px 0; background: #0a111e; color: #aebbd0; font-family: ui-monospace, SFMono-Regular, Consolas, "Microsoft YaHei", monospace; font-size: 10px; line-height: 1.78; white-space: pre-wrap; overflow-wrap: anywhere; }
.status-pill.gap, .priority-high { border-color: rgba(251, 113, 133, .25); background: rgba(159, 18, 57, .13); color: #fda4af; }
.status-pill.evidence_found { border-color: rgba(52, 211, 153, .22); background: rgba(5, 150, 105, .11); color: #86efac; }
.status-pill.mention_only, .status-pill.partial, .status-pill.needs_human_review, .priority-medium { border-color: rgba(251, 191, 36, .24); background: rgba(146, 64, 14, .11); color: #f5d78c; }
.priority-low { border-color: rgba(96, 165, 250, .22); background: rgba(37, 99, 235, .1); color: #93c5fd; }
.skill-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.skill-row:last-child { border-bottom: 0; }
.diff-block { margin: 8px 0; padding: 11px 14px; border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Consolas, "Microsoft YaHei", monospace; font-size: 10px; line-height: 1.78; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-block.removed { border-left: 3px solid var(--rose); background: rgba(159, 18, 57, .13); color: #fecdd3; }
.diff-block.added { border-left: 3px solid var(--green); background: rgba(5, 150, 105, .11); color: #bbf7d0; }
.diff-block.same { background: #0b1321; color: #73829a; }
.editor-panel textarea { min-height: 590px; }
.preview-json { max-height: 370px; overflow: auto; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: #070e19; color: #a9c2e6; }
.privacy-line { color: var(--muted); font-size: 10px; line-height: 1.75; }
.version-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 9px 0; padding: 15px; border: 1px solid var(--border); border-radius: 9px; background: #0b1422; }
.actions-bottom { margin-top: 17px; padding: 15px 18px; border: 1px solid var(--border); border-radius: 12px; background: rgba(15, 24, 39, .94); box-shadow: var(--shadow); }
.learning-block { margin-top: 15px; }
.empty { padding: 38px 18px; text-align: center; color: var(--muted); }
.plain-list { padding-left: 19px; color: #aebbd0; font-size: 11px; line-height: 1.83; }
.inline-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.rule { margin: 17px 0; border: 0; border-top: 1px solid var(--border); }
details { margin-top: 7px; }
summary { cursor: pointer; color: #d5dfed; font-size: 11px; font-weight: 630; line-height: 1.65; }
details p { margin-top: 8px; }
pre { overflow-wrap: anywhere; white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; line-height: 1.76; }

dialog {
  width: min(520px, calc(100vw - 30px));
  padding: 24px;
  border: 1px solid var(--border-strong);
  border-radius: 15px;
  background: var(--panel-raised);
  color: var(--text);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .6);
}
dialog::backdrop { background: rgba(2, 6, 23, .78); backdrop-filter: blur(5px); }
dialog input { margin: 8px 0; }
#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: min(430px, calc(100vw - 32px));
  padding: 13px 17px;
  border: 1px solid #34435a;
  border-radius: 10px;
  background: rgba(17, 24, 39, .97);
  color: #e8eef8;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .4);
  font-size: 11px;
  line-height: 1.65;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}
#toast.visible { opacity: 1; transform: translateY(0); }
.skip { position: fixed; top: -60px; left: 12px; z-index: 200; padding: 10px 14px; border-radius: 7px; background: white; color: #111827; }
.skip:focus { top: 12px; }

@media (max-width: 1180px) {
  .application-header { grid-template-columns: 1fr max-content; gap: 9px 18px; padding: 10px 18px 9px; }
  .nav-group { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .brand { min-width: 0; }
  main { padding-top: 28px; }
}

@media (max-width: 860px) {
  main { padding: 24px 16px 48px; }
  .hero { grid-template-columns: 1fr; padding: 25px; }
  .hero-aside { display: none; }
  .split, .review-grid { grid-template-columns: 1fr; }
  .editor-panel textarea { min-height: 440px; }
  .workspace-text { min-height: 350px; }
  .requirement-row { grid-template-columns: 1fr 94px 49px; }
}

@media (max-width: 560px) {
  .application-header { gap: 8px 10px; padding: 9px 10px 8px; }
  .brand-mark { width: 33px; height: 33px; flex-basis: 33px; border-radius: 9px; }
  .brand-copy small { display: none; }
  .brand-copy strong { font-size: 14px; }
  .model-state { display: none; }
  .nav-group { margin-inline: -2px; }
  .nav-label { padding: 6px 8px; }
  .nav-index { display: none; }
  main { padding: 22px 10px 42px; }
  footer { flex-direction: column; padding: 17px 12px; }
  h1 { font-size: clamp(27px, 9vw, 37px); }
  .hero { padding: 21px; border-radius: 15px; }
  .metric-grid { grid-template-columns: 1fr; }
  .toolbar .button { flex-grow: 1; }
  .version-card { align-items: flex-start; flex-direction: column; }
  .requirement-row { grid-template-columns: 1fr 88px; }
  .requirement-row .button { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
