:root {
  --ink: #0d1726;
  --navy: #102b49;
  --blue: #246aa2;
  --cyan: #67d9df;
  --amber: #ffb457;
  --paper: #f6f8fb;
  --white: #ffffff;
  --muted: #708092;
  --line: #dbe3eb;
  --success: #238a78;
  --danger: #bd4242;
  --shadow: 0 24px 70px rgba(12, 35, 61, .12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 320px; background: var(--paper); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, #0c243e 0 470px, transparent 470px),
    var(--paper);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { cursor: pointer; }

.ambient {
  position: absolute;
  inset: 0 0 auto;
  height: 470px;
  pointer-events: none;
  overflow: hidden;
}

.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}

.ambient::before {
  width: 540px;
  height: 540px;
  right: -170px;
  top: -260px;
  background: radial-gradient(circle, rgba(103, 217, 223, .22), transparent 69%);
}

.ambient::after {
  width: 700px;
  height: 250px;
  left: 35%;
  top: 180px;
  transform: rotate(-8deg);
  border: 1px solid rgba(122, 223, 229, .13);
}

.shell { position: relative; width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.masthead {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--white);
}

.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand > span:last-child { display: grid; line-height: 1; gap: 5px; }
.brand b { font: 700 16px/1.3 "Segoe UI", "Microsoft YaHei", sans-serif; letter-spacing: .02em; }
.brand small { color: #a8bfd2; font-size: 11px; letter-spacing: .16em; }

.brand-mark { position: relative; width: 36px; height: 36px; display: block; }
.brand-mark i { position: absolute; left: 4px; width: 28px; height: 7px; border-radius: 8px; transform: rotate(-27deg); background: var(--cyan); }
.brand-mark i:nth-child(1) { top: 6px; width: 18px; }
.brand-mark i:nth-child(2) { top: 15px; left: 8px; }
.brand-mark i:nth-child(3) { top: 24px; left: 16px; width: 16px; background: var(--amber); }

.system-state { color: #c1d0dd; font-size: 12px; letter-spacing: .04em; }
.system-state span { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #70e4b2; box-shadow: 0 0 0 5px rgba(112, 228, 178, .09); }

.hero {
  min-height: 342px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 64px;
  align-items: center;
  color: var(--white);
  padding: 26px 0 60px;
}

.eyebrow { margin: 0 0 13px; color: var(--cyan); font: 700 10px/1 "Trebuchet MS", sans-serif; letter-spacing: .23em; }
.hero h1 { margin: 0; max-width: 650px; font: 700 clamp(38px, 5vw, 62px)/1.05 "Trebuchet MS", "Microsoft YaHei", sans-serif; letter-spacing: -.035em; }
.hero h1 span { white-space: nowrap; }
.lead { max-width: 610px; margin: 24px 0 0; color: #c4d2df; font-size: 15px; line-height: 1.8; }

.route-card {
  min-height: 254px;
  padding: 12px 18px 16px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 26px 8px 26px 8px;
  background: linear-gradient(135deg, rgba(255,255,255,.065), rgba(255,255,255,.018));
  box-shadow: inset 0 1px rgba(255,255,255,.06);
}
.route-card svg { width: 100%; height: 190px; overflow: visible; }
.route-shadow { fill: none; stroke: rgba(0,0,0,.17); stroke-width: 10; transform: translateY(4px); }
.route-line { fill: none; stroke: var(--cyan); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 7 10; animation: packets 9s linear infinite; }
.node circle { fill: #123759; stroke: rgba(255,255,255,.3); stroke-width: 2; }
.node text { fill: white; text-anchor: middle; font: 700 16px "Trebuchet MS", sans-serif; }
.node.map circle { fill: var(--amber); stroke: #ffd7a5; }
.node.map path { fill: none; stroke: #102b49; stroke-width: 3; stroke-linecap: round; }
.route-label { fill: #a9bfd1; font: 12px "Segoe UI", sans-serif; }
.route-meta { display: flex; gap: 7px; flex-wrap: wrap; }
.route-meta span { padding: 7px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; color: #c7d6e1; font-size: 11px; }

@keyframes packets { to { stroke-dashoffset: -170; } }

.workspace { margin: 0 0 60px; border-radius: 24px; background: var(--white); box-shadow: var(--shadow); overflow: hidden; }
.section-heading { min-height: 112px; padding: 28px 34px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.section-heading .eyebrow { color: var(--blue); margin-bottom: 9px; }
.section-heading h2 { margin: 0; font: 700 25px/1.1 "Trebuchet MS", "Microsoft YaHei", sans-serif; }

.steps { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; }
.steps li { position: relative; color: #99a5b1; font-size: 12px; letter-spacing: .08em; }
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 9px; right: -19px; width: 10px; height: 1px; background: #cdd5dc; }
.steps b { display: block; color: #b5bec7; font: 700 9px/1 "Trebuchet MS", sans-serif; margin-bottom: 7px; }
.steps li.active { color: var(--navy); }
.steps li.active b { color: var(--blue); }

.work-grid { display: grid; grid-template-columns: .86fr 1.14fr .92fr; min-height: 445px; }
.panel { min-width: 0; padding: 30px; border-right: 1px solid var(--line); }
.panel:last-child { border-right: 0; }
.panel-label { margin-bottom: 22px; color: #8794a1; font: 700 10px/1 "Trebuchet MS", sans-serif; letter-spacing: .18em; text-transform: uppercase; }

.source-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: -7px 0 15px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #f1f4f7; }
.source-tab { min-height: 34px; border: 0; border-radius: 8px; color: #708092; background: transparent; font-size: 11px; font-weight: 700; transition: .16s ease; }
.source-tab:hover { color: var(--navy); }
.source-tab.active { color: var(--navy); background: white; box-shadow: 0 4px 12px rgba(16,43,73,.08); }
.source-tab:focus-visible { outline: 3px solid rgba(36,106,162,.17); outline-offset: 2px; }

.dropzone {
  min-height: 244px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 25px;
  border: 1px dashed #a8b7c5;
  border-radius: 18px 5px 18px 5px;
  background: #f8fafc;
  text-align: center;
  transition: .2s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--blue); background: #f1f8fc; transform: translateY(-1px); }
.dropzone:focus-within { outline: 3px solid rgba(36,106,162,.16); outline-offset: 3px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone strong { font-size: 15px; }
.dropzone > span:last-child { color: var(--muted); font-size: 12px; }
.upload-icon { position: relative; width: 48px; height: 48px; margin-bottom: 4px; border-radius: 50%; background: #e4f2f7; }
.upload-icon::before { content: ""; position: absolute; left: 14px; right: 14px; bottom: 12px; height: 2px; background: var(--blue); }
.upload-icon::after { content: ""; position: absolute; left: 23px; top: 12px; width: 2px; height: 19px; background: var(--blue); }
.upload-icon i::before, .upload-icon i::after { content: ""; position: absolute; top: 12px; width: 11px; height: 2px; background: var(--blue); }
.upload-icon i::before { left: 16px; transform: rotate(-45deg); }
.upload-icon i::after { right: 16px; transform: rotate(45deg); }

.file-chip { min-height: 88px; display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; }
.file-kind { flex: 0 0 auto; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 11px; color: white; background: #238468; font: 700 10px "Trebuchet MS", sans-serif; }
.file-copy { min-width: 0; display: grid; gap: 4px; flex: 1; }
.file-copy b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.file-copy small { color: var(--muted); font-size: 11px; }
.file-chip button { border: 0; color: var(--blue); background: transparent; font-size: 12px; }
.feishu-source { min-height: 244px; padding: 18px; border: 1px solid #cfe8df; border-radius: 18px 5px 18px 5px; background: linear-gradient(145deg, #f2fbf8, #fbfefd); }
.feishu-heading { display: flex; align-items: center; gap: 11px; padding-bottom: 15px; border-bottom: 1px solid #dcece6; }
.feishu-heading > div { min-width: 0; display: grid; gap: 4px; }
.feishu-heading b { font-size: 13px; }
.feishu-heading small { color: #568074; font-size: 10px; }
.feishu-mark { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px 11px 4px 11px; color: white; background: #20a675; font: 800 17px "Microsoft YaHei", sans-serif; box-shadow: 0 8px 18px rgba(32,166,117,.2); }
.feishu-url-label { display: block; margin: 15px 0 6px; color: #45675e; font-size: 10px; font-weight: 700; }
.feishu-url { width: 100%; height: 40px; padding: 0 11px; border: 1px solid #bad8ce; border-radius: 9px; color: var(--ink); background: white; font-size: 11px; outline: none; }
.feishu-url:focus { border-color: #20a675; box-shadow: 0 0 0 3px rgba(32,166,117,.12); }
.feishu-read-button { width: 100%; height: 40px; margin-top: 10px; border: 0; border-radius: 10px 4px 10px 4px; color: white; background: #16875f; font-size: 11px; font-weight: 700; }
.feishu-read-button:hover:not(:disabled) { background: #0f7651; }
.feishu-read-button:disabled { cursor: not-allowed; color: #8da79f; background: #dce9e5; }
.feishu-read-button.loading { color: white; background: #368f73; }
.feishu-help { margin: 9px 0 0; color: #6d887f; font-size: 10px; line-height: 1.5; }
.privacy-note { margin-top: 15px; color: #82909d; font-size: 11px; line-height: 1.6; }
.privacy-note span { color: var(--success); margin-right: 4px; }

.records-panel { background: #fbfcfd; }
.empty-state { height: 290px; display: grid; place-content: center; text-align: center; color: #a0abb5; }
.empty-state span { font: 700 18px "Trebuchet MS", "Microsoft YaHei", sans-serif; }
.empty-state p { margin: 8px 0 0; font-size: 12px; }
.records-head { display: flex; justify-content: space-between; align-items: start; gap: 15px; margin-bottom: 15px; }
.records-head h3 { margin: 0 0 5px; font-size: 16px; }
.records-head p { margin: 0; color: var(--muted); font-size: 11px; }
.records-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.selection-count { color: var(--muted); font-size: 10px; white-space: nowrap; }
.select-all-button { padding: 6px 9px; border: 1px solid #b9cbd8; border-radius: 999px; color: var(--blue); background: white; font-size: 10px; }
.select-all-button:hover:not(:disabled) { border-color: var(--blue); background: #f2f8fc; }
.select-all-button:disabled { cursor: not-allowed; opacity: .55; }
.schema-ok { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; color: #1d7b68; background: #e7f6f1; font-size: 10px; }
.record-list { max-height: 290px; overflow: auto; padding-right: 4px; display: grid; gap: 8px; }
.record-option { position: relative; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; padding: 13px 12px; border: 1px solid var(--line); border-radius: 12px; background: white; cursor: pointer; transition: .16s ease; }
.record-option:hover { border-color: #9cb8ce; transform: translateX(2px); }
.record-option.selected { border-color: var(--blue); box-shadow: inset 3px 0 var(--blue); background: #f6fbfe; }
.record-option input { position: absolute; opacity: 0; pointer-events: none; }
.check-mark { position: relative; width: 18px; height: 18px; border: 1px solid #aab7c2; border-radius: 5px; background: white; transition: .16s ease; }
.record-option input:checked + .check-mark,
.selected .check-mark { border-color: var(--blue); background: var(--blue); }
.record-option input:checked + .check-mark::after,
.selected .check-mark::after { content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.record-option input:focus-visible + .check-mark { outline: 3px solid rgba(43, 126, 184, .2); outline-offset: 2px; }
.record-main { min-width: 0; display: grid; gap: 4px; }
.record-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.record-main small { color: var(--muted); font-size: 10px; }
.record-meta { color: #536579; font-size: 10px; text-align: right; line-height: 1.55; }

.output-blueprint { display: grid; gap: 12px; }
.output-blueprint > div { display: flex; align-items: center; gap: 13px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fafbfd; }
.format { flex: 0 0 auto; width: 42px; height: 46px; display: grid; place-items: center; border-radius: 8px 8px 4px 4px; color: white; font: 700 15px "Trebuchet MS", sans-serif; }
.format.xlsx { background: #25856b; }
.format.pdf { background: #d95c53; }
.output-blueprint p { margin: 0; display: grid; gap: 4px; }
.output-blueprint b { font-size: 13px; }
.output-blueprint small { color: var(--muted); font-size: 10px; line-height: 1.45; }

.generate-button { width: 100%; height: 50px; margin-top: 20px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border: 0; border-radius: 12px 4px 12px 4px; color: white; background: var(--navy); box-shadow: 0 10px 25px rgba(16,43,73,.18); transition: .18s ease; }
.generate-button:not(:disabled):hover { background: #174872; transform: translateY(-1px); }
.generate-button:disabled { cursor: not-allowed; color: #9ca8b3; background: #e6eaee; box-shadow: none; }
.generate-button i { font-size: 18px; font-style: normal; }
.generate-button.loading i { animation: nudge .65s ease-in-out infinite alternate; }
@keyframes nudge { to { transform: translateX(5px); } }

.export-progress { margin-top: 12px; padding: 12px 13px; border: 1px solid #cbdce8; border-radius: 11px 4px 11px 4px; background: #f4f9fc; box-shadow: inset 3px 0 #2b7eb8; }
.export-progress[hidden] { display: none; }
.progress-copy { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #36566f; font-size: 10px; line-height: 1.4; }
.progress-copy span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-copy b { flex: 0 0 auto; color: var(--navy); font: 700 11px "Trebuchet MS", sans-serif; letter-spacing: .02em; }
.progress-track { position: relative; height: 7px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: repeating-linear-gradient(90deg, #dbe7ee 0, #dbe7ee calc(10% - 1px), #edf3f6 calc(10% - 1px), #edf3f6 10%); }
.progress-track > span { position: absolute; inset: 0 auto 0 0; width: 0; min-width: 0; border-radius: inherit; background: linear-gradient(90deg, #238468, #2b7eb8); box-shadow: 0 0 12px rgba(43,126,184,.28); transition: width .28s ease; }
.progress-track > span::after { content: ""; position: absolute; top: 50%; right: 0; width: 7px; height: 7px; border: 2px solid white; border-radius: 50%; background: #2b7eb8; transform: translate(35%, -50%); box-shadow: 0 0 0 2px rgba(43,126,184,.16); }
.export-progress.complete { border-color: #badbce; background: #f1faf6; box-shadow: inset 3px 0 var(--success); }
.export-progress.complete .progress-track > span { background: var(--success); }
.export-progress.complete .progress-copy b { color: var(--success); }
.export-progress.error { border-color: #edcbc7; background: #fff7f6; box-shadow: inset 3px 0 var(--danger); }
.export-progress.error .progress-track > span { background: var(--danger); }
.export-progress.error .progress-copy b { color: var(--danger); }

.status { min-height: 22px; margin-top: 11px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.status.error { color: var(--danger); }
.status.success { color: var(--success); }
.downloads { display: grid; gap: 8px; margin-top: 8px; }
.download-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid #c7ddd8; border-radius: 10px; color: #176e5c; background: #f0faf7; text-decoration: none; font-size: 11px; }
.download-link b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.download-link span { flex: 0 0 auto; font-weight: 700; }

@media (max-width: 980px) {
  body { background: linear-gradient(180deg, #0c243e 0 610px, transparent 610px), var(--paper); }
  .hero { grid-template-columns: 1fr; gap: 28px; padding-bottom: 44px; }
  .route-card { max-width: 680px; }
  .work-grid { grid-template-columns: 1fr 1fr; }
  .action-panel { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .panel:nth-child(2) { border-right: 0; }
}

@media (max-width: 680px) {
  body { background: linear-gradient(180deg, #0c243e 0 650px, transparent 650px), var(--paper); }
  .shell { width: min(100% - 22px, 1180px); }
  .system-state { display: none; }
  .hero h1 { font-size: 39px; }
  .hero h1 span { white-space: normal; }
  .route-card { min-height: 220px; padding-inline: 8px; }
  .route-card svg { height: 170px; }
  .section-heading { align-items: start; gap: 18px; padding: 25px 20px; }
  .steps { gap: 18px; }
  .steps li { font-size: 10px; }
  .steps li:not(:last-child)::after { right: -13px; width: 7px; }
  .work-grid { display: block; }
  .panel { padding: 25px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .panel:last-child { border-bottom: 0; }
  .dropzone { min-height: 205px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
.pdf-compression-options { margin: 16px 0; padding: 14px; border: 1px solid #d9e4de; border-radius: 10px; background: #f7faf7; }
.pdf-compression-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.pdf-compression-toggle input { width: 16px; height: 16px; accent-color: #176f59; }
.pdf-target-label { display: flex; align-items: center; gap: 7px; font-size: 12px; margin: 12px 0; }
.pdf-target-label input { width: 70px; padding: 6px; border: 1px solid #ccdacf; border-radius: 5px; font: inherit; }
.pdf-compression-options small { display: block; font-size: 11px; line-height: 1.7; color: #748177; }
.source-template-download { display: flex; flex-direction: column; align-items: center; gap: 5px; margin: 0 0 14px; padding: 13px 12px; border: 1px solid #b9cfdf; border-radius: 10px; color: var(--blue); background: #f1f7fc; text-decoration: none; font-size: 13px; font-weight: 600; }
.source-template-download small { color: var(--muted); font-size: 10px; font-weight: 400; }
.source-template-download:hover { border-color: var(--blue); background: #e8f2fa; }
.source-template-download:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
