/* ===== 全局重置 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #303133;
  background: #f0f2f5;
}
a { text-decoration: none; color: inherit; }

/* ===== 布局 ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== 侧边栏 ===== */
.sidebar {
  width: 220px;
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  color: #d1d5db;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-logo {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  font-size: 14px;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.nav-item.active {
  color: #fff;
  background: rgba(59,130,246,0.15);
  border-left-color: #3b82f6;
}
.nav-sub {
  padding-left: 44px;
  font-size: 13px;
}
.nav-icon {
  margin-right: 10px;
  font-size: 16px;
}
.nav-group-title {
  padding: 12px 20px 8px;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
}
.nav-group-title:hover { color: #fff; }
.nav-arrow { float: right; font-size: 10px; }
.nav-group-items { display: none; }

/* ===== 主区域 ===== */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===== 顶栏 ===== */
.topbar {
  height: 28px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
}
.breadcrumb { font-size: 11px; color: #6b7280; line-height: 1; }
.breadcrumb b { color: #111827; }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.biz-switcher {
  display: flex;
  gap: 6px;
}
.biz-tag {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  background: #f3f4f6;
  color: #6b7280;
  transition: all 0.2s;
}
.biz-tag:hover { background: #e5e7eb; }
.biz-tag.active {
  background: #3b82f6;
  color: #fff;
}
.biz-loading { color: #9ca3af; font-size: 13px; }
/* 顶部业态Tab栏 */
.biz-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 2px 10px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: nowrap;
  overflow: hidden;
}
.biz-tabs-left {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
}
.biz-tabs-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}
.biz-tabs-no-switch {
  justify-content: flex-end;
  min-height: 30px;
}
.biz-tabs-label {
  font-size: 11px;
  color: #6b7280;
  margin-right: 4px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.biz-tab {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  background: #f3f4f6;
  color: #6b7280;
  transition: all 0.2s;
  user-select: none;
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.biz-tab:hover {
  background: #e5e7eb;
  color: #374151;
}
.biz-tab.active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  border-color: #2563eb;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
  position: relative;
}
.biz-tab.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #2563eb;
}

.topbar-user {
  font-size: 14px;
  color: #374151;
}
.logout-btn {
  padding: 5px 14px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: #6b7280;
  transition: all 0.2s;
}
.logout-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* 用户信息容器 */
.user-info-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
}
.user-info-wrapper .topbar-user {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.user-info-wrapper .logout-btn {
  padding: 4px 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: #6b7280;
  transition: all 0.2s;
}
.user-info-wrapper .logout-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: #fef2f2;
}

/* ===== 内容区 ===== */
.app-content {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
}

/* ===== 卡片 ===== */
.card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
}

/* ===== 统计卡片 ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.stat-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
}
.stat-blue { color: #3b82f6; }
.stat-green { color: #10b981; }
.stat-orange { color: #f59e0b; }
.stat-purple { color: #8b5cf6; }

/* ===== 搜索栏 ===== */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.input {
  padding: 7px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  min-width: 140px;
}
.input:focus { border-color: #3b82f6; }

/* ===== 按钮 ===== */
.btn {
  padding: 7px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}
.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-ghost { background: #fff; color: #6b7280; border: 1px solid #d1d5db; }
.btn-ghost:hover { border-color: #3b82f6; color: #3b82f6; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 表格 ===== */
.table-container { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  background: #f9fafb;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}
.data-table td {
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
  color: #4b5563;
}
.data-table tr:hover { background: #f9fafb; }
.empty {
  text-align: center;
  color: #9ca3af;
  padding: 40px !important;
}

/* ===== 分页 ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}
.page-info { font-size: 13px; color: #6b7280; }

/* ===== 徽章 ===== */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-primary { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #e5e7eb; color: #374151; }
.badge-gray { background: #f3f4f6; color: #6b7280; }

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  background: #fff;
  border-radius: 8px;
  width: 90%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { font-size: 16px; font-weight: 600; color: #111827; }
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #9ca3af;
}
.modal-close:hover { color: #4b5563; }
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== 表单 ===== */
.form-row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}
.form-group {
  flex: 1;
  min-width: 0;
}
.form-label {
  display: block;
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 6px;
  font-weight: 500;
  line-height: 1.4;
}
.form-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  background: #fff;
  color: #1f2937;
  box-sizing: border-box;
  height: 38px;
}
.form-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.form-input:disabled { background: #f9fafb; color: #9ca3af; }
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}
select.form-input:hover { border-color: #9ca3af; }
.required { color: #ef4444; }

/* ===== 登录页 ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
}
.login-subtitle {
  text-align: center;
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 32px;
}
.login-btn {
  width: 100%;
  padding: 12px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 8px;
}
.login-btn:hover { background: #2563eb; }

/* 待审核徽章 */
.audit-badge {
  display: inline-block;
  background: #ff4d4f;
  color: white;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  vertical-align: middle;
}
.audit-badge:hover {
  background: #cf1322;
}
