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

/* ====== 布局 ====== */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px; background: #1a1a2e; color: #fff; position: fixed;
  top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 100;
}
.sidebar-header {
  padding: 24px 20px; font-size: 18px; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-nav { padding: 12px 0; }
.nav-item {
  display: block; padding: 14px 24px; color: #aaa; text-decoration: none;
  font-size: 15px; transition: all 0.2s; border-left: 3px solid transparent;
}
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,0.08); border-left-color: #4fc3f7; }
.nav-item.active { background: rgba(79,195,247,0.1); }

.main-content { margin-left: 240px; flex: 1; padding: 28px 36px; min-height: 100vh; }
.page { display: none; }
.page.active { display: block; }

/* 页头 */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.page-header h2 { font-size: 22px; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters select, .filters input {
  padding: 8px 14px; border: 1px solid #ddd; border-radius: 8px;
  font-size: 14px; outline: none;
}
.filters input:focus, .filters select:focus { border-color: #1a73e8; }

.badge {
  display: inline-block; padding: 4px 12px; background: #e8f0fe;
  color: #1a73e8; border-radius: 12px; font-size: 13px; font-weight: 500;
}

/* 按钮 */
.btn {
  display: inline-block; padding: 9px 20px; border: none; border-radius: 8px;
  cursor: pointer; font-size: 14px; font-weight: 500; text-decoration: none;
  transition: opacity 0.2s; white-space: nowrap;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: #1a73e8; color: #fff; }
.btn-success { background: #34a853; color: #fff; }
.btn-danger { background: #ea4335; color: #fff; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* 卡片 */
.card {
  background: #fff; border-radius: 12px; padding: 28px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06); margin-bottom: 20px;
}
.card h3 { font-size: 17px; margin-bottom: 10px; }
.card-desc { color: #666; font-size: 14px; line-height: 1.7; margin-bottom: 18px; }
.card label { display: block; margin: 12px 0 6px; font-size: 14px; font-weight: 500; color: #555; }
.card input[type="text"], .card input[type="password"], .card input[type="file"], .card input[type="number"] {
  width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px;
  font-size: 14px; outline: none; transition: border-color 0.2s;
}
.card input:focus { border-color: #1a73e8; }

/* 表格 */
.table-wrapper { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,0.06); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 800px; }
.data-table th {
  background: #f8fafc; padding: 13px 16px; text-align: left; font-weight: 600;
  color: #555; border-bottom: 2px solid #eee; white-space: nowrap;
}
.data-table td { padding: 11px 16px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.data-table tr:hover { background: #fafbff; }
.data-table.simple th, .data-table.simple td { padding: 9px 14px; font-size: 13px; }

/* 状态标签 */
.status-tag {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 500;
}
.status-pending { background: #fff3e0; color: #e65100; }
.status-approved { background: #e8f5e9; color: #2e7d32; }
.status-rejected { background: #ffebee; color: #c62828; }
.status-abnormal { background: #fce4ec; color: #c2185b; font-weight:700; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 20px; }
.pagination button {
  padding: 7px 14px; border: 1px solid #ddd; background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 13px;
}
.pagination button.active { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.pagination button:hover:not(.active) { background: #f5f5f5; }

/* 弹窗 */
.modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45); z-index: 999;
  display: flex; align-items: center; justify-content: center;
}
.modal-content {
  background: #fff; border-radius: 16px; max-width: 640px; width: 90%;
  max-height: 85vh; overflow-y: auto; animation: modalIn 0.25s ease;
}
.modal-lg { max-width: 900px; }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 28px 16px; border-bottom: 1px solid #eee;
}
.modal-header h3 { font-size: 18px; }
.modal-close { font-size: 26px; cursor: pointer; color: #999; line-height: 1; }
.modal-close:hover { color: #333; }
.modal-body { padding: 24px 28px; }

@keyframes modalIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* 登录页 */
#loginPage.active { display: flex; align-items: center; justify-content: center; min-height: 80vh; }
.login-box {
  background: #fff; border-radius: 16px; padding: 48px 40px; width: 380px;
  text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.login-box h1 { font-size: 24px; margin-bottom: 8px; }
.login-sub { color: #888; font-size: 14px; margin-bottom: 28px; }
.login-form input[type="text"], .login-form input[type="password"] {
  width: 100%; padding: 12px 16px; margin-bottom: 14px; border: 1px solid #ddd;
  border-radius: 10px; font-size: 15px; outline: none; box-sizing: border-box;
}
.login-form input:focus { border-color: #1a73e8; }
.login-hint { font-size: 12px; color: #bbb; margin-top: 16px; }

/* 导入结果 */
#importResult { padding: 20px; border-radius: 12px; text-align: center; }
.import-ok { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.import-err { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

/* 图片预览 */
.img-preview-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin: 16px 0; }
.img-preview { width: 100%; height: 200px; object-fit: cover; border-radius: 8px; border: 1px solid #eee; cursor: pointer; }
.img-preview:hover { transform: scale(1.02); }

/* 响应式 */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-240px); }
  .main-content { margin-left: 0; }
}

.mt-24 { margin-top: 24px; }
