﻿/* ========== 全局重置 & 基础 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
}

/* ========== 登录页 ========== */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  width: 380px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.login-box h1 {
  text-align: center;
  margin-bottom: 8px;
  font-size: 24px;
  color: #333;
}

.login-box .subtitle {
  text-align: center;
  color: #999;
  margin-bottom: 30px;
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #555;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
  outline: none;
}

.form-group input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: #667eea;
  color: #fff;
}

.btn-primary:hover {
  background: #5a6fd6;
}

.btn-danger {
  background: #ff4d4f;
  color: #fff;
}

.btn-danger:hover {
  background: #e04345;
}

.btn-success {
  background: #52c41a;
  color: #fff;
}

.btn-success:hover {
  background: #49b018;
}

.btn-default {
  background: #fff;
  color: #333;
  border: 1px solid #d9d9d9;
}

.btn-default:hover {
  border-color: #667eea;
  color: #667eea;
}

.btn-block {
  width: 100%;
  padding: 11px 20px;
}

.error-tip {
  color: #ff4d4f;
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
  display: none;
}
/* ========== 主布局 ========== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: #001529;
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 20px;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-menu {
  list-style: none;
  padding: 8px 0;
  flex: 1;
}

.sidebar-menu li {
  padding: 12px 20px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
  color: rgba(255, 255, 255, 0.65);
}

.sidebar-menu li.active,
.sidebar-menu li:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ========== 顶部栏 ========== */
.topbar {
  height: 56px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.topbar-title {
  font-size: 16px;
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-name {
  font-size: 14px;
  color: #666;
}

/* ========== 内容区域 ========== */
.content {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

/* ========== 统计卡片 ========== */
.stats-row {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  flex: 1;
  background: #fff;
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-card-label {
  font-size: 13px;
  color: #999;
  margin-bottom: 8px;
}

.stat-card-value {
  font-size: 28px;
  font-weight: 600;
  color: #333;
}

.stat-card-value.green {
  color: #52c41a;
}

/* ========== 搜索 & 操作栏 ========== */
.action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 400px;
}

.search-box input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.action-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* ========== 表格 ========== */
.table-wrapper {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table thead {
  background: #fafafa;
}

table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  border-bottom: 1px solid #f0f0f0;
}

table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid #f0f0f0;
}

table tbody tr:hover {
  background: #fafafa;
}

.action-btns {
  display: flex;
  gap: 8px;
}

.action-btns .btn {
  padding: 4px 12px;
  font-size: 12px;
}

/* ========== 分页 ========== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 16px;
}

.pagination button {
  padding: 6px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  border-color: #667eea;
  color: #667eea;
}

.pagination button:disabled {
  color: #ccc;
  cursor: not-allowed;
}

.pagination .page-info {
  font-size: 13px;
  color: #666;
}

/* ========== 模态弹窗 ========== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: #fff;
  border-radius: 10px;
  padding: 28px;
  width: 440px;
  max-width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.modal-box h2 {
  margin-bottom: 20px;
  font-size: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ========== Toast 提示 ========== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 24px;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

.toast.success {
  background: #52c41a;
}

.toast.error {
  background: #ff4d4f;
}

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

/* ========== 确认对话框 ========== */
.confirm-dialog .modal-box {
  width: 380px;
}

.confirm-dialog .modal-box p {
  font-size: 15px;
  color: #555;
  line-height: 1.6;
}
