:root {
  --ink: #122033;
  --muted: #6b6458;
  --navy: #0c1b2e;
  --navy-2: #16324f;
  --gold: #b08d57;
  --gold-2: #c9a56a;
  --paper: #f4efe4;
  --card: #fffdf8;
  --line: #e6dccb;
  --danger: #9b2c2c;
  --ok: #276749;
  --shadow: 0 18px 50px rgba(18, 32, 51, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

a { color: inherit; }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(176, 141, 87, 0.22), transparent 55%),
    linear-gradient(160deg, #0c1b2e 0%, #16324f 58%, #0c1b2e 100%);
}

.login-card {
  width: 420px;
  max-width: calc(100vw - 32px);
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 36px 34px 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.login-kicker {
  letter-spacing: 0.28em;
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
}

.login-card h1 {
  margin: 10px 0 8px;
  font-size: 28px;
  letter-spacing: 0.02em;
}

.login-card p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.topbar {
  background: var(--navy);
  color: #f7f1e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  font-size: 13px;
  letter-spacing: 0.32em;
  color: var(--gold-2);
  font-weight: 700;
}

.brand-name { font-size: 18px; font-weight: 650; }

.top-actions { display: flex; align-items: center; gap: 8px; }

.menu { position: relative; }

.menu-btn, .text-link {
  border: 0;
  background: transparent;
  color: #f7f1e6;
  cursor: pointer;
  font: inherit;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
}

.menu summary.menu-btn {
  list-style: none;
  display: inline-block;
}

.menu summary.menu-btn::-webkit-details-marker { display: none; }

.menu-btn:hover, .text-link:hover, .menu.is-open .menu-btn, details.menu[open] .menu-btn {
  background: rgba(255, 255, 255, 0.08);
}

.menu-list {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
}

.menu.is-open .menu-list,
details.menu[open] .menu-list { display: block; }

.menu-list a, .menu-disabled {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
}

.menu-disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.menu-list a:hover, .menu-list a.is-active { background: #f4efe4; }

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 28px auto 48px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 18px;
}

.page-head h1 { margin: 0; font-size: 28px; font-weight: 650; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 16px; }

.card-pad { padding: 22px 24px 24px; }

.section-title {
  margin: 0 0 16px;
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--gold);
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.full { grid-column: 1 / -1; }

.label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 8px;
}

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
}

.textarea { min-height: 88px; resize: vertical; }

.hint { margin-top: 6px; color: var(--muted); font-size: 12px; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px 0;
  border-bottom: 1px solid var(--line);
  background: #fbf7ef;
  border-radius: 18px 18px 0 0;
}

.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 14px 16px 12px;
  border-bottom: 2px solid transparent;
  text-decoration: none;
}

.tab:focus-visible,
.btn:focus-visible,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible,
.menu-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.tab.is-active {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--gold);
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}

.pane { padding: 22px 24px 8px; }

.pane-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.family { margin-top: 8px; }
.family + .family { margin-top: 18px; }

.family h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.mods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mod {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
}

.mod input { margin-top: 3px; }

.mod b { display: block; font-size: 13px; font-weight: 650; }
.mod span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 24px 22px;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 22px;
  background: var(--navy);
  color: #f7f1e6;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover { background: var(--navy-2); }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.flash {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.flash-err { background: #fff5f5; color: var(--danger); }
.flash-ok { background: #f0fff4; color: var(--ok); }

.stub {
  padding: 48px 40px;
}

.stub h2 { margin: 0 0 8px; font-size: 24px; }
.stub p { color: var(--muted); max-width: 640px; }

.public-body { min-height: 100vh; }
.filter-bar { display: flex; gap: 12px; align-items: end; margin-bottom: 16px; }
.filter-bar .label { margin: 0; }
.filter-bar .select { min-width: 160px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
.table th { color: var(--muted); font-weight: 650; font-size: 12px; letter-spacing: 0.04em; }
.empty { color: var(--muted); text-align: center; padding: 32px 14px !important; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #f4efe4; }
.badge-payment_declared, .badge-draft { background: #fff7ed; color: #9a3412; }
.badge-paid, .badge-active { background: #ecfdf3; color: var(--ok); }
.badge-issued { background: #eef2ff; color: #3730a3; }
.badge-issue_failed, .badge-rejected { background: #fff5f5; color: var(--danger); }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; text-decoration: none; box-shadow: var(--shadow); }
.stat span { color: var(--muted); font-size: 12px; }
.stat b { display: block; font-size: 22px; margin-top: 6px; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-danger { background: var(--danger); }
.btn-small { padding: 6px 12px; border-radius: 8px; font-size: 13px; }
.row-actions, .row-actions form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: 8px 0; }
.qr-thumb { width: 72px; height: 72px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.qr-box { width: 220px; height: 220px; object-fit: contain; background: #fff; }
.qr-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 16px 0; }
.order-no { font-size: 44px; letter-spacing: 0.22em; font-weight: 700; margin: 8px 0; text-transform: lowercase; }
.center { text-align: center; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.product-card, .plan-card { text-decoration: none; display: block; cursor: pointer; }
.product-card h2, .plan-card b { margin: 0 0 8px; }
.plan-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #fff; }
.plan-card.is-active, .plan-card:has(input:checked) { border-color: var(--gold); box-shadow: var(--shadow); }
.plan-card input { margin-right: 8px; }
.price { font-size: 22px; font-weight: 700; margin: 8px 0; }
.status-lead { font-size: 22px; font-weight: 700; margin: 0 0 12px; }
.danger-form { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.text-link.dark { color: var(--ink); }
.panel .actions { padding-left: 0; padding-right: 0; }

@media (max-width: 840px) {
  .stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 840px) {
  .grid, .mods { grid-template-columns: 1fr 1fr; }
  .page-head { display: block; }
  .tabs { overflow-x: auto; }
}

@media (max-width: 640px) {
  .grid, .mods { grid-template-columns: 1fr; }
  .actions { flex-direction: column; align-items: stretch; }
  .filter-bar { display: block; }
}

.shop-body {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(176, 141, 87, 0.16), transparent 55%),
    var(--paper);
}
.shop-top {
  background: var(--navy);
  color: #f7f1e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 64px;
}
.shop-trust { color: rgba(247, 241, 230, 0.72); font-size: 13px; }
.shop-wrap { width: min(960px, calc(100% - 40px)); margin: 0 auto 64px; }
.shop-hero { padding: 40px 0 8px; }
.shop-hero h1 { margin: 8px 0 10px; font-size: 36px; letter-spacing: -0.03em; }
.shop-hero p { margin: 0; color: var(--muted); max-width: 640px; font-size: 16px; line-height: 1.6; }
.shop-toggle {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  margin: 24px 0 8px;
}
.shop-toggle-btn {
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  color: var(--muted);
}
.shop-toggle-btn em {
  font-style: normal;
  margin-left: 6px;
  color: var(--gold);
  font-size: 12px;
}
.shop-toggle-btn.is-active {
  background: var(--navy);
  color: #f7f1e6;
}
.shop-toggle-btn.is-active em { color: var(--gold-2); }
.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
.shop-card {
  position: relative;
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px 22px 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  min-height: 100%;
}
.shop-card input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.shop-card.is-featured { border-color: rgba(176, 141, 87, 0.55); }
.shop-card.is-active,
.shop-card:has(input:checked) {
  border-color: var(--gold);
  box-shadow: 0 18px 50px rgba(176, 141, 87, 0.18);
}
.shop-ribbon {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--navy);
  color: #f7f1e6;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 999px;
}
.shop-family { display: block; font-weight: 750; font-size: 18px; margin-bottom: 10px; }
.shop-price { display: block; font-size: 40px; letter-spacing: -0.04em; line-height: 1; }
.shop-price small { font-size: 16px; color: var(--muted); margin-left: 4px; font-weight: 600; }
.shop-save {
  display: inline-block;
  margin-top: 10px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}
.shop-equiv { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }
.shop-tagline { color: var(--muted); font-size: 14px; line-height: 1.55; min-height: 44px; }
.shop-bullets { margin: 0; padding: 0; list-style: none; }
.shop-bullets li {
  position: relative;
  padding: 7px 0 7px 22px;
  font-size: 14px;
}
.shop-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}
.shop-pick {
  display: block;
  margin-top: 18px;
  text-align: center;
  border-radius: 12px;
  padding: 11px 16px;
  background: #f4efe4;
  font-weight: 700;
}
.shop-card:has(input:checked) .shop-pick,
.shop-card.is-active .shop-pick {
  background: var(--navy);
  color: #f7f1e6;
}
.shop-detail {
  margin-top: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.shop-detail[hidden] { display: none; }
.shop-detail-head h2 { margin: 0 0 6px; font-size: 22px; }
.shop-detail-head p { margin: 0 0 18px; color: var(--muted); }
.shop-detail-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 28px; }
.shop-detail h3 {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--gold);
}
.shop-features { margin: 0; padding: 0; list-style: none; columns: 2; gap: 18px; }
.shop-features li { padding: 6px 0 6px 18px; position: relative; break-inside: avoid; font-size: 14px; }
.shop-features li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.shop-features.is-extra li::before { content: "+"; color: var(--gold); }
.shop-extra-label { margin: 16px 0 8px; font-size: 13px; color: var(--muted); }
.shop-stat {
  background: #0c1b2e;
  color: #f7f1e6;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.shop-stat span { display: block; font-size: 12px; letter-spacing: 0.12em; color: var(--gold-2); }
.shop-stat b { display: block; font-size: 32px; margin-top: 6px; }
.shop-quotas { margin: 0; display: grid; gap: 10px; }
.shop-quotas div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.shop-quotas dt { color: var(--muted); font-size: 13px; }
.shop-quotas dd { margin: 0; font-weight: 700; }
.shop-apply { margin-top: 8px; }
.shop-cta { min-width: 180px; }

@media (max-width: 840px) {
  .shop-grid, .shop-detail-grid, .shop-features { grid-template-columns: 1fr; columns: 1; }
  .shop-top { display: block; height: auto; padding: 14px 20px; }
  .shop-trust { display: block; margin-top: 6px; }
  .shop-hero h1 { font-size: 28px; }
}
