:root {
  --ink: #172033;
  --muted: #6c7485;
  --line: #e5e8ef;
  --surface: #ffffff;
  --canvas: #f4f6f9;
  --navy: #101b35;
  --brand: #f05a31;
  --brand-dark: #d94721;
  --brand-soft: #fff1eb;
  --green: #15966d;
  --green-soft: #e8f7f1;
  --amber: #bd7710;
  --amber-soft: #fff5df;
  --red: #d44444;
  --red-soft: #ffeded;
  --shadow: 0 24px 70px rgba(29, 39, 60, .10);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
.hidden { display: none !important; }

.site-header {
  height: 86px;
  padding: 0 clamp(24px, 6vw, 96px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 5;
}
.site-header.compact { background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(145deg, #ff805b, var(--brand)); color: #fff; font-weight: 900; font-size: 20px;
  box-shadow: 0 10px 22px rgba(240, 90, 49, .24); transform: rotate(-3deg);
}
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-size: 18px; letter-spacing: .04em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 5px; letter-spacing: .16em; }
.quiet-link { color: var(--muted); font-size: 14px; transition: color .2s; }
.quiet-link:hover { color: var(--brand); }
.center-link { text-align: center; display: block; }

.public-page {
  background:
    radial-gradient(circle at 16% 22%, rgba(240, 90, 49, .12), transparent 25%),
    linear-gradient(115deg, #fff 0 54%, #f3f5f8 54% 100%);
}
.public-page::before {
  content: ""; position: fixed; width: 420px; height: 420px; border: 1px solid rgba(240,90,49,.13);
  border-radius: 50%; left: -180px; bottom: -230px; box-shadow: 0 0 0 72px rgba(240,90,49,.025), 0 0 0 144px rgba(240,90,49,.018);
}
.checkout-layout {
  width: min(1180px, calc(100% - 48px)); margin: 28px auto 54px; display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(460px, .78fr); gap: clamp(56px, 8vw, 120px); align-items: center;
}
.hero-copy { padding-left: clamp(0px, 2vw, 24px); }
.eyebrow { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.hero-copy h1 { font-size: clamp(46px, 6vw, 78px); line-height: 1.05; letter-spacing: -.045em; margin: 19px 0 25px; font-weight: 850; }
.hero-copy h1 em { color: var(--brand); font-style: normal; position: relative; }
.hero-copy h1 em::after { content: ""; position: absolute; height: 7px; border-radius: 10px; left: 2px; right: 0; bottom: -8px; background: rgba(240,90,49,.17); transform: rotate(-1deg); }
.hero-copy > p { color: var(--muted); font-size: 17px; line-height: 1.9; max-width: 560px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 38px; color: #4d5667; font-size: 13px; }
.trust-row span::before { content: "✓"; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 7px; border-radius: 50%; color: var(--green); background: var(--green-soft); font-weight: 900; }

.checkout-card, .status-card, .login-panel {
  background: rgba(255,255,255,.96); border: 1px solid rgba(226,229,236,.9); border-radius: 24px;
  box-shadow: var(--shadow); padding: clamp(28px, 4vw, 44px);
}
.card-heading, .panel-heading, .page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.card-heading { margin-bottom: 31px; }
.card-heading h2, .panel-heading h2 { margin: 6px 0 0; font-size: 25px; letter-spacing: -.025em; }
.step-label { color: var(--brand); font-weight: 800; font-size: 12px; letter-spacing: .08em; }
.secure-chip, .live-dot { border-radius: 99px; padding: 7px 11px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 700; white-space: nowrap; }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 21px; }
.field > span { color: #3e4758; font-size: 13px; font-weight: 650; }
.field > span b { color: var(--brand); margin-left: 4px; font-size: 10px; }
.field > span i { color: #9aa0ab; margin-left: 4px; font-size: 11px; font-style: normal; font-weight: 400; }
.field input, .field select, .field textarea, .filter-bar input, .filter-bar select {
  width: 100%; border: 1px solid #dfe3ea; background: #fbfcfd; color: var(--ink); border-radius: 11px;
  padding: 12px 14px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus, .field select:focus, .field textarea:focus, .filter-bar input:focus, .filter-bar select:focus {
  border-color: rgba(240,90,49,.65); background: #fff; box-shadow: 0 0 0 4px rgba(240,90,49,.09);
}
.field textarea { resize: vertical; min-height: 92px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.55; }
.field-help { color: #9299a7; font-size: 11px; line-height: 1.5; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.money-input { display: grid; grid-template-columns: auto 1fr auto; align-items: center; border: 1px solid #dfe3ea; border-radius: 12px; background: #fbfcfd; overflow: hidden; }
.money-input:focus-within { border-color: rgba(240,90,49,.65); box-shadow: 0 0 0 4px rgba(240,90,49,.09); background: #fff; }
.money-input input { border: 0; box-shadow: none !important; background: transparent !important; padding: 15px 8px; font-size: 20px; font-weight: 700; }
.money-input i { font-style: normal; padding-left: 15px; font-size: 18px; color: var(--brand); font-weight: 800; }
.money-input small { color: var(--muted); padding-right: 15px; }

.primary-button, .secondary-button {
  min-height: 44px; border-radius: 11px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 15px;
  font-weight: 750; font-size: 14px; cursor: pointer; transition: transform .18s, box-shadow .18s, background .18s; border: 1px solid transparent;
}
.primary-button { background: var(--brand); color: #fff; box-shadow: 0 10px 22px rgba(240,90,49,.22); }
.primary-button:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 13px 28px rgba(240,90,49,.28); }
.secondary-button { background: #fff; color: #3a4354; border-color: #dfe3ea; }
.secondary-button:hover { border-color: #b9c0cc; transform: translateY(-1px); }
.primary-button:disabled, .secondary-button:disabled, button:disabled { opacity: .52; cursor: not-allowed; transform: none; box-shadow: none; }
.primary-button.wide, .secondary-button.wide { width: 100%; min-height: 51px; }
.primary-button.small { min-height: 41px; padding-inline: 22px; }
.text-button { border: 0; background: transparent; color: var(--brand); cursor: pointer; padding: 7px; }
.agreement { color: #a0a6b1; text-align: center; font-size: 10px; line-height: 1.6; margin: 12px 0 0; }
.form-message, .notice { border-radius: 10px; padding: 11px 13px; font-size: 12px; line-height: 1.55; margin-top: 13px; }
.form-message.error, .notice.error { color: #a72d2d; background: var(--red-soft); }
.form-message.success { color: #087653; background: var(--green-soft); }
.notice.warning { color: #81500b; background: var(--amber-soft); border: 1px solid #f2ddb0; margin: 0 0 22px; }
.payment-ready { text-align: center; animation: rise .35s ease-out; }
.payment-ready h3 { font-size: 24px; margin: 15px 0 8px; }
.payment-ready p { color: var(--muted); margin: 7px; }
.payment-ready strong { color: var(--ink); }
.payment-ready .primary-button { margin-top: 24px; }
.payment-ready .secondary-button { margin-top: 10px; }
.payment-ready .text-button { margin-top: 12px; }
.success-icon { margin: 0 auto; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-size: 28px; font-weight: 900; background: var(--green); box-shadow: 0 10px 28px rgba(21,150,109,.24); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.site-footer { display: flex; justify-content: center; gap: 36px; color: #8c93a0; font-size: 11px; padding: 20px 24px 30px; }

.status-page { background: linear-gradient(145deg, #f9fafc, #eef1f5); }
.status-shell { min-height: calc(100vh - 87px); display: grid; place-items: center; padding: 45px 20px; }
.status-card { width: min(600px, 100%); text-align: center; }
.status-card h1 { margin: 9px 0; font-size: 31px; }
.status-card > p { color: var(--muted); line-height: 1.7; }
.status-symbol { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 22px; display: grid; place-items: center; position: relative; }
.status-symbol::after { font-size: 30px; font-weight: 900; }
.status-symbol.pending { background: var(--amber-soft); }
.status-symbol.pending::after { content: "…"; color: var(--amber); transform: translateY(-5px); }
.status-symbol.paid { background: var(--green-soft); }
.status-symbol.paid::after { content: "✓"; color: var(--green); }
.status-symbol.failed { background: var(--red-soft); }
.status-symbol.failed::after { content: "×"; color: var(--red); }
.status-symbol.warning { background: var(--amber-soft); }
.status-symbol.warning::after { content: "!"; color: var(--amber); }
.status-symbol.pending span { position: absolute; inset: -7px; border-radius: 50%; border: 1px solid rgba(189,119,16,.2); animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { transform: scale(1.08); opacity: .35; } }
.order-summary { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 13px 0; margin: 29px 0; }
.order-summary div { display: flex; justify-content: space-between; text-align: left; gap: 30px; padding: 10px 4px; }
.order-summary dt { color: var(--muted); font-size: 13px; }
.order-summary dd { margin: 0; font-weight: 650; font-size: 13px; word-break: break-all; text-align: right; }
.status-actions { display: flex; justify-content: center; gap: 10px; }
.poll-note { font-size: 11px !important; margin-top: 18px; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: var(--navy); position: relative; overflow: hidden; }
.login-view::before, .login-view::after { content: ""; position: absolute; width: 450px; height: 450px; border-radius: 50%; background: radial-gradient(circle, rgba(240,90,49,.25), transparent 68%); }
.login-view::before { left: -130px; top: -180px; }
.login-view::after { right: -180px; bottom: -200px; }
.login-panel { width: min(440px, 100%); position: relative; z-index: 1; }
.brand.centered { margin-bottom: 37px; }
.login-panel h1 { margin: 9px 0 8px; font-size: 31px; }
.login-panel > div > p { color: var(--muted); font-size: 13px; margin-bottom: 27px; }

.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); background: var(--canvas); }
.admin-sidebar { background: var(--navy); color: #fff; padding: 25px 17px; display: flex; flex-direction: column; position: fixed; width: 240px; height: 100vh; z-index: 20; }
.brand.inverse { padding: 4px 8px 30px; }
.brand.inverse small { color: #8290ab; }
.admin-nav { display: flex; flex-direction: column; gap: 7px; }
.nav-item { border: 0; color: #a9b3c6; background: transparent; border-radius: 10px; padding: 12px 14px; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 12px; font-size: 14px; }
.nav-item span { width: 20px; text-align: center; font-size: 17px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; background: var(--brand); box-shadow: 0 8px 20px rgba(240,90,49,.24); }
.sidebar-bottom { margin-top: auto; border-top: 1px solid rgba(255,255,255,.09); padding: 17px 10px 2px; display: flex; flex-direction: column; gap: 13px; font-size: 12px; color: #8c98ad; }
.sidebar-bottom button { color: #8c98ad; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
.sidebar-bottom a:hover, .sidebar-bottom button:hover { color: #fff; }
.admin-main { grid-column: 2; min-width: 0; }
.admin-topbar { height: 72px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 34px; position: sticky; top: 0; z-index: 10; }
.admin-topbar > div { font-size: 13px; }
.breadcrumb { color: #9aa1ad; }
.admin-topbar > span { color: var(--muted); font-size: 12px; }
.menu-button { display: none; border: 0; background: transparent; font-size: 22px; }
.admin-content { padding: 31px 34px 50px; max-width: 1540px; margin: 0 auto; }
.page-heading { align-items: center; margin-bottom: 25px; }
.page-heading h1 { margin: 0 0 6px; font-size: 27px; letter-spacing: -.025em; }
.page-heading p, .panel-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card, .panel { background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.stat-card { padding: 20px 21px; position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; width: 48px; height: 48px; border-radius: 50%; right: -13px; top: -15px; background: currentColor; opacity: .07; }
.stat-card span { display: block; color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; font-size: 29px; margin: 12px 0 7px; letter-spacing: -.02em; }
.stat-card small { color: #9ba1ad; font-size: 10px; }
.stat-card.accent { color: var(--brand); }
.stat-card.green { color: var(--green); }
.stat-card.amber { color: var(--amber); }
.stat-card.red { color: var(--red); }
.stat-card span, .stat-card small { color: var(--muted); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, .7fr); gap: 18px; }
.panel { padding: 21px; }
.panel-heading { margin-bottom: 18px; align-items: center; }
.panel-heading h2 { font-size: 17px; margin: 0 0 5px; }
.service-list { margin: 0; }
.service-list div { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); font-size: 12px; }
.service-list dt { color: var(--muted); }
.service-list dd { margin: 0; font-weight: 750; }
code { color: #b84020; background: var(--brand-soft); border-radius: 5px; padding: 3px 5px; font-size: 11px; }

.table-wrap { overflow-x: auto; margin: 0 -5px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: #818998; font-weight: 650; text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 10px; border-bottom: 1px solid #edf0f4; color: #3a4354; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fafbfc; }
#recent-orders tbody tr { cursor: pointer; }
.wide-table { min-width: 980px; }
.mono-cell { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.amount-cell { font-weight: 750; color: var(--ink); }
.empty-cell { text-align: center; padding: 45px; color: #9ba2af; }
.status-badge { display: inline-flex; border-radius: 99px; padding: 5px 8px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.status-badge.pending, .status-badge.warning { color: var(--amber); background: var(--amber-soft); }
.status-badge.paid { color: var(--green); background: var(--green-soft); }
.status-badge.failed { color: var(--red); background: var(--red-soft); }
.status-badge.muted { color: #687184; background: #edf0f4; }
.table-action { border: 1px solid var(--line); border-radius: 7px; background: #fff; padding: 5px 9px; cursor: pointer; font-size: 11px; }
.table-action:hover { border-color: var(--brand); color: var(--brand); }
.filter-bar { display: grid; grid-template-columns: minmax(260px, 1fr) 180px auto; gap: 10px; margin-bottom: 20px; }
.filter-bar input, .filter-bar select { padding: 10px 12px; font-size: 12px; }
.pagination { display: flex; justify-content: space-between; align-items: center; padding-top: 17px; color: var(--muted); font-size: 11px; }
.pagination div { display: flex; align-items: center; gap: 10px; }
.pagination button { border: 1px solid var(--line); background: #fff; padding: 6px 10px; border-radius: 7px; cursor: pointer; font-size: 11px; }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 18px; align-items: start; }
.settings-form { padding: 25px; }
.settings-form > .primary-button, .settings-form > .secondary-button { margin-top: 3px; }
.settings-side { display: grid; gap: 18px; }
.copy-field { display: grid; grid-template-columns: 1fr auto; }
.copy-field input { border-radius: 11px 0 0 11px; }
.copy-field button { border: 1px solid #dfe3ea; border-left: 0; border-radius: 0 11px 11px 0; background: #f4f6f8; padding: 0 14px; cursor: pointer; color: var(--brand); font-size: 12px; }
.toggle-field { display: flex; gap: 11px; align-items: flex-start; padding: 13px; border-radius: 11px; background: #f7f8fa; margin-bottom: 21px; }
.toggle-field input { margin-top: 3px; accent-color: var(--brand); }
.toggle-field span { display: flex; flex-direction: column; gap: 5px; }
.toggle-field strong { font-size: 12px; }
.toggle-field small { color: var(--muted); line-height: 1.5; }
.checkbox-line { display: flex; gap: 8px; color: var(--red); font-size: 11px; margin: -10px 0 20px; }
.checkbox-line input { accent-color: var(--red); }
.doc-note { background: var(--navy); color: #fff; }
.doc-note h2 { margin: 8px 0 15px; }
.doc-note ul { margin: 0; padding-left: 19px; color: #b9c2d2; line-height: 1.9; font-size: 12px; }

.detail-dialog { width: min(760px, calc(100% - 30px)); max-height: calc(100vh - 50px); padding: 0; border: 0; border-radius: 17px; box-shadow: 0 30px 100px rgba(7,15,31,.3); }
.detail-dialog::backdrop { background: rgba(10,17,31,.58); backdrop-filter: blur(3px); }
.dialog-header { position: sticky; top: 0; z-index: 2; background: #fff; display: flex; justify-content: space-between; align-items: center; padding: 22px 25px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 5px 0 0; font-size: 20px; word-break: break-all; }
.dialog-header button { border: 0; width: 34px; height: 34px; border-radius: 50%; background: #f2f4f7; cursor: pointer; font-size: 22px; color: var(--muted); }
.dialog-content { padding: 24px 25px 30px; }
.detail-state { margin-bottom: 15px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px; }
.detail-row { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid #edf0f4; font-size: 12px; min-width: 0; }
.detail-row span { color: var(--muted); white-space: nowrap; }
.detail-row strong { text-align: right; word-break: break-all; font-weight: 650; }
.section-title { font-size: 14px; margin: 25px 0 12px; }
.empty-note { padding: 24px; text-align: center; border-radius: 10px; background: #f7f8fa; color: var(--muted); font-size: 12px; }
.callback-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 10px; }
.callback-card > div { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); }
.payload-block { margin-top: 17px; }
.payload-block h3 { font-size: 12px; margin: 0 0 8px; }
.payload-block pre { margin: 0; max-height: 330px; overflow: auto; border-radius: 10px; background: #121b2d; color: #d6deeb; padding: 15px; font: 11px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; color: #fff; background: var(--green); border-radius: 10px; padding: 12px 17px; box-shadow: 0 12px 30px rgba(0,0,0,.18); font-size: 12px; animation: rise .2s ease-out; }
.toast.error { background: var(--red); }

@media (max-width: 1050px) {
  .checkout-layout { grid-template-columns: 1fr 460px; gap: 38px; }
  .hero-copy h1 { font-size: 52px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid, .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .public-page { background: #f5f6f8; }
  .checkout-layout { width: min(600px, calc(100% - 30px)); grid-template-columns: 1fr; margin-top: 0; }
  .hero-copy { text-align: center; padding: 24px 12px 0; }
  .hero-copy h1 { font-size: clamp(41px, 12vw, 60px); }
  .hero-copy > p { font-size: 14px; }
  .trust-row { justify-content: center; }
  .admin-shell { display: block; }
  .admin-main { grid-column: auto; }
  .admin-sidebar { transform: translateX(-105%); transition: transform .25s; box-shadow: 15px 0 40px rgba(0,0,0,.25); }
  .admin-sidebar.open { transform: translateX(0); }
  .menu-button { display: block; }
  .admin-topbar { padding: 0 19px; justify-content: flex-start; gap: 16px; }
  .admin-topbar > span { margin-left: auto; }
  .admin-content { padding: 23px 18px 45px; }
}

@media (max-width: 560px) {
  .site-header { height: 72px; padding: 0 18px; }
  .brand-mark { width: 39px; height: 39px; }
  .brand strong { font-size: 16px; }
  .checkout-layout { width: calc(100% - 20px); gap: 25px; }
  .checkout-card, .status-card { border-radius: 18px; padding: 25px 20px; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .trust-row { gap: 10px 15px; }
  .site-footer { flex-direction: column; align-items: center; gap: 8px; }
  .status-actions { flex-direction: column; }
  .status-actions a, .status-actions button { width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-card strong { font-size: 24px; }
  .filter-bar { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; }
  .detail-grid { grid-template-columns: 1fr; }
  .admin-topbar > span { display: none; }
}
