: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);
}

* { 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; }

.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; }
.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: grid; place-items: center; background: linear-gradient(135deg, #0b2447, #146ebe); box-shadow: 0 5px 14px rgba(11,36,71,.22); }
.logo-mark img { width: 26px; height: 26px; }
.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-x: auto; 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); }

.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-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: minmax(0, 1fr) 300px; gap: 14px; margin-top: 14px; align-items: start; }
.home-main { min-width: 0; }
.home-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 86px; }
.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; }

/* 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: 1fr 360px; gap: 16px; 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; }

/* 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-table-wrap { overflow-x: auto; }
.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; }
.admin-actions { display: flex; gap: 6px; }
.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; }
.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%); background: #fff; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-lg); animation: toast-in .18s ease; }
.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; }

/* 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; }

/* 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; }
  .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; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .container { width: calc(100% - 24px); }
  .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; }
  .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; }
  .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; }
}
