/* ============================================
   微信扫码订货会管理系统 - 公共样式
   ============================================ */
:root {
  --wx-green: #07c160;
  --wx-green-dark: #06ad56;
  --primary: #1a56db;
  --primary-dark: #1e40af;
  --ink: #191919;
  --ink-2: #646566;
  --ink-3: #969799;
  --line: #ebedf0;
  --bg: #f7f8fa;
  --card: #ffffff;
  --danger: #ee0a24;
  --warn: #ff976a;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --nav-h: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
    "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 24px; border-radius: 8px;
  font-size: 15px; font-weight: 500; line-height: 1;
  transition: all 0.2s; border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-wx { background: var(--wx-green); color: #fff; }
.btn-wx:hover { background: var(--wx-green-dark); }
.btn-block { display: flex; width: 100%; }
.btn-lg { height: 48px; font-size: 16px; border-radius: 10px; }
.btn-outline { border-color: var(--line); background: #fff; color: var(--ink); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 6px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.card + .card { margin-top: 12px; }

/* ---------- 表单 ---------- */
.form-item { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 8px; }
.form-input, .form-select, .form-textarea {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; outline: none; transition: border 0.2s;
}
.form-textarea { height: auto; padding: 10px 12px; resize: vertical; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary); }
.form-select { appearance: none; background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23969799' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center; }
.form-tip { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
.table th { background: #fafbfc; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.table tr:hover td { background: #fafbfc; }

/* ---------- 标签 ---------- */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; line-height: 1.6; }
.tag-green { background: rgba(7, 193, 96, 0.12); color: var(--wx-green); }
.tag-blue { background: rgba(26, 86, 219, 0.1); color: var(--primary); }
.tag-gray { background: #f2f3f5; color: var(--ink-2); }
.tag-orange { background: rgba(255, 122, 69, 0.12); color: #ff7a45; }
.tag-red { background: rgba(238, 10, 36, 0.08); color: var(--danger); }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h); background: #fff; border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.nav-logo { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; color: var(--primary); }
.nav-logo .logo-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--wx-green));
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 16px;
}
.nav-menu { display: flex; align-items: center; gap: 28px; }
.nav-menu a { color: var(--ink-2); font-size: 14px; transition: color 0.2s; }
.nav-menu a:hover, .nav-menu a.active { color: var(--primary); font-weight: 500; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-actions .btn { height: 36px; padding: 0 18px; font-size: 13px; }

/* ---------- 页脚 ---------- */
.footer { background: #1c1e23; color: #a8abb2; padding: 40px 0 0; margin-top: 60px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; padding-bottom: 32px; }
.footer h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer ul li { margin-bottom: 10px; font-size: 13px; }
.footer ul li a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #2e3138; padding: 18px 0; text-align: center; font-size: 12px; }
.footer-bottom a { color: #a8abb2; }
.footer-bottom a:hover { color: #fff; }

/* ---------- 通用 ---------- */
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.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; }
.text-primary { color: var(--primary); } .text-wx { color: var(--wx-green); }
.text-danger { color: var(--danger); } .text-2 { color: var(--ink-2); } .text-3 { color: var(--ink-3); }
.text-center { text-align: center; }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-15 { font-size: 15px; }
.fs-16 { font-size: 16px; } .fs-18 { font-size: 18px; } .fs-20 { font-size: 20px; } .fs-24 { font-size: 24px; }
.fw-500 { font-weight: 500; } .fw-700 { font-weight: 700; }
.price { color: var(--danger); font-weight: 700; }
.price::before { content: "¥"; font-size: 0.8em; margin-right: 1px; }
.empty { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.empty .empty-icon { font-size: 48px; margin-bottom: 12px; }

/* ---------- 面包屑 ---------- */
.crumbs { padding: 14px 0; font-size: 13px; color: var(--ink-3); }
.crumbs a { color: var(--primary); }
.crumbs a:hover { text-decoration: underline; }

/* ---------- 页面标题区 ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-title { font-size: 20px; font-weight: 700; }

/* ---------- 分页 ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }
.pagination .btn { height: 34px; padding: 0 14px; font-size: 13px; }

/* ---------- 提示条 ---------- */
.alert { padding: 12px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.alert-info { background: rgba(26, 86, 219, 0.08); color: var(--primary); }
.alert-warn { background: rgba(255, 122, 69, 0.1); color: #d46b08; }
.alert-success { background: rgba(7, 193, 96, 0.1); color: var(--wx-green-dark); }

/* ---------- Toast ---------- */
.wxsale-toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.9);
  background: rgba(0, 0, 0, 0.78); color: #fff; font-size: 14px;
  padding: 12px 20px; border-radius: 8px; z-index: 9999;
  opacity: 0; transition: all 0.25s; max-width: 80vw; text-align: center;
  pointer-events: none;
}
.wxsale-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.wxsale-toast.error { background: rgba(238, 10, 36, 0.88); }

/* ---------- 移动端汉堡按钮 ---------- */
.nav-toggle {
  display: none;
  width: 40px; height: 40px; border-radius: 8px;
  align-items: center; justify-content: center; flex: none;
  background: transparent;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: ""; display: block; width: 20px; height: 2px;
  background: var(--ink); border-radius: 2px; transition: all 0.25s;
}
.nav-toggle-bar { position: relative; }
.nav-toggle-bar::before { position: absolute; top: -6px; left: 0; }
.nav-toggle-bar::after { position: absolute; top: 6px; left: 0; }
.nav-toggle.active .nav-toggle-bar { background: transparent; }
.nav-toggle.active .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle.active .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 移动端展开菜单 ---------- */
.nav-mobile {
  display: none;
  flex-direction: column;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 8px 16px 16px;
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease;
}
.nav-mobile.open { display: flex; max-height: 80vh; overflow-y: auto; }
.nav-mobile a:not(.btn) {
  padding: 14px 4px; font-size: 15px; color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.nav-mobile a:not(.btn).active { color: var(--primary); font-weight: 600; }
.nav-mobile-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.nav-mobile-actions .btn { height: 44px; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .nav-menu { display: none; }
  .nav-actions { display: none; }
  .nav-toggle { display: flex; }
  .container { padding: 0 12px; }
}
