/* ======================================================
   浦东基地在线工作台 · 统一主题 (_theme.css)
   修改此处，全局生效
   ====================================================== */

:root {
  /* ----- 主色调（6个模块色系）----- */
  --blue:       #1a6bb3;
  --blue-light: #e3f2fd;
  --orange:     #e67e22;
  --orange-light:#fff3e0;
  --green:      #27ae60;
  --green-light:#e8f5e9;
  --purple:     #8e44ad;
  --purple-light:#f3e5f5;
  --red:        #c0392b;
  --red-light:  #ffebee;
  --brown:      #d35400;
  --brown-light:#fbe9e7;

  /* ----- 功能色 ----- */
  --primary:       #1a6bb3;
  --primary-dark:  #155a8a;
  --success:       #27ae60;
  --warning:       #e67e22;
  --danger:        #c0392b;
  --info:          #3498db;

  /* ----- 中性色 ----- */
  --bg:            #f0f2f5;
  --card-bg:       #ffffff;
  --text:          #333333;
  --text-secondary:#666666;
  --text-light:    #999999;
  --border:        #e8e8e8;
  --border-light:  #f0f0f0;

  /* ----- 排版 ----- */
  --font:          'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', sans-serif;
  --font-mono:     'Consolas', 'SF Mono', monospace;
  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     14px;
  --shadow-sm:     0 1px 4px rgba(0,0,0,.06);
  --shadow:        0 2px 10px rgba(0,0,0,.08);
  --shadow-lg:     0 6px 24px rgba(0,0,0,.12);
  --transition:    all .2s ease;
}

/* ----- 全局重置 ----- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ----- 按钮系统 ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #1e8449; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d35400; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--blue-light); }

.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ----- 卡片 ----- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card-accent-left {
  position: relative;
  padding-left: 4px;
}
.card-accent-left::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--primary);
}

/* ----- 表格 ----- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  background: #f5f7fa;
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}
td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
tr:hover td { background: #fafcff; }
tr:nth-child(even) td { background: #fafafa; }
tr:nth-child(even):hover td { background: #fafcff; }

/* ----- 状态徽章 ----- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
}
.badge-active  { background: #d5f5e3; color: #1e8449; }
.badge-vacation { background: #fef9e7; color: #b7950b; }
.badge-training{ background: #d6eaf8; color: #1a5276; }
.badge-deleted { background: #f2f3f4; color: #999; }

/* ----- 角色色标 ----- */
.role-fx      { background: #ffe0e0; color: var(--danger); }
.role-jxs     { background: #d5f5e3; color: #1e8449; }
.role-jxy     { background: #e8f8f5; color: #148f77; }
.role-qwy     { background: #fef9e7; color: #b7950b; }
.role-xy      { background: #f2f3f4; color: #999; }
.role-zz      { background: #d6eaf8; color: #1a5276; }
.role-default { background: #eee; color: #666; }

/* ----- 工具类 ----- */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-sm     { font-size: 12px; }
.text-xs     { font-size: 10px; }
.text-muted  { color: var(--text-light); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }

/* ----- 响应式断点 ----- */

/* 平板 (~1024px) */
@media (max-width: 1024px) {
  .container, .dashboard {
    max-width: 100% !important;
    padding: 0 12px !important;
  }
}

/* 手机 (~768px) */
@media (max-width: 768px) {
  html { font-size: 14px; }
  body { padding: 8px; }

  /* 隐藏非核心列 */
  .hide-mobile { display: none !important; }

  /* 导航栏横向滚动 */
  .__topbar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding: 8px 10px;
    gap: 6px;
  }
  .__topbar a { padding: 4px 8px; font-size: 11px; }
  .__topbar .__tagline { display: none; }

  /* 表格横向滚动 */
  .ws-body, .gp-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table { font-size: 12px; min-width: 500px; }
  th, td { padding: 6px 8px; }

  /* 搜索栏折叠 */
  .search-bar {
    flex-wrap: wrap;
    gap: 6px;
  }
  .search-bar input { font-size: 14px; }

  /* 统计卡片网格 */
  .stats-bar, .stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  /* 按钮缩小 */
  .btn { padding: 6px 12px; font-size: 12px; }
  .btn-sm { padding: 3px 6px; font-size: 10px; }

  /* 弹窗全宽 */
  .modal-box { width: 95vw; padding: 20px; }

  /* 卡片导航网格 */
  .nav-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .nav-card { padding: 14px 10px; gap: 10px; }
  .nav-card .icon { width: 36px; height: 36px; font-size: 18px; }
  .nav-card .info h3 { font-size: 13px; }

  /* 工具栏 */
  .toolbar { gap: 6px; }
  .toolbar .btn { padding: 5px 10px; font-size: 11px; }

  /* 操作按钮组 */
  .actions { flex-wrap: wrap; gap: 2px; }

  /* 车间分布chip */
  .ws-row { gap: 4px; }
  .ws-chip { padding: 6px 10px; min-width: 70px; }
  .ws-chip .chip-num { font-size: 15px; }
}
