/* ===== 民情热线系统 - 现代风格样式表 ===== */
:root {
  /* 主色调：沉稳的墨绿色系，符合政务场景 */
  --primary: #0f5b3e;
  --primary-light: #16804e;
  --primary-soft: #e8f5e9;
  --accent: #2a7f62;
  --danger: #d32f2f;
  --danger-light: #fce4ec;
  --warning: #f57c00;
  --warning-light: #fff3e0;
  --success: #2e7d32;
  --success-light: #e8f5e9;
  --info: #0277bd;
  --info-light: #e1f5fe;

  --gray-50: #f8fafb;
  --gray-100: #f0f2f5;
  --gray-200: #e4e7eb;
  --gray-300: #cdd1d6;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;

  --white: #ffffff;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background: #f3f4f6;
  background-image: radial-gradient(circle at 10% 20%, rgba(15,91,62,0.02) 0%, transparent 50%),
                    radial-gradient(circle at 90% 80%, rgba(15,91,62,0.03) 0%, transparent 50%);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ========== 顶部导航 ========== */
.header {
  background: linear-gradient(135deg, #0f5b3e 0%, #16804e 100%);
  color: #fff;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header .logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.header .logo .icon {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ========== 按钮系统 ========== */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
  letter-spacing: 0.3px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
  text-decoration: none;
}

.btn:hover,
.btn:focus {
  text-decoration: none;
}

.btn:active {
  transform: scale(0.96);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.7);
  color: #fff;
}
.btn-outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15,91,62,0.3);
}
.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 12px rgba(15,91,62,0.4);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 2px 8px rgba(211,47,47,0.25);
}
.btn-danger:hover {
  background: #c62828;
  box-shadow: 0 4px 12px rgba(211,47,47,0.35);
}

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 2px 8px rgba(46,125,50,0.25);
}
.btn-success:hover {
  background: #1b5e20;
  box-shadow: 0 4px 12px rgba(46,125,50,0.35);
}

.btn-warning {
  background: var(--warning);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245,124,0,0.25);
}
.btn-warning:hover {
  background: #e65100;
  box-shadow: 0 4px 12px rgba(245,124,0,0.35);
}

.btn-sm {
  padding: 7px 16px;
  font-size: 0.82rem;
  border-radius: 6px;
}
.btn-xs {
  padding: 4px 12px;
  font-size: 0.76rem;
  border-radius: 5px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ========== 主布局 ========== */
.main-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

/* ========== 卡片 ========== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
  margin-bottom: 24px;
  border: 1px solid var(--gray-200);
  transition: box-shadow var(--transition);
}
.card:hover {
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title .dot {
  width: 10px;
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: inline-block;
}

/* ========== 表单 ========== */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--gray-700);
}
.form-group label .required {
  color: #d93025;
  margin-left: 3px;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  font-family: var(--font);
  transition: all var(--transition);
  background: var(--gray-50);
  color: var(--gray-900);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15,91,62,0.08);
  background: #fff;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

/* 单选框组 */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
  padding: 10px 18px;
  border: 2px solid var(--gray-300);
  border-radius: 30px;
  transition: all var(--transition);
  font-size: 0.9rem;
  background: var(--gray-50);
  user-select: none;
  color: var(--gray-700);
}
.radio-group label:hover {
  border-color: var(--primary-light);
  background: #f0f7f4;
}
.radio-group input[type="radio"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}
.radio-group label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(15,91,62,0.1);
}

.mode-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border: 2px solid var(--primary);
  border-radius: 30px;
  color: var(--primary);
  background: var(--white);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition);
}
.mode-link:hover {
  color: var(--white);
  background: var(--primary);
}

/* 文件上传区域 */
.file-upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--gray-50);
  position: relative;
}
.file-upload-area:hover {
  border-color: var(--primary);
  background: #f8fcf9;
}
.file-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-upload-area .upload-hint {
  color: var(--gray-500);
  font-size: 0.88rem;
}

.image-preview-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}
.image-preview {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--gray-200);
  transition: transform 0.2s, box-shadow 0.2s;
}
.image-preview:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-sm);
}

/* ========== 登录弹窗 ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 36px 36px 28px;
  width: 420px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal h3 {
  margin-bottom: 24px;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  color: var(--gray-900);
  letter-spacing: 0.3px;
}
.modal .form-group {
  margin-bottom: 18px;
}
.modal .btn-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.modal .btn-row .btn {
  flex: 1;
  justify-content: center;
}

/* ========== 管理后台面板 ========== */
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.citizen-form-area { display: block; }
.citizen-form-area.hidden { display: none; }

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.stat-badge {
  background: var(--gray-50);
  border-radius: 24px;
  padding: 8px 18px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  user-select: none;
  letter-spacing: 0.3px;
}
.stat-badge:hover {
  border-color: var(--primary-light);
  background: #f1f8f4;
}
.stat-badge.active-filter {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(15,91,62,0.08);
}

/* ========== 信访件列表 ========== */
.petition-list {
  list-style: none;
}
.petition-item {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 14px;
  transition: all var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  position: relative;
}
.petition-item:hover {
  box-shadow: var(--shadow);
  border-color: #cbd5e1;
}

.petition-item .petition-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.petition-item .petition-id {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
  background: var(--primary-soft);
  padding: 4px 12px;
  border-radius: 20px;
}

/* 状态标签 */
.status-tag {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.status-pending { background: #fff8e1; color: #b45309; }
.status-assigned { background: #e3f2fd; color: #0b5394; }
.status-completed { background: #e8f5e9; color: #1b5e20; }
.status-reassigned { background: #fce4ec; color: #b71c1c; }
.status-closed { background: #f1f5f9; color: #475569; }

.petition-item .petition-detail {
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.6;
}
.petition-item .petition-meta {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.petition-item .action-row {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.deadline-warning { color: #d32f2f; font-weight: 700; }
.deadline-normal { color: var(--gray-500); }

.petition-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.petition-images img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid var(--gray-200);
  cursor: pointer;
  transition: all var(--transition);
}
.petition-images img:hover {
  transform: scale(1.08);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* 办理结果及历史记录 */
.result-text {
  background: #f9fafb;
  border-left: 4px solid var(--primary);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--gray-700);
  line-height: 1.6;
}
.history-block {
  background: #fafbfc;
  border: 1px dashed var(--gray-300);
  border-radius: 8px;
  padding: 14px 18px;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--gray-500);
}
.history-block strong { color: var(--gray-700); }

/* ========== 响应式调整 ========== */
@media (max-width: 768px) {
  .header {
    padding: 0 16px;
    height: 56px;
  }
  .header .logo {
    font-size: 1rem;
  }
  .btn {
    padding: 8px 14px;
    font-size: 0.82rem;
  }
  .card {
    padding: 20px 16px;
  }
  .radio-group label {
    padding: 8px 14px;
    font-size: 0.82rem;
  }
  .stats-row {
    gap: 6px;
  }
  .stat-badge {
    padding: 6px 12px;
    font-size: 0.76rem;
  }
}

/* ========== 辅助 & 动画 ========== */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.35s ease;
  pointer-events: none;
  letter-spacing: 0.3px;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-24px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.toast-success { background: #e8f5e9; color: #1e4620; border-left: 4px solid #2e7d32; }
.toast-error { background: #fce4ec; color: #621b16; border-left: 4px solid #c62828; }
.toast-info { background: #e3f2fd; color: #0c3b5c; border-left: 4px solid #0277bd; }

.img-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.9);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.img-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}

/* ========== 页脚与公开说明页面 ========== */
.site-footer {
  padding: 24px 16px 32px;
  text-align: center;
  color: var(--gray-500);
  font-size: 0.82rem;
  line-height: 1.8;
}
.site-footer p + p { margin-top: 4px; }
.site-footer .footer-meta { color: var(--gray-400); font-size: 0.9em; }
.site-footer a {
  color: var(--gray-700);
  text-decoration: none;
}
.site-footer a:hover { color: var(--primary); text-decoration: underline; }
.site-footer .footer-separator { margin: 0 8px; color: var(--gray-300); }
.policy-page { max-width: 820px; margin: 0 auto; padding: 36px 20px 56px; }
.policy-page .card { padding: 32px 36px; }
.policy-page h1 { font-size: 1.45rem; margin-bottom: 8px; }
.policy-page .policy-updated { color: var(--gray-500); font-size: 0.82rem; margin-bottom: 24px; }
.policy-page h2 { margin: 24px 0 10px; font-size: 1rem; color: var(--gray-900); }
.policy-page p, .policy-page li { color: var(--gray-700); }
.policy-page ul { padding-left: 22px; }
.policy-page li + li { margin-top: 6px; }
@media (max-width: 768px) {
  .site-footer { padding: 18px 14px 26px; font-size: 0.76rem; }
  .policy-page { padding: 20px 12px 36px; }
  .policy-page .card { padding: 22px 18px; }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}
