:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --text: #172033;
  --muted: #6c768b;
  --line: #e4e9f1;
  --primary: #6255e7;
  --primary-dark: #493bc9;
  --cyan: #23b9cf;
  --success: #159570;
  --warning: #e58b18;
  --danger: #d64e63;
  --shadow: 0 20px 60px rgba(37, 48, 77, .09);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 8% -4%, rgba(98, 85, 231, .14), transparent 34%),
    radial-gradient(circle at 94% 4%, rgba(35, 185, 207, .12), transparent 28%),
    var(--bg);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid rgba(228, 233, 241, .8);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 780; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; color: white;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 9px 25px rgba(98, 85, 231, .25);
}
.top-actions { display: flex; align-items: center; gap: 10px; }
.mode-pill, .badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 99px; padding: 6px 10px; font-size: 12px; font-weight: 700;
  background: #edf0ff; color: var(--primary-dark);
}

.page { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 38px 0 60px; }
.claim-page { width: min(780px, calc(100% - 28px)); padding-top: 54px; }
.hero { text-align: center; margin-bottom: 30px; }
.eyebrow { color: var(--primary); font-size: 13px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 10px 0 10px; font-size: clamp(30px, 6vw, 48px); line-height: 1.12; letter-spacing: -.035em; }
h2, h3, p { margin-top: 0; }
.hero p { max-width: 610px; margin: 0 auto; color: var(--muted); line-height: 1.8; }

.card {
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(228, 233, 241, .9);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.claim-card { padding: clamp(22px, 5vw, 38px); }
.section-card { padding: 22px; margin-top: 18px; overflow: hidden; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 18px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 28px; }
.step { display: flex; align-items: center; gap: 9px; color: #9aa3b5; font-size: 13px; font-weight: 700; }
.step span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #eef1f6; }
.step.active { color: var(--primary); }
.step.active span { background: var(--primary); color: white; }
.step.done { color: var(--success); }
.step.done span { background: #dcf8ef; color: var(--success); }

.field { margin-bottom: 17px; }
.field label { display: block; font-size: 13px; font-weight: 750; margin-bottom: 8px; }
.field small { display: block; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.control {
  width: 100%; border: 1px solid #dce2ec; background: white; color: var(--text);
  border-radius: 13px; padding: 13px 14px; outline: none; transition: .18s ease;
}
.control:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(98, 85, 231, .1); }
textarea.control { min-height: 92px; resize: vertical; }
.input-action { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.claim-input { text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

.btn {
  border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 760;
  color: #384057; background: #edf0f5; transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); background: #e5e9f0; }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.btn.primary { color: white; background: linear-gradient(135deg, var(--primary), #7969ef); box-shadow: 0 9px 24px rgba(98, 85, 231, .22); }
.btn.primary:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); }
.btn.success { color: white; background: var(--success); }
.btn.danger { color: white; background: var(--danger); }
.btn.small { padding: 7px 10px; border-radius: 9px; font-size: 12px; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.full { width: 100%; }

.product-box { border: 1px solid #e5e1ff; border-radius: 16px; padding: 17px; background: #f8f7ff; margin-bottom: 20px; }
.product-box strong { display: block; font-size: 17px; }
.product-box span { color: var(--muted); font-size: 13px; }
.notice { padding: 13px 15px; border-radius: 12px; font-size: 13px; line-height: 1.6; margin: 14px 0; }
.notice.info { background: #eef8fb; color: #256c78; }
.notice.error { background: #fff0f2; color: #a9364a; }
.notice.success { background: #eaf9f3; color: #12775a; }
.hidden { display: none !important; }

.status-panel { text-align: center; padding: 18px 0 2px; }
.status-icon { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto 16px; font-size: 26px; background: #edf0ff; color: var(--primary); }
.status-panel h2 { margin-bottom: 8px; }
.status-panel p { color: var(--muted); line-height: 1.7; }
.result-box { text-align: left; border-radius: 15px; background: var(--surface-soft); border: 1px solid var(--line); padding: 15px; margin-top: 18px; }
.card-secret { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 12px; border: 1px dashed #c8cfe0; border-radius: 11px; margin-top: 10px; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; word-break: break-all; }

.dashboard-head { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 24px; }
.dashboard-head h1 { font-size: 30px; margin-bottom: 4px; }
.dashboard-head p { color: var(--muted); margin: 0; }
.toolbar { display: flex; gap: 9px; flex-wrap: wrap; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 12px; }
.metric { background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: 17px; padding: 17px; }
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { display: block; font-size: 25px; font-weight: 820; margin-top: 7px; }

.table-wrap { overflow: auto; margin: 0 -22px -22px; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 13px 14px; border-top: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: top; }
th { color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; background: #fafbfc; }
td strong { display: block; max-width: 260px; }
.subtext { color: var(--muted); font-size: 11px; margin-top: 4px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #a8b0c1; }
.status-dot.good::before { background: var(--success); }
.status-dot.warn::before { background: var(--warning); }
.status-dot.bad::before { background: var(--danger); }
.mini-input { width: 76px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(21,27,43,.38); backdrop-filter: blur(5px); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { width: min(460px, 100%); padding: 26px; }
.modal.settings-modal { width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; }
.modal.product-modal { width: min(980px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.modal h2 { margin-bottom: 8px; }
.modal p { color: var(--muted); line-height: 1.6; }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
.span-2 { grid-column: span 2; }
.toggle-row { display: flex; align-items: center; gap: 9px; font-weight: 750; margin: 4px 0 18px; }
.toggle-row input { width: 18px; height: 18px; accent-color: var(--primary); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 16px; }
.modal-actions.spread { justify-content: space-between; flex-wrap: wrap; }
.inventory-panel { margin-top: 22px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.inventory-panel .section-head { padding: 16px; margin: 0; }
.section-head.compact h3 { margin: 0; font-size: 16px; }
.table-wrap.inner { margin: 0; max-height: 330px; }
.table-wrap.inner table { min-width: 650px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 16px; border: 1px solid #ffd4da; border-radius: 15px; background: #fff8f9; }
.danger-zone p { margin: 5px 0 0; font-size: 12px; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: 400px; background: #172033; color: white; border-radius: 13px; padding: 13px 16px; box-shadow: var(--shadow); z-index: 80; }
.empty { color: var(--muted); text-align: center; padding: 28px !important; }

@media (max-width: 1000px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .topbar { padding: 0 16px; }
  .page { padding-top: 26px; }
  .claim-page { padding-top: 30px; }
  .steps { grid-template-columns: 1fr; }
  .step { display: none; }
  .step.active { display: flex; }
  .input-action { grid-template-columns: 1fr; }
  .dashboard-head { align-items: flex-start; flex-direction: column; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .danger-zone { align-items: flex-start; flex-direction: column; }
  .section-card { padding: 17px; }
  .table-wrap { margin: 0 -17px -17px; }
}
