/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1a3a5c;
  --primary-light: #2c5f8a;
  --accent: #c0392b;
  --accent-hover: #a93226;
  --green: #27ae60;
  --blue: #2980b9;
  --yellow: #f39c12;
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --border: #dcdde1;
  --shadow: 0 2px 10px rgba(0,0,0,0.08);
  --radius: 10px;
  --max-width: 1200px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* === Navigation === */
.navbar {
  background: var(--primary);
  color: white;
  padding: 0 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 700;
}

.logo-icon { font-size: 1.5rem; }

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255,255,255,0.15);
  color: white;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
}

/* === Hero === */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 60px 0 50px;
  text-align: center;
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 12px;
  font-weight: 700;
}

.hero-subtitle {
  font-size: 1.15rem;
  opacity: 0.85;
  margin-bottom: 12px;
  font-weight: 500;
}

.hero p {
  max-width: 700px;
  margin: 0 auto 24px;
  opacity: 0.9;
  font-size: 1rem;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-green { background: rgba(39, 174, 96, 0.2); color: #2ecc71; border: 1px solid rgba(39, 174, 96, 0.3); }
.badge-blue { background: rgba(41, 128, 185, 0.2); color: #85c1e9; border: 1px solid rgba(41, 128, 185, 0.3); }
.badge-yellow { background: rgba(243, 156, 18, 0.2); color: #f5d76e; border: 1px solid rgba(243, 156, 18, 0.3); }

/* === Layout === */
.layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 30px;
  margin: 30px 0;
}

/* === Card === */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 24px 30px 16px;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  font-size: 1.3rem;
  color: var(--primary);
}

.card-header p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 4px;
}

.required-mark { color: var(--accent); font-weight: bold; }

/* === Form === */
.report-form { padding: 24px 30px 30px; }

.form-group {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.form-group:last-of-type { border-bottom: none; margin-bottom: 20px; padding-bottom: 0; }

.section-title {
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 0;
}

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

.form-field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.form-field input[type="text"],
.form-field input[type="number"],
.form-field input[type="date"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fafafa;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(44, 95, 138, 0.12);
  background: white;
}

.form-field textarea { resize: vertical; min-height: 100px; }
.form-field small { display: block; color: var(--text-light); font-size: 0.8rem; margin-top: 4px; }

.char-count {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
}

.checkbox-field { margin-bottom: 12px; }

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-label a { color: var(--blue); text-decoration: underline; }

/* === Upload Area === */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: #fafafa;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary-light);
  background: rgba(44, 95, 138, 0.05);
}

.upload-icon { font-size: 2.5rem; display: block; margin-bottom: 10px; }
.upload-placeholder p { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.upload-placeholder small { color: var(--text-light); }

.file-list {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-item {
  background: #f0f2f5;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-item .remove-file {
  cursor: pointer;
  color: var(--accent);
  font-weight: bold;
  margin-left: 4px;
}

/* === Reporter Info Toggle === */
.reporter-info {
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-top: 8px;
}

/* === Button === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 32px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(192, 57, 43, 0.3);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal {
  background: white;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: modalIn 0.3s ease;
}

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

.modal-icon { font-size: 3rem; margin-bottom: 16px; }
.modal h3 { font-size: 1.4rem; margin-bottom: 10px; color: var(--green); }
.modal p { color: var(--text-light); margin-bottom: 6px; }
.ref-note { font-size: 0.9rem; }
.ref-note strong { color: var(--text); }
.modal .btn { margin-top: 20px; }

/* === Sidebar === */
.sidebar .card { margin-bottom: 24px; padding: 24px; }

.sidebar h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}

.guide-list {
  list-style: none;
}

.guide-list li {
  padding: 8px 0;
  padding-left: 20px;
  position: relative;
  font-size: 0.9rem;
  border-bottom: 1px solid #f0f0f0;
}

.guide-list li:last-child { border-bottom: none; }

.guide-list li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--primary-light);
  font-weight: bold;
}

/* === FAQ === */
.faq-item { border-bottom: 1px solid #f0f0f0; }

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 12px 0;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: inherit;
}

.faq-question span { font-size: 0.75rem; transition: transform 0.2s; color: var(--text-light); }
.faq-question.active span { transform: rotate(180deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer.open {
  max-height: 200px;
  padding-bottom: 12px;
}

.faq-answer p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* === Urgent Card === */
.urgent-card {
  border-left: 4px solid var(--accent);
  background: #fff5f5;
}

.urgent-card hr {
  border: none;
  border-top: 1px solid #f0d0d0;
  margin: 12px 0;
}

.hotline {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 4px;
}

/* === Stats === */
.stats-section { margin-bottom: 40px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
  transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-3px); }

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* === Footer === */
.footer {
  background: var(--primary);
  color: rgba(255,255,255,0.85);
  padding-top: 40px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 30px;
  padding-bottom: 30px;
}

.footer-section h4 {
  color: white;
  margin-bottom: 12px;
  font-size: 1rem;
}

.footer-section p {
  font-size: 0.85rem;
  line-height: 1.7;
  opacity: 0.8;
}

.footer-section a {
  display: block;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.footer-section a:hover { color: white; }

.footer-warning {
  color: var(--yellow) !important;
  opacity: 1 !important;
  font-weight: 600;
  margin-top: 8px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 16px 0;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.7;
}

/* === Admin Page === */
.admin-container {
  margin: 30px auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-header h1 { font-size: 1.6rem; color: var(--primary); }
.admin-login { text-align: center; padding: 60px 20px; }
.admin-login input { padding: 10px 16px; width: 280px; border: 1.5px solid var(--border); border-radius: 8px; margin-right: 8px; font-size: 0.95rem; }
.admin-login .btn { width: auto; display: inline-flex; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  background: var(--primary);
  color: white;
  padding: 10px 14px;
  text-align: left;
  font-size: 0.85rem;
}

.admin-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  vertical-align: top;
}

.admin-table tr:hover td { background: #f8f9fa; }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-pending { background: #fef9e7; color: #f39c12; }
.status-processing { background: #eaf2f8; color: #2980b9; }
.status-resolved { background: #eafaf1; color: #27ae60; }
.status-dismissed { background: #fdf2f2; color: #c0392b; }

.detail-box {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin: 16px 0;
}

.detail-box h4 { color: var(--primary); margin-bottom: 8px; }
.detail-grid dt { font-weight: 600; font-size: 0.85rem; color: var(--text-light); margin-top: 8px; }
.detail-grid dd { font-size: 0.9rem; margin-left: 0; margin-bottom: 4px; }

/* === 404 === */
.error-page { text-align: center; padding: 100px 20px; }
.error-page h1 { font-size: 5rem; color: var(--primary); }
.error-page p { font-size: 1.1rem; margin: 12px 0 24px; color: var(--text-light); }

/* === Responsive === */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-content { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .mobile-toggle { display: block; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--primary); padding: 12px 20px; gap: 4px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
  .hero h1 { font-size: 1.5rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .report-form { padding: 20px 16px; }
  .card-header { padding: 20px 16px 12px; }
}

/* === Accessibility === */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
