:root {
  --primary: #2B9F5A;
  --primary-dark: #238A4D;
  --danger: #FF4D4F;
  --bg: #F5F7FA;
  --white: #FFFFFF;
  --text: #333333;
  --text-secondary: #666666;
  --text-light: #999999;
  --border: #E8E8E8;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  width: 420px;
  padding: 48px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.login-box h1 {
  margin: 0 0 8px;
  font-size: 28px;
  color: var(--text);
}

.login-box .subtitle {
  margin: 0 0 32px;
  color: var(--text-light);
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.form-group input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}

.form-group input:focus {
  border-color: var(--primary);
}

.code-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.code-group label {
  flex-shrink: 0;
}

.code-group input {
  flex: 1;
  width: auto;
  min-width: 0;
}

.code-group .captcha-box {
  flex-shrink: 0;
  width: 120px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.captcha-box span {
  font-size: 24px;
  letter-spacing: 6px;
  color: #333;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 24px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

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

.btn-default {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.error {
  color: var(--danger);
  font-size: 14px;
  text-align: center;
  margin-top: 16px;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.logo {
  padding: 24px;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
}

.sidebar nav {
  flex: 1;
  padding: 16px 0;
}

.sidebar nav a {
  display: block;
  padding: 12px 24px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(43, 159, 90, 0.08);
  color: var(--primary);
}

.sidebar .logout {
  padding: 16px;
  border-top: 1px solid var(--border);
}

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

.topbar {
  height: 64px;
  padding: 0 32px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.content {
  padding: 24px;
  flex: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.card {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.card h3 {
  margin: 0 0 16px;
  font-size: 16px;
}

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

.table th,
.table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.table th {
  color: var(--text-secondary);
  font-weight: 500;
  background: #fafafa;
}

.text-secondary { color: var(--text-secondary); }
.text-light { color: var(--text-light); }

.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}

.form-group select {
  height: 44px;
}

.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

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

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.badge-success {
  background: rgba(43, 159, 90, 0.12);
  color: var(--primary);
}

.badge-danger {
  background: rgba(255, 77, 79, 0.12);
  color: var(--danger);
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--white);
  border-radius: 12px;
  padding: 32px;
  width: 480px;
  max-width: 90vw;
  max-height: 94vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  /* 隐藏滚动条（仍可滚动），弹窗表单更干净 */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.modal-content::-webkit-scrollbar {
  display: none;
}

.modal-content.wide {
  width: 640px;
}

.modal-content h3 {
  margin: 0 0 24px;
  font-size: 18px;
}

.sidebar .subtitle {
  padding: 8px 24px;
  font-size: 13px;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
}
