:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #dfe5ee;
  --primary: #246bfd;
  --primary-dark: #1856d4;
  --soft: #eef4ff;
  --success: #16794a;
  --danger: #c93b3b;
  --shadow: 0 12px 36px rgba(31, 46, 80, 0.08);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button, input, select { font: inherit; }

.app-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 48px;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 10px 14px;
  border: 1px solid #cde9db;
  border-radius: 999px;
  background: #f0fbf5;
  color: var(--success);
  font-size: 14px;
  font-weight: 700;
}

.privacy-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

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

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 19px;
}

.step {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.drop-zone {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 26px;
  border: 2px dashed #b8c4d8;
  border-radius: 16px;
  background: #fafcff;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
  outline: none;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.dragover {
  border-color: var(--primary);
  background: var(--soft);
}

.drop-zone.dragover { transform: scale(1.005); }

.drop-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: var(--primary);
  color: white;
  font-weight: 900;
  letter-spacing: .04em;
}

.drop-zone strong {
  display: block;
  font-size: 18px;
}

.drop-zone p {
  margin: 6px 0 0;
  color: var(--muted);
}

.file-meta {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.file-meta > div {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.file-meta span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

.file-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-wrap {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.preview-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

#previewCanvas {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 340px;
  margin: 0 auto;
  border: 1px solid #d8dee8;
  background: white;
  box-shadow: 0 8px 24px rgba(24, 39, 75, 0.08);
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

.page-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid #cfd8e6;
  border-radius: 12px;
  background: white;
  font-family: Consolas, "Microsoft YaHei UI", monospace;
  font-size: 18px;
  outline: none;
}

.page-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(36, 107, 253, .10);
}

.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.page-summary {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f6f8fb;
  color: var(--muted);
  font-size: 14px;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.action-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-height: 210px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
}

.action-panel h3 {
  margin: 0;
  font-size: 18px;
}

.action-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.settings-row {
  display: flex;
  gap: 14px;
}

.settings-row label {
  flex: 1;
  color: var(--muted);
  font-size: 13px;
}

select {
  display: block;
  width: 100%;
  height: 40px;
  margin-top: 6px;
  padding: 0 10px;
  border: 1px solid #ccd6e5;
  border-radius: 10px;
  background: white;
}

.btn {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:not(:disabled):hover { background: var(--primary-dark); }

.btn-secondary {
  border: 1px solid #cdd7e5;
  background: white;
  color: var(--text);
}

.text-btn {
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.text-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.danger { color: var(--danger); }

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-track {
  height: 12px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef6;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width .15s linear;
}

.progress-text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.message {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #cbd9f3;
  background: #f1f6ff;
  color: #23426e;
  line-height: 1.55;
}

.message.error {
  border-color: #f0caca;
  background: #fff4f4;
  color: #8f2929;
}

.message.success {
  border-color: #c9e7d8;
  background: #f1fbf6;
  color: #196844;
}

footer {
  padding: 24px 6px 0;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

footer p { margin: 4px 0; }
footer .small { font-size: 12px; }

.hidden { display: none !important; }

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1040px);
    padding-top: 22px;
  }

  .hero {
    flex-direction: column;
  }

  .privacy-badge { align-self: flex-start; }

  .file-meta,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
  }

  .settings-row {
    flex-direction: column;
  }
}
