:root {
  color-scheme: dark;
  --bg: #070a12;
  --panel: rgba(14, 20, 35, 0.78);
  --panel-strong: rgba(18, 26, 46, 0.94);
  --line: rgba(148, 163, 184, 0.18);
  --text: #edf4ff;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --brand: #3b82f6;
  --brand-2: #22d3ee;
  --ok: #34d399;
  --bad: #fb7185;
  --warn: #fbbf24;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 8%, rgba(59, 130, 246, 0.25), transparent 32rem),
    radial-gradient(circle at 86% 10%, rgba(34, 211, 238, 0.16), transparent 28rem),
    linear-gradient(135deg, #060914 0%, #0b1020 45%, #060815 100%);
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  width: 26rem;
  height: 26rem;
  filter: blur(24px);
  opacity: 0.22;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}
.ambient-a { left: -8rem; top: 18rem; background: #2563eb; }
.ambient-b { right: -10rem; bottom: 5rem; background: #22d3ee; }

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

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.hero-copy {
  flex: 1 1 auto;
  min-width: 0;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 7px 11px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 999px;
  color: #a5f3fc;
  background: rgba(8, 47, 73, 0.32);
  font-size: 12px;
  letter-spacing: 0.18em;
  font-weight: 700;
}
.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 0.96;
  letter-spacing: -0.055em;
}
.hero p {
  max-width: 710px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}
.hero-channel {
  flex: 0 0 auto;
  align-self: center;
  min-width: 218px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 20px;
  color: #e0f2fe;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.28), rgba(15, 23, 42, 0.78));
  box-shadow: 0 16px 42px rgba(2, 132, 199, 0.14);
  text-decoration: none;
  backdrop-filter: blur(18px);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.hero-channel:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.62);
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.42), rgba(15, 23, 42, 0.86));
}
.hero-channel:focus-visible {
  outline: 3px solid rgba(56, 189, 248, 0.3);
  outline-offset: 3px;
}
.hero-channel-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  color: #082f49;
  background: linear-gradient(135deg, #67e8f9, #38bdf8);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.28);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.hero-channel-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.hero-channel-copy small {
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.hero-channel-copy strong {
  color: #f0f9ff;
  font-size: 14px;
  white-space: nowrap;
}
.hero-channel-arrow {
  margin-left: auto;
  color: #7dd3fc;
  font-size: 16px;
}
.hero-card {
  min-width: 230px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hero-card strong { display: block; margin-bottom: 3px; }
.hero-card small { color: var(--muted); line-height: 1.4; }
.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.12), 0 0 22px rgba(52, 211, 153, 0.8);
  flex: 0 0 auto;
}
.service-off .dot { background: var(--bad); box-shadow: 0 0 0 6px rgba(251, 113, 133, 0.12); }



.extract-status-panel {
  padding: 22px 24px 18px;
  margin: 0 0 18px;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(10, 15, 29, 0.95), rgba(8, 13, 24, 0.92));
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.26);
  overflow: hidden;
}
.extract-status-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 18px;
  align-items: start;
  margin-bottom: 14px;
}
.extract-status-copy {
  min-width: 0;
}
.extract-status-copy h2 {
  margin: 4px 0 8px;
  font-size: clamp(20px, 2.1vw, 28px);
  line-height: 1.18;
  letter-spacing: -0.04em;
  font-weight: 800;
}
.extract-status-copy p:last-child {
  margin: 0;
  color: #d6deea;
  font-size: 14px;
  line-height: 1.5;
}
.status-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #dbe7f5;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.status-eyebrow span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--brand-2);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.92);
}
.extract-status-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  color: #cbd5e1;
  font-size: 13px;
  text-align: right;
}
.extract-legend {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  color: #e2e8f0;
  font-size: 13px;
}
.extract-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-mark {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.legend-mark.ok { background: linear-gradient(135deg, #22c55e, #5eead4); box-shadow: 0 0 12px rgba(52, 211, 153, 0.42); }
.legend-mark.empty { background: #334155; }
.extract-grid {
  display: grid;
  grid-template-columns: repeat(48, minmax(0, 1fr));
  gap: 5px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.30), rgba(71, 85, 105, 0.26));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.extract-cell {
  height: 24px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.05);
  background: #344b63;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.extract-cell.ok {
  background: linear-gradient(180deg, #58e183 0%, #2ecc71 100%);
  border-color: rgba(187, 247, 208, 0.30);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), 0 0 14px rgba(52, 211, 153, 0.26);
}
.extract-empty {
  grid-column: 1 / -1;
  color: #94a3b8;
  text-align: center;
  padding: 18px;
}
.extract-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.extract-metrics div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.48);
}
.extract-metrics small {
  display: block;
  color: #94a3b8;
  font-size: 12px;
}
.extract-metrics strong {
  display: block;
  margin-top: 4px;
  color: #f8fafc;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}


.layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}
.input-panel,
.result-panel,
.log-panel { padding: 24px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}
.panel-head > div { display: flex; align-items: center; gap: 12px; }
.panel h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(34, 211, 238, 0.16));
  color: #bfdbfe;
  font-weight: 800;
  border: 1px solid rgba(147, 197, 253, 0.18);
}

.badge,
.mini-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(15, 23, 42, 0.72);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.badge.ok,
.mini-pill.ok { color: #bbf7d0; border-color: rgba(52, 211, 153, 0.35); background: rgba(6, 78, 59, 0.34); }
.badge.bad,
.mini-pill.bad { color: #fecdd3; border-color: rgba(251, 113, 133, 0.35); background: rgba(127, 29, 29, 0.32); }
.badge.running { color: #bfdbfe; border-color: rgba(59, 130, 246, 0.38); background: rgba(30, 64, 175, 0.25); }
.mini-pill.warn { color: #fde68a; border-color: rgba(251, 191, 36, 0.35); background: rgba(120, 53, 15, 0.26); }

.field { display: grid; gap: 9px; margin-bottom: 18px; }
.field span {
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
}
.field-note {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}
.cdk-check-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.inline-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.2);
  outline: none;
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.58);
  color: var(--text);
  padding: 14px 15px;
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
textarea { resize: vertical; min-height: 150px; line-height: 1.55; }
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(34, 211, 238, 0.58);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.10);
  background: rgba(2, 6, 23, 0.76);
}
::placeholder { color: #64748b; }

button {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition: transform 0.18s, filter 0.18s, opacity 0.18s, border-color 0.18s;
}
button:disabled { opacity: 0.58; cursor: not-allowed; }
button:not(:disabled):hover { transform: translateY(-1px); filter: brightness(1.08); }
.primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  border-radius: 18px;
  color: #03111f;
  background: linear-gradient(135deg, #67e8f9, #60a5fa 52%, #818cf8);
  box-shadow: 0 18px 40px rgba(59, 130, 246, 0.30);
}
.secondary,
.ghost {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 15px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid var(--line);
}
.ghost { min-height: 36px; color: var(--muted); }
.arrow { font-size: 20px; }

.email-card,
.status-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px;
  margin: 2px 0 18px;
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(15, 23, 42, 0.52));
}
.email-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: rgba(34, 211, 238, 0.15);
  color: #67e8f9;
  font-weight: 900;
  font-size: 20px;
}
.email-card div,
.status-card div { flex: 1; min-width: 0; }
.email-card small,
.status-card small { color: var(--muted); display: block; margin-bottom: 4px; }
.email-card strong,
.status-card strong { display: block; overflow-wrap: anywhere; }
.status-card { align-items: flex-start; }
.status-card p { margin: 0; color: var(--muted); line-height: 1.55; max-width: 260px; }

.error {
  margin: 0 0 16px;
  padding: 13px 14px;
  border-radius: 16px;
  color: #fecdd3;
  background: rgba(127, 29, 29, 0.36);
  border: 1px solid rgba(251, 113, 133, 0.30);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.hidden { display: none !important; }

.result-card {
  display: grid;
  gap: 16px;
}
.qr-result {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 0 0 4px;
}
.qr-box {
  width: min(230px, 100%);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background: #f8fafc;
  padding: 12px;
  color: #475569;
  text-align: center;
  font-weight: 800;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; border-radius: 14px; }
.qr-empty { color: #64748b; padding: 18px; }
.amount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(52, 211, 153, 0.22);
  background: rgba(6, 78, 59, 0.22);
}
.amount-row span { color: var(--muted); }
.amount-row strong { color: #bbf7d0; font-size: 18px; }
.expiry-card {
  width: min(262px, 100%);
  padding: 12px 16px 11px;
  border-radius: 17px;
  border: 1px solid rgba(52, 211, 153, 0.32);
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.30), rgba(15, 23, 42, 0.70));
  transition: border-color 0.2s, background 0.2s;
}
.expiry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}
.expiry-head strong {
  color: #a7f3d0;
  font-size: 20px;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}
.countdown-track {
  height: 6px;
  margin: 8px 0 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.30);
}
.countdown-track span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399, #6ee7b7);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.48);
  transition: width 0.35s linear, background 0.2s;
}
.expiry-card small {
  display: block;
  color: #64748b;
  text-align: center;
  line-height: 1.4;
}
.expiry-card.expired {
  border-color: rgba(251, 113, 133, 0.35);
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.24), rgba(15, 23, 42, 0.70));
}
.expiry-card.expired .expiry-head strong,
.expiry-card.expired small { color: #fda4af; }
.expiry-card.expired .countdown-track span {
  background: var(--bad);
  box-shadow: none;
}
.payment-link-block {
  display: grid;
  gap: 9px;
  margin-top: 2px;
}
.payment-link-block > label {
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
}
.payment-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
}
.payment-link-row input {
  min-width: 0;
  text-overflow: ellipsis;
}
.payment-link-row button { min-height: 48px; white-space: nowrap; }
.open-link-button {
  color: #bbf7d0;
  border-color: rgba(52, 211, 153, 0.30);
  background: rgba(6, 78, 59, 0.38);
}

.log-panel { margin-top: 18px; }
.log-list {
  height: 260px;
  overflow: auto;
  padding: 8px;
  border-radius: 20px;
  background: rgba(2, 6, 23, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.12);
}
.log-line {
  display: grid;
  grid-template-columns: 78px 120px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 11px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.45;
}
.log-line:last-child { border-bottom: 0; }
.log-line time { color: #64748b; }
.log-line b { color: #93c5fd; font-weight: 800; }
.log-line.ok b,
.log-line.ok span { color: #bbf7d0; }
.log-line.fail b,
.log-line.error b,
.log-line.fail span,
.log-line.error span { color: #fecdd3; }
.log-line.warn b,
.log-line.warn span { color: #fde68a; }
.log-line.muted {
  display: block;
  color: #64748b;
  padding: 18px;
  text-align: center;
}


@media (max-width: 960px) {
  .hero { align-items: stretch; flex-direction: column; }
  .hero-channel { width: 100%; align-self: stretch; }
  .hero-card { width: 100%; }
  .extract-status-head { grid-template-columns: 1fr; }
  .extract-status-meta { align-items: flex-start; text-align: left; }
  .extract-legend { justify-content: flex-start; }
  .extract-grid { grid-template-columns: repeat(24, minmax(0, 1fr)); }
  .extract-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 22px, 1180px); padding-top: 26px; }
  .input-panel,
  .result-panel,
  .log-panel,
  .extract-status-panel { padding: 18px; border-radius: 22px; }
  .extract-grid { grid-template-columns: repeat(18, minmax(0, 1fr)); gap: 4px; padding: 9px; }
  .extract-cell { height: 18px; border-radius: 5px; }
  .inline-field { grid-template-columns: 1fr; }
  .payment-link-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payment-link-row input { grid-column: 1 / -1; }
  .status-card { display: block; }
  .status-card p { max-width: none; margin-top: 10px; }
  .log-line { grid-template-columns: 1fr; gap: 4px; }
}
