/* 穗垦鳜鱼溯源系统 - 公共样式 */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  color: #333;
}

/* ========== 登录页 ========== */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  max-width: 420px;
  width: 100%;
}

.login-card .logo {
  font-size: 48px;
  text-align: center;
  margin-bottom: 16px;
}

.login-card h1 {
  font-size: 20px;
  text-align: center;
  color: #1a4d8c;
  margin-bottom: 8px;
}

.login-card .subtitle {
  text-align: center;
  color: #888;
  margin-bottom: 30px;
  font-size: 14px;
}

.tabs {
  display: flex;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  background: none;
  border: none;
  padding: 12px;
  cursor: pointer;
  font-size: 14px;
  color: #888;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.tab.active {
  color: #1a4d8c;
  border-bottom-color: #1a4d8c;
  font-weight: bold;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

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

.form-group label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: #1a4d8c;
}

.code-row {
  display: flex;
  gap: 8px;
}

.code-row input { flex: 1; }
.btn-code {
  background: #1a4d8c;
  color: #fff;
  border: none;
  padding: 0 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.btn-code:disabled { background: #aaa; cursor: not-allowed; }

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #1a4d8c 0%, #2d6cb8 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 8px;
}

.btn-primary:hover { opacity: 0.9; }

.hint {
  margin-top: 16px;
  padding: 12px;
  background: #f7f9fc;
  border-radius: 8px;
  font-size: 12px;
  color: #666;
}

.hint code {
  background: #e8eef7;
  padding: 2px 6px;
  border-radius: 4px;
  color: #1a4d8c;
}

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

.sidebar {
  width: 220px;
  background: #1a4d8c;
  color: #fff;
  padding: 20px 0;
}

.sidebar .logo {
  text-align: center;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 18px;
  font-weight: bold;
}

.sidebar .logo .icon { font-size: 32px; display: block; margin-bottom: 8px; }

.sidebar .nav { list-style: none; padding: 20px 0; }
.sidebar .nav li a {
  display: block;
  padding: 12px 24px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 14px;
}
.sidebar .nav li a:hover, .sidebar .nav li a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-left: 3px solid #fff;
}

.main {
  flex: 1;
  background: #f5f7fa;
}

.topbar {
  background: #fff;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.topbar .user-info { font-size: 14px; color: #666; }
.topbar .user-info strong { color: #1a4d8c; margin-right: 8px; }
.topbar .btn-logout {
  background: #fff;
  color: #1a4d8c;
  border: 1px solid #1a4d8c;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.content { padding: 24px; }

.card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card h2 { font-size: 16px; margin-bottom: 16px; color: #1a4d8c; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  background: #1a4d8c;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
}
.btn:hover { opacity: 0.85; }
.btn-secondary { background: #888; }
.btn-success { background: #28a745; }
.btn-danger { background: #dc3545; }
.btn-sm { padding: 4px 12px; font-size: 12px; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th, .table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #eee;
}
.table th { background: #f7f9fc; color: #666; font-weight: bold; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.badge-pending { background: #fff3cd; color: #856404; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-qualified { background: #cce5ff; color: #004085; }

.alert {
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 16px;
}
.alert-success { background: #d4edda; color: #155724; }
.alert-error { background: #f8d7da; color: #721c24; }
.alert-info { background: #d1ecf1; color: #0c5460; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}
.stat-card .num { font-size: 32px; color: #1a4d8c; font-weight: bold; }
.stat-card .label { color: #888; margin-top: 8px; font-size: 13px; }

.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal.active { display: flex; }
.modal-content {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
}
.modal-content h3 { margin-bottom: 16px; color: #1a4d8c; }
.modal-content .form-group { margin-bottom: 12px; }
.modal-content textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
