/* =========================================================
   优付 USDT Pay — 共享设计系统（浅色 SaaS / 正规平台风）
   被 shop.html / pay.html / admin.html 共用
   ========================================================= */
:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff4ff;
  --brand-ink: #1e3a8a;
  --ok: #16a34a;
  --ok-soft: #ecfdf3;
  --warn: #d97706;
  --warn-soft: #fffaeb;
  --danger: #dc2626;
  --danger-soft: #fef3f2;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6e8ec;
  --line-2: #eef1f5;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --shadow: 0 4px 16px rgba(15,23,42,.08);
  --shadow-lg: 0 18px 50px rgba(15,23,42,.16);
  --maxw: 1140px;
  --nav-h: 64px;
  --sidebar-w: 232px;
  font-synthesis: none;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.mono { font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.center { text-align: center; }
.right { text-align: right; }
.flex { display: flex; }
.between { display: flex; justify-content: space-between; align-items: center; }
.wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.full { width: 100%; }

/* ---------- 顶栏（商城 / 支付页共用） ---------- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; height: 100%;
  padding: 0 20px; display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #6366f1);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: var(--shadow-sm);
}
.brand .name { font-size: 17px; letter-spacing: .2px; }
.brand .sub { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .4px; }
.nav-links { display: flex; gap: 4px; margin-left: 10px; }
.nav-links a {
  padding: 8px 12px; border-radius: 9px; color: var(--ink-2); font-size: 14px; font-weight: 500;
}
.nav-links a:hover { background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--brand); background: var(--brand-soft); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang-toggle {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
  font-size: 13px; font-weight: 600; background: #fff;
}
.lang-toggle button {
  border: none; background: transparent; padding: 7px 12px; cursor: pointer; color: var(--muted);
}
.lang-toggle button.active { background: var(--brand); color: #fff; }

/* ---------- 布局容器 ---------- */
.container { max-width: 880px; margin: 0 auto; padding: 0 20px; }
.container-wide { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.page { padding: 28px 0 56px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 700; }
.card-sub { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 12px 18px; font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: .15s ease; font-family: inherit; line-height: 1;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { border-color: #cbd5e1; background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover:not(:disabled) { background: var(--brand-soft); }
.btn-danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }
.btn-success { background: var(--ok); color: #fff; }
.btn-success:hover:not(:disabled) { filter: brightness(.96); }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge-ok { background: var(--ok-soft); color: #15803d; }
.badge-no { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--warn-soft); color: #b45309; }
.badge-info { background: var(--brand-soft); color: var(--brand-dark); }
.badge-muted { background: #f1f5f9; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--ok); } .dot-no { background: var(--danger); } .dot-warn { background: var(--warn); }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 26px; }
.hero h1 { font-size: 34px; line-height: 1.2; font-weight: 800; letter-spacing: -.4px; }
.hero p { font-size: 16px; color: var(--muted); margin-top: 12px; max-width: 620px; }
.hero-cta { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }
.trust-row { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 26px; }
.trust-item { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.trust-item .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 15px; }

/* ---------- 商品网格 ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 0 14px; }
.section-head h2 { font-size: 21px; font-weight: 700; }
.section-head .link { font-size: 13.5px; font-weight: 600; }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.product-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: .18s ease; box-shadow: var(--shadow-sm);
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d6e0f5; }
.product-thumb {
  height: 132px; display: grid; place-items: center; font-size: 40px;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff); color: #6366f1;
}
.product-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-name { font-size: 15.5px; font-weight: 700; }
.product-desc { font-size: 13px; color: var(--muted); min-height: 36px; }
.product-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.product-price { font-size: 18px; font-weight: 800; color: var(--ink); }
.product-price small { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ---------- 步骤指示 ---------- */
.steps { display: flex; gap: 8px; margin: 6px 0 22px; }
.step { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.step .num { width: 26px; height: 26px; border-radius: 50%; background: #eef1f5; color: var(--muted); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.step.active { border-color: var(--brand); background: var(--brand-soft); }
.step.active .num { background: var(--brand); color: #fff; }
.step.done .num { background: var(--ok); color: #fff; }
.step .t { font-size: 13.5px; font-weight: 600; }

/* ---------- 订单摘要 / 支付 ---------- */
.order-summary .row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed var(--line-2); font-size: 14.5px; }
.order-summary .row:last-child { border-bottom: none; }
.order-summary .k { color: var(--muted); }
.order-summary .v { font-weight: 600; }
.pay-status { padding: 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; margin-top: 14px; }
.pay-status.info { background: var(--brand-soft); color: var(--brand-dark); }
.pay-status.ok { background: var(--ok-soft); color: #15803d; }
.pay-status.err { background: var(--danger-soft); color: var(--danger); }

/* ---------- 统计卡（后台仪表盘） ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.stat-card .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-card .value { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -.5px; }
.stat-card .delta { font-size: 12.5px; margin-top: 4px; color: var(--muted); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12.5px; letter-spacing: .3px; text-transform: uppercase; }
.table tbody tr:hover { background: var(--surface-2); }
.table td .name { font-weight: 600; }
.table .actions { display: flex; gap: 8px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input, .select, textarea.input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 14.5px; font-family: inherit; color: var(--ink); background: #fff; transition: .15s;
}
.input:focus, textarea.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input::placeholder { color: #aab2c0; }
.input-row { display: flex; gap: 10px; }
.input-row > * { flex: 1; min-width: 0; }
.note { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.hint-box { background: var(--surface-2); border: 1px solid var(--line-2); border-left: 3px solid var(--brand); border-radius: 8px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); }

/* ---------- 后台外壳（侧边栏） ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: #0f172a; color: #cbd5e1;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .s-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; color: #fff; }
.sidebar .s-brand .logo { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), #6366f1); display: grid; place-items: center; color: #fff; font-weight: 800; }
.sidebar .s-brand .name { font-weight: 700; font-size: 15px; }
.sidebar .s-brand .sub { font-size: 10.5px; color: #94a3b8; }
.sidebar-nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 10px;
  color: #cbd5e1; font-size: 14px; font-weight: 500; cursor: pointer;
}
.sidebar-nav a:hover { background: #1e293b; color: #fff; text-decoration: none; }
.sidebar-nav a.active { background: var(--brand); color: #fff; }
.sidebar-nav a .ic { width: 18px; text-align: center; }
.sidebar .s-foot { margin-top: auto; padding: 14px 18px; font-size: 12px; color: #64748b; border-top: 1px solid #1e293b; }
.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.topbar .title { font-size: 16px; font-weight: 700; }
.topbar .spacer { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar .who { font-size: 13px; color: var(--muted); }
.admin-content { padding: 24px; max-width: 1080px; width: 100%; }
.page-section { display: none; }
.page-section.active { display: block; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: var(--radius); width: 100%; max-width: 480px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.x-close { cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; border: none; background: none; }

/* ---------- 日志 ---------- */
.log-box { background: #0f172a; color: #cbd5e1; border-radius: var(--radius-sm); padding: 14px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; max-height: 260px; overflow-y: auto; }
.log-entry { padding: 3px 0; border-bottom: 1px solid #1e293b; }
.log-info { color: #cbd5e1; } .log-ok { color: #4ade80; } .log-err { color: #f87171; } .log-warn { color: #fbbf24; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 500px at 50% -10%, #e8efff, var(--bg)); }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; }
.login-brand { display: flex; align-items: center; gap: 11px; justify-content: center; margin-bottom: 6px; }
.login-brand .logo { width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(135deg, var(--brand), #6366f1); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 19px; }
.login-title { text-align: center; font-size: 19px; font-weight: 700; margin-top: 8px; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); background: #fff; margin-top: 40px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 30px 20px; display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 24px; }
.footer-inner h4 { font-size: 13px; color: var(--ink); margin-bottom: 12px; font-weight: 700; }
.footer-inner a, .footer-inner p { font-size: 13px; color: var(--muted); display: block; margin-bottom: 7px; }
.footer-bottom { border-top: 1px solid var(--line-2); padding: 14px 20px; text-align: center; font-size: 12.5px; color: var(--muted); }
.footer-badges { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.footer-badge { font-size: 11.5px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; color: var(--ink-2); background: var(--surface-2); }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .sidebar { display: none; }
  .admin-shell { flex-direction: column; }
  .admin-main { min-height: 100vh; }
  .hero h1 { font-size: 27px; }
  .product-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .steps { flex-direction: column; }
  .mobile-nav { display: flex; }
}
.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); z-index: 60; }
.mobile-nav a { flex: 1; text-align: center; padding: 10px; font-size: 12px; color: var(--muted); }
.mobile-nav a.active { color: var(--brand); }
