:root {
  --navy: #0b2447;
  --navy-2: #123a66;
  --blue: #146ebe;
  --blue-2: #0ea5e9;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f4f7fb;
  --white: #ffffff;
  --red: #e11d48;
  --amber: #f59e0b;
  --green: #16a34a;
  --teal: #0f766e;
  --radius: 8px;
  --shadow: 0 4px 18px rgba(15, 23, 42, .07);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, .12);
}

.i18n-editor {
  border: 1px solid #cfe0f2;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8fbff;
}

.i18n-editor > summary,
.i18n-language-card > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--navy);
}

.i18n-editor > .muted {
  margin: 8px 0 10px;
}

.i18n-language-card {
  border-top: 1px solid #deebf7;
  padding: 10px 0;
}

.i18n-language-card summary small {
  margin-left: 6px;
  color: #718096;
  font-weight: 500;
}

.i18n-language-card .editor-grid {
  margin-top: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
svg { display: block; }
.icon { width: 18px; height: 18px; flex: none; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: min(1240px, 100% - 32px); margin: 0 auto; }
.boot-screen { min-height: 100vh; display: grid; place-content: center; gap: 14px; justify-items: center; color: var(--muted); background: var(--bg); }
.boot-screen img { width: 56px; height: 56px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 9px 15px; min-height: 38px; font-weight: 600;
  background: var(--blue); color: #fff; transition: filter .15s, transform .1s, border-color .15s, background .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-dark { background: var(--navy); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); background: #f8fbff; }
.btn-sm { padding: 6px 11px; min-height: 32px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.pay-method:disabled { opacity: .55; cursor: not-allowed; filter: grayscale(.35); }

.purchase-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 12px 0 16px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--line); }
.purchase-flow > div { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px 18px; background: #fff; }
.purchase-flow .flow-step { width: 30px; height: 30px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--blue) 12%, white); color: var(--blue); font-weight: 800; }
.purchase-flow b, .purchase-flow small { display: block; }
.purchase-flow b { color: var(--ink); font-size: 14px; }
.purchase-flow small { margin-top: 3px; color: var(--muted); line-height: 1.35; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.badge-blue { background: #e8f4fc; color: #1a5f96; }
.badge-red { background: #ffe9ee; color: #be123c; }
.badge-green { background: #e7f8ee; color: #15803d; }
.badge-amber { background: #fff6e6; color: #b45309; }
.badge-gray { background: #eef2f7; color: #475569; }
.badge-teal { background: #e0f5f2; color: #0f766e; }

.price { color: var(--red); font-weight: 700; }
.price small { font-size: .82em; font-weight: 600; }
.price-old { color: #94a3b8; text-decoration: line-through; font-size: 12px; font-weight: 400; margin-left: 5px; }
.muted { color: var(--muted); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Topbar */
.topbar { background: var(--navy); color: #cbd5e1; }
.topbar-inner { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; }
.topbar-brand { display: flex; align-items: center; gap: 7px; color: #f8fafc; font-weight: 600; }
.topbar-brand img { width: 18px; height: 18px; border-radius: 5px; object-fit: cover; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.topbar-link { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 6px; color: #cbd5e1; }
.topbar-link:hover { color: #fff; background: rgba(255,255,255,.08); }

/* Header */
.header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { min-height: 70px; display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 11px; flex: none; }
.logo-mark { width: 42px; height: 42px; border-radius: 8px; display: block; overflow: hidden; background: transparent; box-shadow: 0 5px 14px rgba(11,36,71,.16); }
.logo-mark img { width: 100%; height: 100%; object-fit: cover; }
.logo-name { font-size: 20px; font-weight: 800; color: var(--navy); line-height: 1.15; }
.logo-sub { font-size: 11px; color: var(--muted); }

.header-search { flex: 1; max-width: 560px; position: relative; }
.search-box { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f8fafc; }
.search-box:focus-within { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(20,110,190,.1); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 11px 14px; color: var(--ink); }
.search-box button { border: 0; background: var(--blue); color: #fff; padding: 0 18px; display: grid; place-items: center; }
.search-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); overflow: hidden; z-index: 20; }
.search-suggest-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #f1f5f9; }
.search-suggest-item:last-child { border-bottom: 0; }
.search-suggest-item:hover { background: #f8fbff; }
.search-suggest-item img { width: 30px; height: 30px; border-radius: 7px; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.header-user { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--ink); }
.header-user:hover { background: #f1f5f9; }
.balance-chip { display: inline-flex; align-items: center; gap: 5px; background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; border-radius: 8px; padding: 5px 9px; font-size: 12px; font-weight: 700; }
.cart-btn { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy); }
.cart-btn:hover { border-color: var(--blue); color: var(--blue); }
.cart-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* Category nav */
.catnav { background: #fff; border-bottom: 1px solid var(--line); }
.catnav-inner { display: flex; align-items: center; gap: 4px; min-height: 44px; overflow: visible; scrollbar-width: none; }
.catnav-inner::-webkit-scrollbar { display: none; }
.catnav-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 7px; color: #334155; font-weight: 600; white-space: nowrap; }
.catnav-link:hover { color: var(--blue); background: #eff6ff; }
.catnav-link.active { color: var(--blue); background: #e8f4fc; }
.catnav-all { font-weight: 800; color: var(--navy); }
.nav-popover { position: relative; flex: none; }
.nav-popover > summary { list-style: none; cursor: pointer; user-select: none; }
.nav-popover > summary::-webkit-details-marker { display: none; }
.nav-popover[open] > summary { color: var(--blue); background: #eff6ff; }
.nav-popover-menu { position: absolute; z-index: 45; top: calc(100% + 7px); left: 0; width: 290px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-lg); }
.nav-popover-menu::before { content: ''; position: absolute; left: 18px; top: -5px; width: 9px; height: 9px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); background: #fff; transform: rotate(45deg); }
.nav-popover-menu a { position: relative; display: grid; gap: 3px; padding: 10px 11px; border-radius: 8px; color: #334155; }
.nav-popover-menu a:hover { color: var(--blue); background: #eff6ff; }
.nav-popover-menu a small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.nav-popover-empty { display: block; padding: 14px; color: var(--muted); text-align: center; }
.language-popover { margin-left: auto; }
.language-popover .nav-popover-menu { right: 0; left: auto; width: 178px; }
.language-popover .nav-popover-menu::before { right: 18px; left: auto; }
.language-menu button { width: 100%; padding: 9px 11px; border: 0; border-radius: 7px; background: transparent; color: #334155; font: inherit; text-align: left; cursor: pointer; }
.language-menu button:hover, .language-menu button.active { color: var(--blue); background: #eff6ff; font-weight: 700; }

.cat-dropdown { position: relative; flex: none; margin-right: 8px; }
.cat-dropdown-btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--blue); color: #fff;
  padding: 10px 16px; border-radius: 7px; font-weight: 700;
}
.cat-dropdown-btn:hover { background: #125f9f; }
.cat-dropdown-btn .chevron { transition: transform .15s; }
.cat-dropdown.open .chevron { transform: rotate(180deg); }
.cat-mega {
  position: absolute; top: calc(100% + 8px); left: 0; width: min(760px, calc(100vw - 24px));
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: 210px 1fr; overflow: hidden; z-index: 40; animation: toast-in .15s ease;
}
.cat-mega[hidden] { display: none; }
.cat-mega-left { background: #f8fafc; border-right: 1px solid var(--line); padding: 8px; overflow-y: auto; max-height: 420px; }
.cat-mega-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; color: #334155; font-weight: 600; cursor: pointer; }
.cat-mega-item:hover { background: #eff6ff; color: var(--blue); }
.cat-mega-item.active { background: #fff; color: var(--blue); box-shadow: 0 1px 5px rgba(15,23,42,.06); }
.cat-mega-item img { width: 30px; height: 30px; border-radius: 7px; }
.cat-mega-right { padding: 16px; overflow-y: auto; max-height: 420px; }
.cat-mega-right h4 { margin: 0 0 12px; font-size: 15px; color: var(--navy); }
.cat-mega-subgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cat-mega-sub { display: block; border: 1px solid #f1f5f9; border-radius: 8px; padding: 10px 11px; color: #475569; font-weight: 600; font-size: 12.5px; }
.cat-mega-sub:hover { border-color: #bfdbfe; color: var(--blue); background: #f8fbff; }
.cat-mega-all { color: var(--blue); font-weight: 700; margin-bottom: 12px; display: inline-flex; align-items: center; gap: 5px; }

/* Hero */
.hero { margin: 16px 0 0; position: relative; overflow: hidden; border-radius: 8px; box-shadow: var(--shadow); }
.hero-slide { position: relative; width: 100%; }
.hero-slide img { width: 100%; height: clamp(240px, 34vw, 430px); object-fit: cover; }
.hero-banner { position: relative; display: block; }
.hero-caption {
  position: absolute; left: 7%; bottom: 16%; max-width: min(520px, 72%);
  display: flex; flex-direction: column; gap: 8px; padding: 18px 22px;
  background: rgba(8, 26, 47, .68); border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px; color: #fff; backdrop-filter: blur(3px);
}
.hero-caption b { font-size: clamp(20px, 3vw, 34px); line-height: 1.2; }
.hero-caption span { font-size: 14px; color: #dbeafe; }
.hero-nav { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; pointer-events: none; padding: 0 12px; }
.hero-nav button { pointer-events: auto; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.5); background: rgba(15,23,42,.35); color: #fff; display: grid; place-items: center; }
.hero-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 7px; }
.hero-dot { width: 8px; height: 8px; border-radius: 999px; border: 0; background: rgba(255,255,255,.45); padding: 0; }
.hero-dot.active { background: #fff; width: 22px; }

/* Notice strip */
.notice-strip { margin-top: 14px; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 11px 14px; }
.notice-label { display: inline-flex; align-items: center; gap: 6px; color: var(--red); font-weight: 700; flex: none; }
.notice-text { color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Service board */
.service-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.service-item { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 13px 14px; display: flex; flex-direction: column; gap: 7px; }
.service-item-head { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.service-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; }
.service-icon.blue { background: #2563eb; }
.service-icon.red { background: var(--red); }
.service-icon.green { background: var(--green); }
.service-icon.teal { background: var(--teal); }
.service-item p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.service-links { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.service-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; background: #eff6ff; color: #1d4ed8; padding: 7px 8px; font-size: 12px; font-weight: 700; }
.service-link:hover { background: #dbeafe; }

/* Home two-column layout */
.home-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; margin-top: 14px; align-items: start; }
.home-main { min-width: 0; grid-column: 2; grid-row: 1; }
.home-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 86px; grid-column: 1; grid-row: 1; }
.side-panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.side-panel-head { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 9px; }
.side-panel p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.side-panel .panel-cta { display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 9px; border-radius: 8px; background: #eff6ff; color: #1d4ed8; padding: 7px 10px; font-size: 12px; font-weight: 700; }
.side-panel .panel-cta.red { background: #fff1f2; color: #be123c; }
.side-panel .panel-cta.blue { background: #eff6ff; color: #1d4ed8; }
.side-panel .panel-cta.teal { background: #f0fdfa; color: #0f766e; }
.side-panel .panel-cta.green { background: #f0fdf4; color: #15803d; }
.side-panel .panel-cta:hover { filter: brightness(.98); }
.member-note { background: #fffbf0; border: 1px solid #fde68a; border-radius: 8px; padding: 12px 13px; color: #92400e; font-size: 12.5px; line-height: 1.6; }
.side-cat-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.side-cat-link { display: flex; align-items: center; gap: 7px; border: 1px solid #f1f5f9; border-radius: 8px; padding: 8px 9px; color: #475569; font-weight: 600; font-size: 12px; }
.side-cat-link:hover { border-color: #bfdbfe; color: var(--blue); background: #f8fbff; }
.side-cat-link img { width: 24px; height: 24px; border-radius: 6px; }
.side-category-panel { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.side-category-head { display: flex; align-items: center; gap: 10px; padding: 15px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #f8fbff, #fff); }
.side-category-head > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.side-category-head b { color: var(--navy); font-size: 16px; }
.side-category-head small { color: var(--muted); font-size: 11.5px; }
.side-category-mark { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 8px; color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-2)); }
.side-category-list { display: flex; flex-direction: column; max-height: min(68vh, 720px); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 7px; }
.side-category-link { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 16px; align-items: center; gap: 9px; min-height: 54px; padding: 7px 8px; border: 1px solid transparent; border-radius: 8px; color: #334155; }
.side-category-link:hover { position: relative; border-color: #bfdbfe; border-radius: 8px; color: var(--blue); background: #f0f7ff; }
.side-category-link.active { position: relative; border-color: #93c5fd; border-radius: 8px; color: #1d4ed8; background: #eff6ff; }
.side-category-branch { border-top: 1px solid #f1f5f9; }
.side-category-row { display: grid; grid-template-columns: minmax(0, 1fr) 32px; align-items: stretch; border: 1px solid transparent; border-radius: 8px; color: #334155; }
.side-category-row:hover { position: relative; border-color: #bfdbfe; color: var(--blue); background: #f0f7ff; }
.side-category-row.active { position: relative; border-color: #93c5fd; color: #1d4ed8; background: #eff6ff; }
.side-category-main { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 54px; padding: 7px 3px 7px 8px; color: inherit; }
.side-category-toggle { width: 32px; min-height: 54px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 0 8px 8px 0; background: transparent; color: #94a3b8; cursor: pointer; }
.side-category-toggle:hover { background: rgba(37, 99, 235, .08); color: var(--blue); }
.side-category-toggle .icon { transition: transform .18s ease; }
.side-category-branch.expanded .side-category-toggle .icon { transform: rotate(180deg); }
.side-category-end { display: grid; place-items: center; color: #94a3b8; }
.side-category-end .icon { width: 15px; height: 15px; }
.side-category-icon { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; }
.side-category-icon.all { display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #0b2447, #146ebe); }
.side-category-icon.all .icon { width: 19px; height: 19px; }
.side-category-name { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.side-category-name b { overflow: hidden; color: inherit; font-size: 13px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.side-category-name small { overflow: hidden; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.side-category-count { min-width: 24px; padding: 2px 6px; border-radius: 999px; background: #f1f5f9; color: #64748b; font-size: 10.5px; font-weight: 700; text-align: center; }
.side-category-link.active .side-category-count, .side-category-link:hover .side-category-count, .side-category-row.active .side-category-count, .side-category-row:hover .side-category-count { background: #dbeafe; color: #1d4ed8; }
.side-category-link > .icon { width: 15px; height: 15px; color: #94a3b8; }
.side-subcategory-list { display: flex; flex-direction: column; gap: 2px; padding: 3px 5px 7px 13px; }
.side-subcategory-list[hidden] { display: none; }
.side-subcategory-link { min-width: 0; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 15px; align-items: center; gap: 7px; min-height: 38px; padding: 5px 7px; border-radius: 7px; color: #64748b; font-size: 11.5px; font-weight: 600; }
.side-subcategory-link:hover { color: var(--blue); background: #f0f7ff; }
.side-subcategory-link.active { color: #1d4ed8; background: #dbeafe; }
.side-subcategory-link > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-subcategory-link > .icon { width: 14px; height: 14px; color: #94a3b8; }
.side-subcategory-branch { width: 13px; height: 18px; align-self: start; margin-top: 1px; border-left: 1px solid #cbd5e1; border-bottom: 1px solid #cbd5e1; border-radius: 0 0 0 4px; }

/* Section */
.section { margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid #f1f5f9; }
.section-title { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 800; color: var(--navy); }
.section-title .bar { width: 4px; height: 19px; border-radius: 2px; background: linear-gradient(180deg, var(--blue-2), var(--blue)); }
.section-more { display: inline-flex; align-items: center; gap: 5px; color: var(--blue); font-weight: 600; font-size: 13px; }

/* Category grid */
.cat-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; padding: 16px 18px; }
.cat-cell { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 13px 6px; border: 1px solid #f1f5f9; border-radius: 8px; background: #fbfdff; }
.cat-cell:hover { border-color: #bfdbfe; background: #f0f7ff; }
.cat-cell img { width: 44px; height: 44px; border-radius: 8px; }
.cat-cell span { font-size: 12.5px; font-weight: 700; color: #334155; text-align: center; }

/* Goods toolbar */
.goods-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 13px 18px; border-bottom: 1px solid #f1f5f9; }
.goods-count { font-size: 14px; font-weight: 700; color: var(--ink); }
.goods-count b { color: var(--red); font-size: 17px; }
.goods-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sort-btn { border: 1px solid var(--line); background: #fff; color: #475569; border-radius: 7px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; }
.sort-btn.active { border-color: var(--blue); color: var(--blue); background: #eff6ff; }
.currency-select { border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; color: #334155; background: #fff; font-size: 12.5px; }

/* Goods table */
.goods-table { width: 100%; border-collapse: collapse; }
.goods-table th { text-align: left; background: #f8fafc; color: #64748b; font-size: 12px; font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.goods-table td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.goods-table tr:hover td { background: #fbfdff; }
.goods-table .col-name { width: auto; }
.goods-table .col-tags { width: 220px; }
.goods-table .col-price { width: 120px; }
.goods-table .col-stock { width: 90px; text-align: center; }
.goods-table .col-action { width: 100px; text-align: right; }
.goods-row { cursor: pointer; }
.goods-cell-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.goods-thumb { width: 46px; height: 46px; border-radius: 8px; flex: none; overflow: hidden; background: #f1f5f9; }
.goods-thumb img { width: 100%; height: 100%; object-fit: cover; }
.goods-name-text { font-weight: 700; color: var(--ink); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.goods-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.stock-low { color: var(--red); font-weight: 700; }
.stock-ok { color: var(--green); font-weight: 600; }

/* Empty */
.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty .icon { width: 38px; height: 38px; margin: 0 auto 12px; color: #cbd5e1; }
.empty h3 { margin: 0 0 7px; font-size: 17px; color: #334155; }

/* Product detail */
.breadcrumb { display: flex; align-items: center; gap: 7px; padding: 14px 0 0; font-size: 12.5px; color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }
.product-wrap { display: grid; grid-template-columns: 380px 1fr; gap: 22px; margin-top: 14px; }
.product-visual { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 22px; align-self: start; }
.product-visual-main { border-radius: 8px; overflow: hidden; }
.product-visual-main img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.product-info { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.product-title { margin: 0 0 10px; font-size: 22px; font-weight: 800; line-height: 1.35; }
.product-tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.product-price-box { display: flex; align-items: baseline; gap: 12px; background: #fff7f8; border: 1px solid #ffe4e6; border-radius: 8px; padding: 13px 15px; margin-bottom: 16px; }
.product-price-box .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.product-price-box .price { font-size: 28px; }
.product-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.meta-item { border: 1px solid #f1f5f9; border-radius: 8px; padding: 10px 12px; background: #fbfdff; }
.meta-item .k { color: var(--muted); font-size: 12px; }
.meta-item .v { font-weight: 800; margin-top: 2px; }
.qty-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.qty-label { font-weight: 700; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.qty-stepper button { width: 36px; height: 38px; border: 0; background: #f8fafc; color: var(--ink); display: grid; place-items: center; }
.qty-stepper button:hover { background: #e2e8f0; }
.qty-stepper input { width: 54px; height: 38px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font-weight: 700; outline: none; }
.product-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.product-actions .btn { min-height: 44px; padding: 0 22px; }
.product-notice { margin-top: 16px; background: #fffbf0; border: 1px solid #fde68a; border-radius: 8px; padding: 11px 13px; color: #92400e; font-size: 12.5px; line-height: 1.55; }
.product-desc { margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.product-desc h3 { margin: 0 0 12px; font-size: 16px; }
.desc-line { display: flex; gap: 8px; align-items: flex-start; color: #475569; padding: 5px 0; }
.desc-line .icon { width: 16px; height: 16px; color: var(--green); margin-top: 2px; }

/* Cart */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; margin-top: 16px; align-items: start; }
.cart-items { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cart-row { display: grid; grid-template-columns: 1fr 130px 140px 90px 36px; gap: 12px; align-items: center; padding: 15px 18px; border-bottom: 1px solid #f1f5f9; }
.cart-row:last-child { border-bottom: 0; }
.cart-product { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cart-product img { width: 52px; height: 52px; border-radius: 8px; }
.cart-product-name { font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-summary { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; position: sticky; top: 84px; }
.cart-summary h3 { margin: 0 0 14px; font-size: 16px; }
.summary-line { display: flex; justify-content: space-between; padding: 7px 0; color: #475569; }
.summary-total { border-top: 1px dashed var(--line); margin-top: 9px; padding-top: 13px; font-size: 17px; font-weight: 800; }
.summary-total .price { font-size: 24px; }
.remove-btn { border: 0; background: transparent; color: #94a3b8; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; }
.remove-btn:hover { color: var(--red); background: #ffe9ee; }

/* Checkout */
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px; margin-top: 16px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.panel h3 { margin: 0 0 14px; font-size: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-weight: 700; font-size: 13px; color: #334155; }
.form-item .hint { color: var(--muted); font-size: 12px; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  padding: 10px 12px; color: var(--ink); outline: 0; min-height: 40px;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,110,190,.1); }
.textarea { min-height: 96px; resize: vertical; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-method { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; gap: 10px; align-items: center; background: #fff; text-align: left; }
.pay-method:hover { border-color: #bfdbfe; }
.pay-method.active { border-color: var(--blue); background: #eff6ff; }
.pay-method .icon { width: 26px; height: 26px; color: var(--blue); }
.pay-method b { display: block; }
.pay-method small { color: var(--muted); }
.order-items { border: 1px solid #f1f5f9; border-radius: 8px; }
.order-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
.order-item:last-child { border-bottom: 0; }
.checkout-page-head { align-items: end; }
.checkout-reference-layout { margin-bottom: 34px; }
.checkout-description-card { min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 30px 34px; box-shadow: 0 12px 32px rgba(15, 39, 72, .05); }
.checkout-product-description + .checkout-product-description { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.checkout-product-description h2 { margin: 0 0 22px; color: var(--navy); font-size: 24px; line-height: 1.4; }
.checkout-description-section { margin-top: 22px; }
.checkout-description-section h3 { margin: 0 0 10px; color: var(--ink); font-size: 18px; }
.checkout-description-section p, .checkout-description-section li { color: #334155; font-size: 15px; line-height: 1.9; }
.checkout-description-section ul { margin: 0; padding-left: 22px; }
.checkout-description-section li + li { margin-top: 6px; }
.checkout-remark-section { padding-top: 18px; border-top: 1px dashed var(--line); }
.checkout-order-card { position: sticky; top: 84px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: 0 14px 38px rgba(15, 39, 72, .09); }
.checkout-line-item { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.checkout-line-item + .checkout-line-item { padding-top: 18px; }
.checkout-line-head { display: flex; justify-content: space-between; gap: 14px; color: var(--navy); font-size: 16px; line-height: 1.5; }
.checkout-line-head b { min-width: 0; }
.checkout-line-head span { color: var(--red); font-weight: 800; white-space: nowrap; }
.checkout-badges { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.checkout-qty-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; color: #475569; font-weight: 700; }
.checkout-price-main { display: flex; align-items: baseline; gap: 10px; margin: 24px 0 14px; color: var(--red); font-size: 30px; font-weight: 900; }
.checkout-price-main del { color: #94a3b8; font-size: 15px; font-weight: 500; }
.checkout-price-box { padding: 14px 16px; background: #f8fbff; border: 1px solid #dce8f5; border-radius: 12px; }
.checkout-price-box > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; color: #475569; }
.checkout-price-box .checkout-final-price { margin-top: 7px; padding: 10px 12px; background: #eaf4ff; border: 1px solid #bfdbfe; border-radius: 10px; color: #164e86; font-weight: 800; }
.checkout-price-box .checkout-final-price b { font-size: 20px; }
.checkout-email-field { margin-top: 22px; }
.checkout-order-card .form-item + .form-item { margin-top: 18px; }
.checkout-pay-methods .pay-method { min-height: 72px; }
.checkout-submit-btn { min-height: 54px; margin-top: 22px; border-radius: 999px; font-size: 17px; box-shadow: 0 10px 22px rgba(20, 110, 190, .2); }
.checkout-safety-note { margin: 11px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.checkout-stage-title { max-width: 920px; margin: 28px auto 18px; color: #94a3b8; font-size: 20px; }
.order-confirm-card { max-width: 920px; margin: 0 auto 52px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 42px rgba(15, 39, 72, .1); }
.order-confirm-card > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 24px; background: #eff6ff; border-bottom: 1px solid #dbeafe; color: var(--blue); }
.order-confirm-card > header h1 { margin: 0; color: var(--navy); font-size: 20px; }
.order-confirm-card > header span { font-size: 13px; }
.order-confirm-body { padding: 24px; }
.confirm-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; padding-bottom: 18px; border-bottom: 1px dashed var(--line); }
.confirm-info-grid > div { display: flex; gap: 12px; }
.confirm-info-grid span { min-width: 72px; color: var(--muted); }
.confirm-info-grid b { color: var(--ink); word-break: break-all; }
.confirm-items { padding: 16px 0 8px; }
.confirm-info-row { display: flex; justify-content: space-between; gap: 18px; padding: 8px 0; color: #334155; }
.confirm-info-row b { white-space: nowrap; }
.confirm-price-box { margin-top: 10px; }
.confirm-remark { margin-top: 16px; padding: 12px 14px; background: #f8fafc; border-radius: 10px; }
.confirm-remark span { color: var(--muted); font-size: 12px; }
.confirm-remark p { margin: 6px 0 0; white-space: pre-wrap; }
.confirm-actions { display: flex; justify-content: center; gap: 12px; margin-top: 20px; }
.confirm-actions .btn { min-width: 170px; min-height: 48px; border-radius: 999px; }
.payment-page-card { max-width: 680px; margin: 0 auto 52px; display: flex; flex-direction: column; align-items: center; padding: 32px; background: #fff; border: 1px solid var(--blue); border-radius: 18px; box-shadow: 0 18px 46px rgba(15, 39, 72, .1); text-align: center; }
.payment-validity { color: var(--blue); font-size: 18px; font-weight: 700; }
.payment-validity b { font-variant-numeric: tabular-nums; }
.payment-qr { width: 260px; height: 260px; margin: 22px auto 14px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; }
.payment-qr-placeholder { width: 260px; height: 260px; margin: 22px auto 14px; display: grid; place-items: center; align-content: center; gap: 12px; background: #f8fafc; border: 2px dashed #cbd5e1; border-radius: 12px; color: #94a3b8; }
.payment-qr-placeholder .icon { width: 56px; height: 56px; }
.payment-total { margin-top: 6px; color: #64748b; font-size: 16px; }
.payment-total b { color: var(--red); font-size: 24px; }
.payment-order-no { margin-top: 7px; color: #94a3b8; font-size: 12px; }
.payment-page-card .payment-submit-btn { min-width: 230px; min-height: 48px; margin-top: 22px; border-radius: 999px; }
.payment-back-link { margin-top: 14px; color: var(--muted); font-size: 13px; }
.payment-address { width: 100%; margin-top: 24px; padding: 20px; display: flex; flex-direction: column; gap: 10px; background: #0f172a; border-radius: 12px; color: #a5f3fc; word-break: break-all; text-align: left; }
.payment-address b { color: #fbbf24; }
.payment-balance-state { margin: 24px 0 4px; display: flex; flex-direction: column; align-items: center; gap: 10px; color: #475569; }
.payment-balance-state .icon { width: 64px; height: 64px; color: var(--blue); }
.payment-balance-state b { color: var(--navy); font-size: 22px; }
.payment-page-card.expired { border-color: #cbd5e1; }

/* Orders */
.orders-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.orders-toolbar .input { max-width: 360px; }
.order-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; margin-top: 14px; overflow: hidden; }
.order-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #f1f5f9; background: #fbfdff; flex-wrap: wrap; }
.order-no { font-weight: 800; color: var(--navy); }
.order-time { color: var(--muted); font-size: 12px; }
.order-body { padding: 14px 16px; }
.order-secrets { margin-top: 12px; background: #0f172a; border-radius: 8px; padding: 13px 14px; color: #a5f3fc; font-family: Consolas, Menlo, monospace; font-size: 12.5px; line-height: 1.7; word-break: break-all; }
.order-secrets .title { color: #fbbf24; font-weight: 700; font-family: inherit; margin-bottom: 5px; display: flex; align-items: center; gap: 6px; }
.secret-line { padding: 3px 0; border-bottom: 1px dashed rgba(148,163,184,.25); }
.secret-line:last-child { border-bottom: 0; }
.order-empty { margin-top: 16px; }

/* Auth */
.auth-wrap { max-width: 430px; margin: 34px auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 26px; box-shadow: var(--shadow); }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-head img { width: 52px; height: 52px; margin: 0 auto 10px; }
.auth-head h1 { margin: 0 0 5px; font-size: 22px; }
.auth-head p { margin: 0; color: var(--muted); }
.auth-switch { text-align: center; margin-top: 16px; color: var(--muted); font-size: 13px; }
.auth-switch a { color: var(--blue); font-weight: 700; }

/* Recharge */
.recharge-layout { display: grid; grid-template-columns: 1fr 360px; gap: 16px; margin-top: 16px; align-items: start; }
.recharge-amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.amount-cell { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 14px 8px; text-align: center; }
.amount-cell:hover { border-color: #99f6e4; }
.amount-cell.active { border-color: var(--teal); background: #f0fdfa; }
.amount-cell b { display: block; font-size: 18px; color: var(--ink); }
.amount-cell small { color: var(--muted); }
.recharge-note { margin-top: 14px; background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 8px; padding: 12px 14px; color: #115e59; font-size: 13px; }

/* Admin */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.admin-nav { background: var(--navy); border-radius: 8px; padding: 12px; position: sticky; top: 84px; }
.admin-nav a { display: flex; align-items: center; gap: 9px; color: #cbd5e1; padding: 10px 12px; border-radius: 8px; font-weight: 600; }
.admin-nav a.active, .admin-nav a:hover { color: #fff; background: rgba(255,255,255,.1); }
.admin-nav .admin-brand { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 800; padding: 10px 12px 14px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 10px; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.admin-stat { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 15px 16px; }
.admin-stat .k { color: var(--muted); font-size: 12px; }
.admin-stat .v { font-size: 24px; font-weight: 800; margin-top: 3px; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.admin-product-result { margin-top: 3px; font-size: 12px; }
.admin-product-result b { color: var(--blue); }
.admin-product-filters { display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(150px, .8fr) minmax(180px, 1fr) auto; align-items: end; gap: 10px; margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.admin-product-filter-field { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.admin-product-filter-field label { color: #64748b; font-size: 11.5px; font-weight: 700; }
.admin-product-reset { min-height: 38px; white-space: nowrap; }
.admin-product-category { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.admin-product-category b { color: #334155; font-size: 12px; }
.admin-product-category small { color: #64748b; font-size: 11px; }
.admin-table-wrap { overflow-x: auto; }
.cards-detail-summary { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.cards-detail-summary span { padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--soft); color: var(--muted); }
.cards-detail-summary b { color: var(--primary); font-size: 17px; }
.cards-detail-title { margin: 18px 0 10px; font-size: 16px; }
.card-secret { display: inline-block; min-width: 220px; max-width: 460px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.admin-table th { text-align: left; padding: 10px 12px; background: #f8fafc; color: #64748b; font-size: 12px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.admin-table tr:hover td { background: #fbfdff; }
@media (max-width: 900px) {
  .admin-product-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-product-search-field { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .admin-product-filters { grid-template-columns: 1fr; }
  .admin-product-search-field { grid-column: auto; }
}
.admin-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.admin-sort { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.admin-sort-value { min-width: 38px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: center; }
.admin-sort .icon-btn { width: 28px; height: 28px; font-size: 14px; font-weight: 800; }
.icon-btn { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #475569; display: inline-grid; place-items: center; }
.icon-btn:hover { color: var(--blue); border-color: #bfdbfe; background: #eff6ff; }
.icon-btn.danger:hover { color: var(--red); border-color: #fecdd3; background: #fff1f2; }

/* Footer */
.footer { margin-top: 26px; background: var(--navy); color: #cbd5e1; }
.footer-inner { padding: 30px 0 22px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 28px; }
.footer h4 { color: #fff; font-size: 15px; margin: 0 0 12px; }
.footer p, .footer li { margin: 0; font-size: 13px; line-height: 1.7; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer a:hover { color: #fff; }
.footer-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-logo img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.footer-logo b { font-size: 17px; color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 13px 0; text-align: center; font-size: 12px; color: #94a3b8; }

/* Toast */
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 9px; max-width: min(360px, calc(100vw - 36px)); }
.toast { background: var(--navy); color: #fff; border-radius: 8px; padding: 12px 15px; box-shadow: var(--shadow-lg); display: flex; align-items: flex-start; gap: 9px; animation: toast-in .2s ease; }
.toast.success { background: #14532d; }
.toast.error { background: #881337; }
.toast.warn { background: #78350f; }
.toast .icon { width: 18px; height: 18px; margin-top: 1px; flex: none; }
.toast.out { animation: toast-out .2s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* Modal */
.modal-mask { position: fixed; inset: 0; z-index: 80; background: rgba(11,36,71,.45); display: grid; place-items: center; padding: 18px; }
.modal { width: min(460px, 100%); max-height: calc(100vh - 36px); display: flex; flex-direction: column; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-lg); animation: toast-in .18s ease; }
.modal-wide { width: min(920px, 100%); max-height: min(86vh, 820px); display: flex; flex-direction: column; }
.modal-wide .modal-body { overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); font-weight: 800; }
.modal-close { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.modal-close:hover { background: #f1f5f9; color: var(--ink); }
.modal-body { padding: 18px; overflow: auto; }
.admin-count-link { border: 0; background: #e8f2ff; color: var(--blue); min-width: 34px; height: 30px; padding: 0 10px; border-radius: 999px; font: inherit; font-weight: 800; cursor: pointer; }
.admin-count-link:hover { background: var(--blue); color: #fff; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0 0 14px; }
.detail-grid > div { min-width: 0; border: 1px solid var(--line); background: #f8fbff; border-radius: 8px; padding: 10px 12px; }
.detail-grid span, .detail-grid b { display: block; overflow-wrap: anywhere; }
.detail-grid span { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.drill-list { display: grid; gap: 8px; }
.drill-card { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto 24px; align-items: center; gap: 14px; text-align: left; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 12px 14px; color: var(--ink); cursor: pointer; }
.drill-card:hover { border-color: #93c5fd; background: #f8fbff; }
.drill-main, .drill-meta { min-width: 0; display: grid; gap: 4px; }
.drill-main small, .drill-meta small { color: var(--muted); overflow-wrap: anywhere; }
.drill-meta { text-align: right; }
.drill-meta b { color: var(--red); }
.drill-arrow { color: var(--blue); font-size: 26px; }
.empty-inline { padding: 18px; border: 1px dashed #cbd5e1; border-radius: 8px; background: #f8fafc; color: var(--muted); text-align: center; }

/* Page head */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 20px 0 4px; }
.page-head h1 { margin: 0; font-size: 24px; color: var(--navy); }
.page-head p { margin: 5px 0 0; color: var(--muted); }

/* Admin editor */
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.editor-grid .full { grid-column: 1 / -1; }

/* Icon manager */
.icon-manager-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.icon-manager-grid-brand { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.icon-manage-card { min-width: 0; display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 10px 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdff; }
.icon-manage-preview { width: 58px; height: 58px; padding: 0; object-fit: cover; border: 1px solid #dbe4ef; border-radius: 10px; background: transparent; }
.icon-manage-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.icon-manage-info b { overflow: hidden; color: var(--navy); text-overflow: ellipsis; white-space: nowrap; }
.icon-manage-info small { color: var(--muted); font-size: 11.5px; }
.icon-manage-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.icon-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Account showcase */
.showcase-page { padding: 26px 0 44px; display: grid; gap: 18px; }
.showcase-hero-card { min-height: 150px; position: relative; overflow: hidden; display: flex; align-items: center; gap: 24px; padding: 28px 34px; background: linear-gradient(135deg, #fff 0%, #f5f9ff 58%, #edf3fb 100%); border: 1px solid #dbe4ef; border-radius: 22px; box-shadow: 0 22px 48px rgba(15, 39, 72, .14); }
.showcase-hero-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 7px; background: linear-gradient(180deg, #76b9ee, #436b91); }
.showcase-hero-icon { width: 72px; height: 72px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #9eb2c5, #58748f); border-radius: 22px; box-shadow: 0 12px 28px rgba(63, 87, 111, .24); }
.showcase-hero-icon .icon { width: 34px; height: 34px; }
.showcase-hero-copy { min-width: 0; flex: 1; }
.showcase-hero-copy small { color: #64748b; font-weight: 800; }
.showcase-hero-copy h1 { margin: 12px 0 8px; color: var(--navy); font-size: clamp(20px, 2vw, 27px); line-height: 1.35; overflow-wrap: anywhere; }
.showcase-hero-copy p { margin: 0; color: #64748b; line-height: 1.7; }
.showcase-hero-card > .btn { min-width: 126px; border-radius: 999px; }
.showcase-tabbar { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: rgba(255,255,255,.88); border: 1px solid #e2e8f0; border-radius: 18px; box-shadow: 0 12px 28px rgba(15, 39, 72, .08); }
.showcase-tabs { display: flex; flex: none; align-items: center; gap: 9px; flex-wrap: wrap; }
.showcase-tab { display: inline-flex; align-items: center; gap: 12px; padding: 13px 22px; border: 1px solid #dbe4ef; color: #475569; background: #f8fafc; border-radius: 999px; font: inherit; font-weight: 800; cursor: pointer; }
.showcase-tab:hover { border-color: #93c5fd; color: var(--blue); background: #eff6ff; }
.showcase-tab.active { border-color: transparent; color: #fff; background: linear-gradient(90deg, #56a2df, #2f6fa8); box-shadow: 0 8px 18px rgba(47,111,168,.2); }
.showcase-page-label { min-width: 0; display: flex; flex: 1; align-items: center; gap: 10px; padding: 12px 16px; border-left: 1px solid #dbe6f5; color: #15365f; font-weight: 800; }
.showcase-page-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.showcase-tabbar .btn { margin-left: auto; border-radius: 999px; }
.showcase-panel { overflow: hidden; background: rgba(255,255,255,.94); border: 1px solid #e2e8f0; border-radius: 22px; box-shadow: 0 16px 38px rgba(15, 39, 72, .08); }
.showcase-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 26px; border-bottom: 1px solid #e2e8f0; }
.showcase-panel-head h2 { margin: 0 0 5px; color: var(--navy); font-size: 21px; }
.showcase-panel-head p { margin: 0; color: #64748b; font-size: 13px; }
.showcase-panel-head .btn { border-radius: 999px; }
.showcase-scroll { max-height: 620px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scroll-behavior: auto; }
.showcase-scroll:focus-visible { outline: 3px solid rgba(37, 120, 195, .24); outline-offset: -3px; }
.showcase-scroll-track { display: grid; gap: 12px; padding: 18px 22px 0; }
.showcase-scroll-track:last-child { padding-bottom: 18px; }
.showcase-account-card { min-height: 94px; display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: linear-gradient(135deg, #fff, #f6faff); border: 1px solid #dce8f5; border-radius: 18px; box-shadow: 0 8px 18px rgba(15, 39, 72, .05); }
.showcase-account-card:hover { border-color: #93c5fd; background: #f8fbff; }
.showcase-account-value { min-width: 0; flex: 1; padding: 10px 4px; border: 0; background: transparent; color: #16233a; font: inherit; font-size: 17px; font-weight: 800; line-height: 1.55; text-align: left; overflow-wrap: anywhere; cursor: copy; }
.showcase-account-card .btn { flex: none; border-radius: 999px; }
.showcase-admin-groups-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.showcase-admin-groups-heading > div { display: grid; gap: 4px; }
.showcase-admin-group-list { display: grid; gap: 14px; }
.showcase-admin-group { overflow: hidden; border: 1px solid #dbe6f5; border-radius: 16px; background: #f8fbff; }
.showcase-admin-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #e6edf7; background: #fff; }
.showcase-admin-group-head > div:first-child { display: flex; align-items: center; gap: 12px; }
.showcase-admin-group-body { display: grid; gap: 12px; padding: 16px; }
.showcase-admin-accounts { min-height: 160px; font-family: Consolas, Menlo, monospace; line-height: 1.65; }

/* Tutorial and managed content hub */
.content-hub-page { padding: 22px 0 42px; }
.tutorial-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.tutorial-filter button { padding: 8px 13px; border: 0; border-radius: 999px; background: #f1f5f9; color: #475569; font: inherit; cursor: pointer; }
.tutorial-filter button:hover, .tutorial-filter button.active { color: #fff; background: var(--blue); }
.tutorial-list { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.tutorial-card { min-width: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr) 24px; align-items: center; gap: 18px; padding: 15px; border: 1px solid #e5edf6; border-radius: 10px; color: #334155; background: #fff; }
.tutorial-card:hover { border-color: #93c5fd; background: #f8fbff; }
.tutorial-card-icon img { width: 96px; height: 76px; padding: 6px; object-fit: contain; border-radius: 9px; background: #f1f5f9; }
.tutorial-card-copy { min-width: 0; display: grid; gap: 5px; }
.tutorial-card-copy b { color: var(--navy); font-size: 18px; }
.tutorial-card-copy small { color: #94a3b8; font-size: 11.5px; }
.tutorial-card-copy p { display: -webkit-box; overflow: hidden; margin: 0; color: #64748b; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tutorial-detail { max-width: 980px; margin: 22px auto 44px; padding: 28px; }
.tutorial-detail-head { display: flex; align-items: flex-start; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.tutorial-detail-head img { width: 88px; height: 88px; padding: 8px; object-fit: contain; border-radius: 14px; background: #f1f5f9; }
.tutorial-detail-head h1 { margin: 10px 0 6px; color: var(--navy); }
.tutorial-detail-head p { margin: 0; color: var(--muted); }
.tutorial-content { margin: 24px 0; color: #334155; font-size: 15px; line-height: 1.9; overflow-wrap: anywhere; }

/* Dynamic admin categories and content */
.admin-category-tree { display: grid; gap: 12px; }
.admin-category-card { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.admin-category-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: #f8fbff; border-bottom: 1px solid var(--line); }
.admin-category-title, .admin-content-title { min-width: 0; display: flex; align-items: center; gap: 10px; }
.admin-category-title img, .admin-content-title img { width: 42px; height: 42px; flex: none; padding: 3px; object-fit: contain; border: 1px solid #dbe4ef; border-radius: 9px; background: #fff; }
.admin-category-title > div, .admin-content-title > div { min-width: 0; display: grid; gap: 3px; }
.admin-category-title b, .admin-content-title b { overflow: hidden; color: var(--navy); text-overflow: ellipsis; white-space: nowrap; }
.admin-category-title small, .admin-content-title small { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.admin-subcategory-list { display: grid; gap: 7px; padding: 12px 16px; }
.admin-subcategory-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid #edf2f7; border-radius: 8px; }
.admin-subcategory-row > div:first-child { min-width: 0; display: grid; gap: 2px; }
.admin-subcategory-row small { color: var(--muted); font-size: 11px; }
.admin-editor-body { min-height: 190px; resize: vertical; }

/* Responsive */
@media (max-width: 980px) {
  .service-board { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .home-layout { grid-template-columns: 1fr; }
  .home-side { position: static; grid-column: 1; grid-row: 1; }
  .home-main { grid-column: 1; grid-row: 2; }
  .catnav-inner { overflow: visible; flex-wrap: wrap; padding: 5px 0; }
  .language-popover { margin-left: 0; }
  .side-category-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; overflow: visible; scrollbar-gutter: auto; gap: 6px; }
  .side-category-branch { border-top-color: transparent; }
  .product-wrap { grid-template-columns: 1fr; }
  .product-visual { max-width: 520px; }
  .cart-layout, .checkout-layout, .recharge-layout, .admin-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .checkout-order-card { position: static; grid-row: 1; }
  .checkout-description-card { grid-row: 2; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .container { width: calc(100% - 24px); }
  .purchase-flow { grid-template-columns: 1fr; }
  .topbar-actions .hide-mobile { display: none; }
  .header-inner { gap: 10px; flex-wrap: wrap; padding: 10px 0; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; }
  .cat-mega { position: fixed; left: 12px; right: 12px; top: 150px; width: auto; grid-template-columns: 1fr; max-height: 72vh; }
  .cat-mega-left { max-height: 170px; border-right: 0; border-bottom: 1px solid var(--line); }
  .cat-mega-right { max-height: 42vh; }
  .cat-mega-subgrid { grid-template-columns: repeat(2, 1fr); }
  .logo-name { font-size: 17px; }
  .logo-sub { display: none; }
  .service-board { grid-template-columns: 1fr; }
  .side-category-list { grid-template-columns: 1fr; }
  .nav-popover-menu { position: fixed; top: 138px; right: 12px; left: 12px; width: auto; max-height: 62vh; overflow-y: auto; }
  .language-popover .nav-popover-menu { right: 12px; left: 12px; width: auto; }
  .nav-popover-menu::before { display: none; }
  .icon-manager-grid, .icon-manager-grid-brand { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .drill-card { grid-template-columns: minmax(0, 1fr) 20px; }
  .drill-meta { grid-column: 1; grid-row: 2; text-align: left; }
  .drill-arrow { grid-column: 2; grid-row: 1 / span 2; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .goods-toolbar { flex-direction: column; align-items: stretch; }
  .goods-controls { justify-content: space-between; }
  .goods-table thead { display: none; }
  .goods-table, .goods-table tbody, .goods-table tr, .goods-table td { display: block; width: 100%; }
  .goods-table tr { border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .goods-table tr:last-child { border-bottom: 0; }
  .goods-table td { border: 0; padding: 5px 0; }
  .goods-table .col-price, .goods-table .col-stock, .goods-table .col-action { width: auto; text-align: left; }
  .goods-cell-name { flex-direction: column; align-items: flex-start; gap: 8px; }
  .cart-row { grid-template-columns: 1fr 88px; grid-auto-rows: auto; padding: 14px; }
  .cart-row .cart-product { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr; }
  .checkout-description-card, .checkout-order-card, .order-confirm-body, .payment-page-card { padding: 18px; }
  .checkout-product-description h2 { font-size: 19px; }
  .checkout-pay-methods { grid-template-columns: 1fr; }
  .confirm-info-grid { grid-template-columns: 1fr; }
  .order-confirm-card > header { align-items: flex-start; flex-direction: column; }
  .confirm-actions { flex-direction: column-reverse; }
  .confirm-actions .btn { width: 100%; }
  .payment-qr, .payment-qr-placeholder { width: min(240px, 100%); height: auto; aspect-ratio: 1; }
  .recharge-amounts { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
  .product-meta { grid-template-columns: repeat(3, 1fr); }
  .product-title { font-size: 19px; }
  .section-head { padding: 12px 14px; }
  .section-title { font-size: 15px; }
  .admin-nav { position: static; display: flex; overflow-x: auto; }
  .admin-nav a { white-space: nowrap; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .hero-nav button { width: 32px; height: 32px; }
  .order-head { flex-direction: column; align-items: flex-start; }
  .showcase-page { padding-top: 16px; gap: 12px; }
  .showcase-hero-card { min-height: 0; flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px 22px; border-radius: 18px; }
  .showcase-hero-card > .btn { width: 100%; }
  .showcase-tabbar { align-items: stretch; flex-direction: column; padding: 12px; }
  .showcase-page-label { border-top: 1px solid #dbe6f5; border-left: 0; }
  .showcase-tab { width: 100%; justify-content: center; padding: 12px 14px; }
  .showcase-tabbar .btn { width: 100%; margin: 0; }
  .showcase-panel { border-radius: 18px; }
  .showcase-panel-head { flex-direction: column; align-items: flex-start; padding: 18px; }
  .showcase-panel-head .btn { width: 100%; }
  .showcase-scroll { max-height: 520px; }
  .showcase-scroll-track { gap: 9px; padding: 12px 12px 0; }
  .showcase-scroll-track:last-child { padding-bottom: 12px; }
  .showcase-account-card { min-height: 84px; align-items: stretch; flex-direction: column; gap: 7px; padding: 14px; border-radius: 14px; }
  .showcase-account-value { width: 100%; font-size: 15px; }
  .showcase-account-card .btn { width: 100%; }
  .showcase-admin-groups-heading { align-items: stretch; flex-direction: column; }
  .showcase-admin-group-head { align-items: flex-start; }
  .tutorial-card { grid-template-columns: 66px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .tutorial-card > .icon { display: none; }
  .tutorial-card-icon img { width: 66px; height: 58px; }
  .tutorial-card-copy b { font-size: 15px; }
  .tutorial-detail { padding: 18px; }
  .tutorial-detail-head { flex-direction: column; }
  .admin-category-card > header, .admin-subcategory-row { align-items: flex-start; flex-direction: column; }
}
