:root {
  --ink: #12151c;
  --ink-soft: #353b48;
  --muted: #687083;
  --paper: #fffefa;
  --canvas: #f7f3eb;
  --blue: #2457d6;
  --blue-dark: #173da4;
  --blue-pale: #eaf0ff;
  --red: #c9151e;
  --red-dark: #921018;
  --red-pale: #fff0ed;
  --yellow: #f2d768;
  --yellow-pale: #fff9dd;
  --line: #cfd3dc;
  --line-dark: #9aa2b1;
  --success: #18785f;
  --shadow: 0 24px 70px rgba(26, 39, 72, .11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(18, 21, 28, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 21, 28, .025) 1px, transparent 1px),
    var(--canvas);
  background-size: 48px 48px;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(36, 87, 214, .28);
  outline-offset: 3px;
}

.institution-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}
.institution-wordmark img { width: 46px; height: 46px; object-fit: contain; }
.institution-wordmark span { display: grid; gap: 3px; }
.institution-wordmark strong { font-size: 15px; letter-spacing: .02em; }
.institution-wordmark small { color: var(--muted); font-size: 10px; letter-spacing: .12em; }

.site-header {
  height: 84px;
  padding: 0 clamp(20px, 4.5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(18, 21, 28, .16);
  background: rgba(255, 254, 250, .94);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
}
.brand-cluster { display: flex; align-items: center; gap: 22px; }
.product-wordmark {
  border-left: 1px solid var(--line);
  padding-left: 22px;
  display: grid;
  color: var(--ink);
  text-decoration: none;
}
.product-wordmark strong { color: var(--blue); font-size: 18px; letter-spacing: .08em; }
.product-wordmark small { margin-top: 2px; color: var(--ink-soft); font-size: 8px; font-weight: 750; letter-spacing: .18em; }
.header-actions { display: flex; align-items: center; gap: 20px; }
.header-actions form { margin: 0; }
.contact-link { color: var(--ink-soft); text-decoration: none; font-size: 11px; }
.contact-link span { color: var(--blue); font: 800 9px ui-monospace, monospace; letter-spacing: .12em; margin-right: 7px; }
.contact-link:hover { color: var(--blue); }
.service-pill { display: inline-flex; align-items: center; gap: 8px; color: var(--success); font-size: 12px; font-weight: 750; }
.service-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(24, 120, 95, .12); }
.service-pill.loading { color: #9a7100; }
.service-pill.error { color: var(--red); }
.text-button { border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; padding: 7px 0 7px 18px; }
.text-button:hover { color: var(--red); }

main { width: min(1420px, calc(100% - 48px)); margin: 0 auto; }
.hero {
  min-height: 390px;
  display: grid;
  grid-template-columns: 1.18fr .82fr;
  gap: clamp(52px, 8vw, 124px);
  align-items: end;
  padding: 76px 3% 66px;
  position: relative;
}
.hero::before {
  content: "";
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--yellow);
  position: absolute;
  right: 4%;
  top: 55px;
  box-shadow: -44px 42px 0 -22px var(--red);
}
.eyebrow, .step-label {
  color: var(--blue);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .18em;
  margin: 0 0 15px;
}
.hero h1 { font-size: clamp(54px, 6vw, 88px); line-height: .98; letter-spacing: -.065em; margin: 0; }
.hero h1 em { color: var(--red); font-style: normal; }
.hero-copy-wrap { align-self: end; margin-bottom: 4px; position: relative; z-index: 1; }
.hero-number { color: var(--red); font: 800 10px ui-monospace, monospace; letter-spacing: .14em; }
.hero-copy { margin: 20px 0 28px; color: var(--ink-soft); font-size: 17px; line-height: 1.85; max-width: 560px; }
.hero-copy strong { color: var(--blue); font-size: .92em; }
.hero-spectrum { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; color: var(--muted); font: 750 9px ui-monospace, monospace; letter-spacing: .12em; }
.hero-spectrum i { height: 4px; background: linear-gradient(90deg, var(--blue) 0 49%, var(--yellow) 49% 68%, var(--red) 68%); }

.workspace {
  background: var(--paper);
  border: 1px solid rgba(18, 21, 28, .34);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.mode-tabs { height: 76px; display: flex; border-bottom: 1px solid var(--line); background: #fff; }
.mode-tab { position: relative; min-width: 220px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-weight: 780; }
.mode-tab span { color: var(--red); font: 750 10px ui-monospace, monospace; margin-right: 16px; }
.mode-tab.active { color: white; background: var(--blue); }
.mode-tab.active span { color: var(--yellow); }
.mode-tab:not(.active):hover { background: var(--blue-pale); color: var(--blue-dark); }
.mode-panel { display: none; padding: clamp(24px, 4vw, 58px); }
.mode-panel.active { display: block; }

.input-card { border: 1px solid var(--line-dark); border-radius: 18px; overflow: hidden; background: white; }
.card-heading { padding: 28px 32px 22px; display: flex; align-items: flex-start; justify-content: space-between; }
.card-heading h2, .upload-card h2 { font-size: 28px; margin: 0; letter-spacing: -.03em; }
.card-heading .step-label, .upload-card .step-label { margin-bottom: 8px; }
#text-count { color: var(--blue); border: 1px solid var(--line); background: var(--blue-pale); border-radius: 999px; padding: 7px 11px; font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
#text-count.below-minimum { color: var(--red); background: var(--red-pale); border-color: #efb8b2; }
textarea { display: block; width: 100%; min-height: 330px; resize: vertical; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 30px 32px; color: var(--ink); background: #fff; font-size: 17px; line-height: 1.9; outline: none; }
textarea:focus { box-shadow: inset 4px 0 var(--blue); background: #fffefb; }
textarea::placeholder { color: #9aa1ad; }

.input-requirements { display: grid; grid-template-columns: .55fr 1fr 1.35fr; border-bottom: 1px solid var(--line); background: var(--yellow-pale); }
.input-requirements > * { padding: 24px 26px; }
.requirements-title { background: var(--yellow); display: flex; flex-direction: column; justify-content: space-between; min-height: 150px; }
.requirements-title span { color: rgba(18, 21, 28, .68); font: 800 9px ui-monospace, monospace; letter-spacing: .15em; }
.requirements-title strong { font-size: 20px; letter-spacing: -.02em; }
.input-requirements article { border-left: 1px solid rgba(18, 21, 28, .15); display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-content: start; }
.input-requirements article b { color: var(--red); font: 850 10px ui-monospace, monospace; padding-top: 3px; }
.input-requirements article p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.8; }
.input-requirements article strong { color: var(--red-dark); }
.input-footer { min-height: 88px; padding: 18px 22px 18px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.input-footer p { color: var(--muted); font-size: 12px; margin: 0; }
.primary-button { border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: white; padding: 14px 22px; cursor: pointer; font-weight: 750; transition: transform .2s, background .2s, box-shadow .2s; }
.primary-button span { color: var(--yellow); margin-left: 18px; }
.primary-button:hover { background: var(--blue); border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 8px 0 rgba(36, 87, 214, .14); }
.primary-button:disabled { cursor: wait; opacity: .55; transform: none; box-shadow: none; }
.primary-button.wide { width: 100%; margin-top: 20px; }

.progress-card { margin-top: 24px; border: 1px solid #aabcf0; background: var(--blue-pale); border-radius: 16px; padding: 22px 26px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--blue-dark); }
.progress-meta strong { font-variant-numeric: tabular-nums; }
.progress-track { height: 7px; background: white; border: 1px solid #c3d0f4; overflow: hidden; margin: 13px 0 11px; }
.progress-track i { display: block; width: 0; height: 100%; background: var(--blue); transition: width .35s; }
.progress-card > p { margin: 0; color: var(--muted); font-size: 12px; }

.result-card { margin-top: 24px; border: 1px solid var(--ink); border-radius: 18px; background: white; color: var(--ink); padding: clamp(28px, 4vw, 50px); overflow: hidden; position: relative; box-shadow: 9px 9px 0 var(--yellow); }
.result-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 7px; background: var(--red); }
.result-kicker { color: var(--blue); font-size: 10px; font-weight: 850; letter-spacing: .18em; }
.result-main { margin-top: 26px; display: grid; grid-template-columns: 1fr 180px; align-items: center; gap: 30px; }
.result-main p { color: var(--muted); margin: 0 0 8px; font-size: 12px; }
.result-main h2 { margin: 0; font-size: clamp(30px, 4vw, 50px); letter-spacing: -.045em; max-width: 720px; }
.confidence-ring { width: 156px; height: 156px; border-radius: 50%; background: conic-gradient(var(--blue) 0deg, #e5e8ee 0deg); padding: 10px; justify-self: end; }
.confidence-ring > div { width: 100%; height: 100%; border-radius: 50%; background: white; border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.confidence-ring strong { color: var(--blue-dark); font-size: 28px; font-variant-numeric: tabular-nums; }
.confidence-ring span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.warning-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.warning-chip { display: inline-flex; padding: 8px 11px; border: 1px solid #efb8b2; background: var(--red-pale); color: var(--red-dark); font-size: 11px; }
.success-chip { border-color: #a9d6c9; background: #edf8f4; color: var(--success); }
.result-details { border-top: 1px solid var(--line); margin-top: 34px; padding-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.result-details div { display: flex; flex-direction: column; gap: 6px; }
.result-details span { color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.result-details strong { font-size: 15px; font-variant-numeric: tabular-nums; }

.batch-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 24px; }
.upload-card, .format-card { border: 1px solid var(--line-dark); border-radius: 18px; padding: 32px; }
.batch-intro { color: var(--ink-soft); line-height: 1.8; font-size: 13px; max-width: 760px; }
.batch-intro code { color: var(--red-dark); background: var(--red-pale); padding: 2px 6px; }
.drop-zone { min-height: 246px; margin-top: 24px; border: 1.5px dashed #8da6e5; background: var(--blue-pale); border-radius: 14px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: background .2s, border .2s, transform .2s; }
.drop-zone:hover, .drop-zone.dragging { background: #dce7ff; border-color: var(--blue); transform: translateY(-2px); }
.drop-zone input { display: none; }
.upload-icon { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--ink); border-radius: 50%; background: white; color: var(--blue); font-size: 23px; margin-bottom: 14px; }
.drop-zone strong { font-size: 16px; }
.drop-zone small { margin-top: 7px; color: var(--muted); }
.format-card { background: var(--yellow); color: var(--ink); position: relative; overflow: hidden; }
.format-card::after { content: "CSV"; position: absolute; right: -12px; bottom: -40px; color: rgba(18, 21, 28, .07); font-size: 112px; font-weight: 950; letter-spacing: -.08em; }
.format-card .step-label { color: var(--red-dark); }
.format-card h3 { font-size: 24px; margin: 0 0 28px; letter-spacing: -.025em; }
.schema-row { border-top: 1px solid rgba(18, 21, 28, .26); padding: 19px 0; display: flex; flex-direction: column; gap: 9px; position: relative; z-index: 1; }
.schema-row > span { color: var(--red-dark); font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.schema-row p { margin: 0; display: grid; grid-template-columns: 74px 1fr; align-items: baseline; gap: 8px; }
.schema-row p b { color: var(--ink-soft); font-size: 11px; }
.schema-row code { color: var(--ink); line-height: 1.65; white-space: normal; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.example-links { margin-top: 30px; display: grid; gap: 8px; position: relative; z-index: 1; }
.example-links a { display: flex; justify-content: space-between; color: var(--blue-dark); text-decoration: none; padding: 12px 0; border-bottom: 1px solid rgba(18, 21, 28, .28); font-size: 12px; font-weight: 750; }
.example-links a:hover { color: var(--red-dark); }
.download-button { display: inline-flex; justify-content: space-between; min-width: 210px; margin-top: 20px; padding: 13px 18px; border-radius: 999px; color: white; background: var(--blue); text-decoration: none; font-weight: 750; font-size: 12px; }

.method-strip { margin: 48px 0 68px; display: grid; grid-template-columns: .55fr .7fr 2fr; border: 1px solid rgba(18, 21, 28, .32); background: white; }
.method-strip > * { padding: 27px 28px; }
.method-stat { display: flex; align-items: center; gap: 16px; border-right: 1px solid var(--line); }
.method-stat span { color: var(--red); font-size: 27px; font-weight: 900; letter-spacing: -.04em; white-space: nowrap; }
.method-stat span small { font-size: 12px; margin-left: 2px; }
.method-strip p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.method-note { background: var(--blue-pale); line-height: 1.9 !important; }

footer { width: min(1420px, calc(100% - 48px)); margin: 0 auto; padding: 0 0 42px; display: flex; justify-content: space-between; align-items: end; color: var(--muted); font-size: 9px; letter-spacing: .13em; }
footer div { display: grid; gap: 5px; }
footer span { color: var(--ink); font-weight: 850; }
footer p { margin: 0; }
footer a { color: var(--blue); text-decoration: none; letter-spacing: .04em; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--red); color: white; padding: 13px 20px; border-radius: 999px; box-shadow: var(--shadow); transition: .2s; z-index: 50; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.hidden { display: none !important; }

.login-body {
  min-height: 100vh;
  background:
    linear-gradient(rgba(18, 21, 28, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 21, 28, .035) 1px, transparent 1px),
    var(--canvas);
  background-size: 52px 52px;
  padding: 0;
}
.login-body::before { content: ""; position: fixed; width: 260px; height: 260px; border-radius: 50%; background: var(--yellow); left: -118px; bottom: -118px; pointer-events: none; }
.login-body::after { content: ""; position: fixed; width: 150px; height: 150px; background: var(--blue); right: -64px; top: 140px; transform: rotate(14deg); pointer-events: none; }
.login-institution { height: 92px; padding: 0 clamp(24px, 5vw, 78px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(18, 21, 28, .18); background: rgba(255, 254, 250, .93); position: relative; z-index: 2; }
.login-institution .institution-wordmark img { width: 52px; height: 52px; }
.login-product { display: flex; align-items: baseline; gap: 12px; }
.login-product strong { color: var(--blue); font-size: 19px; letter-spacing: .08em; }
.login-product span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.login-shell { width: min(1240px, calc(100% - 56px)); min-height: calc(100vh - 92px); margin: 0 auto; display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(70px, 10vw, 150px); align-items: center; position: relative; z-index: 1; }
.login-brand { padding: 72px 0; }
.login-brand h1 { margin: 0; font-size: clamp(58px, 7vw, 98px); line-height: .98; letter-spacing: -.07em; }
.login-brand h1 em { font-style: normal; color: var(--red); }
.login-brand .eyebrow { color: var(--blue); }
.login-lead { color: var(--ink-soft); font-size: 17px; line-height: 1.9; margin: 30px 0 0; max-width: 650px; }
.login-lead strong { color: var(--blue); }
.login-coordinates { width: min(530px, 88%); margin-top: 52px; display: grid; grid-template-columns: auto 1fr auto; gap: 15px; align-items: center; color: var(--muted); font: 800 9px ui-monospace, monospace; letter-spacing: .15em; }
.login-coordinates i { display: block; height: 5px; background: linear-gradient(90deg, var(--blue) 0 50%, var(--yellow) 50% 68%, var(--red) 68%); }
.login-panel { position: relative; background: white; color: var(--ink); border: 1px solid var(--ink); border-radius: 20px; padding: 54px 46px 34px; box-shadow: 12px 12px 0 var(--yellow); overflow: hidden; }
.login-panel::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 8px; background: linear-gradient(90deg, var(--red) 0 31%, var(--yellow) 31% 48%, var(--blue) 48%); }
.login-panel-index { position: absolute; right: 25px; top: 22px; color: #e6e9ef; font-size: 82px; font-weight: 950; letter-spacing: -.08em; line-height: 1; }
.login-panel .step-label { position: relative; z-index: 1; }
.login-panel h2 { position: relative; z-index: 1; font-size: 36px; margin: 0; letter-spacing: -.045em; }
.login-panel-copy { color: var(--ink-soft); margin: 12px 0 34px; font-size: 14px; }
.login-form label { display: block; font-size: 11px; font-weight: 800; margin-bottom: 9px; }
.password-row { display: flex; border: 1px solid var(--line-dark); border-radius: 10px; overflow: hidden; background: white; }
.password-row input { min-width: 0; flex: 1; border: 0; outline: none; padding: 15px 16px; color: var(--ink); background: white; }
.password-row:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36, 87, 214, .12); }
.password-row button { border: 0; background: var(--blue); color: white; padding: 0 20px; cursor: pointer; font-weight: 750; }
.password-row button:hover { background: var(--blue-dark); }
.password-row button span { color: var(--yellow); margin-left: 9px; }
.form-error { min-height: 18px; color: var(--red); font-size: 11px; margin: 10px 0 0; }
.login-panel-footer { border-top: 1px solid var(--line); margin-top: 34px; padding-top: 20px; display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 9px; letter-spacing: .04em; }
.login-panel-footer a { color: var(--blue); text-decoration: none; }

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

@media (max-width: 1080px) {
  .contact-link { display: none; }
  .input-requirements { grid-template-columns: 1fr 1fr; }
  .requirements-title { grid-column: 1 / -1; min-height: auto; flex-direction: row; align-items: center; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 32px; min-height: auto; padding: 66px 0 52px; }
  .hero::before { width: 54px; height: 54px; top: 40px; }
  .hero-copy { max-width: 720px; }
  .batch-grid, .login-shell { grid-template-columns: 1fr; }
  .login-shell { max-width: 620px; min-height: auto; padding: 64px 0 80px; gap: 42px; }
  .login-brand { padding: 0; }
  .method-strip { grid-template-columns: 1fr 1fr; }
  .method-note { grid-column: 1 / -1; border-top: 1px solid var(--line); }
}

@media (max-width: 700px) {
  main, footer { width: min(100% - 24px, 1420px); }
  .site-header { height: 72px; padding: 0 14px; }
  .institution-wordmark img { width: 39px; height: 39px; }
  .institution-wordmark strong { font-size: 12px; }
  .institution-wordmark small { font-size: 8px; }
  .product-wordmark { display: none; }
  .service-pill span { display: none; }
  .header-actions { gap: 12px; }
  .text-button { padding-left: 12px; }
  .hero h1 { font-size: 50px; }
  .hero-copy { font-size: 15px; }
  .mode-tab { min-width: 50%; }
  .mode-panel { padding: 14px; }
  .card-heading, .upload-card, .format-card { padding: 23px 19px; }
  textarea { min-height: 300px; padding: 23px 19px; }
  .input-requirements { grid-template-columns: 1fr; }
  .requirements-title { grid-column: auto; }
  .input-requirements article { border-left: 0; border-top: 1px solid rgba(18, 21, 28, .15); }
  .input-footer { align-items: stretch; flex-direction: column; padding: 18px 19px; }
  .primary-button { width: 100%; }
  .result-main { grid-template-columns: 1fr; }
  .confidence-ring { justify-self: start; }
  .result-details { grid-template-columns: 1fr; }
  .method-strip { grid-template-columns: 1fr; }
  .method-stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .method-note { grid-column: auto; }
  footer { flex-direction: column; align-items: flex-start; gap: 12px; }
  .login-institution { height: 80px; padding: 0 16px; }
  .login-institution .institution-wordmark img { width: 44px; height: 44px; }
  .login-product span { display: none; }
  .login-shell { width: min(100% - 28px, 620px); padding: 54px 0 70px; }
  .login-brand h1 { font-size: 54px; }
  .login-lead { font-size: 15px; }
  .login-panel { padding: 46px 24px 28px; box-shadow: 7px 7px 0 var(--yellow); }
  .login-panel-footer { flex-direction: column; }
}
