:root {
  --bg: #eef6ff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(255, 255, 255, 0.76);
  --text: #14233f;
  --muted: #71829c;
  --blue: #2368ef;
  --blue-soft: #dbeeff;
  --green: #1f9a62;
  --shadow: 0 28px 70px rgba(56, 103, 155, 0.18);
  --radius-lg: 28px;
  --radius-md: 20px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(220, 238, 255, 0.7)),
    var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 42%, rgba(89, 166, 244, 0.13) 42% 58%, transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), transparent 36%);
}

body::after {
  content: "";
  position: fixed;
  top: 86px;
  right: -110px;
  z-index: 0;
  width: min(980px, 58vw);
  height: min(720px, 72vh);
  pointer-events: none;
  background: url("/pdf-upload-art.png?v=20260427art1") right top / contain no-repeat;
  opacity: 0.62;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.glass-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 252, 255, 0.68));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    var(--shadow);
  backdrop-filter: blur(22px);
}

.topbar {
  min-height: 80px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.upload-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(180deg, #83ccff, #2f7dff 70%, #1454dc);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 16px 30px rgba(43, 124, 255, 0.25);
}

.brand-mark::before {
  content: "E";
}

.brand small,
.eyebrow {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
}

.topbar-actions,
.panel-head,
.file-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ghost-button,
.clear-button,
.primary-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

.ghost-button,
.clear-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.primary-button {
  width: 100%;
  color: #fff;
  background: linear-gradient(180deg, #73c1ff, #2b7cff 70%, #1454dc);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 16px 30px rgba(46, 124, 246, 0.28);
}

.ghost-button:hover,
.clear-button:hover,
.primary-button:hover {
  transform: translateY(-2px);
}

.clear-button:disabled,
.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.tool-hero {
  padding: 38px 4px 28px;
}

.tool-hero h1 {
  margin: 10px 0 12px;
  max-width: 760px;
  font-size: clamp(34px, 6vw, 66px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.workflow-rail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-workflow {
  margin-top: 18px;
}

.workflow-rail span {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 900;
}

.workflow-rail i {
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(35, 104, 239, 0.16), rgba(35, 104, 239, 0.72));
}

.file-toolbar,
.file-meta,
.price-note {
  color: var(--muted);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 22px;
  align-items: start;
}

.upload-panel,
.estimate-panel {
  padding: 24px;
}

.panel-head h2 {
  margin: 4px 0 0;
  font-size: 24px;
  letter-spacing: 0;
}

.drop-zone {
  position: relative;
  margin-top: 20px;
  min-height: 220px;
  overflow: hidden;
  border: 1px dashed rgba(35, 104, 239, 0.35);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(239, 248, 255, 0.64));
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.topic-field {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.topic-field span {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.topic-field input {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(35, 104, 239, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  outline: none;
  padding: 0 16px;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.topic-field input:focus {
  border-color: rgba(35, 104, 239, 0.62);
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 0 0 4px rgba(35, 104, 239, 0.12);
}

.topic-field small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.drop-zone:hover,
.drop-zone.is-dragover {
  border-color: rgba(35, 104, 239, 0.72);
  background: rgba(235, 246, 255, 0.86);
  transform: translateY(-2px);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-zone strong {
  font-size: 22px;
}

.drop-zone small {
  max-width: 360px;
  color: var(--muted);
  line-height: 1.6;
}

.file-toolbar {
  margin: 18px 2px 12px;
  font-size: 13px;
  font-weight: 700;
}

.file-list {
  display: grid;
  gap: 10px;
}

.file-list.empty {
  min-height: 116px;
}

.empty-state,
.file-row {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.empty-state {
  min-height: 116px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  text-align: center;
}

.empty-state span {
  color: var(--muted);
}

.file-row {
  padding: 14px 14px 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.file-name {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.remove-file {
  appearance: none;
  border: 0;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
}

.estimate-panel {
  position: sticky;
  top: 18px;
}

.status-pill {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 900;
}

.price-total {
  margin: 24px 0 4px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.price-total strong {
  font-size: 64px;
  line-height: 0.9;
  color: var(--blue);
}

.price-total span {
  font-size: 22px;
  font-weight: 800;
  color: var(--blue);
}

.price-note {
  margin: 0;
  text-align: center;
  line-height: 1.6;
}

.stat-grid {
  margin: 24px 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-grid div {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.stat-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.mode-group {
  display: grid;
  gap: 10px;
}

.mode-card {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  min-height: 76px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
}

.mode-card.is-selected {
  border-color: rgba(35, 104, 239, 0.4);
  background: linear-gradient(180deg, rgba(237, 247, 255, 0.95), rgba(255, 255, 255, 0.76));
  box-shadow: 0 14px 28px rgba(35, 104, 239, 0.12);
}

.mode-card.single-mode {
  cursor: default;
  grid-template-columns: 1fr;
}

.mode-card span,
.mode-card strong {
  font-weight: 900;
}

.progress-section,
.history-panel {
  margin-top: 22px;
  padding: 24px;
}

.panel-head.compact h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.progress-bar {
  margin: 22px 0 12px;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 5px rgba(20, 35, 63, 0.08);
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, #75c7ff, #2677f0);
  transition: width 220ms ease;
}

.progress-message {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.step-list,
.audit-row-list,
.pdf-history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-list {
  display: none !important;
  gap: 10px;
}

.step-list li,
.audit-row-list li,
.pdf-history-item {
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.step-list li {
  min-height: 48px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}

.step-list li.is-done {
  color: var(--green);
}

.step-list li.is-running {
  color: var(--blue);
}

.step-list li.is-failed {
  color: #c43950;
}

.step-state {
  flex: 0 0 auto;
  font-size: 12px;
}

.audit-card {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(35, 104, 239, 0.12);
}

.workflow-card {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(35, 104, 239, 0.12);
}

.audit-grid {
  margin: 16px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.audit-grid div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.audit-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.audit-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 24px;
}

.status-pill.is-flagged {
  color: #b45309;
  background: #fff3d6;
}

.audit-row-list {
  display: grid;
  gap: 8px;
}

.workflow-steps {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.workflow-step {
  min-width: 0;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.workflow-step-index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(180deg, #73c1ff, #2b7cff 70%, #1454dc);
  font-size: 13px;
  font-weight: 900;
}

.workflow-step strong,
.workflow-step em,
.workflow-step p {
  display: block;
}

.workflow-step strong {
  margin-top: 10px;
  font-size: 14px;
}

.workflow-step em {
  margin-top: 5px;
  color: var(--blue);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.workflow-step.is-review em {
  color: #b45309;
}

.workflow-step p,
.workflow-note {
  color: var(--muted);
  line-height: 1.6;
}

.workflow-step p {
  margin: 8px 0 0;
  font-size: 12px;
}

.workflow-note {
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 750;
}

.workflow-missing {
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.workflow-missing strong {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.workflow-missing div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workflow-missing span {
  min-height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #5f4211;
  background: #fff3d6;
  font-size: 12px;
  font-weight: 900;
}

.workflow-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.secondary-button {
  appearance: none;
  min-height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  cursor: pointer;
  font-weight: 900;
}

.audit-row-list li {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.audit-row-list li.is-flagged {
  color: #b45309;
}

.result-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.result-actions .action-link {
  width: auto;
  min-width: 180px;
}

.pdf-history-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.pdf-history-item {
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.pdf-history-open {
  min-width: 0;
  flex: 1 1 auto;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.pdf-history-item strong,
.pdf-history-item small {
  display: block;
}

.pdf-history-item strong {
  margin-bottom: 4px;
  font-size: 15px;
}

.pdf-history-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pdf-history-item em {
  flex: 0 0 auto;
  color: var(--blue);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.pdf-history-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.pdf-history-delete {
  border: 0;
  border-radius: 999px;
  min-height: 34px;
  padding: 0 14px;
  color: #b42335;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.pdf-history-delete:hover {
  background: #fff1f3;
}

.empty-state.small {
  min-height: 82px;
  color: var(--muted);
  font-weight: 800;
}

.payment-agreement {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(12, 26, 48, 0.34);
  backdrop-filter: blur(14px);
}

.payment-agreement[hidden] {
  display: none !important;
}

.agreement-card {
  width: min(640px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  padding: 24px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 251, 255, 0.92));
  box-shadow: 0 34px 90px rgba(20, 35, 63, 0.28);
}

.agreement-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.agreement-head h2 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.15;
}

.agreement-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-size: 24px;
  font-weight: 900;
}

.agreement-summary {
  margin: 18px 0;
  padding: 16px 18px;
  border-radius: 18px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 20px;
  font-weight: 900;
}

.agreement-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.agreement-list li {
  padding: 12px 14px;
  border-radius: 16px;
  color: #3f526f;
  background: rgba(255, 255, 255, 0.76);
  line-height: 1.6;
  font-weight: 700;
}

.agreement-check {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.88);
  font-weight: 900;
  cursor: pointer;
}

.agreement-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.agreement-actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  max-width: min(520px, calc(100% - 32px));
  padding: 14px 18px;
  border-radius: 999px;
  color: #fff;
  background: rgba(20, 35, 63, 0.9);
  box-shadow: 0 18px 42px rgba(20, 35, 63, 0.24);
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  body::after {
    top: 150px;
    right: -260px;
    width: 820px;
    height: 520px;
    opacity: 0.34;
  }

  .estimate-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .topbar,
  .panel-head,
  .file-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .ghost-button {
    flex: 1;
  }

  .tool-hero h1 {
    font-size: 38px;
  }

  .upload-panel,
  .estimate-panel,
  .progress-section,
  .history-panel {
    padding: 18px;
    border-radius: 24px;
  }

  .drop-zone {
    min-height: 190px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .audit-grid {
    grid-template-columns: 1fr;
  }

  .workflow-steps {
    grid-template-columns: 1fr;
  }

  .workflow-rail i {
    display: none;
  }

  .result-actions,
  .workflow-actions,
  .pdf-history-item,
  .audit-row-list li {
    align-items: stretch;
    flex-direction: column;
  }

  .pdf-history-actions {
    justify-content: space-between;
  }

  .result-actions .action-link {
    width: 100%;
  }

  .workflow-actions .ghost-button,
  .workflow-actions .action-link {
    width: 100%;
  }
}
