:root {
  --bg: #f4f5fb;
  --card: #ffffff;
  --ink: #0b1220;
  --muted: #667085;
  --line: rgba(15, 23, 42, .09);
  --brand: #4338ca;
  --brand-2: #06b6d4;
  --gold: #b45309;
  --ok: #047857;
  --warn: #b45309;
  --danger: #b91c1c;
  --radius: 20px;
  --shadow: 0 18px 50px -24px rgba(15, 23, 42, .35);
  --shadow-sm: 0 8px 24px -16px rgba(15, 23, 42, .4);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: .01em;
}

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

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(720px 420px at 8% -10%, rgba(67, 56, 202, .18), transparent 60%),
    radial-gradient(680px 420px at 100% 0%, rgba(6, 182, 212, .16), transparent 62%),
    radial-gradient(560px 360px at 50% 110%, rgba(180, 83, 9, .08), transparent 65%);
  pointer-events: none;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(11, 18, 32, .9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
}

.brand { display: flex; align-items: center; gap: 10px; color: #fff; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(99, 102, 241, .9);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15px; letter-spacing: .04em; }
.brand-text .brand-r { font-size: 11px; font-weight: 600; letter-spacing: .02em; color: #7dd3fc; margin-left: 3px; }
.brand-text small { font-size: 9px; letter-spacing: .22em; color: #8ea0b8; }

.topnav { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.topnav a { color: #b8c4d8; }
.topnav a:hover { color: #fff; }

/* ---------- layout ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 18px 16px 56px; }

.card {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.card h2 { margin: 0 0 12px; font-size: 17px; letter-spacing: .01em; }
.card h3 { margin: 16px 0 8px; font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.card-head { margin-bottom: 14px; }
.step-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--brand);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap-row { flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.strong { font-weight: 700; }
.right { text-align: right; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 26px 22px 24px;
  margin-bottom: 16px;
  color: #eef2ff;
  background:
    radial-gradient(420px 260px at 88% -10%, rgba(6, 182, 212, .45), transparent 65%),
    radial-gradient(360px 240px at 0% 110%, rgba(99, 102, 241, .55), transparent 60%),
    linear-gradient(145deg, #0b1220, #131c33 55%, #0d1830);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 70% 20%, #000 0%, transparent 75%);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  letter-spacing: .24em;
  font-weight: 700;
  color: #a5b4fc;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, #818cf8, transparent);
}

.hero h1 {
  margin: 12px 0 8px;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -.01em;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #a5b4fc, #67e8f9 60%, #fcd34d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub { margin: 0; font-size: 13px; color: #aab8ce; max-width: 460px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #e0e7ff;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
}
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
}
.pill.on::before { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .18); }
.pill.off::before { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, .18); }
.pill.ghost { color: #cbd5e1; }
.pill.ghost::before { display: none; }

/* ---------- banners ---------- */
.banner {
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid rgba(67, 56, 202, .12);
}
.banner.warn { background: #fffbeb; color: #92400e; border-color: rgba(180, 83, 9, .16); }
.banner.danger { background: #fef2f2; color: #991b1b; border-color: rgba(185, 28, 28, .16); }
.banner.ok { background: #ecfdf5; color: #065f46; border-color: rgba(4, 120, 87, .16); }

/* ---------- forms ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }

input[type=text], input[type=number], input[type=password], select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcff;
  font-size: 15px;
  color: var(--ink);
  font-family: inherit;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(67, 56, 202, .55);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(67, 56, 202, .1);
}
textarea { min-height: 128px; resize: vertical; }

/* ---------- dropzone ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 28px 16px;
  border: 1.5px dashed rgba(67, 56, 202, .32);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(238, 242, 255, .7), rgba(255, 255, 255, .9));
  text-align: center;
  cursor: pointer;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 14px 32px -22px rgba(67, 56, 202, .8);
}
.dz-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4338ca, #06b6d4);
  color: #fff;
  box-shadow: 0 12px 26px -14px rgba(67, 56, 202, .85);
}
.dz-title { font-weight: 700; font-size: 15px; }
.dz-sub { font-size: 12px; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #4338ca, #4f46e5 55%, #0891b2);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 16px 30px -18px rgba(67, 56, 202, .85);
  transition: transform .16s, box-shadow .16s, filter .16s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; filter: none; }
.btn.ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn.danger { background: linear-gradient(135deg, #b91c1c, #dc2626); }
.btn.small-btn { width: auto; padding: 7px 13px; font-size: 13px; border-radius: 10px; }
.btn-arrow { font-size: 17px; line-height: 1; }

.fine { margin: 10px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- file list / recent ---------- */
.file-list { margin: 10px 0 0; padding: 0; list-style: none; }
.file-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: #f8faff;
  border: 1px solid var(--line);
  font-size: 13px;
}

.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.tasks li:last-child { border-bottom: 0; }
.tasks a { font-weight: 600; color: var(--ink); }

/* ---------- status / steps ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eef2ff;
  color: #3730a3;
}
.badge.ok { background: #ecfdf5; color: #047857; }
.badge.warn { background: #fffbeb; color: #b45309; }
.badge.danger { background: #fef2f2; color: #b91c1c; }
.badge.gray { background: #f1f5f9; color: #64748b; }

.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  list-style: none;
  margin: 16px 0 4px;
  padding: 0;
}
.steps li { position: relative; text-align: center; font-size: 11px; color: #98a2b3; }
.steps li .dot {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: 0 auto 6px;
  border-radius: 50%;
  background: #eef2f7;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--line);
  position: relative;
  z-index: 1;
}
.steps li::before {
  content: "";
  position: absolute;
  top: 13px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: #e6ebf3;
}
.steps li:first-child::before { display: none; }
.steps li.done { color: #475569; }
.steps li.done .dot {
  background: linear-gradient(135deg, #4338ca, #06b6d4);
  border-color: transparent;
  color: #fff;
}
.steps li.done::before { background: linear-gradient(90deg, #4338ca, #06b6d4); }
.steps li.active { color: var(--brand); font-weight: 700; }
.steps li.active .dot {
  background: #fff;
  border: 2px solid var(--brand);
  color: var(--brand);
  box-shadow: 0 0 0 5px rgba(67, 56, 202, .12);
}
.steps li.warn .dot { background: #fffbeb; border-color: #f59e0b; color: #b45309; }

.progress {
  height: 8px;
  border-radius: 999px;
  background: #e9eef6;
  overflow: hidden;
  margin: 10px 0 6px;
}
.progress > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #4338ca, #06b6d4);
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}

/* ---------- quote ---------- */
.amount {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  background: linear-gradient(100deg, #4338ca, #0891b2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.amount small { font-size: 15px; font-weight: 700; -webkit-text-fill-color: #64748b; }
.amount.estimate { background: linear-gradient(100deg, #b45309, #ea580c); }

/* 预览卡: 第一页缩图 */
.preview-thumb {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 6px 0 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
}

.quote-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 14px;
}

/* ---------- timeline / preview ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 14px 20px;
  border-left: 1.5px solid var(--line);
  margin-left: 5px;
  font-size: 13px;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -5.5px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4338ca, #06b6d4);
}
.timeline .when { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

.preview img { width: 100%; border-radius: 14px; border: 1px solid var(--line); }

/* ---------- desktop QR ---------- */
.qr-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 12px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 18px;
  box-shadow: var(--shadow);
  max-width: 250px;
}
.qr-float img { width: 74px; height: 74px; border-radius: 10px; background: #fff; }
.qr-float b { display: block; font-size: 13px; }
.qr-float small { color: var(--muted); font-size: 11px; }
@media (max-width: 1180px) { .qr-float { display: none; } }

/* ---------- footer ---------- */
.foot {
  text-align: center;
  color: #94a3b8;
  font-size: 11px;
  letter-spacing: .12em;
  padding: 8px 0 26px;
}

/* ---------- admin ---------- */
.admin-wrap { max-width: 1180px; margin: 0 auto; }
.admin-grid { display: grid; grid-template-columns: 1fr 390px; gap: 16px; align-items: start; }
.page-head { margin: 4px 0 16px; }
.page-head h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.01em; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
table.data th {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
}
table.data tbody tr { cursor: pointer; transition: background .15s; }
table.data tbody tr:hover td { background: #f8faff; }
table.data tr.active td { background: #eef2ff; }
table.data tr.attention td { background: #fffbeb; }
table.data tr.done td { color: #94a3b8; }
.table-scroll { overflow-x: auto; }

.kv { display: grid; grid-template-columns: 92px 1fr; gap: 6px 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------- QR poster ---------- */
.poster {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 34px 30px 26px;
  color: #eef2ff;
  background:
    radial-gradient(360px 240px at 90% 0%, rgba(6, 182, 212, .4), transparent 65%),
    linear-gradient(155deg, #0b1220, #15203a 60%, #0c172c);
  text-align: center;
  box-shadow: var(--shadow);
}
.poster::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  pointer-events: none;
}
.poster-shop { font-size: 13px; letter-spacing: .3em; color: #93c5fd; text-transform: uppercase; }
.poster-title {
  margin: 10px 0 4px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: .04em;
  background: linear-gradient(100deg, #e0e7ff, #67e8f9, #fcd34d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.poster-sub { font-size: 13px; color: #a8b6cc; }
.poster-qr {
  width: 240px;
  height: 240px;
  margin: 22px auto 18px;
  padding: 12px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 22px 50px -24px rgba(0, 0, 0, .8);
}
.poster-qr img { width: 100%; height: 100%; display: block; border-radius: 8px; }
.poster-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  font-size: 12px;
  color: #cbd5e1;
}
.poster-steps li {
  padding: 8px 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
}
.poster-foot {
  font-size: 10.5px;
  letter-spacing: .1em;
  color: #7f8ea6;
  word-break: break-all;
}

/* ---------- toast / modal ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(11, 18, 32, .5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 18px; padding: 18px; width: 100%; max-width: 480px; max-height: 88vh; overflow: auto; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  background: rgba(11, 18, 32, .94);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  z-index: 80;
  max-width: 90vw;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .hero { padding: 22px 18px; }
  .hero h1 { font-size: 25px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .card { padding: 16px; border-radius: 18px; }
  .amount { font-size: 34px; }
  .steps li { font-size: 10px; }
}

/* ---------- print: poster only ---------- */
@media print {
  @page { size: A5 portrait; margin: 10mm; }
  body { background: #fff; }
  .topbar, .foot, .page-head, .admin-grid > .card:nth-child(2), .toast { display: none !important; }
  .wrap, .admin-wrap { padding: 0; max-width: none; }
  .admin-grid { display: block; }
  .card { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .poster {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    width: 148mm;
    min-height: 190mm;
    margin: 0 auto;
    border-radius: 18px;
  }
}
