* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
}

/* 登录/注册页 */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  padding: 20px;
}
.auth-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideIn 0.4s;
}
.auth-logo {
  font-size: 56px;
  text-align: center;
  margin-bottom: 8px;
}
.auth-card h1 {
  text-align: center;
  color: #1e3c72;
  font-size: 24px;
  margin-bottom: 4px;
}
.auth-subtitle {
  text-align: center;
  color: #888;
  font-size: 13px;
  margin-bottom: 24px;
}
.auth-tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 2px solid #f0f0f0;
}
.auth-tab {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  font-size: 15px;
  cursor: pointer;
  color: #999;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.auth-tab.active {
  color: #2a5298;
  border-bottom-color: #2a5298;
  font-weight: 600;
}
.auth-form { display: none; }
.auth-form.active { display: block; animation: fadeIn 0.3s; }
.auth-tip {
  text-align: center;
  font-size: 12px;
  color: #aaa;
  margin-top: 16px;
}
.auth-links {
  text-align: right;
  margin-top: 8px;
}
.auth-links a {
  color: #2a5298;
  font-size: 13px;
  text-decoration: none;
}
.auth-links a:hover { text-decoration: underline; }
.code-row {
  display: flex;
  gap: 8px;
}
.code-row input { flex: 1; }
.btn-code {
  white-space: nowrap;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid #2a5298;
  color: #2a5298;
  background: white;
  border-radius: 4px;
  cursor: pointer;
}
.btn-code:hover:not(:disabled) { background: #2a5298; color: white; }
.btn-code:disabled {
  border-color: #ccc;
  color: #999;
  cursor: not-allowed;
}
.btn-block { width: 100%; padding: 12px; font-size: 16px; margin-top: 8px; }

/* 顶部用户信息 */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 14px;
}
.user-name { font-weight: 600; }
.user-role {
  background: rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}

/* 头部 */
.header {
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { font-size: 32px; }
.logo h1 { font-size: 22px; font-weight: 600; letter-spacing: 1px; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.nav-btn:hover { background: rgba(255,255,255,0.25); }
.nav-btn.active { background: white; color: #1e3c72; font-weight: 600; }

/* 容器 */
.container {
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 24px;
}
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-left: 4px solid #2a5298;
  transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card.green { border-left-color: #52c41a; }
.stat-card.orange { border-left-color: #fa8c16; }
.stat-card.red { border-left-color: #f5222d; }
.stat-card.purple { border-left-color: #722ed1; }
.stat-value { font-size: 30px; font-weight: 700; color: #1e3c72; margin-bottom: 4px; }
.stat-label { font-size: 13px; color: #888; }

/* 面板 */
.dashboard-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) { .dashboard-panels { grid-template-columns: 1fr; } }

.panel {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.panel h2 { font-size: 16px; margin-bottom: 12px; color: #1e3c72; }

/* 工具栏 */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-box { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.search-box input, .search-box select {
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
}
.search-box input { flex: 1; min-width: 200px; }
.search-box input:focus, .search-box select:focus { border-color: #2a5298; }

/* 按钮 */
.btn {
  padding: 8px 16px;
  border: 1px solid #d9d9d9;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.btn:hover { border-color: #2a5298; color: #2a5298; }
.btn-primary {
  background: #2a5298;
  color: white;
  border-color: #2a5298;
}
.btn-primary:hover { background: #1e3c72; color: white; }
.btn-danger { color: #f5222d; border-color: #ffccc7; }
.btn-danger:hover { background: #fff1f0; color: #cf1322; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn + .btn { margin-left: 4px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.data-table th {
  background: #fafafa;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #555;
  border-bottom: 2px solid #f0f0f0;
  white-space: nowrap;
}
.data-table td {
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
}
.data-table tr:hover td { background: #fafbff; }
.data-table tr:last-child td { border-bottom: none; }

/* 状态标签 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.tag-green { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tag-red { background: #fff1f0; color: #f5222d; border: 1px solid #ffa39e; }
.tag-orange { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd591; }
.tag-blue { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; }
.tag-gray { background: #fafafa; color: #999; border: 1px solid #e8e8e8; }

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  justify-content: center;
  align-items: center;
}
.modal.active { display: flex; }
.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  animation: slideIn 0.3s;
}
@keyframes slideIn { from { transform: translateY(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 { font-size: 18px; color: #1e3c72; }
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  line-height: 1;
}
.modal-close:hover { color: #333; }
form { padding: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #555;
  font-weight: 500;
}
.form-group input, .form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
}
.form-group input:focus, .form-group select:focus { border-color: #2a5298; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* Toast */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #333;
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 300;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #52c41a; }
.toast.error { background: #f5222d; }

/* 空状态 */
.empty {
  text-align: center;
  padding: 40px;
  color: #999;
}
