* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: #f5f7fa;
  color: #1a1a2e;
  min-height: 100vh;
}

/* ===== 登录页 ===== */
.login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.login-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-card h1 {
  font-size: 24px;
  margin-bottom: 8px;
  color: #1a1a2e;
}
.login-card .subtitle {
  color: #888;
  font-size: 14px;
  margin-bottom: 28px;
}
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
  font-weight: 500;
}
.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: #0f3460;
}
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}
.btn-primary {
  background: #0f3460;
  color: #fff;
  width: 100%;
  padding: 12px;
}
.btn-primary:hover { background: #16213e; }
.btn-secondary {
  background: #e8ecf1;
  color: #333;
}
.btn-secondary:hover { background: #dde3ea; }
.btn-danger {
  background: #e74c3c;
  color: #fff;
}
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.login-error {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}
.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: #888;
}
.login-footer a {
  color: #0f3460;
  text-decoration: none;
  cursor: pointer;
}

/* ===== 后台布局 ===== */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: #1a1a2e;
  color: #fff;
  padding: 20px 0;
  flex-shrink: 0;
}
.sidebar .logo {
  padding: 0 20px 20px;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 1px solid #2a2a4e;
  margin-bottom: 10px;
}
.sidebar nav a {
  display: block;
  padding: 12px 20px;
  color: #aab;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.sidebar nav a:hover { background: #252545; color: #fff; }
.sidebar nav a.active { background: #0f3460; color: #fff; border-left: 3px solid #e94560; }
.sidebar .user-info {
  position: absolute;
  bottom: 0;
  width: 220px;
  padding: 16px 20px;
  border-top: 1px solid #2a2a4e;
  font-size: 13px;
}
.sidebar .user-info .email { color: #aab; word-break: break-all; }
.sidebar .user-info .logout {
  color: #e94560;
  cursor: pointer;
  margin-top: 8px;
  display: inline-block;
}
.main-content {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.page-header h2 { font-size: 22px; font-weight: 600; }

/* ===== 表格 ===== */
.data-table {
  width: 100%;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.data-table table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: #f0f3f7;
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #e0e5ec;
}
.data-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid #f0f3f7;
}
.data-table tr:hover { background: #fafbfc; }
.data-table tr:last-child td { border-bottom: none; }

/* ===== 状态标签 ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.badge-open { background: #fff3cd; color: #856404; }
.badge-progress { background: #cce5ff; color: #004085; }
.badge-resolved { background: #d4edda; color: #155724; }
.badge-closed { background: #e2e3e5; color: #383d41; }
.badge-high { background: #f8d7da; color: #721c24; }
.badge-medium { background: #fff3cd; color: #856404; }
.badge-low { background: #d4edda; color: #155724; }
.badge-admin { background: #0f3460; color: #fff; }
.badge-user { background: #e2e3e5; color: #383d41; }

/* ===== 模态框 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: #fff;
  border-radius: 10px;
  padding: 28px;
  width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal h3 { margin-bottom: 20px; font-size: 18px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ===== 详情页 ===== */
.bug-detail {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.bug-detail .meta {
  display: flex;
  gap: 24px;
  margin: 16px 0;
  flex-wrap: wrap;
}
.bug-detail .meta-item { font-size: 13px; color: #666; }
.bug-detail .meta-item strong { color: #333; }
.bug-detail .desc {
  margin: 20px 0;
  padding: 16px;
  background: #f8f9fb;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.comments-section { margin-top: 28px; }
.comments-section h4 { margin-bottom: 14px; font-size: 15px; }
.comment {
  padding: 12px 16px;
  background: #f8f9fb;
  border-radius: 6px;
  margin-bottom: 10px;
}
.comment .comment-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
}
.comment .comment-body { font-size: 14px; line-height: 1.6; }

/* ===== 筛选栏 ===== */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-bar select, .filter-bar input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}
.loading { text-align: center; padding: 40px; color: #999; }

/* ===== 项目卡片 ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.project-card {
  background: #fff;
  border-radius: 10px;
  padding: 22px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s;
  border-left: 4px solid #0f3460;
}
.project-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.project-card-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: #1a1a2e;
}
.project-card-header > div {
  display: flex;
  gap: 6px;
}
.project-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 14px;
  min-height: 20px;
}
.project-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #888;
  padding-top: 12px;
  border-top: 1px solid #f0f3f7;
}
.checkbox-group {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 8px 12px;
}
