/* ========== 全局重置与基础变量 ========== */
:root {
  --primary: #1677ff;
  --primary-dark: #0958d9;
  --primary-light: #e6f4ff;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ff4d4f;
  --info: #722ed1;
  --text-main: #1a1a1a;
  --text-secondary: #666;
  --text-light: #999;
  --bg-page: #f5f6fa;
  --bg-card: #ffffff;
  --border: #e8e8e8;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
}

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

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

a { text-decoration: none; color: var(--primary); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
input, select, textarea { font-family: inherit; outline: none; }

/* ========== 通用容器 ========== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.section {
  padding: 24px 0;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
}

.section-more {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ========== 顶部导航栏 ========== */
.navbar {
  background: #fff;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  cursor: pointer;
}

.navbar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--info));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar-menu a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 500;
  transition: all 0.2s;
}

.navbar-menu a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.navbar-menu a.active {
  background: var(--primary);
  color: #fff;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-login {
  padding: 6px 20px;
  border: 1.5px solid var(--primary);
  border-radius: 20px;
  color: var(--primary);
  background: #fff;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-login:hover {
  background: var(--primary);
  color: #fff;
}

.btn-login.logged-in {
  background: var(--primary);
  color: #fff;
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #389e0d; color: #fff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #d9363e; color: #fff; }

.btn-outline {
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text-main);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-block { width: 100%; }
.btn-lg { padding: 12px 32px; font-size: 16px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ========== 卡片 ========== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.card-body { padding: 16px; }

/* ========== 首页 Banner ========== */
.banner {
  background: linear-gradient(135deg, #1677ff 0%, #722ed1 100%);
  color: #fff;
  padding: 48px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.banner h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  position: relative;
}

.banner p {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 24px;
  position: relative;
}

.banner-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  position: relative;
}

.banner-actions .btn-outline {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}

.banner-actions .btn-outline:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* ========== 功能导航宫格 ========== */
.quick-nav {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 12px;
  margin-top: -32px;
  position: relative;
  z-index: 10;
}

.quick-nav-item {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.quick-nav-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.quick-nav-item .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 24px;
}

.quick-nav-item .label {
  font-size: 12px;
  color: var(--text-main);
  font-weight: 500;
}

/* ========== 列表网格 ========== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ========== 寻人/寻物卡片 ========== */
.info-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.info-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}

.info-card .card-image {
  width: 100%;
  height: 180px;
  background: #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #ccc;
  position: relative;
  overflow: hidden;
}

.info-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info-card .card-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.tag-urgent { background: var(--danger); }
.tag-find-person { background: var(--warning); }
.tag-find-item { background: var(--primary); }
.tag-found-item { background: var(--success); }
.tag-anti-fraud { background: var(--info); }

.info-card .card-content {
  padding: 12px;
}

.info-card .card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-card .card-meta {
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.info-card .card-meta span {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ========== 表单 ========== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text-main);
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color 0.2s;
  background: #fff;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}

.form-input.error {
  border-color: var(--danger);
}

.form-input.error + .form-error {
  display: block;
}

/* ========== 标签筛选 ========== */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

.filter-tab {
  padding: 6px 16px;
  border-radius: 20px;
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ========== 匹配结果 ========== */
.match-result {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.match-result.match-high { border-left-color: var(--success); }
.match-result.match-medium { border-left-color: var(--warning); }
.match-result.match-low { border-left-color: var(--text-light); }

.match-badge {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
}

.match-badge.high { background: #f6ffed; color: var(--success); border: 1px solid #b7eb8f; }
.match-badge.medium { background: #fffbe6; color: var(--warning); border: 1px solid #ffe58f; }
.match-badge.low { background: #f5f5f5; color: var(--text-light); border: 1px solid #d9d9d9; }

/* ========== 二维码展示 ========== */
.qrcode-display {
  text-align: center;
  padding: 24px;
}

.qrcode-display .qrcode-box {
  display: inline-block;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius);
  border: 2px dashed var(--border);
}

.qrcode-display .qrcode-info {
  margin-top: 16px;
}

.qrcode-display .qrcode-code {
  font-size: 13px;
  color: var(--text-secondary);
  font-family: monospace;
  margin-top: 8px;
}

/* ========== 反诈宣传 ========== */
.anti-fraud-banner {
  background: linear-gradient(135deg, #ff4d4f 0%, #fa8c16 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.anti-fraud-banner .banner-icon {
  font-size: 40px;
}

.anti-fraud-banner h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.anti-fraud-banner p {
  font-size: 13px;
  opacity: 0.9;
}

.fraud-type-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  border-top: 3px solid var(--danger);
}

.fraud-type-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.fraud-type-card .icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.fraud-type-card h4 {
  font-size: 15px;
  margin-bottom: 6px;
}

.fraud-type-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========== 消息提示 ========== */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show { opacity: 1; }

/* ========== 模态框 ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 90%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn 0.2s ease;
}

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

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-light);
  background: transparent;
}

.modal-close:hover { background: #f5f5f5; }

.modal-body { padding: 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ========== 页面切换 ========== */
.page { display: none; }
.page.active { display: block; }

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-light);
}

.empty-state .icon {
  font-size: 64px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 14px;
}

/* ========== 统计数据 ========== */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card .stat-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ========== 页脚 ========== */
.footer {
  background: #1a1a2e;
  color: rgba(255,255,255,0.65);
  padding: 32px 0 16px;
  margin-top: 48px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.footer-brand h3 {
  color: #fff;
  font-size: 18px;
  margin-bottom: 8px;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.8;
}

.footer-col h4 {
  color: #fff;
  font-size: 14px;
  margin-bottom: 12px;
}

.footer-col a {
  display: block;
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  margin-bottom: 6px;
}

.footer-col a:hover { color: #fff; }

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

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .navbar-menu { display: none; }
  .quick-nav { grid-template-columns: repeat(4, 1fr); }
  .grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr; }
  .banner h1 { font-size: 24px; }
  .section-title { font-size: 18px; }
}

/* ========== 实用工具类 ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-light { color: var(--text-light); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.rounded { border-radius: var(--radius); }
.shadow { box-shadow: var(--shadow); }
