:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #1a2332;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #0ea5c9;
  --brand-deep: #0284a8;
  --jade: #14b8a6;
  --jade-deep: #0d9488;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --nav-h: 48px;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand-deep); text-decoration: none; }
a:hover { color: var(--brand); }
img { display: block; max-width: 100%; height: auto; }
button, input, select { font-family: inherit; }

/* —— 顶栏 —— */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  min-height: var(--nav-h);
  max-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}
.brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  max-height: 40px;
  line-height: 0;
  color: var(--ink);
  padding: 2px 0;
  background: transparent;
  border-radius: 0;
}
.brand-logo {
  height: 34px !important;
  max-height: 34px !important;
  width: auto !important;
  max-width: 160px !important;
  object-fit: contain;
  object-position: left center;
  background: transparent !important;
}
.brand.brand--text {
  line-height: 1.2;
  max-height: none;
}
.brand-text-logo {
  display: inline-block;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--brand-deep);
  line-height: 1.1;
  max-width: 168px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.footer-text-logo {
  font-size: 1.05rem;
  max-width: 140px;
}
.login-text-logo {
  display: block;
  text-align: center;
  margin: 0 auto 1rem;
  font-size: 1.65rem;
  max-width: 100%;
}
.site-nav nav {
  display: flex;
  align-items: center;
  gap: .35rem .85rem;
  flex-wrap: nowrap;
}
.site-nav nav a {
  color: var(--ink-2);
  font-size: .875rem;
  padding: .25rem .15rem;
  white-space: nowrap;
}
.site-nav nav a:hover { color: var(--brand-deep); }
.nav-cta {
  background: var(--brand) !important;
  color: #fff !important;
  padding: .35rem .85rem !important;
  border-radius: 6px;
  font-weight: 600;
  font-size: .8125rem !important;
}
.nav-cta:hover {
  background: var(--brand-deep) !important;
  color: #fff !important;
}
.nav-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 2px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  line-height: 1;
}
.cart-badge.is-empty { display: none; }

/* —— 邀请条 —— */
.invite-banner {
  background: linear-gradient(105deg, #0f172a 0%, #0e7490 55%, #14b8a6 100%);
  color: #fff;
  padding: 1rem 1.25rem;
}
.invite-banner-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.invite-banner strong {
  display: block;
  font-size: 1rem;
  margin-bottom: .25rem;
}
.invite-banner p {
  margin: 0;
  font-size: .8125rem;
  opacity: .9;
  max-width: 36rem;
}
.invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.invite-banner .btn-ghost {
  background: transparent;
  border-color: rgba(255,255,255,.45);
  color: #fff;
}
.invite-banner .btn-ghost:hover {
  border-color: #fff;
  color: #fff;
}

/* —— 主内容 —— */
.page-main {
  flex: 1;
  width: 100%;
}
.inner-wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}
.inner-wrap h1 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--ink);
}
.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 .35rem;
}
.page-desc {
  color: var(--muted);
  font-size: .9rem;
  margin: 0 0 1.25rem;
}

/* —— 公告条 —— */
.notice-bar {
  background: linear-gradient(90deg, #ecfeff 0%, #f0fdfa 100%);
  border-bottom: 1px solid #cceef5;
  padding: .65rem 1rem;
  font-size: .8125rem;
  color: var(--ink-2);
  text-align: center;
  line-height: 1.5;
}
.notice-bar a { font-weight: 600; }

/* —— 搜索 + 分类 —— */
.shop-toolbar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.search-row {
  display: flex;
  gap: .5rem;
  margin-bottom: .85rem;
}
.search-row input {
  flex: 1;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 .9rem;
  font-size: .9rem;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.search-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14, 165, 201, 0.15); }
.search-row button {
  height: 40px;
  padding: 0 1.1rem;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: .875rem;
  cursor: pointer;
}
.search-row button:hover { background: var(--brand-deep); }

.cat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.cat-tag {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 .75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font-size: .8125rem;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.cat-tag:hover { border-color: var(--brand); color: var(--brand-deep); }
.cat-tag.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 .85rem;
}
.section-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.section-head .hint { font-size: .8rem; color: var(--muted); }

/* —— 商品网格 —— */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .85rem;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1rem .9rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.product-card:hover {
  border-color: #bae6fd;
  box-shadow: 0 4px 16px rgba(14, 165, 201, 0.1);
}
.product-card.is-hidden { display: none; }
.stock-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: .7rem;
  font-weight: 600;
  color: var(--ok);
  background: #dcfce7;
  padding: .15rem .45rem;
  border-radius: 4px;
}
.product-card h3 {
  margin: 0;
  font-size: .95rem;
  font-weight: 650;
  line-height: 1.4;
  color: var(--ink);
  flex: 1;
}
.product-meta {
  margin: 0;
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.45;
}
.product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .25rem;
  padding-top: .55rem;
  border-top: 1px dashed var(--line);
}
.price-cny {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-deep);
  line-height: 1.2;
}
.price-cny small {
  font-size: .75rem;
  font-weight: 500;
  color: var(--muted);
}
.btn-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 .9rem;
  border-radius: 6px;
  background: var(--brand);
  color: #fff !important;
  font-size: .8125rem;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}
.btn-buy:hover { background: var(--brand-deep); color: #fff !important; }
.product-btns {
  display: flex;
  gap: .4rem;
  align-items: center;
}
.btn-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 .7rem;
  border-radius: 6px;
  background: #fff;
  color: var(--brand-deep);
  border: 1px solid #bae6fd;
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-cart:hover { background: #ecfeff; }

.cart-qty {
  width: 64px;
  padding: .35rem;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.cart-remove { color: var(--danger); font-size: .85rem; }
.cart-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.cart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.empty-tip {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 1rem;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* —— 通用按钮 —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .65rem 1.2rem;
  font-weight: 600;
  font-size: .9rem;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); color: #fff; }
.btn-ghost {
  background: #fff;
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-deep); }
.btn-block { width: 100%; }

/* —— 卡片面板 —— */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 1rem; }

.login-panel {
  max-width: 420px;
  margin: 2rem auto;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
}
.login-logo {
  display: block;
  height: 40px !important;
  max-height: 40px !important;
  width: auto !important;
  max-width: 180px !important;
  margin: 0 auto 1rem;
  padding: 0;
  object-fit: contain;
  background: transparent !important;
  border-radius: 0;
  box-sizing: content-box;
}
.login-panel h1 {
  font-size: 1.2rem;
  margin: 0 0 .5rem;
}
.login-panel p { color: var(--muted); font-size: .9rem; margin: 0; }
.login-panel .btn { margin-top: 1.25rem; }
.tg-bot-login { margin-top: 1.25rem; text-align: left; }
.tg-bot-login--compact { margin-top: .5rem; }
.tg-bot-login--compact .tg-bot-login-open { font-size: .9rem; padding: .55rem 1rem; }
.tg-bot-login--compact .tg-bot-login-hint { font-size: .82rem; margin-bottom: .65rem; }
.tg-bot-login-open { margin-bottom: .75rem; }
.tg-bot-login-hint {
  font-size: .88rem;
  color: var(--muted);
  margin: 0 0 1rem;
  line-height: 1.5;
}
.tg-bot-login-qr {
  text-align: center;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fafbfc;
  margin-bottom: .75rem;
}
.tg-bot-login-qr img { margin: 0 auto .65rem; border-radius: 8px; }
.tg-bot-login-qr p { font-size: .82rem; color: var(--muted); margin: 0; }
.tg-bot-login-wait { text-align: center; color: var(--brand-deep); }
@media (max-width: 640px) {
  .tg-bot-login-qr { display: none; }
}
.login-widget-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
  min-height: 44px;
}
.login-hint {
  margin-top: .85rem !important;
  font-size: .85rem !important;
}
.login-fallback {
  margin-top: .65rem !important;
  font-size: .85rem !important;
}
.login-fallback a { color: var(--brand-deep); text-decoration: underline; }
.login-help {
  margin-top: 1.25rem;
  text-align: left;
  font-size: .8rem;
  color: var(--muted);
}
.login-help summary { cursor: pointer; color: var(--ink-2); }

/* —— 账户 / 表格 —— */
.account-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: var(--brand-deep);
  padding: .45rem .85rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
}
.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
table.www-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
table.www-table th,
table.www-table td {
  text-align: left;
  padding: .75rem .85rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.www-table th {
  color: var(--muted);
  font-weight: 600;
  background: #f8fafc;
  font-size: .8rem;
}
table.www-table tr:last-child td { border-bottom: 0; }
.status-pill {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.status-pending { background: #fff7ed; color: var(--warn); }
.status-paid { background: #dcfce7; color: var(--ok); }
.status-other { background: #f1f5f9; color: var(--muted); }

/* —— 下单 / 支付 —— */
.buy-layout {
  display: grid;
  gap: 1rem;
  max-width: 640px;
}
.buy-spec {
  margin: 0;
  padding: 0;
  list-style: none;
}
.buy-spec li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .9rem;
}
.buy-spec li:last-child { border-bottom: 0; }
.buy-spec .k { color: var(--muted); }
.buy-spec .v { color: var(--ink); font-weight: 500; text-align: right; }
.price-highlight {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brand-deep);
  margin: .25rem 0;
}
.usdt-hint { font-size: .85rem; color: var(--muted); margin: 0 0 1rem; }

.pay-box {
  max-width: 480px;
  margin: 0 auto;
}
.pay-amount {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--brand-deep);
  margin: .35rem 0;
  text-align: center;
}
.pay-addr {
  word-break: break-all;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .75rem;
  font-size: .85rem;
  color: var(--ink-2);
  margin: 1rem 0;
  text-align: center;
}
.qr-box {
  width: 200px;
  height: 200px;
  margin: 1rem auto;
  background: #fff;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.pay-actions { text-align: center; }
.msg {
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  font-size: .875rem;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  color: var(--brand-deep);
}
.msg-err {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger);
}
.msg-ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.login-tabs {
  display: flex;
  gap: .5rem;
  margin: 1.15rem 0 .85rem;
  justify-content: center;
}
.login-tab {
  flex: 1;
  text-align: center;
  padding: .45rem .75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: .875rem;
  background: #f8fafc;
}
.login-tab.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.login-form {
  text-align: left;
  margin-top: .5rem;
}
.login-form label {
  display: block;
  margin: .65rem 0 .3rem;
  font-size: .8rem;
  color: var(--muted);
}
.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="text"] {
  width: 100%;
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .9rem;
  box-sizing: border-box;
}
.login-form .btn { margin-top: 1rem; }
.code-row {
  display: flex;
  gap: .5rem;
  align-items: stretch;
}
.code-row input {
  flex: 1;
  min-width: 0;
}
.code-row .btn {
  margin-top: 0 !important;
  flex: 0 0 auto;
  white-space: nowrap;
  padding: .55rem .75rem;
}
.bind-status {
  margin: .65rem 0 0;
  padding-left: 1.1rem;
  color: var(--ink-2);
  font-size: .875rem;
  line-height: 1.6;
}
.bind-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.bind-tip {
  margin: 0;
  color: var(--muted);
  font-size: .85rem;
}

.contact-card {
  max-width: 480px;
  text-align: center;
}
.contact-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
}

/* —— 右侧悬浮客服 —— */
.cs-float {
  position: fixed;
  right: 18px;
  bottom: 88px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .45rem;
}
.cs-float-link {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .65rem .85rem;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  font-size: .86rem;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
}
.cs-float-link.cs-tg { background: #229ED9; }
.cs-float-link.cs-wa { background: #25D366; }
.cs-float-link:hover { filter: brightness(1.05); color: #fff; }
.cs-float-link svg { flex-shrink: 0; }

/* —— 页脚 —— */
.site-footer {
  margin-top: auto;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 1.5rem 1.25rem;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.footer-logo {
  height: 28px !important;
  max-height: 28px !important;
  width: auto !important;
  max-width: 130px !important;
  object-fit: contain;
  padding: 0;
  background: transparent !important;
  border-radius: 0;
  box-sizing: content-box;
}
.footer-brand span { color: var(--muted); font-size: .8rem; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem 1.15rem;
}
.footer-links a { color: var(--muted); font-size: .85rem; }
.footer-links a:hover { color: var(--brand-deep); }
.footer-copy {
  width: 100%;
  color: var(--muted);
  font-size: .75rem;
  margin-top: .35rem;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  margin: 1rem 0 0;
  font-size: .875rem;
}
.pager a {
  color: var(--brand-deep);
  padding: .35rem .7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}
.pager a:hover { border-color: var(--brand); }
.pager .is-disabled {
  color: var(--muted);
  padding: .35rem .7rem;
  border: 1px solid transparent;
}
.pager-info { color: var(--ink-2); }

@media (max-width: 640px) {
  .site-nav { padding: 0 .75rem; }
  .site-nav nav { gap: .55rem; }
  .site-nav nav a { font-size: .8rem; }
  .product-grid { grid-template-columns: 1fr; }
  .inner-wrap { padding: 1rem .75rem 2rem; }
}
