/* ========== 全局样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif; background: #f0f2f5; color: #333; }

/* ========== 登录页 ========== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-card { background: white; border-radius: 12px; padding: 48px; width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.login-logo { font-size: 48px; text-align: center; margin-bottom: 16px; }
.login-card h2 { text-align: center; font-size: 24px; color: #333; margin-bottom: 4px; }
.login-subtitle { text-align: center; color: #999; margin-bottom: 32px; }
.login-hint { text-align: center; color: #999; font-size: 13px; margin-top: 16px; }

/* ========== 表单 ========== */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; color: #666; margin-bottom: 8px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px;
  font-size: 14px; transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #667eea; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.checkbox-group label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }

/* ========== 按钮 ========== */
.btn { padding: 10px 20px; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: #667eea; color: white; }
.btn-primary:hover { background: #5a67d8; }
.btn-secondary { background: #f0f0f0; color: #333; }
.btn-secondary:hover { background: #e0e0e0; }
.btn-danger { background: #f56565; color: white; }
.btn-danger:hover { background: #e53e3e; }
.btn-text { background: none; color: #666; padding: 8px; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ========== 管理后台布局 ========== */
.admin-page { display: flex; height: 100vh; }

/* ========== 侧边栏 ========== */
.sidebar {
  width: 240px; background: #2d3748; color: white; display: flex; flex-direction: column;
  flex-shrink: 0;
}
.sidebar-header { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h2 { font-size: 18px; margin-bottom: 4px; }
.sidebar-header p { font-size: 12px; color: rgba(255,255,255,0.6); }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: rgba(255,255,255,0.7);
  text-decoration: none; transition: all 0.2s; cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-item.active { background: rgba(102,126,234,0.3); color: white; border-right: 3px solid #667eea; }
.nav-icon { font-size: 18px; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); }

/* ========== 主内容区 ========== */
.main-content { flex: 1; overflow-y: auto; }
.top-bar {
  background: white; padding: 16px 32px; display: flex; justify-content: space-between;
  align-items: center; border-bottom: 1px solid #e0e0e0; position: sticky; top: 0; z-index: 10;
}
.top-bar h1 { font-size: 20px; }
.top-bar-actions { display: flex; align-items: center; gap: 16px; color: #999; font-size: 14px; }

/* ========== 页面 ========== */
.page { display: none; padding: 24px 32px; }
.page.active { display: block; }

/* ========== 页面操作栏 ========== */
.page-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.search-box input { padding: 10px 16px; border: 1px solid #ddd; border-radius: 6px; width: 300px; font-size: 14px; }

/* ========== 过滤栏 ========== */
.filter-bar { display: flex; gap: 8px; margin-bottom: 20px; }
.filter-btn {
  padding: 8px 16px; border: 1px solid #ddd; background: white; border-radius: 6px;
  cursor: pointer; font-size: 14px; transition: all 0.2s;
}
.filter-btn.active { background: #667eea; color: white; border-color: #667eea; }

/* ========== 卡片 ========== */
.card { background: white; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.card-header h3 { font-size: 16px; font-weight: 600; }
.card-body { padding: 20px; }

/* ========== 表格 ========== */
.table-container { background: white; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: #f7fafc; }
th { padding: 12px 16px; text-align: left; font-size: 13px; color: #666; font-weight: 600; border-bottom: 1px solid #e0e0e0; }
td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid #f0f0f0; }
tbody tr:hover { background: #f7fafc; }
.loading { text-align: center; color: #999; padding: 40px; }
.empty-hint { text-align: center; color: #999; padding: 40px; }

/* ========== 状态标签 ========== */
.status-badge {
  display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 500;
}
.status-active { background: #c6f6d5; color: #22543d; }
.status-paused { background: #feebc8; color: #7c2d12; }
.status-discharged { background: #e2e8f0; color: #2d3748; }
.status-waiting { background: #bee3f8; color: #2c5282; }
.status-confirmed { background: #c6f6d5; color: #22543d; }
.status-completed { background: #e2e8f0; color: #2d3748; }
.status-cancelled { background: #fed7d7; color: #742a2a; }

/* ========== 弹窗 ========== */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-content {
  background: white; border-radius: 12px; width: 500px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-lg { width: 700px; }
.modal-xl { width: 900px; }
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid #e0e0e0; display: flex;
  justify-content: space-between; align-items: center;
}
.modal-header h3 { font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #999; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #e0e0e0; display: flex; justify-content: flex-end; gap: 12px; }

/* ========== 错误提示 ========== */
.error-message { background: #fed7d7; color: #742a2a; padding: 12px; border-radius: 6px; margin-bottom: 16px; }

/* ========== 隐藏类 ========== */
.hidden { display: none !important; }
