/* ===== CSS Variables ===== */
:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #dbeafe;
  --green: #059669;
  --green-dark: #047857;
  --green-light: #d1fae5;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 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);
  --radius: 12px;
  --max-width: 480px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

/* ===== Container ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
}

/* ===== Top Bar (language switch) ===== */
.top-bar {
  background: var(--blue);
  color: var(--white);
  text-align: right;
  padding: 6px 16px;
  font-size: 0.8rem;
}

.top-bar .container {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.top-bar a {
  color: var(--white);
  opacity: 0.8;
  font-size: 0.8rem;
}

.top-bar a:hover {
  opacity: 1;
  text-decoration: none;
}

/* ===== Navigation ===== */
nav {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
}

.nav-brand span {
  color: var(--green);
}

.nav-menu {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-menu::-webkit-scrollbar { display: none; }

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-600);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
  background: var(--blue-light);
  color: var(--blue);
  text-decoration: none;
}

.nav-menu a .nav-icon {
  font-size: 1.1rem;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-700);
  cursor: pointer;
  padding: 4px;
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--green) 100%);
  color: var(--white);
  text-align: center;
  padding: 48px 16px 40px;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

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

.hero-sub {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-sub span {
  background: rgba(255,255,255,0.2);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===== Card Grid (Home) ===== */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 24px 0;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.card:active {
  transform: scale(0.97);
}

.card-icon {
  font-size: 2.8rem;
  line-height: 1;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-800);
}

.card p {
  font-size: 0.8rem;
  color: var(--gray-500);
  line-height: 1.4;
}

.card.card-blue .card-icon { color: var(--blue); }
.card.card-green .card-icon { color: var(--green); }

/* ===== Page Header ===== */
.page-header {
  background: var(--white);
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--gray-200);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.breadcrumb a {
  color: var(--gray-500);
}

.breadcrumb span {
  color: var(--gray-700);
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}

.page-header p {
  font-size: 0.9rem;
  color: var(--gray-500);
  margin-top: 4px;
}

/* ===== Section / District ===== */
.district-section {
  padding: 20px 0;
}

.district-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--blue-light);
}

.district-title .title-icon {
  font-size: 1.3rem;
}

/* ===== List Items ===== */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  border-left: 4px solid var(--blue);
}

.item-card.green-border {
  border-left-color: var(--green);
}

.item-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.item-card .item-addr {
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.tag-free { background: var(--green-light); color: var(--green); }
.tag-paid { background: #fef3c7; color: #d97706; }
.tag-clean { background: var(--green-light); color: var(--green); }
.tag-ok { background: var(--blue-light); color: var(--blue); }
.tag-24h { background: var(--gray-100); color: var(--gray-600); }
.tag-ac { background: #e0f2fe; color: #0369a1; }
.tag-wifi { background: #ede9fe; color: #7c3aed; }

.stars {
  color: #f59e0b;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

/* ===== Ad Placeholder ===== */
.ad-placeholder {
  background: var(--gray-100);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--gray-400);
  font-size: 0.85rem;
  margin: 16px 0;
}

/* ===== Footer ===== */
footer {
  background: var(--gray-800);
  color: var(--gray-400);
  text-align: center;
  padding: 24px 16px;
  margin-top: auto;
  font-size: 0.85rem;
}

footer a {
  color: var(--blue-light);
}

/* ===== Responsive ===== */
@media (min-width: 640px) {
  :root { --max-width: 640px; }
  .hero h1 { font-size: 2.5rem; }
  .card-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 480px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 8px 16px;
    box-shadow: var(--shadow-lg);
    gap: 2px;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .hero h1 {
    font-size: 1.7rem;
  }

  .card-grid {
    gap: 10px;
  }

  .card {
    padding: 20px 12px;
  }

  .card-icon {
    font-size: 2.2rem;
  }
}
