/* 忻州便民小助手 - 现代H5设计 */
:root {
  --primary: #ff6b6b;
  --primary-dark: #e55a5a;
  --secondary: #4ecdc4;
  --accent: #ffa500;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #2d3436;
  --text-secondary: #636e72;
  --border: #eef1f5;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-lg: 20px;
  --nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

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

.container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 32px 20px 28px;
  position: relative;
  overflow: hidden;
}

header::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--bg);
  border-radius: 50% 50% 0 0;
}

.header-content { position: relative; z-index: 1; }

.header-badge {
  display: inline-block;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(10px);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

header h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.header-subtitle {
  font-size: 13px;
  opacity: 0.85;
}

/* Search */
.search-section {
  padding: 0 16px;
  margin-top: -8px;
  position: relative;
  z-index: 2;
}

.search-wrapper {
  display: flex;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 4px 4px 4px 14px;
  gap: 8px;
}

.search-icon { color: #b2bec3; flex-shrink: 0; }

#searchInput {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  color: var(--text);
  padding: 10px 0;
}

#searchInput::placeholder { color: #b2bec3; }

#searchBtn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}

#searchBtn:active { opacity: 0.85; }

/* Content */
.content-section {
  padding: 20px 16px calc(var(--nav-height) + var(--safe-bottom) + 24px);
}

.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.tab-content h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

/* Bottom Navigation */
.nav-tabs {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 6px 0 calc(6px + var(--safe-bottom));
  z-index: 100;
  height: calc(var(--nav-height) + var(--safe-bottom));
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  transition: color 0.2s;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn svg { transition: transform 0.2s, color 0.2s; }

.tab-btn.active {
  color: var(--primary);
}

.tab-btn.active svg { transform: scale(1.1); }

/* Cards - shared */
.phone-category { margin-bottom: 20px; }

.phone-category h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 0;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.phone-item, .bus-route, .service-item, .hospital-item, .school-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}

.phone-item:active, .bus-route:active, .service-item:active, .hospital-item:active, .school-item:active {
  transform: scale(0.985);
}

.phone-item h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.phone-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.phone-number {
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
}

.call-btn {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: opacity 0.2s;
}

.call-btn:active { opacity: 0.85; }

.phone-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* Bus */
.bus-info {
  background: linear-gradient(135deg, var(--secondary), #44a08d);
  color: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.8;
}

.bus-info strong { opacity: 0.85; }

.route-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.route-id {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 3px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.route-name { font-size: 15px; font-weight: 600; color: var(--text); }

.station-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }

.stations-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }

.station-tag {
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Service Guide */
.service-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.service-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 8px;
}

/* Hospital & School */
.item-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.item-detail {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.6;
}

.item-detail strong { color: var(--text); font-weight: 600; }

/* School section headers */
.tab-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

.school-info {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  font-size: 14px;
}

.school-info a { color: var(--primary); text-decoration: none; }

/* Service tips */
.service-tips {
  background: var(--card) !important;
  border-radius: var(--radius) !important;
  padding: 14px 16px !important;
  box-shadow: var(--shadow);
  font-size: 14px;
  border-left: 3px solid var(--accent) !important;
}

/* No results */
.no-results {
  text-align: center;
  color: var(--text-secondary);
  padding: 48px 20px;
  font-size: 15px;
}

/* Footer */
footer {
  text-align: center;
  padding: 16px;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  font-size: 12px;
  color: #b2bec3;
}

/* Responsive */
@media (min-width: 481px) {
  .container { box-shadow: var(--shadow-lg); }
}

@media (max-width: 360px) {
  header h1 { font-size: 22px; }
  .tab-btn span { font-size: 10px; }
}
