:root {
  --primary: #667eea;
  --primary-dark: #5a67d8;
  --secondary: #764ba2;
  --success: #48bb78;
  --success-dark: #38a169;
  --warning: #ed8936;
  --danger: #f56565;
  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --bg-light: #f8f9fa;
  --bg-card: #f7fafc;
  --border: #e2e8f0;
  --border-focus: #667eea;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  min-height: 100vh;
  padding: 20px;
}
.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-left h1 { font-size: 24px; margin-bottom: 4px; }
.header-left p { opacity: 0.85; font-size: 13px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-right .user-info { font-size: 14px; opacity: 0.9; }
.header-right .btn-logout {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s;
}
.header-right .btn-logout:hover { background: rgba(255,255,255,0.3); }
.nav {
  display: flex;
  background: #f8f9fa;
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
}
.nav a {
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
}
.nav a:hover { color: var(--primary); }
.nav a.active { color: var(--primary); border-bottom-color: var(--primary); }
.main-content { padding: 30px 40px; }
.section {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}
.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
}
.input-group { margin-bottom: 20px; }
.input-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s;
  background: white;
}
.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.input-group textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102,126,234,0.4); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: var(--success-dark); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #e53e3e; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { background: #cbd5e0; cursor: not-allowed; transform: none; box-shadow: none; }
.info-card {
  background: white;
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}
.info-card .label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.info-card .value { font-size: 24px; font-weight: 600; color: var(--text-primary); }
.info-card .unit { font-size: 14px; color: #a0aec0; margin-left: 4px; }
.info-card.warning { border-left-color: var(--warning); background: #fffaf0; }
.info-card.success { border-left-color: var(--success); background: #f0fff4; }
.info-card.danger { border-left-color: var(--danger); background: #fff5f5; }
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #edf2f7; font-weight: 600; color: var(--text-secondary); font-size: 13px; }
td { color: var(--text-primary); }
tr:hover td { background: #f7fafc; }
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.badge-primary { background: #ebf4ff; color: #3182ce; }
.badge-success { background: #f0fff4; color: #276749; }
.badge-warning { background: #fffaf0; color: #975a16; }
.badge-danger { background: #fff5f5; color: #c53030; }
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.5s;
}
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.alert {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.6;
}
.alert-warning { background: #fffaf0; border: 1px solid var(--warning); color: #744210; }
.alert-info { background: #ebf8ff; border: 1px solid #4299e1; color: #2c5282; }
.alert-success { background: #f0fff4; border: 1px solid var(--success); color: #276749; }
.alert-danger { background: #fff5f5; border: 1px solid var(--danger); color: #9b2c2c; }
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}
.login-card {
  background: white;
  border-radius: 16px;
  padding: 48px 40px;
  width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-card h1 {
  text-align: center;
  margin-bottom: 8px;
  font-size: 24px;
  color: var(--text-primary);
}
.login-card .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}
.login-card .logo {
  text-align: center;
  font-size: 48px;
  margin-bottom: 16px;
}
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 14px; }
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.modal {
  background: white;
  border-radius: 12px;
  padding: 32px;
  width: 480px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}
.modal h2 { font-size: 18px; color: var(--text-primary); margin-bottom: 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
@media (max-width: 1024px) {
  .form-row { grid-template-columns: 1fr; }
  .main-content { padding: 20px; }
  .header { padding: 16px 20px; }
  .nav { padding: 0 20px; overflow-x: auto; }
}
@media (max-width: 768px) {
  body { padding: 10px; }
  .info-grid { grid-template-columns: 1fr 1fr; }
}
