* { box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif; margin:0; background:#f4f6f9; color:#222; }
a { color:#1e6bb8; text-decoration:none; } a:hover { text-decoration:underline; }

/* 左侧栏 */
.sidebar {
  position:fixed; left:0; top:0; bottom:0; width:220px;
  background:#0f172a;   /* slate-900,深蓝黑,长时间看不刺眼 */
  color:#f1f5f9;
  padding:18px 0;
  display:flex; flex-direction:column;
  box-shadow:1px 0 2px rgba(0,0,0,0.20);
  transition: width 0.22s ease;
}
/* 折叠态:用 <html class="sb-collapsed"> 控,与 main.php <head> 同步 script 配合,
   避免筛选整页刷新时的"先展开再折叠"闪烁 */
.sb-collapsed .sidebar { width:0 !important; padding:0 !important; overflow:hidden !important; }
.sidebar.collapsed     { width:0; padding:0; overflow:hidden; }  /* 兼容旧版(可后续删除) */
.sidebar .brand {
  font-size:16px; font-weight:600;
  padding:6px 22px 18px;
  border-bottom:1px solid #1e293b;
  color:#f1f5f9;
  letter-spacing:1px;
}
.sidebar .brand::before { content:"● "; color:#64748b; font-size:14px; }  /* 灰蓝点,降一档不抢眼 */
.sidebar nav { flex:1; padding:10px 0; }
.sidebar nav a {
  display:block; padding:10px 22px;
  color:#cbd5e1;
  font-size:14px;
  border-left:3px solid transparent;
  white-space:nowrap;
  transition: background 0.15s, color 0.15s;
}
.sidebar nav a:hover { background:#1e293b; color:#f8fafc; text-decoration:none; }
.sidebar nav a.active {
  background:rgba(96,165,250,0.10);   /* 柔和的半透天蓝,不刺眼 */
  color:#f1f5f9;
  border-left-color:#60a5fa;          /* 偏柔的天蓝左条 */
  font-weight:600;
}
.sidebar-footer {
  padding:14px 22px; font-size:12px; color:#475569;
  border-top:1px solid #1e293b;
  letter-spacing:0.5px;
}

/* 折叠/展开按钮 (浮在 sidebar 右边缘) */
.sidebar-toggle {
  position:fixed; top:14px; left:188px; z-index:30;
  width:26px; height:26px; padding:0;
  background:#fff; color:#374151;
  border:1px solid #d1d5db; border-radius:4px;
  cursor:pointer; font-size:14px; line-height:1;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 1px 2px rgba(0,0,0,0.05);
  transition: left 0.22s ease, background 0.15s;
}
.sidebar-toggle:hover { background:#f3f4f6; }
/* 按钮位置由 main.php 里的 JS 直接控制 (.style.left),不靠 CSS 选择器 */

/* 顶部条 (品牌名 + 用户信息) */
.topbar {
  position:fixed; left:220px; right:0; top:0; height:54px;
  background:#fff; border-bottom:1px solid #e5e7eb;
  display:flex; align-items:center; padding:0 28px;
  z-index:10;
  transition: left 0.22s ease;
}
.topbar-title { font-weight:600; font-size:15px; color:#111827; }
.topbar .user-info { margin-left:auto; color:#6b7280; font-size:13px; }
.topbar .user-info a { color:#374151; margin-left:14px; }
.topbar .user-info a:hover { color:#1f2937; }

.container { max-width:none; margin-left:220px; margin-top:78px; padding:24px 28px; transition: margin-left 0.22s ease; }
.sb-collapsed .topbar    { left:0; padding-left:56px; }   /* 让出按钮位置 (26+20) */
.sb-collapsed .container { margin-left:0; }

.stat-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:16px; margin-bottom:24px; }
.stat-card { background:#fff; padding:16px; border-radius:8px; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.stat-card .label { color:#6b7280; font-size:13px; }
.stat-card .value { font-size:28px; font-weight:600; margin-top:6px; }
.stat-card.alert-warn .value { color:#ef4444; }

.data-table { width:100%; border-collapse:collapse; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,0.06); border-radius:8px; overflow:hidden; margin-bottom:18px; }
.data-table th, .data-table td { padding:10px 12px; border-bottom:1px solid #e5e7eb; text-align:left; font-size:13px; }
.data-table th { background:#f9fafb; color:#374151; }
.data-table tbody tr:hover { background:#f9fafb; }

.tag { display:inline-block; padding:2px 8px; border-radius:12px; font-size:12px; }
.tag-pending { background:#e0e7ff; color:#3730a3; }
.tag-processing { background:#fef3c7; color:#92400e; }
.tag-done { background:#d1fae5; color:#065f46; }
.tag-error { background:#fee2e2; color:#991b1b; }
.tag-pause { background:#f3f4f6; color:#6b7280; }

.btn { display:inline-block; padding:8px 16px; background:#2563eb; color:#fff; border-radius:6px; border:none; cursor:pointer; font-size:14px; }
.btn:hover { background:#1d4ed8; text-decoration:none; }
.btn-secondary { background:#6b7280; }
.btn-secondary:hover { background:#4b5563; }
.link-danger { background:none; border:none; color:#dc2626; cursor:pointer; padding:0; }

.filter-bar { display:flex; gap:8px; margin-bottom:16px; }
.filter-bar input, .filter-bar select { padding:6px 10px; border:1px solid #d1d5db; border-radius:6px; }
.filter-bar button { padding:6px 16px; background:#2563eb; color:#fff; border:none; border-radius:6px; cursor:pointer; }

.pagination a { display:inline-block; padding:6px 12px; border:1px solid #d1d5db; margin-right:4px; border-radius:4px; }
.pagination a.active { background:#2563eb; color:#fff; border-color:#2563eb; }

.form-grid { display:grid; grid-template-columns:repeat(2, 1fr); gap:14px 18px; background:#fff; padding:20px; border-radius:8px; }
.form-grid label { display:block; font-size:13px; color:#374151; margin-bottom:4px; }
.form-grid input, .form-grid select, .form-grid textarea { width:100%; padding:8px; border:1px solid #d1d5db; border-radius:6px; font-size:14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid button { padding:8px 18px; background:#2563eb; color:#fff; border:none; border-radius:6px; cursor:pointer; }

.card { background:#fff; padding:18px 20px; border-radius:8px; margin-bottom:18px; box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.card h3 { margin-top:0; margin-bottom:14px; padding-bottom:10px; border-bottom:1px solid #e5e7eb; font-size:15px; color:#1f2937; }
.card .detail-grid { background:transparent; padding:0; box-shadow:none; margin-bottom:0; }

.checkbox { display:block; margin-bottom:8px; font-weight:normal; }

.alert { padding:10px 16px; border-radius:6px; margin-bottom:16px; }
.alert-success { background:#d1fae5; color:#065f46; }
.alert-error { background:#fee2e2; color:#991b1b; }

.detail-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); gap:12px; background:#fff; padding:18px; border-radius:8px; margin-bottom:16px; }
.detail-grid label { display:block; font-size:12px; color:#6b7280; }
.detail-grid > div > div { padding-top:4px; }

.pre { white-space:pre-wrap; word-break:break-word; background:#fff; padding:16px; border-radius:6px; border:1px solid #e5e7eb; max-height:300px; overflow:auto; font-size:12px; }

.auth { display:flex; min-height:100vh; align-items:center; justify-content:center; background:#1f2937; }
.auth-card { background:#fff; padding:32px 36px; border-radius:8px; width:360px; box-shadow:0 4px 16px rgba(0,0,0,0.2); }
.auth-card h1 { margin-top:0; font-size:22px; text-align:center; margin-bottom:24px; }
.auth-card label { display:block; font-size:13px; margin:10px 0 4px; }
.auth-card input { width:100%; padding:8px; border:1px solid #d1d5db; border-radius:6px; }
.auth-card button { width:100%; padding:10px; background:#2563eb; color:#fff; border:none; border-radius:6px; margin-top:18px; cursor:pointer; }
.muted { color:#6b7280; font-size:12px; text-align:center; margin-top:14px; }

/* 边框 + 加粗字体的状态徽章 (区别于 .tag 胶囊样式,用于经营状态/限高/被执行) */
.badge-bordered { display:inline-block; padding:1px 8px; border:1.5px solid currentColor; border-radius:4px; font-weight:600; font-size:13px; line-height:1.5; }
.badge-ok      { color:#047857; background:#ecfdf5; }  /* 绿 - 在业/存续 */
.badge-warn    { color:#b45309; background:#fffbeb; }  /* 橙 - 吊销/注销/迁出 */
.badge-bad     { color:#b91c1c; background:#fef2f2; }  /* 红 - 限高/被执行 是 */
.badge-neutral { color:#6b7280; background:#f9fafb; border-color:#d1d5db; }  /* 灰 - 否/未知 */
.badge-bordered.badge-mini { padding:0 6px; font-size:11px; font-weight:600; margin-left:4px; vertical-align:middle; }
