:root {
  --bg-canvas: #f6f7fb;
  --bg-card: #ffffff;
  --bg-muted: #f1f5f9;
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748b;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --alipay-blue: #1677ff;
  --alipay-blue-dark: #0958d9;
  --alipay-tint: #eff6ff;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --emerald: #059669;
  --emerald-bg: #ecfdf5;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.14);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-900);
  background: var(--bg-canvas);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

.hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Mode Banner */
.mode-banner {
  background: linear-gradient(90deg, #0f172a 0%, #1e3a8a 100%);
  color: #e2e8f0;
  font-size: 12.5px;
  padding: 8px 0;
}

.mode-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.mode-banner-link {
  color: #93c5fd;
  font-weight: 600;
  white-space: nowrap;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-900);
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f172a 0%, #1677ff 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(22, 119, 255, 0.25);
  flex-shrink: 0;
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-en {
  font-size: 12px;
  font-weight: 600;
  color: var(--alipay-blue);
  margin-left: 4px;
}

.brand-sub {
  font-size: 12px;
  color: var(--ink-500);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
}

.chip-alipay {
  background: var(--alipay-tint);
  color: var(--alipay-blue-dark);
  border: 1px solid #bfdbfe;
}

.chip-alipay .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
}

.chip-wallet {
  background: var(--bg-muted);
  color: var(--ink-700);
  border: 1px solid var(--border-subtle);
}

/* Hero Strip */
.main-content {
  padding-top: 22px;
  padding-bottom: 44px;
}

.hero-strip {
  background: linear-gradient(135deg, #0f172a 0%, #172554 62%, #1d4ed8 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-md);
}

.hero-copy {
  max-width: 720px;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #93c5fd;
  background: rgba(147, 197, 253, 0.14);
  border: 1px solid rgba(147, 197, 253, 0.28);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.hero-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.hero-desc {
  margin: 0;
  font-size: 14.5px;
  color: #cbd5e1;
  line-height: 1.65;
}

.hero-desc strong {
  color: #ffffff;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(105px, 1fr));
  gap: 12px;
  flex-shrink: 0;
}

.metric-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
}

.metric-num {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
}

.metric-label {
  font-size: 11.5px;
  color: #cbd5e1;
  margin-top: 2px;
}

/* Workspace Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
}

.panel-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-500);
}

/* Sample Chips */
.sample-bar {
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
}

.sample-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-600);
  margin-bottom: 8px;
}

.sample-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sample-chip {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--ink-700);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sample-chip:hover {
  border-color: var(--alipay-blue);
  color: var(--alipay-blue);
}

.sample-chip.active {
  background: var(--alipay-blue);
  border-color: var(--alipay-blue);
  color: #ffffff;
}

/* Inputs */
.form-row {
  margin-bottom: 14px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-700);
  margin-bottom: 6px;
}

.field-label-row .field-label {
  margin-bottom: 0;
}

.char-counter {
  font-size: 12px;
  color: var(--ink-500);
}

.text-input,
.contract-textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-900);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.text-input:focus,
.contract-textarea:focus {
  outline: none;
  border-color: var(--alipay-blue);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.contract-textarea {
  resize: vertical;
  min-height: 280px;
  line-height: 1.65;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

.btn-sm {
  font-size: 12.5px;
  padding: 7px 12px;
  border-radius: 8px;
}

.btn-lg {
  font-size: 15px;
  padding: 13px 22px;
  border-radius: 12px;
}

.btn-primary {
  background: var(--ink-900);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: #1e293b;
}

.btn-alipay {
  background: linear-gradient(135deg, #1677ff 0%, #0958d9 100%);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(22, 119, 255, 0.28);
}

.btn-alipay:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-emerald {
  background: var(--emerald);
  color: #ffffff;
}

.btn-emerald:hover:not(:disabled) {
  background: #047857;
}

.btn-secondary {
  background: #ffffff;
  color: var(--ink-700);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--ink-900);
  color: var(--ink-900);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-600);
  border-color: var(--border-subtle);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-muted);
  color: var(--ink-900);
}

.btn-danger-outline {
  background: #ffffff;
  color: var(--danger);
  border-color: #fecaca;
}

.btn-danger-outline:hover:not(:disabled) {
  background: var(--danger-bg);
}

.btn-tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 600;
}

.submit-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.submit-row .btn-primary {
  flex: 1;
}

/* History */
.history-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.history-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-500);
  margin-bottom: 8px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.history-item:hover {
  border-color: var(--alipay-blue);
  background: #f8fbff;
}

.history-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Alerts */
.alert {
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
}

.alert-error {
  background: var(--danger-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-info {
  background: var(--alipay-tint);
  color: var(--alipay-blue-dark);
  border: 1px solid #bfdbfe;
}

.alert-success {
  background: var(--emerald-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

/* Empty State */
.empty-state {
  padding: 20px 8px;
  text-align: center;
}

.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: var(--alipay-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 800;
}

.empty-desc {
  margin: 0 auto 18px;
  max-width: 480px;
  font-size: 13.5px;
  color: var(--ink-600);
}

.flow-steps {
  text-align: left;
  background: var(--bg-muted);
  border-radius: 14px;
  padding: 16px 18px 16px 34px;
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--ink-700);
}

.flow-steps li {
  margin-bottom: 10px;
}

.flow-steps li:last-child {
  margin-bottom: 0;
}

.compliance-pill-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.compliance-pill {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-600);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: 999px;
}

/* Score Hero & Gauge */
.score-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.gauge-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  flex-shrink: 0;
}

.gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-track {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 10;
}

.gauge-progress {
  fill: none;
  stroke: var(--danger);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 314.16;
  stroke-dashoffset: 314.16;
  transition: stroke-dashoffset 0.65s ease, stroke 0.3s ease;
}

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-num {
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.gauge-unit {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 3px;
}

.score-meta {
  flex: 1;
  min-width: 0;
}

.score-top-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.tag-slate { background: #e2e8f0; color: var(--ink-700); }
.tag-high { background: #fee2e2; color: #b91c1c; }
.tag-medium { background: #fef3c7; color: #b45309; }
.tag-low { background: #d1fae5; color: #047857; }
.tag-lock { background: #e0e7ff; color: #3730a3; }
.tag-unlocked { background: #d1fae5; color: #065f46; }
.tag-alipay { background: var(--alipay-tint); color: var(--alipay-blue-dark); }

.report-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
}

.report-verdict {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--ink-600);
}

.exposure-box {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #fecaca;
  padding: 6px 12px;
  border-radius: 10px;
}

.exposure-label {
  font-size: 12px;
  color: var(--ink-600);
}

.exposure-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--danger);
}

/* Stats Strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.stat-box {
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  border: 1px solid var(--border-subtle);
}

.stat-high { background: #fff5f5; border-color: #fecaca; }
.stat-med { background: #fffbeb; border-color: #fde68a; }
.stat-miss { background: #f5f3ff; border-color: #ddd6fe; }
.stat-clauses { background: #f8fafc; }

.stat-val {
  font-size: 20px;
  font-weight: 800;
}

.stat-high .stat-val { color: var(--danger); }
.stat-med .stat-val { color: var(--warn); }
.stat-miss .stat-val { color: #6d28d9; }

.stat-lbl {
  font-size: 11.5px;
  color: var(--ink-600);
}

/* Unlocked Toolbar */
.unlocked-toolbar {
  background: var(--emerald-bg);
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.unlocked-banner-msg {
  font-size: 13px;
  font-weight: 700;
  color: #065f46;
}

.unlocked-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Section & Findings */
.section-block {
  margin-bottom: 18px;
}

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

.section-head h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
}

.engine-note {
  font-size: 12px;
  color: var(--ink-500);
}

.findings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.finding-card {
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--danger);
  border-radius: 12px;
  padding: 14px 16px;
  background: #ffffff;
}

.finding-card.severity-medium {
  border-left-color: var(--warn);
}

.finding-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.finding-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.finding-excerpt {
  background: #f8fafc;
  border-left: 3px solid #94a3b8;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-700);
  margin: 8px 0;
}

.finding-excerpt mark {
  background: #fee2e2;
  color: #991b1b;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 700;
}

.finding-meta {
  font-size: 12.5px;
  color: var(--ink-600);
  margin: 6px 0;
}

.finding-meta strong {
  color: var(--ink-900);
}

.rewrite-box {
  margin-top: 10px;
  background: var(--emerald-bg);
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 11px 12px;
}

.rewrite-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 12.5px;
  font-weight: 800;
  color: #065f46;
}

.rewrite-text {
  font-size: 13px;
  color: #064e3b;
  margin: 0;
}

.script-box {
  margin-top: 10px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
}

.script-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.tab-group {
  display: inline-flex;
  gap: 6px;
}

.tab-pill {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--ink-600);
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
}

.tab-pill.active {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: #ffffff;
}

.locked-rewrite-hint {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: repeating-linear-gradient(-45deg, #f8fafc, #f8fafc 8px, #f1f5f9 8px, #f1f5f9 16px);
  border: 1px dashed #cbd5e1;
  font-size: 12.5px;
  color: var(--ink-600);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Paywall Card */
.paywall-card {
  margin-top: 16px;
  border: 2px solid #93c5fd;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  border-radius: 16px;
  padding: 18px;
}

.locked-teasers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.teaser-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  font-size: 13px;
}

.teaser-lock-badge {
  font-size: 11.5px;
  color: var(--alipay-blue-dark);
  font-weight: 700;
  white-space: nowrap;
}

.paywall-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.alipay-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--alipay-blue);
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.paywall-title {
  margin: 0 0 2px;
  font-size: 16.5px;
  font-weight: 800;
}

.paywall-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-600);
}

.credit-unlock-bar {
  background: var(--emerald-bg);
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #065f46;
}

.sku-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.sku-card {
  position: relative;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  padding: 12px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  font-family: inherit;
}

.sku-card:hover {
  border-color: var(--alipay-blue);
}

.sku-card.selected {
  border-color: var(--alipay-blue);
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.14);
}

.sku-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  color: #ffffff;
  background: var(--alipay-blue);
  padding: 2px 7px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.sku-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-900);
  margin-bottom: 4px;
}

.sku-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 5px;
}

.sku-price {
  font-size: 21px;
  font-weight: 900;
  color: var(--alipay-blue-dark);
}

.sku-orig {
  font-size: 12px;
  color: var(--ink-500);
  text-decoration: line-through;
}

.sku-desc {
  font-size: 11.5px;
  color: var(--ink-600);
  line-height: 1.45;
}

.paywall-cta-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.paywall-cta-row .btn-alipay {
  width: 100%;
}

.paywall-trust-notes {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--ink-500);
}

/* Missing clauses & bundle script */
.missing-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.missing-card {
  border: 1px solid #ddd6fe;
  background: #faf5ff;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
}

.missing-card strong {
  display: block;
  margin-bottom: 4px;
  color: #4c1d95;
}

.script-pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px 16px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-lg);
}

.modal-wide {
  max-width: 720px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.modal-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--ink-500);
}

.icon-close {
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  color: var(--ink-600);
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-row {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px;
  background: #fafafa;
}

.order-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.order-row-meta {
  font-size: 12.5px;
  color: var(--ink-600);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
  margin-bottom: 10px;
}

.order-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-order-summary {
  background: var(--bg-muted);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.preview-order-summary div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13.5px;
}

.price-big {
  font-size: 20px;
  color: var(--alipay-blue-dark);
}

.preview-notice {
  font-size: 12.5px;
  color: var(--ink-600);
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 14px;
}

.preview-cashier-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: #ffffff;
  padding: 18px 0;
  font-size: 12.5px;
  color: var(--ink-600);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--ink-900);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
}

/* Responsive Mobile H5 */
@media (max-width: 960px) {
  .container {
    padding: 0 14px;
  }
  .topbar {
    position: static;
  }
  .panel {
    padding: 16px;
  }
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .hero-strip {
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
  }
  .hero-title {
    font-size: 21px;
  }
  .hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .metric-card {
    padding: 10px 6px;
  }
  .metric-num {
    font-size: 18px;
  }
  .finding-top {
    flex-wrap: wrap;
  }
  .finding-top > div {
    flex-wrap: wrap;
  }
  .exposure-box {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
  }
  .locked-rewrite-hint,
  .teaser-row {
    flex-wrap: wrap;
  }
  .sku-grid {
    grid-template-columns: 1fr;
  }
  .score-hero {
    flex-direction: column;
    text-align: center;
  }
  .score-top-tags {
    justify-content: center;
  }
  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .order-row-meta {
    grid-template-columns: 1fr;
  }
  .toast {
    max-width: calc(100vw - 28px);
    text-align: center;
    border-radius: 14px;
  }
  .btn-lg {
    white-space: normal;
    text-align: center;
  }
}

/* A4 Print-to-PDF Styling */
@media print {
  .mode-banner, .topbar, .hero-strip, .input-panel, .paywall-card, .unlocked-actions, .site-footer, .modal-backdrop, .toast {
    display: none !important;
  }
  body {
    background: #ffffff;
  }
  .workspace-grid {
    display: block;
  }
  .report-panel {
    border: none;
    box-shadow: none;
    padding: 0;
  }
}
