:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --ink: #1f2733;
  --muted: #6b7686;
  --line: #e2e8f0;
  --primary: #1660c0;
  --primary-ink: #ffffff;
  --ok: #1f7a3d;
  --ok-bg: #e8f5ec;
  --warn: #b45309;
  --warn-bg: #fdf3e3;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --radius: 14px;
  --shadow: 0 1px 3px rgb(16 24 40 / 0.08), 0 1px 2px rgb(16 24 40 / 0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

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

.break-word { overflow-wrap: anywhere; word-break: break-word; }
.muted { color: var(--muted); }
.tiny { font-size: 12.5px; }

/* Top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; border-radius: 10px;
  font-weight: 700; font-size: 18px;
}
.brand-text { display: inline-flex; flex-direction: column; line-height: 1.25; }
.brand-text small { color: var(--muted); font-size: 12px; }
.topnav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.topnav a { color: var(--ink); font-weight: 500; }
.nav-user { color: var(--muted); font-size: 13.5px; }
.inline-form { display: inline; margin: 0; }
.linklike {
  background: none; border: none; padding: 0; margin: 0;
  color: var(--primary); font-size: 14px; cursor: pointer; font-family: inherit;
}
.linklike:hover { text-decoration: underline; }

/* Layout */
.page { max-width: 1080px; margin: 0 auto; padding: 28px 20px 56px; }
.footer {
  max-width: 1080px; margin: 0 auto; padding: 20px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 13px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.eyebrow {
  display: block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.card h1 { margin: 0 0 8px; font-size: 24px; line-height: 1.3; }
.card h2 { margin: 0 0 8px; font-size: 19px; line-height: 1.3; }
.card h3 { margin: 0 0 4px; font-size: 17px; }
.lead { color: var(--ink); margin: 0 0 14px; }
.card p { margin: 0 0 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 10px 18px; font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit; text-decoration: none;
  transition: filter 0.12s ease, transform 0.05s ease;
}
.btn:hover { text-decoration: none; filter: brightness(0.97); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.full { width: 100%; }
.button-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; align-items: center; }

/* Alerts */
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.alert.error { background: var(--danger-bg); color: var(--danger); }
.alert.info { background: var(--ok-bg); color: var(--ok); }
.notice {
  background: #f0f4fa; border: 1px solid #dbe6f5; color: #2c4a78;
  border-radius: 10px; padding: 12px 14px; font-size: 13.5px; margin-top: 12px;
}

/* Hero */
.hero { background: linear-gradient(180deg, #eef4fc, #ffffff); }
.hero-copy h1 { font-size: 30px; margin: 8px 0 8px; }

/* Sections */
.section { margin-top: 28px; }
.section-head { margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 20px; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-head-copy h1 { margin: 0; font-size: 26px; }
.price-badge {
  background: var(--primary); color: #fff; border-radius: 999px;
  padding: 8px 16px; font-weight: 700; font-size: 15px; white-space: nowrap;
}

/* Product grid */
.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.product-card { display: block; }
.product-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.pill {
  background: #eef4fc; color: var(--primary); border-radius: 999px;
  padding: 2px 10px; font-size: 12.5px; font-weight: 600;
}
.price { margin: 10px 0; font-size: 14px; }
.price strong { font-size: 22px; color: var(--ink); }
.text-link { font-weight: 600; color: var(--primary); }

/* Info grid */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.info-item span { display: block; color: var(--muted); font-size: 12.5px; }
.info-item strong { display: block; margin-top: 2px; }

/* Two column layout */
.two-col {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start;
}
.two-col > .card { min-width: 0; }
.side-card { }

/* Forms */
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.stack-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13.5px; }
.stack-form input[type="text"],
.stack-form input[type="password"],
.stack-form textarea,
.stack-form input[type="file"] {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 15px; font-family: inherit; background: #fff; width: 100%;
}
.stack-form textarea { resize: vertical; min-height: 140px; }
.stack-form input:focus, .stack-form textarea:focus {
  outline: 2px solid rgba(22, 96, 192, 0.35); border-color: var(--primary);
}
.char-note, .file-note { color: var(--muted); font-size: 12.5px; }

/* Auth */
.auth-card { max-width: 420px; margin: 0 auto; }

/* Status */
.status-badge {
  display: inline-flex; align-items: center;
  border-radius: 999px; padding: 3px 12px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.status-badge.queued, .status-badge.processing { background: var(--warn-bg); color: var(--warn); }
.status-badge.complete { background: var(--ok-bg); color: var(--ok); }
.status-badge.failed, .status-badge.cancelled { background: var(--danger-bg); color: var(--danger); }

/* Summary table */
.summary-table { width: 100%; }
.summary-table > div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.summary-table > div:last-child { border-bottom: none; }
.summary-table span { color: var(--muted); }
.summary-table strong { text-align: right; overflow-wrap: anywhere; }

/* Amount box */
.amount-box {
  display: flex; align-items: baseline; justify-content: space-between;
  background: #f0f4fa; border-radius: 12px; padding: 14px 16px; margin: 14px 0;
}
.amount-box strong { font-size: 24px; color: var(--primary); }
.amount-box.large strong { font-size: 30px; }

/* Payment disabled contract */
.payment-disabled {
  border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px;
  color: var(--muted); font-size: 13.5px; display: flex; flex-direction: column; gap: 4px;
}
.payment-disabled strong { color: var(--ink); }
.qr-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 1 / 1; max-width: 220px; margin: 16px auto;
  border: 1.5px dashed #c3cede; border-radius: 14px; color: var(--muted);
}
.paid-note { background: var(--ok-bg); color: var(--ok); padding: 12px 14px; border-radius: 12px; }
.paid-note span { display: block; margin-top: 2px; font-size: 13.5px; }

/* Order item */
.order-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: #fafbfd; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px;
}
.order-item .muted { font-size: 13px; }

/* Job list */
.job-list { display: flex; flex-direction: column; gap: 12px; }
.job-card {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  color: var(--ink); min-width: 0;
}
.job-card:hover { text-decoration: none; border-color: #c9d6ea; }
.job-card-main { min-width: 0; }
.job-title { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.job-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.job-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; white-space: nowrap; }

/* Status head */
.status-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.status-head h2 { margin: 0; }

/* Download */
.download-box { margin-top: 14px; }
.download-meta { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.download-meta .muted { font-size: 13px; }

/* Empty state */
.empty-state { text-align: center; padding: 40px 22px; }
.empty-state .btn { margin-top: 8px; }

/* Account summary */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { font-size: 26px; color: var(--ink); }

/* Compact rows */
.compact-list { display: flex; flex-direction: column; gap: 10px; }
.compact-row {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 14px 16px; color: var(--ink); min-width: 0;
}
.compact-row:hover { text-decoration: none; border-color: #c9d6ea; }
.compact-main { display: flex; flex-direction: column; min-width: 0; }
.compact-main .muted { font-size: 12.5px; }
.compact-side { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.compact-side .muted { font-size: 14px; }

/* Order table */
.order-table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.order-table { width: 100%; border-collapse: collapse; min-width: 0; }
.order-table th, .order-table td {
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle;
}
.order-table th { background: #fafbfd; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.order-table tr:last-child td { border-bottom: none; }
.order-table td .muted { font-size: 12.5px; }
.small { font-size: 12.5px; }
.small-btn { padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.status-badge.unpaid { background: var(--warn-bg); color: var(--warn); }
.status-badge.paid { background: var(--ok-bg); color: var(--ok); }
.status-badge.refunded, .status-badge.cancelled { background: var(--danger-bg); color: var(--danger); }

/* Ops workbench */
.group-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.active-tab, .btn.active-tab:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.audit-list .info-item { border-bottom: 1px solid var(--line); padding: 6px 0; }
.audit-list .info-item strong { font-size: 12.5px; color: var(--muted); }

/* Catalog */
.pill.muted-pill { background: #eef0f3; color: var(--muted); }
.price-badge.muted-badge { background: #eef0f3; color: var(--muted); }
.unavailable-card {
  border-style: dashed; text-align: center; padding: 40px 24px;
}
.unavailable-card .button-row { justify-content: center; }

/* Stepbar */
.stepbar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px;
  color: var(--muted); font-size: 13px; font-weight: 600;
}
.stepbar span {
  padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.stepbar span.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.stepbar span.done { color: var(--primary); }

/* Responsive */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .order-table-wrap { border: none; background: transparent; }
  .order-table, .order-table tbody, .order-table tr, .order-table td { display: block; width: 100%; }
  .order-table thead { display: none; }
  .order-table th, .order-table td { border: none; }
  .order-table tbody { display: flex; flex-direction: column; gap: 12px; }
  .order-table tr {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 14px; margin-bottom: 10px;
  }
  .order-table td { padding: 4px 0; border-bottom: none; }
}
@media (max-width: 560px) {
  .page { padding: 20px 14px 48px; }
  .hero-copy h1 { font-size: 24px; }
  .page-head-copy h1 { font-size: 22px; }
  .price-badge { font-size: 13px; }
  .topbar-inner { padding: 10px 14px; }
  .job-card { flex-direction: column; align-items: flex-start; gap: 8px; }
  .job-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .amount-box { flex-direction: column; align-items: flex-start; gap: 4px; }
  .button-row .btn { flex: 1 1 auto; }
  .compact-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .compact-side { width: 100%; justify-content: space-between; }
}