:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #172033;
  --muted: #64748b;
  --line: #e2e8f0;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #15803d;
  --green-soft: #dcfce7;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --radius: 18px;
  --shadow: 0 10px 35px rgba(15, 23, 42, 0.07);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 18px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--blue);
  color: white;
  font-size: 12px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.brand-text { font-size: 16px; }
.topnav { display: flex; gap: 16px; font-size: 14px; color: var(--muted); }
.topnav a { color: var(--muted); }

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 18px 48px;
}

.hero { padding: 20px 2px 18px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1 { margin: 0 0 10px; font-size: clamp(28px, 6vw, 44px); line-height: 1.15; letter-spacing: -0.02em; }
h2 { margin: 0 0 8px; font-size: 18px; }
.lede { max-width: 720px; margin: 0; color: var(--muted); font-size: 16px; }
.muted { color: var(--muted); }
.small-note { margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.error { color: var(--red); background: var(--red-soft); padding: 10px 12px; border-radius: 12px; font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 0 0 16px;
}

.uploader { padding: 16px; }

.dropzone {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  border: 2px dashed #b9c6e4;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff, #eef4ff);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.dropzone:hover, .dropzone.dragging {
  border-color: var(--blue);
  background: #eaf1ff;
  transform: translateY(-1px);
}
.drop-icon { font-size: 32px; color: var(--blue); line-height: 1; }
.dropzone strong { font-size: 18px; }
.dropzone .muted { font-size: 13px; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.field { margin: 16px 0 0; }
.field label { display: block; margin: 0 0 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
select, input[type="text"] {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}
select:focus, input[type="text"]:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .3);
  outline-offset: 2px;
}

.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.chip.active { border-color: var(--blue); background: #eff6ff; color: var(--blue-dark); font-weight: 700; }

.primary, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.primary {
  width: 100%;
  border-color: var(--blue);
  background: var(--blue);
  color: white;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .28);
}
.primary:hover { background: var(--blue-dark); text-decoration: none; }
.primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.button.small { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.button.danger { border-color: #fecaca; background: var(--red-soft); color: var(--red); }
.button.ghost { border-color: var(--line); color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.progress {
  width: 100%;
  height: 10px;
  margin: 12px 0 0;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e8eef8;
  appearance: none;
}
.progress::-webkit-progress-bar { background: #e8eef8; border-radius: 999px; }
.progress::-webkit-progress-value { background: var(--blue); border-radius: 999px; transition: width .25s ease; }
.progress::-moz-progress-bar { background: var(--blue); border-radius: 999px; }

.steps { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 20px 0; }
.steps article { background: transparent; padding: 8px 4px; }
.step-no {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  margin-bottom: 6px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
}
.steps h2 { font-size: 16px; margin-bottom: 4px; }
.steps p { margin: 0; color: var(--muted); font-size: 14px; }

.notice { border-color: #fde68a; background: #fffbeb; }
.notice h2 { font-size: 16px; }
.notice p { margin: 0; color: #78350f; font-size: 14px; }

.task-head { padding: 10px 2px 14px; }
.task-head h1 { font-size: clamp(22px, 5vw, 32px); word-break: break-word; }
.status-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.status-queued { background: #e0e7ff; color: #3730a3; }
.status-running { background: #dbeafe; color: #1e40af; }
.status-succeeded { background: var(--green-soft); color: var(--green); }
.status-failed { background: var(--red-soft); color: var(--red); }
.status-cancelled { background: #e2e8f0; color: #475569; }

.share-box { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.share-box label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; }

.prose h2 { margin-top: 18px; }
.prose ul { padding-left: 22px; color: var(--muted); }
.prose li { margin: 4px 0; }
.prose p { color: var(--muted); }

.footer {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  color: #94a3b8;
  font-size: 12px;
}

@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .card { padding: 24px; }
  .uploader { padding: 24px; }
  .actions { gap: 10px; }
}

/* Portal */
.topbar { flex-wrap: wrap; }
.topnav { flex-wrap: wrap; gap: 8px 14px; font-size: 13px; }
.topnav a.active { color: var(--blue-dark); font-weight: 700; }

.portal-hero { padding-bottom: 20px; }
.portal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 18px;
}
.portal-cta { width: 100%; padding-inline: 22px; text-align: center; }
.portal-cta:hover { color: white; }

.tool-section { margin: 6px 0 20px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 12px;
}
.section-head .eyebrow { margin-bottom: 4px; }
.section-head h2 { margin: 0; font-size: 22px; }

.feature-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.feature-card {
  display: flex;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.feature-card--available:hover {
  border-color: #bfd3ff;
  box-shadow: 0 14px 40px rgba(37, 99, 235, .12);
  text-decoration: none;
  transform: translateY(-1px);
}
.feature-card--primary {
  border-color: #bfd3ff;
  background: linear-gradient(135deg, #ffffff, #f4f8ff);
}
.feature-card.is-planned { opacity: .82; box-shadow: none; }
.feature-mark {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: #eff6ff;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}
.feature-copy { min-width: 0; }
.feature-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.feature-heading h3 { margin: 0; font-size: 18px; }
.feature-copy p { margin: 6px 0 10px; color: var(--muted); font-size: 14px; }
.feature-link { font-size: 14px; font-weight: 700; color: var(--blue); }
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.status-available { background: var(--green-soft); color: var(--green); }
.status-planned { background: #eef2f7; color: #64748b; }

.trust-card p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.trust-card p:last-child { margin-bottom: 0; }
.breadcrumb { margin: 0 0 2px; font-size: 14px; }
.breadcrumb a { color: var(--muted); }
.footer a { color: #94a3b8; }

@media (min-width: 720px) {
  .portal-cta { width: auto; min-width: 190px; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-card--primary { grid-column: span 2; }
  .portal-hero { padding-top: 28px; }
}
