:root {
  color-scheme: light;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e8ef;
  --paper: #f5f7fb;
  --surface: #ffffff;
  --accent: #175cd3;
  --accent-2: #0b4bb3;
  --good: #087443;
  --danger: #c4320a;
  --shadow: 0 18px 60px rgba(24, 39, 75, 0.1);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); min-width: 320px; }
input, select, textarea { font: inherit; }
.shell { min-height: 100dvh; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1180px) / 2)); background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 760; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: white; background: var(--accent); font-size: 14px; box-shadow: 0 8px 20px rgba(23,92,211,.24); }
.nav { display: flex; align-items: center; gap: 8px; }
.nav-link, .action { cursor: pointer; user-select: none; transition: .18s ease; }
.nav-link { padding: 10px 14px; color: var(--muted); font-size: 14px; border-radius: 10px; }
.nav-link:hover, .nav-link.active { color: var(--ink); background: #f0f3f8; }
.page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 56px 0 88px; }
.hero { display: grid; grid-template-columns: 1.12fr .88fr; gap: 40px; align-items: center; padding: 34px 0 64px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; color: var(--accent); background: #eaf2ff; border-radius: 9px; font-size: 13px; font-weight: 700; }
.hero h1 { font-size: clamp(42px, 6vw, 72px); line-height: 1.03; letter-spacing: -.055em; margin: 22px 0 20px; max-width: 760px; }
.hero p { max-width: 590px; color: var(--muted); line-height: 1.8; font-size: 17px; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.action { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 11px; font-weight: 700; font-size: 14px; }
.action:active { transform: translateY(1px); }
.primary { color: white; background: var(--accent); box-shadow: 0 8px 22px rgba(23,92,211,.2); }
.primary:hover { background: var(--accent-2); }
.secondary { color: var(--ink); background: white; border: 1px solid var(--line); }
.secondary:hover { border-color: #b8c0cc; }
.danger { color: var(--danger); background: #fff6f3; border: 1px solid #f5c8bb; }
.hero-ticket { min-height: 300px; padding: 34px; border-radius: 22px; color: white; background: #14213d; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero-ticket::after { content: ''; position: absolute; width: 250px; height: 250px; border-radius: 50%; right: -70px; top: -90px; border: 42px solid rgba(255,255,255,.08); }
.ticket-label { opacity: .72; font-size: 13px; letter-spacing: .12em; }
.ticket-value { font-size: 70px; line-height: 1; font-weight: 800; letter-spacing: -.06em; margin: 44px 0 10px; }
.ticket-value small { font-size: 24px; margin-right: 6px; }
.ticket-bottom { display: flex; align-items: end; justify-content: space-between; margin-top: 40px; border-top: 1px solid rgba(255,255,255,.18); padding-top: 18px; }
.section-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin: 18px 0 24px; }
.section-head h2 { margin: 0; font-size: 28px; letter-spacing: -.03em; }
.section-head p { color: var(--muted); margin: 7px 0 0; }
.coupon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.coupon-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 8px 28px rgba(31,45,61,.055); }
.coupon-band { height: 7px; background: var(--accent); }
.coupon-card.lime .coupon-band { background: #67a300; }
.coupon-card.coral .coupon-band { background: #e04f2f; }
.coupon-body { padding: 24px; }
.coupon-kicker { color: var(--muted); font-size: 13px; }
.coupon-amount { font-size: 48px; font-weight: 800; letter-spacing: -.06em; margin: 14px 0 8px; }
.coupon-amount small { font-size: 17px; letter-spacing: 0; margin-right: 4px; }
.coupon-card h3 { font-size: 18px; margin: 0 0 8px; }
.coupon-card p { color: var(--muted); font-size: 13px; line-height: 1.65; min-height: 44px; }
.coupon-meta { display: flex; justify-content: space-between; padding: 16px 24px; background: #fafbfc; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12px; }
.coupon-card .action { margin: 18px 24px 24px; width: calc(100% - 48px); }
.query-panel { margin-top: 54px; padding: 30px; display: grid; grid-template-columns: 1fr auto; gap: 18px; background: #101828; color: white; border-radius: 18px; }
.query-panel h3 { margin: 0 0 8px; font-size: 22px; }
.query-panel p { margin: 0; color: #aeb8c8; }
.inline-form { display: flex; gap: 10px; align-items: center; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { color: var(--muted); font-size: 13px; font-weight: 650; }
.field input, .field select, .field textarea { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23,92,211,.1); }
.query-panel input { min-width: 240px; border: 0; padding: 13px 14px; border-radius: 10px; }
.result-list { margin-top: 18px; display: grid; gap: 10px; }
.my-ticket { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.code { font: 700 17px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
.muted { color: var(--muted); }
.status { display: inline-flex; padding: 5px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #ecfdf3; color: var(--good); }
.status.redeemed { color: #344054; background: #f2f4f7; }
.status.paused { color: #b54708; background: #fffaeb; }
.empty { padding: 42px 24px; text-align: center; color: var(--muted); background: white; border: 1px dashed #cfd5df; border-radius: 14px; }
.loading { padding: 28px; color: var(--muted); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(16,24,40,.58); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { width: min(460px, 100%); background: white; padding: 28px; border-radius: 18px; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 8px; font-size: 23px; }
.modal p { margin: 0 0 22px; color: var(--muted); line-height: 1.6; }
.form-stack { display: grid; gap: 15px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 80; max-width: 380px; padding: 14px 17px; background: #101828; color: white; border-radius: 11px; box-shadow: var(--shadow); }
.toast.error { background: #7a271a; }
.admin-shell { min-height: 100dvh; display: grid; grid-template-columns: 230px 1fr; }
.sidebar { background: #101828; color: white; padding: 28px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; }
.sidebar .brand { padding: 0 10px 32px; }
.side-nav { display: grid; gap: 6px; }
.side-item { padding: 12px 14px; border-radius: 10px; color: #aeb8c8; cursor: pointer; font-size: 14px; }
.side-item.active, .side-item:hover { background: #23314e; color: white; }
.sidebar-foot { margin-top: auto; }
.admin-main { min-width: 0; padding: 34px max(28px, calc((100vw - 230px - 1100px) / 2)); }
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.admin-head h1 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.stat-card { padding: 20px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; font-size: 30px; margin-top: 12px; letter-spacing: -.04em; }
.panel { background: white; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.panel-head { padding: 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
th { color: var(--muted); font-weight: 650; background: #fafbfc; }
td strong { display: block; margin-bottom: 3px; }
.table-actions { display: flex; gap: 8px; }
.mini { min-height: 32px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.filters { display: flex; gap: 10px; }
.filters input, .filters select { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.login-page { min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; }
.login-visual { padding: 70px; background: #101828; color: white; display: flex; flex-direction: column; justify-content: space-between; }
.login-visual h1 { font-size: clamp(42px,5vw,70px); letter-spacing: -.055em; line-height: 1.04; max-width: 600px; }
.login-visual p { color: #aeb8c8; line-height: 1.8; max-width: 520px; }
.login-form-wrap { display: grid; place-items: center; padding: 30px; background: white; }
.login-card { width: min(390px, 100%); }
.login-card h2 { font-size: 30px; margin: 0 0 8px; letter-spacing: -.04em; }
.login-card > p { margin: 0 0 28px; color: var(--muted); }
.login-card .primary { width: 100%; margin-top: 8px; }
.credential-note { margin-top: 20px; padding: 13px; border-radius: 10px; background: #f2f4f7; color: var(--muted); font-size: 13px; }
.wallet-hero { display: grid; grid-template-columns: .8fr 1.2fr; gap: 30px; align-items: stretch; margin-bottom: 54px; }
.wallet-hero > div { padding: 34px; border-radius: 18px; background: #101828; color: white; }
.wallet-hero h1 { margin: 42px 0 8px; font-size: 58px; letter-spacing: -.055em; }
.wallet-hero h1 small { font-size: 18px; letter-spacing: 0; color: #aeb8c8; }
.wallet-hero p { color: #aeb8c8; }
.redeem-box { padding: 30px; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 36px rgba(31,45,61,.06); }
.redeem-box h2 { margin: 0 0 8px; }
.redeem-box > p { color: var(--muted); margin: 0 0 24px; }
.redeem-box input { flex: 1; min-width: 180px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; text-transform: uppercase; letter-spacing: .14em; font-weight: 750; }
.secure-note, .flow-note { margin-top: 16px; padding: 12px 14px; border-radius: 10px; color: var(--muted); background: #f2f4f7; font-size: 12px; line-height: 1.6; }
.boundary-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.boundary-grid > div { padding: 24px; border-right: 1px solid var(--line); }
.boundary-grid > div:last-child { border-right: 0; }
.boundary-grid p { color: var(--muted); line-height: 1.65; margin: 8px 0 0; font-size: 13px; }
.send-layout { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
.send-form .form-stack { padding: 22px; }
.api-layout { display: grid; grid-template-columns: minmax(360px, .82fr) minmax(0, 1.18fr); gap: 18px; align-items: start; }
.api-form .form-stack { padding: 22px; }
.api-form textarea { resize: vertical; min-height: 210px; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; }
.api-result { min-width: 0; }
.api-result .panel-head > div { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 16px; }
.api-result pre { overflow: auto; min-height: 460px; max-height: 70vh; margin: 0; padding: 22px; background: #101828; color: #d8e2f0; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.connection-layout { display: grid; grid-template-columns: minmax(420px, .9fr) minmax(320px, 1.1fr); gap: 18px; align-items: start; }
.connection-form .form-stack { padding: 22px; }
.connection-form .action { border: 0; width: 100%; }
.credential-summary { display: grid; gap: 5px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfc; }
.credential-summary span, .credential-summary small { color: var(--muted); font-size: 12px; }
.credential-summary strong { font: 700 14px ui-monospace, SFMono-Regular, Menlo, monospace; }
.connection-info-body { padding: 22px; }
.integration-templates { display: grid; gap: 10px; }
.integration-templates span { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.integration-templates b { color: var(--ink); white-space: nowrap; }
.transport-switch { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.transport-switch span { display: grid; gap: 4px; }
.transport-switch small { color: var(--muted); line-height: 1.45; }
.transport-switch input { position: absolute; opacity: 0; pointer-events: none; }
.transport-switch i { position: relative; width: 44px; height: 24px; flex: 0 0 auto; border-radius: 99px; background: #cfd5df; transition: background .18s ease; }
.transport-switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(16,24,40,.24); transition: transform .18s ease; }
.transport-switch input:checked + i { background: var(--accent); }
.transport-switch input:checked + i::after { transform: translateX(20px); }
.transport-switch:has(input:focus-visible) { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(23,92,211,.1); }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-ticket { min-height: 260px; }
  .coupon-grid { grid-template-columns: 1fr 1fr; }
  .query-panel { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; padding: 14px 18px; overflow-x: auto; }
  .sidebar .brand { padding: 0 20px 0 0; white-space: nowrap; }
  .side-nav { display: flex; }
  .sidebar-foot { margin: 0 0 0 auto; }
  .admin-main { padding: 26px 20px 60px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { padding: 42px 28px; min-height: 310px; }
  .wallet-hero, .send-layout, .api-layout, .connection-layout { grid-template-columns: 1fr; }
  .boundary-grid { grid-template-columns: 1fr; }
  .boundary-grid > div { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 620px) {
  .topbar { padding: 0 16px; }
  .topbar .nav-link:first-child { display: none; }
  .page { width: min(100% - 28px, 1180px); padding-top: 30px; }
  .hero { padding-top: 15px; }
  .hero h1 { font-size: 43px; }
  .hero-ticket { padding: 27px; }
  .coupon-grid { grid-template-columns: 1fr; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .query-panel input { min-width: 0; width: 100%; }
  .section-head, .admin-head, .panel-head { align-items: flex-start; flex-direction: column; }
  .filters { width: 100%; flex-direction: column; }
  .filters input, .filters select { width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .sidebar-foot .action { padding: 0 11px; }
}
