/* ===== 东莞学区分布网站 · 公共样式 ===== */
:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #3b82f6;
  --color-accent: #8b5cf6;
  --color-bg: #ffffff;
  --color-bg-secondary: #f8fafc;
  --color-bg-tertiary: #f1f5f9;
  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #94a3b8;
  --color-border: #e2e8f0;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.container-narrow { width: 100%; max-width: 900px; margin: 0 auto; padding: 0 1.25rem; }

/* ===== 导航栏 ===== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226,232,240,0.6);
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 800; font-size: 1.125rem; color: var(--color-text);
}
.logo-icon {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem;
}
.nav-back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 1rem; border-radius: var(--radius-full);
  background: rgba(37,99,235,0.08); color: var(--color-primary);
  font-size: 0.875rem; font-weight: 600; transition: all .2s;
}
.nav-back:hover { background: var(--color-primary); color: #fff; }

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 50%, #7c3aed 100%);
  color: #fff; padding: 5rem 0 6rem;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.12) 0%, transparent 40%),
              radial-gradient(circle at 80% 70%, rgba(255,255,255,0.08) 0%, transparent 40%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; text-align: center; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900; line-height: 1.15; margin-bottom: 1rem;
  text-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.hero p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  opacity: 0.92; max-width: 700px; margin: 0 auto 2rem;
}
.search-box {
  max-width: 560px; margin: 0 auto;
  position: relative;
}
.search-box input {
  width: 100%; padding: 1rem 1.25rem 1rem 3rem;
  border-radius: var(--radius-full); border: none;
  font-size: 1rem; font-family: var(--font-sans);
  box-shadow: var(--shadow-xl);
  outline: none;
}
.search-box::before {
  content: '🔍'; position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%);
  font-size: 1.1rem; opacity: 0.5;
}

/* ===== 统计卡片 ===== */
.stats-section { margin-top: -3rem; position: relative; z-index: 2; padding-bottom: 3rem; }
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem;
}
.stat-card {
  background: rgba(255,255,255,0.95);
  border-radius: var(--radius-xl);
  padding: 1.75rem 1.25rem; text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
}
.stat-number {
  font-size: 2.5rem; font-weight: 900;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 0.875rem; color: var(--color-text-secondary); margin-top: 0.25rem; }

/* ===== 卡片网格 ===== */
.section { padding: 4rem 0; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-tag {
  display: inline-block; padding: 0.35rem 0.9rem;
  background: rgba(37,99,235,0.1); color: var(--color-primary);
  border-radius: var(--radius-full); font-size: 0.875rem; font-weight: 600; margin-bottom: 0.75rem;
}
.section-header h2 { font-size: clamp(1.75rem, 4vw, 2.25rem); font-weight: 800; margin-bottom: 0.75rem; }
.section-header p { color: var(--color-text-secondary); max-width: 600px; margin: 0 auto; }

.town-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.town-card {
  display: flex; flex-direction: column;
  background: var(--color-bg);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}
.town-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); }
.town-card-header {
  padding: 1.5rem; color: #fff; min-height: 110px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.town-card-header h3 { font-size: 1.5rem; font-weight: 800; }
.town-card-header span { opacity: 0.9; font-size: 0.875rem; margin-top: 0.25rem; }
.town-card-body {
  padding: 1.25rem 1.5rem; flex: 1;
  display: flex; flex-direction: column; justify-content: space-between;
}
.badge-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.3rem 0.6rem; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 600;
}
.badge-primary { background: rgba(37,99,235,0.1); color: var(--color-primary); }
.badge-success { background: rgba(16,185,129,0.1); color: #059669; }
.badge-warning { background: rgba(245,158,11,0.1); color: #d97706; }
.town-card-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  padding: 0.65rem; border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff; font-size: 0.875rem; font-weight: 600; text-align: center;
  transition: opacity .2s;
}
.town-card-link:hover { opacity: 0.9; }

/* ===== 详情页 ===== */
.page-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 50%, #7c3aed 100%);
  color: #fff; padding: 3rem 0 4rem;
}
.page-header h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 900; margin-bottom: 0.75rem; }
.page-header p { opacity: 0.9; max-width: 700px; }
.breadcrumb { margin-bottom: 1rem; font-size: 0.875rem; opacity: 0.85; }
.breadcrumb a { text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb a:hover { opacity: 1; }

.detail-section { margin-top: -2rem; position: relative; z-index: 2; padding-bottom: 4rem; }
.detail-card {
  background: var(--color-bg); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); border: 1px solid var(--color-border);
  overflow: hidden;
}
.detail-card-header {
  padding: 1.5rem 1.5rem 0;
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
}
.detail-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-btn {
  padding: 0.45rem 0.9rem; border-radius: var(--radius-full);
  border: 1px solid var(--color-border); background: var(--color-bg-secondary);
  font-family: var(--font-sans); font-size: 0.875rem; font-weight: 500; cursor: pointer;
  transition: all .2s;
}
.filter-btn.active, .filter-btn:hover {
  background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}
.table-wrap { overflow-x: auto; padding: 1rem; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 0.9375rem;
  min-width: 720px;
}
.data-table thead { position: relative; z-index: 10; }
.data-table th {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff; font-weight: 700; text-align: left;
  padding: 0.9rem 1rem; white-space: nowrap;
}
.data-table td {
  padding: 1rem; border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: rgba(37,99,235,0.04); }
.data-table .col-school { font-weight: 700; color: var(--color-text); min-width: 160px; }
.data-table .col-level { white-space: nowrap; }
.data-table .col-zone { color: var(--color-text-secondary); line-height: 1.7; min-width: 280px; }
.data-table .col-note { color: var(--color-text-muted); font-size: 0.875rem; min-width: 180px; }
.level-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.25rem 0.65rem; border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 700;
}
.level-primary { background: rgba(37,99,235,0.12); color: var(--color-primary-dark); }
.level-success { background: rgba(16,185,129,0.12); color: #047857; }
.level-info { background: rgba(139,92,246,0.12); color: #6d28d9; }

.empty-tip { text-align: center; padding: 3rem 1rem; color: var(--color-text-muted); display: none; }

/* ===== 页脚 ===== */
.footer {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #cbd5e1; padding: 3rem 0 2rem; font-size: 0.9375rem;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: center; }
.footer-brand { font-weight: 800; color: #fff; font-size: 1.125rem; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a { color: #94a3b8; transition: color .2s; }
.footer-links a:hover { color: #fff; }
.footer-bottom { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; color: #64748b; font-size: 0.875rem; }
.footer-bottom a { color: #94a3b8; text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom a:hover { color: #fff; }

/* ===== 悬浮按钮 ===== */
.float-actions {
  position: fixed; right: 1rem; top: 50%; transform: translateY(-50%);
  z-index: 1000;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.float-btn {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; color: #fff; font-size: 1.25rem;
  box-shadow: var(--shadow-lg);
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.float-btn:hover { transform: scale(1.1); }
.float-btn-top { background: linear-gradient(135deg, #64748b, #475569); }
.float-btn-wechat { background: linear-gradient(135deg, #07c160, #05a350); }
.float-btn-phone { background: linear-gradient(135deg, #2563eb, #7c3aed); }
.float-label {
  position: absolute; right: 60px; top: 50%; transform: translateY(-50%);
  background: rgba(15,23,42,0.9); color: #fff; padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md); font-size: 0.75rem; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.float-btn:hover .float-label { opacity: 1; }

/* ===== 微信弹窗 ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(15,23,42,0.6);
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: #fff; border-radius: var(--radius-xl);
  max-width: 360px; width: 100%; text-align: center;
  box-shadow: var(--shadow-xl); overflow: hidden;
  animation: modalIn .3s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  background: linear-gradient(135deg, #07c160, #05a350);
  color: #fff; padding: 1.25rem;
}
.modal-header h3 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.modal-body { padding: 1.5rem; }
.modal-body img { width: 200px; height: 200px; margin: 0 auto 1rem; border-radius: var(--radius-md); }
.modal-body p { color: var(--color-text-secondary); font-size: 0.9375rem; }
.modal-close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.95); border: none; cursor: pointer;
  font-size: 1.4rem; line-height: 1; color: #333;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform .2s, background .2s;
  z-index: 10;
}
.modal-close:hover { transform: scale(1.1); background: #fff; }
html.modal-open { overflow: hidden; }

/* ===== 返回顶部进度 ===== */
.progress-ring {
  position: absolute; inset: 0; transform: rotate(-90deg);
}
.progress-ring circle {
  fill: none; stroke: rgba(255,255,255,0.3); stroke-width: 3;
}
.progress-ring .progress-bar {
  stroke: #fff; stroke-dasharray: 157; stroke-dashoffset: 157;
  transition: stroke-dashoffset 0.1s;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .hero { padding: 3.5rem 0 4.5rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .stat-card { padding: 1.25rem 0.75rem; }
  .stat-number { font-size: 1.75rem; }
  .town-grid { grid-template-columns: 1fr; }
  .section { padding: 3rem 0; }
  .float-actions { right: 0.75rem; gap: 0.6rem; }
  .float-btn { width: 46px; height: 46px; font-size: 1.1rem; }
  .float-label { display: none; }
  .data-table th, .data-table td { padding: 0.75rem; }
  .footer-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-card-header { flex-direction: column; align-items: flex-start; }
}

/* 隐藏类 */
.hidden { display: none !important; }
