/* 公共样式 */
:root {
  --primary: #3b82f6;
  --primary-soft: rgba(59, 130, 246, 0.18);
  --primary-text: #60a5fa;
  --sidebar: #0f172a;
  --bg: #f8fafc;
  --text: #334155;
}

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 250px;
  height: 100vh;
  background: #0f172a;
  color: #cbd5e1;
  padding: 0;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 10;
  transition: width 0.3s;
  overflow: hidden;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
}

/* ============ 折叠态侧边栏 ============ */
.sidebar.collapsed {
  width: 64px;
  background: #0f172a;
  /* 覆盖 inline 的 overflow:auto/hidden，保证飞出子菜单不被裁切 */
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  transition: width 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .menu-text,
.sidebar.collapsed .group-arrow {
  display: none !important;
}

/* summary 里的标题是裸文本（未包 .menu-text），用 font-size:0 抹掉，仅恢复图标 span */
.sidebar.collapsed .menu>details>summary>div {
  font-size: 0 !important;
  line-height: 0 !important;
}

.sidebar.collapsed .menu>details>summary>div>span {
  font-size: 18px !important;
  line-height: 1 !important;
}

/* 顶部 LOGO 区 */
.sidebar.collapsed .sidebar-logo {
  padding: 0;
  height: 56px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.sidebar.collapsed .toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: static;
  width: 36px;
  height: 36px;
  font-size: 18px;
  border-radius: 8px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.sidebar.collapsed .toggle-btn:hover {
  background: var(--primary-soft);
  color: #fff;
}

/* 菜单整体 */
.sidebar.collapsed .menu {
  width: 100%;
  padding: 10px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

/* 通用 item 容器（单层菜单 / details） */
.sidebar.collapsed .menu>li.single-menu,
.sidebar.collapsed .menu>details {
  width: 100%;
  margin: 0;
  padding: 0 8px;
  display: block;
  position: relative;
  border-left: none;
  box-sizing: border-box;
}

/* 单层菜单 */
.sidebar.collapsed .menu>li.single-menu a,
.sidebar.collapsed .menu>details>summary {
  width: 48px;
  height: 44px;
  margin: 0 auto;
  padding: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  list-style: none;
  border: none;
  position: relative;
}

.sidebar.collapsed .menu>details>summary::-webkit-details-marker {
  display: none;
}

.sidebar.collapsed .menu>details>summary>div {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0 !important;
}

.sidebar.collapsed .menu>details>summary>div>span,
.sidebar.collapsed .menu>li.single-menu a .menu-icon {
  margin: 0 !important;
  font-size: 18px !important;
  display: block !important;
  line-height: 1;
}

/* hover */
.sidebar.collapsed .menu>li.single-menu:hover>a,
.sidebar.collapsed .menu>details>summary:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

/* active */
.sidebar.collapsed .menu>li.single-menu.active>a {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.sidebar.collapsed .menu>li.single-menu.active>a::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

/* details 在折叠态：禁用原生展开，子菜单改为悬浮飞出 */
.sidebar.collapsed .menu>details>.sub-menu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  min-width: 200px;
  margin-left: 8px;
  padding: 8px 0;
  background: #1e293b;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  list-style: none;
  z-index: 1000;
  flex-direction: column;
  align-items: stretch;
}

/* 悬浮 details 时弹出（即便未 open 也展示） */
.sidebar.collapsed .menu>details:hover>.sub-menu {
  display: flex;
}

/* 飞出菜单的标题（用 details 名称做头） */
.sidebar.collapsed .menu>details>.sub-menu::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 16px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid #1e293b;
}

/* 飞出菜单内的 li */
.sidebar.collapsed .menu>details>.sub-menu li {
  width: 100%;
  margin: 0;
  padding: 0;
  display: block;
  border-left: none;
}

.sidebar.collapsed .menu>details>.sub-menu li a {
  display: flex !important;
  align-items: center;
  justify-content: flex-start !important;
  width: 100%;
  padding: 10px 16px !important;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s, color 0.2s;
  box-sizing: border-box;
}

.sidebar.collapsed .menu>details>.sub-menu li a .menu-icon {
  display: inline-block !important;
  margin-right: 10px !important;
  font-size: 14px !important;
}

.sidebar.collapsed .menu>details>.sub-menu li a .menu-text {
  display: inline !important;
}

.sidebar.collapsed .menu>details>.sub-menu li:hover a {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.sidebar.collapsed .menu>details>.sub-menu li.active a {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.sidebar.collapsed .menu>details>.sub-menu li.pos-highlight a {
  color: #34d399;
}

.sidebar.collapsed .menu>details>.sub-menu li.pos-highlight:hover a {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

/* 折叠态下避免 details[open] 影响显示 */
.sidebar.collapsed .menu>details[open]>.sub-menu {
  display: none;
}

.sidebar.collapsed .menu>details[open]:hover>.sub-menu {
  display: flex;
}

/* 折叠态：分组下含 active 子项时，主层级图标也呈激活态 */
.sidebar.collapsed .menu>details:has(> .sub-menu > li.active)>summary {
  background: var(--primary-soft);
  color: var(--primary-text);
}

.sidebar.collapsed .menu>details:has(> .sub-menu > li.active)>summary::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

/* 飞出菜单中的 active 项保持高亮（覆盖 ::before 的偏移） */
.sidebar.collapsed .menu>details>.sub-menu li.active::before {
  left: 0;
}

.sidebar-logo {
  padding: 24px;
  font-size: 18px;
  font-weight: bold;
  border-bottom: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-text {
  background: linear-gradient(90deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.menu {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.menu li {
  padding: 0;
  cursor: pointer;
  transition: 0.3s;
  color: #94a3b8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sub-menu li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 24px;
  text-decoration: none;
  color: inherit;
}

.menu li:hover,
.menu li.active {
  background: #1e293b;
  color: #fff;
  border-left: 4px solid var(--primary);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.header {
  padding: 16px 32px;
  background: #fff;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  z-index: 5;
}

.header span {
  margin-left: 20px;
  font-size: 14px;
  color: #64748b;
}

/* ===== 语言切换器（下拉点击式） ===== */
.language-switcher {
  position: relative;
  display: inline-block;
  margin-left: 20px;
  width: -moz-fit-content;
  width: fit-content;
}

/* 重置 .header span { margin-left: 20px } 对内部 span 的污染 */
.language-switcher span {
  margin-left: 0 !important;
  font-size: inherit !important;
  color: inherit !important;
}

/* 触发按钮 */
.language-switcher>.lang-current {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  color: #334155;
  font-weight: 500;
  list-style: none;
  user-select: none;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.language-switcher>.lang-current::-webkit-details-marker {
  display: none;
}

.language-switcher>.lang-current:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.language-switcher[open]>.lang-current {
  border-color: var(--primary);
  color: var(--primary);
  background: #f8fafc;
}

.language-switcher .lang-globe {
  font-size: 12px;
  line-height: 1;
}

.language-switcher .lang-label {
  line-height: 1;
}

.language-switcher .lang-arrow {
  font-size: 9px;
  color: #94a3b8;
  transition: transform 0.2s;
  margin-left: 1px;
}

.language-switcher[open] .lang-arrow {
  transform: rotate(180deg);
  color: var(--primary);
}

/* 下拉面板 */
.language-switcher .lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100px;
  padding: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  z-index: 1000;
  animation: lang-menu-in 0.15s ease-out;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

@keyframes lang-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.language-switcher .lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.language-switcher .lang-item:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.language-switcher .lang-item.lang-active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.language-switcher .lang-item-check {
  font-size: 12px;
  color: var(--primary);
}

.page {
  display: none;
  padding: 24px 32px;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.3s ease-out;
}

.page.active {
  display: flex;
}

/* Dashboard Aesthetics */
.dash-hero {
  background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%);
  color: white;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
  position: relative;
  overflow: hidden;
}

.dash-hero::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 50%;
  background: url('data:image/svg+xml;utf8,<svg opacity="0.1" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="40" stroke="white" stroke-width="2" fill="none"/></svg>') repeat;
  z-index: 1;
}

.dash-hero>* {
  position: relative;
  z-index: 2;
}

.sub-dash-hero {
  background: linear-gradient(135deg, #0f172a 0%, #10b981 100%);
  color: white;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
  position: relative;
  overflow: hidden;
}

.alert-banner {
  padding: 16px 24px;
  background: linear-gradient(to right, #fee2e2, #fef2f2);
  border-left: 6px solid #ef4444;
  border-radius: 8px;
  color: #b91c1c;
  font-weight: bold;
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-btn {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}

.alert-btn:hover {
  background: #dc2626;
}

/* 卡片样式 */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  border: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 20px -3px rgba(0, 0, 0, 0.1);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 10px;
}

.card-title {
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
}

.card-value {
  font-size: 32px;
  font-weight: 800;
  color: #0f172a;
}

/* 图表区域样式 */
.charts-area {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .charts-area {
    grid-template-columns: 1fr;
  }
}

/* 面板样式 */
.panel {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  border: 1px solid #f1f5f9;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* 按钮样式 */
.btn-primary {
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-secondary {
  background: #f1f5f9;
  color: #334155;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  border: 1px solid #e2e8f0;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

th {
  color: #64748b;
  font-weight: 600;
  background: #f8fafc;
  border-radius: 4px;
}

/* 徽章样式 */
.badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

.badge-red {
  background: #fee2e2;
  color: #ef4444;
}

.badge-orange {
  background: #ffedd5;
  color: #f97316;
}

.badge-green {
  background: #dcfce3;
  color: #22c55e;
}

.badge-blue {
  background: #dbeafe;
  color: #3b82f6;
}

.badge-purple {
  background: #f3e8ff;
  color: #9333ea;
}

/* 异常行样式 */
.row-abnormal {
  border-left: 4px solid #ef4444;
  background: #fffafa;
  outline: 1px solid #fee2e2;
}

/* ============================================================
   模态框 & 表单（公共组件样式）
   用法：
     <div class="modal-overlay" id="modal-xxx">
       <div class="modal">                       // 可选修饰类：modal--sm / modal--lg / modal--xl
         <div class="modal-title">标题</div>
         <div class="modal-subtitle">副标题/提示</div>
         <div class="form-group form-group--required">
           <label>字段名</label>
           <input type="text" placeholder="...">
         </div>
         <div class="form-row form-row--2">     // 多列表单
           <div class="form-group"><label>字段A</label><input></div>
           <div class="form-group"><label>字段B</label><input></div>
         </div>
         <div class="modal-footer">
           <button class="btn-secondary" onclick="closeModal('modal-xxx')">取消</button>
           <button class="btn-primary">确定</button>
         </div>
       </div>
     </div>

   openModal('modal-xxx') / closeModal('modal-xxx') 由 layout 提供。
   ============================================================ */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  padding: 20px;
  box-sizing: border-box;
}

.modal-overlay.is-open {
  display: flex !important;
}

/* 说明：下面的 .modal / .modal-title / .modal-footer 都用 .modal-overlay 前缀
   提升特异性（0,2,0），压过 web/js/modal.js 运行时注入的同名旧规则 */

.modal-overlay .modal {
  background: #fff;
  border-radius: 12px;
  width: 450px;
  max-width: 100%;
  max-height: calc(100vh - 40px);
  padding: 30px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-overlay .modal.modal--sm { width: 360px; }
.modal-overlay .modal.modal--lg { width: 640px; }
.modal-overlay .modal.modal--xl { width: 860px; }

.modal-overlay .modal-title {
  font-size: 18px;
  margin: 0 0 8px 0;
  padding: 0;
  border: none;
  font-weight: bold;
  color: #0f172a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* 副标题 / 说明文字（例："带 * 为必填项"） */
.modal-overlay .modal-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 20px 0;
  padding-bottom: 15px;
  border-bottom: 1px solid #f1f5f9;
}

/* 标题右侧关闭按钮 */
.modal-overlay .modal-close {
  flex-shrink: 0;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: normal;
  background: #fff;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  white-space: nowrap;
}

.modal-overlay .modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.modal-overlay .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
  border-bottom: none;
}

/* ===== 表单字段 ===== */
.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}

/* required 修饰：自动在 label 后追加红色 * */
.form-group.form-group--required > label::after,
.form-group.is-required > label::after {
  content: ' *';
  color: #ef4444;
  font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 14px;
  color: #0f172a;
  background: #f8fafc;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #94a3b8;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-group input[disabled],
.form-group select[disabled],
.form-group textarea[disabled] {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

/* inline 帮助文字 */
.form-group .form-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #94a3b8;
}

.form-group .form-error {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #ef4444;
}

/* checkbox / radio 内联行（复选 + label 一行） */
.form-group.form-group--inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group.form-group--inline > label {
  margin-bottom: 0;
  font-weight: 500;
}

.form-group.form-group--inline > input[type="checkbox"],
.form-group.form-group--inline > input[type="radio"] {
  width: auto;
  padding: 0;
  background: transparent;
}

/* ===== 多列表单行 ===== */
.form-row {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-row.form-row--2 { grid-template-columns: 1fr 1fr; }
.form-row.form-row--3 { grid-template-columns: 1fr 1fr 1fr; }

.form-row > .form-group {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .form-row.form-row--2,
  .form-row.form-row--3 {
    grid-template-columns: 1fr;
  }
}

/* 分页样式 */
.pagination {
  display: flex;
  justify-content: flex-end;   /* 默认靠右 */
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

/* 根据 data-align 属性覆盖：center / left / right */
.pagination[data-align="center"] { justify-content: center; }
.pagination[data-align="left"]   { justify-content: flex-start; }
.pagination[data-align="right"]  { justify-content: flex-end; }

/* 统计文字："第 X/Y 页 · 共 N 条" */
.pagination .pagination-info {
  color: #64748b;
  font-size: 13px;
  margin-left: 15px;
}

.page-item {
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  color: #334155;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  box-sizing: border-box;
}

/* 宽体：上一页/下一页 等文字类按钮，不用强制正方形 */
.page-item.page-item--wide {
  width: auto !important;
  min-width: 32px;
  padding: 0 12px !important;
}

a.page-item:hover {
  background: #f1f5f9;
  border-color: var(--primary);
  color: var(--primary);
}

.page-item.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: bold;
  cursor: default;
}

.page-item.page-ellipsis {
  background: transparent;
  border-color: transparent;
  color: #94a3b8;
  cursor: default;
  pointer-events: none;
}

@media (max-width: 768px) {
  .page-item {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 12px;
  }
}

/* 运单表单样式 */
.waybill-form {
  width: 100%;
  font-size: 13px;
  color: #333;
}

.waybill-form input,
.waybill-form select,
.waybill-form textarea {
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 13px;
}

.waybill-form input:focus,
.waybill-form select:focus,
.waybill-form textarea:focus {
  border-color: var(--primary);
  outline: none;
}

.wf-row-2 {
  display: flex;
  gap: 30px;
  margin-bottom: 20px;
}

.wf-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wf-col label {
  color: #555;
  font-size: 12px;
}

/* ============================================================
   公共表单控件 .w-input / .w-select
   既可用于 .waybill-form 内部（宽度 100% 填满网格单元），
   也可独立用于工具栏/筛选条/弹窗（宽度 auto 跟随内容，
     或配合 .w-input--w150 等 helper 指定具体宽度）
   ============================================================ */
.w-input,
.w-select {
  width: auto;
  height: 34px;
  padding: 6px 12px;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* 在 .waybill-form 内：宽度填满网格单元 + 保留原有 #ccc 边框 */
.waybill-form .w-input,
.waybill-form .w-select {
  width: 100%;
  border-color: #ccc;
}

select.w-select { cursor: pointer; padding-right: 28px; }

.w-input:hover:not(:disabled),
.w-select:hover:not(:disabled) {
  border-color: #94a3b8;
}

.w-input:focus,
.w-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.w-input:disabled,
.w-input[readonly],
.w-select:disabled {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}

.w-input::placeholder { color: #94a3b8; }

/* 宽度 helper —— 和 .j-input 对应的一套 */
.w-input--w120, .w-select--w120 { width: 120px; }
.w-input--w150, .w-select--w150 { width: 150px; }
.w-input--w180, .w-select--w180 { width: 180px; }
.w-input--w200, .w-select--w200 { width: 200px; }
.w-input--w220, .w-select--w220 { width: 220px; }
.w-input--w250, .w-select--w250 { width: 250px; }
.w-input--w280, .w-select--w280 { width: 280px; }
.w-input--w300, .w-select--w300 { width: 300px; }
.w-input--auto,  .w-select--auto  { width: auto; }

.wf-panels {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  align-items: stretch;
}

.wf-panel {
  flex: 1;
  border: 1px solid #e3e3e3;
  padding: 20px;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.wf-header {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wf-red {
  color: #ef4444;
  font-weight: bold;
  margin-left: 4px;
  font-size: 13px;
}

.wf-link {
  color: #666;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  font-weight: normal;
}

.wf-link:hover {
  color: var(--primary);
}

.wf-smart-row {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.wf-smart-btn {
  background: #1fb982;
  color: white;
  border: none;
  padding: 0 15px;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
}

.wf-smart-btn-outline {
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
  padding: 0 15px;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
}

.wf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

.wf-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.wf-group label {
  color: #555;
  font-size: 12px;
}

.wf-group input[readonly] {
  background: #f5f5f5;
  color: #777;
  cursor: not-allowed;
}

.wf-footer {
  text-align: right;
  margin-top: auto;
  font-size: 12px;
  color: var(--primary);
  padding-top: 10px;
}

.wf-footer input[type="checkbox"] {
  vertical-align: middle;
  margin-left: 10px;
  margin-right: 3px;
}

.wf-smart-box {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  padding: 10px;
  border: 1px solid #e3e3e3;
  background: #fcfcfc;
}

.wf-smart-box textarea {
  flex: 1;
  height: 40px;
  border: none;
  resize: none;
  outline: none;
  background: transparent;
  font-size: 12px;
  color: #666;
}

.wf-goods-box {
  border: 1px solid #e3e3e3;
  padding: 20px;
  background: #fff;
  margin-bottom: 20px;
}

.wf-goods-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 15px 0;
  border-bottom: 1px dashed #eee;
  gap: 20px;
}

.wf-goods-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.wf-g-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wf-g-item label {
  color: #555;
  white-space: nowrap;
  font-size: 12px;
}

.wf-btn-del {
  background: #ef4444;
  color: white;
  border: none;
  padding: 6px 15px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

.wf-submit {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 40px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}

.wf-add-good {
  color: var(--primary);
  font-size: 14px;
  margin-left: 15px;
  cursor: pointer;
  font-weight: normal;
}

/* 侧边栏详情/摘要组样式 */
.menu details {
  margin-bottom: 6px;
}

.menu summary {
  padding: 14px 20px;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 15px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s, color 0.2s;
  user-select: none;
  list-style: none;
  background: transparent;
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu summary:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.menu details[open] summary {
  color: #fff;
  opacity: 1;
}

.menu details[open] summary .group-arrow {
  transform: rotate(90deg);
  color: #94a3b8;
}

.menu .group-arrow {
  font-size: 16px;
  transition: transform 0.2s;
  color: #64748b;
}

.menu .sub-menu {
  padding: 4px 0 8px 0;
  margin: 0;
  background: #0f172a;
  list-style: none;
}

.menu .sub-menu li {
  padding: 0;
  font-size: 14px;
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s;
}

.menu .sub-menu li a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 12px 20px 12px 48px;
  text-decoration: none;
  color: inherit;
}

.menu .sub-menu li .menu-icon {
  font-size: 15px;
  margin-right: 12px;
  opacity: 0.8;
}

.menu .sub-menu li:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

/* 活动状态 */
.menu .sub-menu li.active {
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: bold;
  opacity: 1;
  position: relative;
}

.menu .sub-menu li.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
}

.menu .sub-menu li.active .menu-icon {
  opacity: 1;
}

/* POS高亮 */
.menu .sub-menu li.pos-highlight {
  color: #34d399;
  font-weight: bold;
}

.menu .sub-menu li.pos-highlight:hover {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.menu .sub-menu li.pos-highlight.active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.menu .sub-menu li.pos-highlight.active::before {
  background: #10b981;
}

/* 单级菜单项 */
.menu>li.single-menu {
  padding: 0;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 15px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transition: background 0.2s, color 0.2s;
  border-bottom: none;
}

.menu>li.single-menu a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 14px 20px;
  text-decoration: none;
  color: inherit;
}

.menu>li.single-menu:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.menu>li.single-menu.active {
  background: var(--primary-soft);
  color: var(--primary-text);
  border-left: 3px solid var(--primary);
  padding-left: 17px;
}

/* 快速操作 */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 10px;
}

.action-btn {
  padding: 30px;
  text-align: center;
  background: #fff;
  border-radius: 20px;
  cursor: pointer;
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  font-size: 16px;
  font-weight: bold;
  transition: transform 0.2s, box-shadow 0.2s;
}

.action-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.btn-blue {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #1d4ed8;
  border: none;
}

.btn-purple {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce3 100%);
  color: #15803d;
  border: none;
}

.btn-orange {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  color: #c2410c;
  border: none;
}

/* 动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: 60px;
    flex-direction: row;
    position: fixed;
    bottom: 0;
    z-index: 100;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    padding: 0;
    display: flex;
  }

  .sidebar-logo {
    display: none;
  }

  .menu {
    display: flex;
    flex-direction: row;
    width: 100%;
    overflow-x: auto;
    margin: 0;
  }

  .menu li {
    padding: 10px 5px;
    justify-content: center;
    flex: 1;
    text-align: center;
    font-size: 12px;
    border-left: none !important;
    border-top: 3px solid transparent;
    flex-direction: column;
    gap: 5px;
  }

  .menu li span {
    display: none;
  }

  .menu li.active {
    border-top: 3px solid var(--primary);
    border-left: none;
    background: rgba(255, 255, 255, 0.1);
  }

  .main {
    height: calc(100vh - 60px);
    padding-bottom: 60px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 15px;
  }

  .header span {
    margin-left: 0;
  }

  .page {
    padding: 15px;
  }

  .cards,
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .dash-hero::after {
    display: none;
  }

  /* 面板修改 */
  .panel {
    padding: 15px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .panel-header>div {
    flex-wrap: wrap;
    gap: 10px;
  }

  /* 表格水平滚动 */
  #page-1 .panel,
  #page-2 .panel,
  #wb-history,
  #wb-codes,
  #page-3 .panel,
  #sub-wb-history,
  #sub-wb-codes {
    overflow-x: auto;
  }

  table {
    width: 100%;
    min-width: 600px;
  }

  /* 运单表单特定 */
  .waybill-form .wf-row-2 {
    flex-direction: column;
    gap: 15px;
  }

  .wf-panels {
    flex-direction: column;
  }

  .wf-grid {
    grid-template-columns: 1fr;
  }

  .wf-goods-row {
    flex-wrap: wrap;
  }

  .wf-g-item {
    flex: 1 1 100% !important;
  }

  .wf-btn-del {
    width: 100%;
    margin-top: 10px;
  }

  .modal {
    width: 90%;
    max-width: 350px;
    padding: 20px;
  }
}

/* 主账号特定样式 */
.master-dashboard {
  --primary: #3b82f6;
  --sidebar: #0f172a;
  --bg: #f8fafc;
  --text: #334155;
}

.master-dashboard .btn-primary {
  background: var(--primary);
}

.master-dashboard .btn-primary:hover {
  background: #2563eb;
}

.master-dashboard .page-item.active {
  background: var(--primary);
  border-color: var(--primary);
}

.master-dashboard .menu li.active {
  border-left: 4px solid var(--primary);
}

.master-dashboard .form-group input:focus {
  border-color: var(--primary);
  outline: none;
  background: #fff;
}

.master-dashboard .wf-link:hover {
  color: var(--primary);
}

.master-dashboard .wf-footer {
  color: var(--primary);
}

.master-dashboard .wf-submit {
  background: var(--primary);
}

/* 子账号特定样式 */
.sub-dashboard {
  --primary: #00a65a;
  --primary-soft: rgba(16, 185, 129, 0.18);
  --primary-text: #34d399;
  --sidebar: #0f172a;
  --bg: #f8fafc;
  --text: #334155;
}

/* ===== 子账号侧边栏（基于 sub_dashboard_preview.html 的样式） =====
   主体结构沿用共享的 .sidebar / .menu 规则，这里仅覆盖视觉差异 */

/* sidebar 容器：稍宽 + 半透明深蓝 */
.sub-dashboard .sidebar {
  width: 260px;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
}

/* 折叠态宽度覆盖（特异性高于 .sub-dashboard .sidebar） */
.sub-dashboard .sidebar.collapsed {
  width: 64px;
}

/* logo 区：绿色渐变文字 */
.sub-dashboard .sidebar-logo .logo-text {
  background: linear-gradient(90deg, #10b981, #059669);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* hover 背景使用半透明白，比 master 的深色更轻盈 */
.sub-dashboard .menu>li.single-menu:hover,
.sub-dashboard .menu summary:hover,
.sub-dashboard .menu .sub-menu li:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* sub-menu 容器背景与 sidebar 协调 */
.sub-dashboard .menu .sub-menu {
  background: transparent;
}

/* 折叠态飞出菜单使用稍亮的深色卡片 */
.sub-dashboard .sidebar.collapsed .menu>details>.sub-menu {
  background: #1e293b;
}

.sub-dashboard .sidebar.collapsed .menu>details>.sub-menu::before {
  border-right-color: #1e293b;
}

.sub-dashboard .btn-primary {
  background: var(--primary);
}

.sub-dashboard .btn-primary:hover {
  background: #059669;
}

.sub-dashboard .page-item.active {
  background: var(--primary);
  border-color: var(--primary);
}

.sub-dashboard .menu li.active {
  border-left: 4px solid var(--primary);
}

.sub-dashboard .form-group input:focus {
  border-color: var(--primary);
  outline: none;
  background: #fff;
}

.sub-dashboard .wf-link:hover {
  color: var(--primary);
}

.sub-dashboard .wf-footer {
  color: var(--primary);
}

.sub-dashboard .wf-submit {
  background: #1fb982;
}

/* 子账号头部徽章 */
.badge-stock {
  background: #10b981;
  color: white !important;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: bold !important;
  box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
}
/* ============================================================
   登录页（local-login）专用样式
   ============================================================ */

.login-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #3b82f6 100%);
  font-family: 'Inter', 'Segoe UI', 'Microsoft YaHei', sans-serif;
  color: #334155;
  overflow: auto;
}

/* 装饰背景：大号渐变光斑 */
.login-body::before,
.login-body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.login-body::before {
  width: 500px;
  height: 500px;
  background: #60a5fa;
  top: -150px;
  left: -150px;
}
.login-body::after {
  width: 400px;
  height: 400px;
  background: #a78bfa;
  bottom: -120px;
  right: -120px;
}

.login-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

.login-card {
  display: flex;
  width: 100%;
  max-width: 900px;
  min-height: 560px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 60px -20px rgba(15, 23, 42, 0.35),
              0 20px 30px -15px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  animation: login-card-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes login-card-in {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* 左侧品牌区 */
.login-brand {
  flex: 1.1;
  padding: 48px 40px;
  background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-brand::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 240px;
  height: 240px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.login-brand-inner {
  position: relative;
  z-index: 1;
}

.login-brand-logo {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 24px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.25));
}

.login-brand-title {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 800;
  margin: 0 0 12px 0;
  background: linear-gradient(90deg, #ffffff 0%, #dbeafe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-brand-tagline {
  font-size: 14px;
  margin: 0 0 32px 0;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
}

.login-brand-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.login-brand-features li {
  padding: 8px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

.login-brand-footer {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

/* 右侧表单区 */
.login-form-wrap {
  flex: 1;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-form-head {
  margin-bottom: 28px;
}

.login-form-head h2 {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 8px 0;
}

.login-form-head p {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

/* 错误提示 */
.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 20px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #ef4444;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.5;
  animation: login-shake 0.4s ease-out;
}

.login-alert-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.login-alert-text {
  flex: 1;
}

@keyframes login-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

/* 带图标的输入框 */
.login-input-wrap {
  position: relative;
}

.login-input-wrap .login-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #94a3b8;
  pointer-events: none;
  user-select: none;
}

.login-input-wrap > input {
  width: 100%;
  padding: 12px 14px 12px 44px !important;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  color: #0f172a;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.login-input-wrap > input:focus {
  outline: none;
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.login-input-wrap > input::placeholder {
  color: #94a3b8;
}

/* 密码显示切换按钮 */
.login-password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px 10px;
  font-size: 16px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.login-password-toggle:hover {
  background: #f1f5f9;
  color: #3b82f6;
}

/* 记住我 / 忘记密码 行 */
.login-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 24px 0;
}

.login-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
  user-select: none;
}

.login-checkbox input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #3b82f6;
  cursor: pointer;
}

.login-forgot {
  font-size: 13px;
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

.login-forgot:hover {
  text-decoration: underline;
}

/* 登录主按钮 */
.login-submit {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 2px;
  box-shadow: 0 10px 20px -8px rgba(59, 130, 246, 0.5);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px -8px rgba(59, 130, 246, 0.55);
  filter: brightness(1.05);
}

.login-submit:active {
  transform: translateY(0);
}

/* 分隔线 */
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 16px 0;
  font-size: 12px;
  color: #94a3b8;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* 第三方登录入口 */
.login-alt-btn {
  display: block;
  width: 100%;
  padding: 12px;
  text-align: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #334155;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  box-sizing: border-box;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.login-alt-btn:hover {
  background: #f8fafc;
  border-color: #3b82f6;
  color: #3b82f6;
}

.login-foot-hint {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}

/* 响应式 */
@media (max-width: 768px) {
  .login-viewport {
    padding: 20px 16px;
  }

  .login-card {
    flex-direction: column;
    max-width: 440px;
    min-height: auto;
  }

  .login-brand {
    padding: 32px 28px;
  }

  .login-brand-title {
    font-size: 24px;
  }

  .login-brand-features {
    display: none;
  }

  .login-form-wrap {
    padding: 32px 28px;
  }
}

/* 登录页字段级错误态 */
.login-form-wrap .form-group .form-error {
  display: none;
  margin-top: 6px;
  font-size: 12px;
  color: #ef4444;
  line-height: 1.4;
}

.login-form-wrap .form-group.has-error .form-error {
  display: block;
}

.login-form-wrap .form-group.has-error .login-input-wrap > input {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.login-form-wrap .form-group.has-error .login-input-icon {
  color: #ef4444;
}

/* ============================================================
   公共工具类（从各 view 的 inline style 中抽取）
   ============================================================ */

/* ----- panel-header 装饰变体：彩色左边框 + 浅灰背景 ----- */
.panel-header--accent {
  background: #f4f4f5;
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid #3b82f6;   /* 默认蓝 */
}
.panel-header--accent.panel-header--purple { border-left-color: #8b5cf6; }
.panel-header--accent.panel-header--green  { border-left-color: #10b981; }
.panel-header--accent.panel-header--blue   { border-left-color: #3b82f6; }
.panel-header--accent.panel-header--red    { border-left-color: #ef4444; }
.panel-header--accent.panel-header--orange { border-left-color: #f97316; }
.panel-header--accent.panel-header--indigo { border-left-color: #4f46e5; }
.panel-header--accent h2 { margin: 0; }

/* panel-header 下方分隔线变体（常用于二级面板） */
.panel-header--divider {
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 15px;
  margin-bottom: 25px;
}

/* panel-header 标题下方的副标题 */
.panel-header-desc {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  color: #64748b;
}

/* panel 间距辅助 */
.panel + .panel { margin-top: 24px; }

/* ----- 徽章新增变体 ----- */
.badge-indigo {
  background: #e0e7ff;
  color: #4338ca;
}
.badge-amber {
  background: #fef3c7;
  color: #92400e;
}
.badge-slate {
  background: #f1f5f9;
  color: #475569;
}
.badge-emerald {
  background: #dcfce3;
  color: #166534;
}
.badge-rose {
  background: #fee2e2;
  color: #991b1b;
}

/* 方形徽章（用于价格标签等，不是胶囊形） */
.badge-square {
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
}

/* ----- 表格操作按钮（单元格里的小胶囊按钮） ----- */
.btn-action {
  border: none;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
  margin-right: 5px;
  transition: filter 0.15s;
}
.btn-action:hover { filter: brightness(1.1); }
.btn-action:last-child { margin-right: 0; }

.btn-action--blue   { background: #3b82f6; }
.btn-action--amber  { background: #f59e0b; }
.btn-action--purple { background: #8b5cf6; }
.btn-action--green  { background: #10b981; }
.btn-action--red    { background: #ef4444; }
.btn-action--slate  { background: #64748b; }

/* 表格操作文字链接 */
.link-action {
  font-size: 12px;
  font-weight: bold;
  text-decoration: none;
  margin-right: 10px;
  color: #3b82f6;
}
.link-action:last-child { margin-right: 0; }
.link-action--danger  { color: #ef4444; }
.link-action--success { color: #10b981; }
.link-action--primary { color: #3b82f6; }

/* ----- 空状态单元格 ----- */
.empty-cell {
  text-align: center;
  color: #94a3b8;
  padding: 40px !important;
}

/* ----- 文字工具类 ----- */
.text-muted     { color: #64748b; }
.text-muted-sm  { color: #64748b; font-size: 12px; }
.text-hint      { color: #94a3b8; }
.text-hint-sm   { color: #94a3b8; font-size: 12px; }
.text-danger    { color: #ef4444; }
.text-success   { color: #10b981; }
.text-strong    { color: #0f172a; font-weight: 700; }

/* 等宽字体（运单号、价格等） */
.text-mono      { font-family: monospace; }
.text-code-blue { color: #1d4ed8; font-family: monospace; font-weight: bold; font-size: 14px; }

/* 运单状态行（深蓝表头） */
.table-dark thead { background: #0f172a; color: #fff; }
.table-dark thead th { color: #fff; background: transparent; }

/* 不换行 / 超宽表格辅助 */
.table-nowrap { white-space: nowrap; }
.table-wide-scroll { overflow-x: auto; }

/* 小号货币单元格（红色等宽） */
.cell-base-price {
  color: #ef4444;
  font-family: monospace;
}

/* 行内灰色小字（"次级信息"） */
.sub-info {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

/* 页面头部搜索栏的输入框基础样式 */
.toolbar-search {
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  width: 250px;
}
.toolbar-search--wide { width: 280px; }

/* 工具栏按钮右对齐辅助 */
.toolbar-right { margin-left: auto; }

/* 绿色强调的主按钮变体（Add/Save 操作） */
.btn-primary.btn-primary--green { background: #10b981; }
.btn-primary.btn-primary--green:hover { background: #059669; }

/* ===== Header 退出登录按钮 ===== */
.header-logout {
  color: #ef4444;
  font-weight: bold;
  font-size: 14px;
  text-decoration: none;
  margin-left: 20px;
  cursor: pointer;
  transition: color 0.2s, opacity 0.2s;
}

.header-logout:hover {
  color: #dc2626;
  opacity: 0.85;
}

/* .j-input 已废弃，统一使用 .w-input / .w-select（见上方定义） */
