/* 现代专业灰白蓝后台 - 完整最终版 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    height: 100%;
    font-family: "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
    background: #f0f2f5;
    color: #333;
    font-size: 14px;
}
.container {
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0,0,0,0.02);
}
.logo {
    height: 60px;
    line-height: 60px;
    padding: 0 20px;
    font-size: 16px;
    font-weight: 600;
    color: #1677ff;
    border-bottom: 1px solid #e5e7eb;
}
.nav-menu {
    list-style: none;
    padding: 10px 0;
}
.nav-item {
    height: 44px;
    line-height: 44px;
    padding: 0 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 10px;
}
/* 纯CSS自动图标（不改PHP）*/
.nav-item:nth-child(1)::before { content: "📊"; }
.nav-item:nth-child(2)::before { content: "📦"; }
.nav-item:nth-child(3)::before { content: "🧾"; }
.nav-item:nth-child(4)::before { content: "💰"; }
.nav-item:nth-child(5)::before { content: "🔢"; }
.nav-item:nth-child(6)::before { content: "👥"; }
.nav-item:nth-child(7)::before { content: "⚙️"; }
.nav-item::before {
    font-size: 16px;
    width: 18px;
    text-align: center;
}
.nav-item:hover {
    background: #f0f7ff;
    color: #1677ff;
}
.nav-item.active {
    background: #e6f4ff;
    color: #1677ff;
    font-weight: 500;
    border-right: 3px solid #1677ff;
}

/* 主内容 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.top-header {
    height: 60px;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.header-title {
    font-size: 16px;
    font-weight: 500;
    color: #1f2937;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}
.tabs {
    display: flex;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}
.tab {
    padding: 0 20px;
    height: 44px;
    line-height: 44px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    white-space: nowrap;
}
.tab.active {
    border-bottom-color: #1677ff;
    color: #1677ff;
    font-weight: 500;
}
.content-area {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
}
.page { display: none; }
.page.active { display: block; }

/* 卡片 */
.layui-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}
.layui-card-header {
    height: 48px;
    line-height: 48px;
    padding: 0 20px;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 500;
    color: #1f2937;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.layui-card-body {
    padding: 20px;
}

/* 按钮 */
.btn,
button,
[type="button"],
[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    background: #6b7280;
    color: #fff;
}
.btn.primary, .btn-primary,
button.primary, button.btn-primary {
    background: #1677ff !important;
    color: #fff !important;
}
.btn-danger, button.btn-danger {
    background: #f43f5e !important;
    color: #fff !important;
}
.btn-normal {
    background: #6b7280;
    color: #fff;
}
button:hover { opacity: 0.92; }
.btn-logout {
    background: #f43f5e !important;
    color: #fff !important;
    padding: 6px 14px;
    border-radius: 6px;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* 表单 */
input, select, textarea {
    height: 36px;
    padding: 0 12px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}
input:focus, select:focus, textarea:focus {
    border-color: #1677ff;
    outline: none;
}
textarea {
    height: auto;
    min-height: 80px;
    padding: 10px 12px;
    resize: vertical;
}
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.form-row .form-group {
    flex: 1;
    min-width: 260px;
}
.permission-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
.permission-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 统计卡片（仪表盘）*/
.stats-grid {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.stat-card {
    flex: 1;
    min-width: 180px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.stat-card h4 {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 8px;
}
.stat-card .value {
    font-size: 26px;
    font-weight: 700;
    color: #1f2937;
}

/* 订单页面统计条（和仪表盘统一）*/
.order-summary-wrap {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    margin-bottom: 20px !important;
    padding: 18px 20px !important;
    background: #fff !important;
    border-radius: 12px !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}
.order-summary-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
}
.order-summary-label {
    font-size: 13px !important;
    color: #6b7280 !important;
    font-weight: normal !important;
}
.order-summary-value {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
}

/* 表格（字体缩小）*/
.table-container {
    overflow-x: auto;
    margin-top: 10px;
}
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    font-size: 13px !important;
}
table th, table td {
    padding: 10px 12px !important;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap !important;
}
table th {
    background: #fafbfc;
    font-weight: 500;
    color: #4b5563;
    font-size: 12px !important;
}
table tr:hover td { background: #f9fafb; }
.empty-tip {
    padding: 30px;
    text-align: center;
    color: #999;
}

/* 操作按钮横排 + 三色 */
.action-buttons {
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
}
.action-buttons button {
    width: 52px !important;
    height: 28px !important;
    font-size: 12px !important;
    border-radius: 4px !important;
    border: none !important;
    color: #fff !important;
}
.action-buttons button:nth-child(1) { background: #1677ff !important; }
.action-buttons button:nth-child(2) { background: #f59e0b !important; }
.action-buttons button:nth-child(3) { background: #ef4444 !important; }
.action-buttons button:hover { opacity: 0.85 !important; }

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
}
.modal-content {
    background: #fff;
    margin: 50px auto;
    border-radius: 12px;
    max-width: 700px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.modal-header {
    height: 48px;
    line-height: 48px;
    padding: 0 20px;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
}
.modal-header h3 {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}
.close {
    font-size: 20px;
    color: #666;
    cursor: pointer;
}
.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}
.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #fafafa;
}

/* 登录页 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #f0f2f5;
}
.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 420px;
    border: 1px solid #e5e7eb;
}
.login-title {
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #1f2937;
}
.login-type {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}
.login-type a { color: #1677ff; text-decoration: none; }
.login-form .form-group { margin-bottom: 20px; }
.login-form input {
    width: 100%;
    height: 44px;
    padding: 0 15px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 14px;
}
.login-form input:focus { border-color: #1677ff; }
.login-btn {
    width: 100%;
    height: 44px;
    background: #1677ff !important;
    color: #fff !important;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
}
.error-message {
    color: #f43f5e;
    font-size: 14px;
    margin-top: 12px;
    text-align: center;
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #c9cdd4; border-radius: 3px; }
::-webkit-scrollbar-track { background: #f1f1f1; }

/* ============================
   订单页面 最终完整修复（整洁版）
   每列宽度单独定义，后期好调整
============================= */

/* ============================
   顶部统计条：仪表盘同款 + 自动填满整行 + 无空白
============================= */
.order-summary-wrap {
  display: flex !important;
  flex-wrap: nowrap !important;    /* 不换行，一横排 */
  gap: 16px !important;            /* 卡片间距 */
  margin-bottom: 20px !important;
  background: transparent !important;
  padding: 0 !important;
  width: 100% !important;         /* 占满整行 */
}

/* 每个统计卡片：自动平分宽度，填满整行 */
.order-summary-item {
  flex: 1 !important;             /* 自动平分宽度 */
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  background: #ffffff !important;
  border-radius: 12px !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
  padding: 18px 20px !important;
  min-width: 120px !important;
}

/* 文字样式 */
.order-summary-label {
  font-size: 13px !important;
  color: #6b7280 !important;
  margin-bottom: 4px !important;
}
.order-summary-value {
  font-size: 26px !important;
  font-weight: 700 !important;
  color: #1f2937 !important;
  line-height: 1.2 !important;
}

/* 2. 表格基础样式 */
.table-container {
    overflow-x: auto !important;
}
table {
    table-layout: fixed !important;
    width: 100% !important;
    font-size: 12px !important;
}
table th,
table td {
    padding: 10px 8px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* 3. 每一列宽度单独设置（后期直接改数字） */
/* 1 订单时间 */
table th:nth-child(1), table td:nth-child(1) { width: 90px !important; }
/* 2 业务员 */
table th:nth-child(2), table td:nth-child(2) { width: 70px !important; }
/* 3 客户名称 */
table th:nth-child(3), table td:nth-child(3) { width: 90px !important; }
/* 4 电话 */
table th:nth-child(4), table td:nth-child(4) { width: 150px !important; }
/* 5 地址 */
table th:nth-child(5), table td:nth-child(5) { width: 200px !important; }
/* 6 邮编 */
table th:nth-child(6), table td:nth-child(6) { width: 70px !important; }
/* 7 收款方式 */
table th:nth-child(7), table td:nth-child(7) { width: 80px !important; }
/* 8 商品 */
table th:nth-child(8), table td:nth-child(8) { width: 250px !important; }
/* 9 商品卖次 */
table th:nth-child(9), table td:nth-child(9) { width: 70px !important; }
/* 10 收款金额 */
table th:nth-child(10), table td:nth-child(10) { width: 90px !important; }
/* 11 实际金额 */
table th:nth-child(11), table td:nth-child(11) { width: 90px !important; }
/* 12 备注 */
table th:nth-child(12), table td:nth-child(12) { width: 180px !important; }
/* 13 操作 */
table th:last-child,  table td:last-child  { width: 180px !important; }

/* 4. 操作按钮样式 */
table td:last-child {
    display: flex !important;
    gap: 4px !important;
    align-items: center !important;
}
table td:last-child button {
    min-width: 48px !important;
    height: 26px !important;
    font-size: 12px !important;
    padding: 0 6px !important;
    border-radius: 4px !important;
    border: none !important;
    color: #fff !important;
}
table td:last-child button:nth-child(1) { background: #1677ff !important; }
table td:last-child button:nth-child(2) { background: #f59e0b !important; }
table td:last-child button:nth-child(3) { background: #ef4444 !important; }


/* ====================== 添加订单页面 - 专业商务重制版 ====================== */
.order-form-page {
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 30px;
}

.order-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid #E5E7EB;
}

.order-form-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.order-form-body {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* 大模块分组：基本信息、商品、收款方式、金额等 */
.order-form-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
}

.order-form-section h4 {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 5px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #E5E7EB;
}

/* 表单行 */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.form-group {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2563EB;
}

.form-group textarea {
  height: 80px;
  padding: 10px 12px;
  resize: vertical;
}

/* 选择按钮组：商品、卖次、收款方式 */
#sell-count-btn-group,
#product-btn-group,
.payment-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.sell-count-chip,
.product-chip,
.payment-chip {
  height: 36px;
  line-height: 36px;
  padding: 0 14px;
  border: 1px solid #D1D5DB;
  border-radius: 4px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}

.sell-count-chip:hover,
.product-chip:hover,
.payment-chip:hover {
  border-color: #2563EB;
  color: #2563EB;
}

.sell-count-chip.active,
.product-chip.active,
.payment-chip.active {
  background: #2563EB;
  color: #fff;
  border-color: #2563EB;
}

/* 已选项目表格 */
.order-items-wrap {
  margin-top: 15px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  overflow: hidden;
}

.order-items-table,
.order-payment-methods-table {
  width: 100%;
  border-collapse: collapse;
}

.order-items-table th,
.order-payment-methods-table th {
  background: #F3F4F6;
  padding: 10px 14px;
  text-align: left;
  font-weight: 500;
  font-size: 14px;
}

.order-items-table td,
.order-payment-methods-table td {
  padding: 10px 14px;
  border-top: 1px solid #E5E7EB;
}

/* 金额区域 */
.order-amount-section {
  background: #EFF6FF;
  border: 1px solid #DBEAFE;
  padding: 20px;
  border-radius: 6px;
}

/* 底部按钮 */
.order-form-footer {
  margin-top: 30px;
  text-align: right;
}

.order-form-footer .btn-primary {
  height: 40px;
  padding: 0 24px;
  background: #2563EB;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}

.order-form-footer .btn-primary:hover {
  background: #1D4ED8;
}

/* 韩文解析框 */
#koreanParseBox {
  min-height: 100px;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #2563EB !important;
  font-size: 14px;
}


/* ===================== 业务员统计表 - 精致协调版 ===================== */
#sales-stats-box * {
    text-align: center !important;
}
#sales-stats-box td:last-child {
    display: table-cell !important;
    justify-content: unset !important;
}

#sales-stats-box {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    font-size: 15px !important;
}
#sales-stats-box th,
#sales-stats-box td {
    padding: 12px !important;
    border: 1px solid #E5E7EB !important; /* 更柔和的边框色 */
}
#sales-stats-box thead th {
    background: #F4F7FA !important; /* 更干净的表头灰 */
    font-weight: 600 !important;
}
#sales-stats-box th:nth-child(1) { width: 8% !important; }
#sales-stats-box th:nth-child(2) { width: 15% !important; }
#sales-stats-box th:nth-child(3) { width: 12% !important; }
#sales-stats-box th:nth-child(4) { width: 32% !important; }
#sales-stats-box th:nth-child(5) { width: 33% !important; }

/* 更高级的隔行变色 */
#sales-stats-box tbody tr:nth-child(even) {
    background: #F9FAFB !important;
}
#sales-stats-box tbody tr:hover {
    background: #EFF6FF !important; /* 柔和淡蓝 hover */
}




/* ==============================================
   【手机端最终完整版】（已修复图标高亮问题）
   底部导航 + 仪表盘 + 订单管理 + 添加订单
=============================================== */
@media (max-width:768px) {
  /* ------------------------------
     1. 底部导航（不遮挡、可滑动）
  ------------------------------ */
  .sidebar { left: -999px !important; position: fixed !important; }
  .container { display: block !important; }
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding-bottom: 100px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    height: auto !important;
  }
  .nav-menu {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 65px !important;
    background: #fff !important;
    z-index: 999999 !important;
    border-top: 1px solid #eee !important;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    justify-content: space-around !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }
  .nav-item {
    flex: 1 !important;
    text-align: center !important;
    font-size: 0 !important;
    color: transparent !important;
    list-style: none !important;
    padding: 8px 0 !important;
    position: relative !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    user-select: none !important;
    border: none !important;
    background: transparent !important;
  }
  /* 彻底清除a标签点击蓝色底色 */
  .nav-item a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    -webkit-tap-highlight-color: transparent !important;
    background: transparent !important;
    outline: none !important;
    border: none !important;
  }
  .nav-item a:active,
  .nav-item a:focus {
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
  }

  /* 图标（已修复第4、5个高亮问题） */
  .nav-item:nth-child(1)::after { content:""; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:24px; height:24px; border:2px solid #666; border-radius:50%; border-top-color:transparent; border-right-color:transparent; }
  .nav-item:nth-child(1)::before { content:""; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%) rotate(45deg); width:4px; height:10px; background:#666; }
  .nav-item:nth-child(2)::after { content:""; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:20px; height:20px; border:2px solid #666; border-radius:2px; }
  .nav-item:nth-child(2)::before { content:""; position:absolute; top:calc(50% - 10px); left:50%; transform:translateX(-50%); width:20px; height:2px; background:#666; }
  .nav-item:nth-child(3)::after { content:""; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:20px; height:24px; border:2px solid #666; border-radius:2px; }
  .nav-item:nth-child(3)::before { content:""; position:absolute; top:calc(50% - 6px); left:calc(50% - 6px); width:12px; height:2px; background:#666; box-shadow:0 4px 0 #666,0 8px 0 #666; }
  
  /* 第4个图标（收款方式，已修复） */
  .nav-item:nth-child(4)::after { content:""; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:20px; height:20px; border:2px solid #666; border-radius:50%; }
  .nav-item:nth-child(4)::before { content:""; position:absolute; top:calc(50% - 6px); left:calc(50% - 4px); width:8px; height:2px; background:#666; box-shadow:0 4px 0 #666, 0 -4px 0 #666; }
  
  /* 第5个图标（商品卖次，已修复） */
  .nav-item:nth-child(5)::after { content:""; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:20px; height:20px; border:2px solid #666; border-radius:2px; border-left-color:transparent; border-right-color:transparent; }
  .nav-item:nth-child(5)::before { content:""; position:absolute; top:calc(50% - 6px); left:calc(50% - 6px); width:12px; height:2px; background:#666; box-shadow:0 4px 0 #666, 0 8px 0 #666; }
  
  .nav-item:nth-child(6)::after { content:""; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:20px; height:20px; border:2px solid #666; border-radius:50%; }
  .nav-item:nth-child(6)::before { content:""; position:absolute; top:calc(50% + 4px); left:50%; transform:translateX(-50%); width:10px; height:8px; border:2px solid #666; border-top:none; border-radius:0 0 10px 10px; }
  .nav-item:nth-child(7)::after { content:""; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%) rotate(45deg); width:16px; height:16px; border:2px solid #666; border-radius:4px; }
  .nav-item:nth-child(7)::before { content:""; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:6px; height:6px; background:#666; border-radius:50%; }

  /* 高亮 */
  .nav-item.active::after,
  .nav-item.active::before { border-color:#2b85e4 !important; background-color:#2b85e4 !important; color:#2b85e4 !important; }

  /* ------------------------------
     2. 仪表盘页面适配
  ------------------------------ */
  .stats-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 0 !important;
  }
  .stat-card {
    flex: 1 !important;
    min-width: calc(33% - 5px) !important;
    margin: 0 !important;
    padding: 8px !important;
    box-sizing: border-box !important;
  }
  .stat-card h4 { font-size: 12px !important; margin: 0 0 4px 0 !important; }
  .stat-card .value { font-size: 16px !important; }

  .layui-card-header {
    display: flex !important;
    align-items: center !important;
    padding: 8px 12px !important;
    height: auto !important;
    min-height: unset !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
  }
  .layui-card-header span {
    font-size: 12px !important;
    white-space: nowrap !important;
    margin-right: 8px !important;
    flex-shrink: 0 !important;
  }
  .layui-card-header div {
    float: none !important;
    display: flex !important;
    gap: 2px !important;
    flex-shrink: 0 !important;
  }
  .layui-card-header button {
    font-size: 10px !important;
    padding: 2px 4px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  #sales-stats-box {
    display: block !important;
    overflow-x: auto !important;
    width: 100% !important;
  }

  /* ------------------------------
     3. 订单管理页面适配
  ------------------------------ */
  .order-summary-wrap {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 10px !important;
    margin-bottom: 12px !important;
  }
  .order-summary-item {
    flex: 1 1 calc(33% - 6px) !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    text-align: center !important;
    padding: 6px !important;
  }
  .order-summary-label { font-size: 11px !important; display: block !important; }
  .order-summary-value { font-size: 13px !important; font-weight: bold !important; }

  .order-toolbar {
    display: block !important;
    overflow-x: auto !important;
    padding-bottom: 10px !important;
    white-space: nowrap !important;
  }
  .order-toolbar-left {
    display: flex !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    margin-bottom: 8px !important;
  }
  .order-toolbar-right {
    display: flex !important;
    gap: 6px !important;
    justify-content: flex-start !important;
  }

  #order-search,
  .order-filter-select,
  .order-filter-date {
    font-size: 11px !important;
    padding: 4px 6px !important;
    height: auto !important;
    min-width: 110px !important;
  }
  .order-toolbar button {
    font-size: 11px !important;
    padding: 4px 8px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  #order-list {
    overflow-x: auto !important;
    width: 100% !important;
  }

  /* ------------------------------
     4. 添加订单表单适配
  ------------------------------ */
  .order-form-page { padding: 10px !important; }
  .form-row { display: block !important; margin-bottom: 10px !important; }
  .form-group { margin-bottom: 10px !important; }
  .form-group label { font-size: 12px !important; display: block !important; margin-bottom: 4px !important; }
  .form-group input,
  .form-group select,
  .form-group textarea {
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 13px !important;
    padding: 6px 8px !important;
  }
  #sell-count-btn-group,
  #product-btn-group {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  #sell-count-btn-group button,
  #product-btn-group button {
    font-size: 11px !important;
    padding: 4px 8px !important;
    white-space: nowrap !important;
  }
  .table-container { overflow-x: auto !important; }
  .order-payment-methods-table,
  .order-products-table,
  .order-multi-amount-table {
    width: 100% !important;
    font-size: 12px !important;
  }
  .order-form-footer {
    text-align: center !important;
    padding: 15px 0 !important;
  }
  .order-form-footer button {
    font-size: 12px !important;
    padding: 8px 20px !important;
  }

  /* ------------------------------
     5. 全局表格适配
  ------------------------------ */
  table {
    width: 100% !important;
    display: block !important;
    overflow-x: auto !important;
  }
  th, td {
    white-space: nowrap !important;
    padding: 8px 5px !important;
  }

  /* ------------------------------
     6. 全局滚动修复
  ------------------------------ */
  html,body{
    height: 100%;
    overflow-y: auto !important;
  }
  .content-area{
    height: auto !important;
  }
  body {
    overflow: visible !important;
    height: auto !important;
  }
}

/* 添加订单页面整体缩小适配 */
@media (max-width:768px) {
    #order-form-wrap {
        transform: scale(0.85) !important;
        transform-origin: top center !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 auto !important;
    }
    .order-form-page,
    .order-form-body,
    .form-group,
    .form-row {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    #product-btn-group,
    #sell-count-btn-group {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
}

/* 分页强制一行紧凑显示 */
@media (max-width:768px) {
    #order-pagination {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        padding: 10px 0 !important;
        font-size: 11px !important;
        white-space: nowrap !important;
    }
    #order-pagination button {
        font-size: 10px !important;
        padding: 3px 6px !important;
        white-space: nowrap !important;
    }
    #order-pagination span {
        font-size: 11px !important;
        white-space: nowrap !important;
    }
}




/* 仅业务员页面正常铺满屏幕（不混乱、不拖动）*/
@media (max-width:768px) {
  .content-area {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }
  #dashboard-page {
    width: 100% !important;
    padding: 0 8px !important;
    box-sizing: border-box !important;
  }
  #dashboard-page .layui-card {
    margin: 0 0 10px 0 !important;
  }
}

@media (max-width:768px) {
    /* 1. 数据统计标题+按钮强制一行 */
    #dashboard-page > div:first-child > div:first-child {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 6px !important;
        margin: 0 8px 15px 8px !important;
    }
    #dashboard-page h3 {
        font-size: 16px !important;
        white-space: nowrap !important;
    }
    #dashboard-page button {
        font-size: 11px !important;
        padding: 4px 6px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    /* 2. 统计卡片数字缩小，不溢出容器 */
    #dashboard-page .stats-grid {
        display: flex !important;
        gap: 8px !important;
        margin: 0 8px 15px 8px !important;
    }
    #dashboard-page .stats-grid .stat-card {
        flex: 1 !important;
        padding: 8px 4px !important;
        min-width: 0 !important;
        text-align: center;
    }
    #dashboard-page .stats-grid .stat-card h4 {
        font-size: 12px !important;
        margin: 0 0 4px 0 !important;
    }
    #dashboard-page .stats-grid .stat-card .value {
        font-size: 13px !important;
        font-weight: bold;
        white-space: nowrap !important;
        overflow: visible !important;
    }
}





/* ========== 订单表单：PC端表格正常，手机端强制换行布局 ========== */
/* --- PC端：保持你原来的表格样式 --- */
.order-items-table {
    width: 100% !important;
    table-layout: fixed !important;
}

.order-items-table td:first-child {
    width: 70% !important;
    padding: 8px 10px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.order-items-table td:last-child {
    width: 30% !important;
    text-align: right !important;
}

/* --- 手机端：强制改成“名称在上，按钮在下”的换行布局，永不被挤掉 --- */
@media (max-width: 768px) {
    .order-items-wrap {
        overflow-x: hidden !important;
    }

    .order-items-table,
    .order-items-table thead,
    .order-items-table tbody,
    .order-items-table th,
    .order-items-table td,
    .order-items-table tr {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 隐藏表头 */
    .order-items-table thead tr {
        position: absolute !important;
        top: -9999px !important;
        left: -9999px !important;
    }

    /* 每一行变成一个独立卡片 */
    .order-items-table tr {
        margin-bottom: 10px !important;
        border: 1px solid #eee !important;
        border-radius: 6px !important;
        padding: 10px !important;
    }

    /* 商品名称独占一行 */
    .order-items-table td:first-child {
        width: 100% !important;
        display: block !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        padding: 0 0 8px 0 !important;
        font-weight: 500 !important;
    }

    /* 按钮和数量框独占下一行，从左到右排列 */
    .order-items-table td:last-child {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 0 !important;
    }

    .order-items-table td:last-child button {
        flex-shrink: 0 !important;
        min-width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
        border: none !important;
        border-radius: 4px !important;
        color: #fff !important;
    }

    .order-items-table td:last-child button:first-child {
        background: #009688 !important;
    }

    .order-items-table td:last-child button:last-child {
        background: #ff5722 !important;
    }

    .order-items-table td:last-child input {
        flex: 1 !important;
        max-width: 60px !important;
        text-align: center !important;
        border: 1px solid #eee !important;
        border-radius: 4px !important;
        padding: 6px !important;
    }
}




/* ====================== 一、公共表格基础样式（统一三张表格） ====================== */
#sales-stats-box,
#sell-stats-box,
#stats-box {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 15px !important;
}

#sales-stats-box th,
#sales-stats-box td,
#sell-stats-box th,
#sell-stats-box td,
#stats-box th,
#stats-box td {
    padding: 12px !important;
    text-align: center !important;
    border: 1px solid #E5E7EB !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

/* 表头背景 */
#sales-stats-box thead th,
#sell-stats-box thead th,
#stats-box thead th {
    background: #F4F7FA !important;
    font-weight: 600 !important;
}

/* 偶数行背景 */
#sales-stats-box tbody tr:nth-child(even),
#sell-stats-box tbody tr:nth-child(even),
#stats-box tbody tr:nth-child(even) {
    background: #F9FAFB !important;
}

/* 悬浮高亮 */
#sales-stats-box tbody tr:hover,
#sell-stats-box tbody tr:hover,
#stats-box tbody tr:hover {
    background: #EFF6FF !important;
}

/* 修复按钮单元格布局 */
#sales-stats-box td:last-child,
#sell-stats-box td:last-child {
    display: table-cell !important;
    justify-content: unset !important;
}

/* ====================== 二、旧表格列宽（恢复你原来的布局） ====================== */
#sales-stats-box th:nth-child(1), #sell-stats-box th:nth-child(1) { width: 8% !important; }
#sales-stats-box th:nth-child(2), #sell-stats-box th:nth-child(2) { width: 15% !important; }
#sales-stats-box th:nth-child(3), #sell-stats-box th:nth-child(3) { width: 12% !important; }
#sales-stats-box th:nth-child(4), #sell-stats-box th:nth-child(4) { width: 15% !important; }
#sales-stats-box th:nth-child(5), #sell-stats-box th:nth-child(5) { width: 25% !important; }
#sales-stats-box th:nth-child(6), #sell-stats-box th:nth-child(6) { width: 25% !important; }

/* ====================== 三、PC端 统计卡片 一行5个布局（恢复你原来的排版） ====================== */
@media (min-width: 992px) {
  .stats-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
  }
  .stats-grid .stat-card {
    flex: 1 1 calc(20% - 13px) !important;
    min-width: 160px !important;
    max-width: calc(20% - 13px) !important;
  }
}

/* ====================== 四、仪表盘合并表格 #stats-box 终极修复（不破坏其他布局） ====================== */
#stats-box {
    width: 100% !important;
    table-layout: auto !important;
    border-collapse: collapse !important;
}

/* 列宽设置 */
#stats-box th:nth-child(1),
#stats-box td:nth-child(1)  { width: 6% !important; }
#stats-box th:nth-child(2),
#stats-box td:nth-child(2)  { width: 8% !important; }
#stats-box th:nth-child(3),
#stats-box td:nth-child(3)  { width: 7% !important; }
#stats-box th:nth-child(4),
#stats-box td:nth-child(4)  { width: 11% !important; }
#stats-box th:nth-child(5),
#stats-box td:nth-child(5)  { width: 11% !important; }
#stats-box th:nth-child(6),
#stats-box td:nth-child(6)  { width: 11% !important; }
#stats-box th:nth-child(7),
#stats-box td:nth-child(7)  { width: 11% !important; }
#stats-box th:nth-child(8),
#stats-box td:nth-child(8)  { width: 10% !important; }
#stats-box th:nth-child(9),
#stats-box td:nth-child(9)  { width: 13% !important; }

/* 强制所有单元格居中，兜底解决文字问题 */
#stats-box th,
#stats-box td,
#stats-box th:nth-child(n+4),
#stats-box td:nth-child(n+4),
#stats-box th:nth-child(10),
#stats-box td:nth-child(10) {
    text-align: center !important;
}

/* 强制背景色和整行一致，不出现留白 */
#stats-box tr:nth-child(even) td:nth-child(10) { background-color: #F9FAFB !important; }
#stats-box tr:nth-child(odd) td:nth-child(10) { background-color: #FFFFFF !important; }
#stats-box tr:hover td:nth-child(10) { background-color: #EFF6FF !important; }
#stats-box thead th:nth-child(10) { background-color: #F4F7FA !important; }




/* ---------- 手机端统计卡片样式优化 ---------- */
@media (max-width: 767px) {
    /* 统计卡片容器 */
    .stats-grid {
        padding: 0 10px !important;
    }

    /* 单个卡片样式 */
    .stats-grid .stat-card {
        flex: 1 1 calc(50% - 10px) !important; /* 一行两个 */
        min-width: unset !important;
        max-width: unset !important;
        margin-bottom: 10px !important;
        padding: 12px 8px !important; /* 减少内边距 */
        box-sizing: border-box !important;
    }

    /* 卡片内的标题文字 */
    .stat-card .stat-title {
        font-size: 12px !important; /* 标题字体更小 */
        margin-bottom: 5px !important;
    }

    /* 卡片内的数字（关键） */
    .stat-card .stat-value {
        font-size: 16px !important; /* 数字字体适中 */
        font-weight: bold !important;
        white-space: nowrap !important; /* 强制不换行 */
        overflow: hidden !important; /* 超出部分隐藏 */
        text-overflow: ellipsis !important; /* 超出显示省略号 */
        line-height: 1.2 !important;
    }
}


/* ====================== 自定义筛选日期一行显示 ====================== */
@media (max-width: 767px) {
    /* 1. 保留JS的隐藏逻辑，不强制设置display */
    #date-filter-container {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    /* 2. 只有当JS把它显示出来时，才应用flex布局 */
    #date-filter-container[style*="display: block"] {
        display: flex !important;
    }

    /* 3. 日期框：第一行各占一半 */
    #date-filter-container input[type="date"] {
        width: calc(50% - 5px) !important;
        box-sizing: border-box !important;
    }

    /* 4. 按钮：第二行各占一半 */
    #date-filter-container button {
        width: calc(50% - 5px) !important;
        box-sizing: border-box !important;
    }
}