/* ════════════════════════════════════════
   市民解憂咖啡館 — 純透明
   全站粉色系泡泡感設計系統 v2.0
   ════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700;900&family=Zen+Maru+Gothic:wght@400;500;700&display=swap');

:root {
  --pink:         #FFC2CB;
  --pink-dark:    #E8899A;
  --pink-deep:    #C0566A;
  --pink-deeper:  #A03050;
  --pink-pale:    #FFF0F2;
  --pink-pale2:   #FFF8F9;
  --pink-mid:     #FFDDE3;

  --glass-white:  rgba(255,255,255,0.55);
  --glass-white2: rgba(255,255,255,0.75);
  --glass-pink:   rgba(255,194,203,0.22);
  --glass-border: rgba(255,255,255,0.60);
  --glass-shadow: 0 8px 40px rgba(192,86,106,0.14);

  --text:         #3A2428;
  --text-muted:   #8A6870;
  --border:       rgba(255,194,203,0.40);
  --border-solid: #F0C8CF;

  --radius-sm:    10px;
  --radius:       18px;
  --radius-lg:    28px;
  --radius-xl:    40px;

  --shadow-sm:    0 2px 16px rgba(192,86,106,0.10);
  --shadow:       0 8px 32px rgba(192,86,106,0.16);
  --shadow-lg:    0 20px 60px rgba(192,86,106,0.22);

  --line-green:   #06C755;
  --white:        #FFFFFF;

  --font-round:   'Zen Maru Gothic', 'Noto Sans TC', sans-serif;
  --font-body:    'Noto Sans TC', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ══════════════════════════════
   全站底色 — 粉色漸層
══════════════════════════════ */
body {
  font-family: var(--font-body);
  color: var(--text);
  font-size: 15px;
  line-height: 1.75;
  overflow-x: hidden;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  /* 全站底色：從淺粉到中粉，形成整體氛圍 */
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%,  rgba(255,240,243,1.0) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 30%,  rgba(255,210,220,0.8) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 50% 80%,  rgba(255,200,215,0.7) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 10% 70%,  rgba(255,230,235,0.9) 0%, transparent 50%),
    linear-gradient(160deg, #FFE8EC 0%, #FFD6DF 35%, #FFCBD6 65%, #FFB8C6 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* 全站泡泡裝飾 — 固定在背景層 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle 180px at 5%   15%,  rgba(255,255,255,0.40) 0%, transparent 70%),
    radial-gradient(circle  90px at 18%  45%,  rgba(255,255,255,0.30) 0%, transparent 70%),
    radial-gradient(circle 140px at 92%   8%,  rgba(255,255,255,0.35) 0%, transparent 70%),
    radial-gradient(circle  60px at 78%  35%,  rgba(255,255,255,0.28) 0%, transparent 70%),
    radial-gradient(circle 200px at 88%  75%,  rgba(255,255,255,0.32) 0%, transparent 70%),
    radial-gradient(circle  80px at 30%  88%,  rgba(255,255,255,0.28) 0%, transparent 70%),
    radial-gradient(circle 120px at 55%  55%,  rgba(255,220,228,0.25) 0%, transparent 70%),
    radial-gradient(circle  50px at 70%  90%,  rgba(255,255,255,0.20) 0%, transparent 70%);
}

/* 所有內容在 z-index:1 以上 */
.navbar, .page-section, .site-footer { position: relative; z-index: 1; }

/* ══════════════════════════════
   NAVBAR
══════════════════════════════ */
.navbar {
  background: rgba(255,232,237,0.75);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border-bottom: 1px solid rgba(255,255,255,0.60);
  position: sticky; top: 0; z-index: 300;
  box-shadow: 0 4px 32px rgba(192,86,106,0.10);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 62px;
}
.nav-brand {
  text-decoration: none;
  display: flex; align-items: center; gap: 10px;
}
.nav-brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(232,137,154,0.35);
}
.nav-brand-name {
  font-family: var(--font-round);
  font-size: 15px; font-weight: 700;
  color: var(--pink-deep); letter-spacing: 0.03em; white-space: nowrap;
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  color: var(--text-muted); text-decoration: none;
  font-size: 14px; font-weight: 500;
  padding: 8px 16px; border-radius: 30px;
  transition: all 0.25s; white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,0.60);
  color: var(--pink-deep);
}
.nav-cta {
  background: linear-gradient(135deg, var(--pink-dark), var(--pink-deep)) !important;
  color: var(--white) !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 16px rgba(192,86,106,0.35);
  margin-left: 8px;
}
.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(192,86,106,0.45) !important;
  background: rgba(255,255,255,0) !important;
}
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--pink-deep); border-radius: 2px; transition: all 0.3s;
}
.mobile-nav {
  display: none;
  background: rgba(255,232,237,0.92);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 8px 16px 20px;
}
.mobile-nav.open { display: block; }
.mobile-nav .nav-link {
  display: block; padding: 13px 16px;
  border-radius: var(--radius-sm); margin-bottom: 3px; font-size: 15px;
}
.mobile-nav .nav-cta {
  display: block; text-align: center; margin-top: 8px;
  padding: 14px; border-radius: var(--radius-sm); font-size: 15px;
}

/* ══════════════════════════════
   PAGE SECTIONS (SPA)
══════════════════════════════ */
.page-section { display: none; padding: 48px 16px; min-height: 60vh; }
.page-section.active { display: block; }
#page-home { padding: 0; }

/* ══════════════════════════════
   HERO — 全寬置中，無人物
══════════════════════════════ */
.hero-unit {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 72px 24px 80px;
}

/* 泡泡裝飾 */
.hero-bubbles {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
}
.bubble {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.30);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.58);
  animation: float 7s ease-in-out infinite;
}
.bubble:nth-child(1) { width:220px;height:220px; top:-40px; left:-60px;  animation-delay:0s;   }
.bubble:nth-child(2) { width: 90px;height: 90px; top:15%;   left:8%;     animation-delay:1.8s; }
.bubble:nth-child(3) { width:140px;height:140px; bottom:-30px; left:15%;  animation-delay:3.2s; }
.bubble:nth-child(4) { width:180px;height:180px; top:-50px; right:-40px;  animation-delay:0.9s; }
.bubble:nth-child(5) { width: 70px;height: 70px; bottom:10%;right:12%;    animation-delay:2.4s; }
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-22px); }
}

/* Hero 主體 — 垂直排列，置中 */
.hero-body {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto; width: 100%;
  display: flex; flex-direction: column; align-items: center;
  gap: 56px;
  animation: heroIn 0.9s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes heroIn {
  from { opacity:0; transform:translateY(36px); }
  to   { opacity:1; transform:translateY(0); }
}

/* 標題區 — 置中 */
.hero-text {
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--glass-white2);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: var(--pink-deep);
  font-size: 13px; font-weight: 700;
  padding: 7px 20px; border-radius: 30px;
  margin-bottom: 22px; letter-spacing: 0.08em;
  box-shadow: 0 2px 16px rgba(192,86,106,0.12);
}
.hero-title {
  font-family: var(--font-round);
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 900; color: var(--pink-deep);
  line-height: 1.15; letter-spacing: 0.01em;
  margin-bottom: 20px;
}
.hero-title .accent { color: var(--pink-dark); }
.hero-sub {
  font-size: clamp(15px, 1.8vw, 18px);
  color: var(--text-muted);
  margin-bottom: 36px; line-height: 1.9;
  max-width: 560px;
}
.hero-btns {
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--pink-dark), var(--pink-deep));
  color: var(--white);
  font-size: 15px; font-weight: 800;
  padding: 15px 32px; border-radius: 30px;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(192,86,106,0.35);
  transition: all 0.25s; min-height: 52px; white-space: nowrap;
}
.btn-primary:hover { transform:translateY(-3px); box-shadow:0 14px 36px rgba(192,86,106,0.45); }
.btn-glass {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--glass-white2);
  backdrop-filter: blur(12px);
  color: var(--pink-deep);
  font-size: 15px; font-weight: 700;
  padding: 15px 32px; border-radius: 30px;
  text-decoration: none;
  border: 1.5px solid var(--glass-border);
  transition: all 0.25s; min-height: 52px; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(192,86,106,0.12);
}
.btn-glass:hover { background:rgba(255,255,255,0.92); transform:translateY(-3px); }

/* ══════════════════════════════
   STATS — 全寬 3 欄卡片
══════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px; width: 100%;
}
/* 共用卡片底色：毛玻璃白浮在粉色底上 */
.stat-card {
  background: var(--glass-white);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  transition: all 0.25s;
  position: relative; overflow: hidden;
  box-shadow: 0 4px 24px rgba(192,86,106,0.10);
  cursor: pointer;
}
.stat-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--pink), var(--pink-dark));
  border-radius: 3px 3px 0 0;
}
.stat-card:hover {
  background: rgba(255,255,255,0.78);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(192,86,106,0.20);
}

/* 主角卡 — 左欄，直排置中 */
.stat-hero {
  padding: 28px 24px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.stat-hero-num {
  display: flex; align-items: baseline; gap: 6px; justify-content: center;
  margin-bottom: 6px;
}
.stat-hero-num .stat-num {
  font-size: clamp(56px, 6vw, 80px);
  color: var(--pink-deep);
}
.stat-num-pct {
  font-family: var(--font-round);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 900; color: var(--pink-dark);
}
.stat-hero-unit {
  font-size: 12px; font-weight: 700;
  color: var(--text-muted); letter-spacing: .06em; margin-bottom: 8px;
}
.stat-hero-desc {
  font-size: 13px; color: var(--text); line-height: 1.75;
  max-width: 200px;
}

/* 配角卡 */
.stat-sub { padding: 24px 20px; }
.stat-sub .stat-num {
  font-size: clamp(36px, 4vw, 56px);
  display: block; margin: 10px 0 4px;
}

/* 最多類別 */
.stat-wide { grid-column: 1 / -1; padding: 16px 20px; }
.stat-wide-row {
  display: flex; align-items: baseline; gap: 12px; margin-top: 6px;
}
.stat-type-name {
  font-family: var(--font-round);
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 900; color: var(--pink-deep);
}
.stat-type-rate {
  font-size: 14px; font-weight: 700; color: var(--pink-dark);
}

/* 共用文字 */
.stat-num {
  font-family: var(--font-round);
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 900; color: var(--pink-deep);
  line-height: 1; font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted); letter-spacing: 0.06em;
}
.stat-unit { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.stat-hint {
  font-size: 10px; color: rgba(192,86,106,0.45);
  margin-top: 8px; font-style: italic; transition: color .2s;
}
.stat-card:hover .stat-hint { color: var(--pink-dark); }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,194,203,0.25) 25%,
    rgba(255,194,203,0.50) 50%,
    rgba(255,194,203,0.25) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px; color: transparent !important; min-width: 60px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ══════════════════════════════
   MODAL 彈窗
══════════════════════════════ */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 999;
  background: rgba(60,20,30,0.40);
  backdrop-filter: blur(10px);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; animation: backdropIn .25s ease; }
@keyframes backdropIn { from{opacity:0;} to{opacity:1;} }
.modal-box {
  background: rgba(255,248,249,0.90);
  backdrop-filter: blur(28px) saturate(1.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 44px 36px 36px;
  max-width: 420px; width: 100%;
  text-align: center; position: relative;
  box-shadow: 0 32px 80px rgba(192,86,106,0.25);
  animation: modalIn .3s cubic-bezier(0.16,1,0.3,1);
}
@keyframes modalIn {
  from{opacity:0;transform:scale(0.88) translateY(20px);}
  to  {opacity:1;transform:scale(1) translateY(0);}
}
.modal-close {
  position: absolute; top: 16px; right: 18px;
  background: rgba(255,194,203,.35); border: none; border-radius: 50%;
  width: 32px; height: 32px; font-size: 14px; color: var(--pink-deep);
  cursor: pointer; transition: background .2s;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(255,194,203,.65); }
.modal-big-num {
  font-family: var(--font-round);
  font-size: clamp(56px, 14vw, 88px);
  font-weight: 900; color: var(--pink-deep);
  line-height: 1; margin-bottom: 8px;
}
.modal-title {
  font-family: var(--font-round);
  font-size: 16px; font-weight: 700;
  color: var(--text-muted); margin-bottom: 16px; letter-spacing: .04em;
}
.modal-desc {
  font-size: 15px; color: var(--text); line-height: 1.85;
  background: rgba(255,194,203,0.18);
  border-radius: var(--radius); padding: 16px 18px;
}

/* ══════════════════════════════
   儀表板區塊
══════════════════════════════ */
.dashboard-section {
  padding: 64px 20px;
  /* 泡泡感分隔：用波形漸層過渡，不用硬邊 */
  background:
    radial-gradient(ellipse 70% 60% at 90% 20%, rgba(255,255,255,0.30) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgba(255,194,203,0.20) 0%, transparent 55%),
    rgba(255,210,220,0.25);
  backdrop-filter: blur(0px);
  position: relative;
}
.dashboard-section::before {
  content: '';
  position: absolute; top: -40px; left: 0; right: 0;
  height: 80px;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(255,220,228,0.6) 0%, transparent 70%);
  pointer-events: none;
}
.section-wrap { max-width: 1100px; margin: 0 auto; }
.section-label {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.60);
  color: var(--pink-deep);
  font-size: 11px; font-weight: 800; letter-spacing: 0.1em;
  padding: 5px 14px; border-radius: 20px; margin-bottom: 10px;
  border: 1px solid var(--glass-border);
}
.section-title {
  font-family: var(--font-round);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 900; color: var(--pink-deep);
  margin-bottom: 32px; line-height: 1.3;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.dash-card-full { grid-column: 1 / -1; }

/* 儀表板卡片：毛玻璃白浮在粉底上 */
.dash-card {
  background: var(--glass-white2);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.dash-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--pink), var(--pink-dark));
}
.dash-card-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}

/* 切換 Tab */
.dash-tabs {
  display: flex; gap: 3px;
  background: rgba(255,194,203,0.25);
  padding: 3px; border-radius: 30px;
}
.dash-tab {
  font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 24px;
  border: none; cursor: pointer;
  background: transparent; color: var(--text-muted);
  transition: all 0.2s; font-family: var(--font-body);
}
.dash-tab.active {
  background: var(--white);
  color: var(--pink-deep);
  box-shadow: 0 2px 8px rgba(192,86,106,0.15);
}

/* 圖例 */
.bar-legend {
  display: flex; align-items: center;
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 10px; gap: 4px;
}
.legend-dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}
.legend-new    { background: var(--pink-dark); }
.legend-closed { background: rgba(192,86,106,0.30); }
.chart-loading { padding:32px;color:#8A6870;font-size:13px;width:100%;text-align:center; }

/* 疊加直條圖 */
.bar-chart {
  display: flex; align-items: flex-end; gap: 6px;
  height: 150px; padding-top: 16px;
}
.bar-col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 5px;
}
.bar-track { width: 100%; flex: 1; display: flex; align-items: flex-end; }
.bar-stacked {
  width: 100%;
  display: flex; flex-direction: column;
  border-radius: 6px 6px 0 0; overflow: hidden;
  transition: height 0.7s cubic-bezier(0.34,1.56,0.64,1);
  min-height: 4px;
}
.bar-seg-new    { background: var(--pink-dark); flex-shrink: 0; }
.bar-seg-closed { background: rgba(192,86,106,0.28); flex-shrink: 0; }
.bar-label { font-size: 10px; color: var(--text-muted); white-space: nowrap; }

/* 當月處理量 */
.month-stats { padding: 8px 0; }
.month-stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid rgba(255,194,203,0.22);
  font-size: 14px;
}
.month-stat-label { color: var(--text-muted); font-weight: 600; }
.month-stat-num {
  font-family: var(--font-round);
  font-size: 22px; font-weight: 900; color: var(--pink-deep);
}
.month-progress-wrap {
  height: 8px; background: rgba(255,194,203,0.28);
  border-radius: 8px; margin: 16px 0 6px; overflow: hidden;
}
.month-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--pink-dark));
  border-radius: 8px;
  transition: width 1s cubic-bezier(0.34,1.56,0.64,1);
}
.month-progress-label {
  font-size: 12px; font-weight: 700; color: var(--pink-deep); text-align: right;
}

/* 圓餅圖 */
.pie-wrap {
  display: flex; align-items: center; gap: 32px;
  justify-content: center; flex-wrap: wrap; padding: 8px 0;
}
.pie-legend { display: flex; flex-direction: column; gap: 8px; min-width: 140px; }
.pie-legend-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text);
}
.pie-legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.pie-legend-pct { font-weight: 700; color: var(--pink-deep); margin-left: auto; }

/* 圓餅圖 tooltip */
.pie-tooltip {
  position: absolute;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 700; color: var(--pink-deep);
  box-shadow: 0 4px 20px rgba(192,86,106,0.20);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0; transition: opacity .2s;
  z-index: 10;
}
.pie-tooltip.show { opacity: 1; }
.pie-canvas-wrap {
  position: relative; display: inline-block;
  cursor: pointer;
}

/* ══════════════════════════════
   陳情流程區塊
══════════════════════════════ */
.flow-section {
  padding: 72px 20px;
  background:
    radial-gradient(ellipse 60% 50% at 15% 30%, rgba(255,255,255,0.35) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 85% 70%, rgba(255,194,203,0.22) 0%, transparent 60%),
    rgba(255,200,215,0.20);
  position: relative;
}
.flow-section::before {
  content: '';
  position: absolute; top: -40px; left: 0; right: 0; height: 80px;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(255,215,225,0.50) 0%, transparent 70%);
  pointer-events: none;
}
.flow-sub {
  text-align: center; font-size: 15px; color: var(--text-muted);
  margin-bottom: 40px; margin-top: -16px;
}
.flow-steps {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 0; flex-wrap: wrap; margin-bottom: 52px;
}
.flow-step {
  flex: 1; min-width: 160px; max-width: 220px;
  background: var(--glass-white2);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px 20px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform .25s, box-shadow .25s;
}
.flow-step:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.flow-num {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--pink-dark), var(--pink-deep));
  color: var(--white); font-size: 11px; font-weight: 900;
  padding: 4px 12px; border-radius: 20px; letter-spacing: .06em;
}
.flow-icon { font-size: 30px; margin: 8px 0 12px; }
.flow-step-title {
  font-family: var(--font-round);
  font-size: 15px; font-weight: 700; color: var(--pink-deep); margin-bottom: 8px;
}
.flow-step-desc { font-size: 12px; color: var(--text-muted); line-height: 1.75; }
.flow-arrow {
  font-size: 22px; color: var(--pink-dark);
  padding: 0 6px; margin-top: 58px; flex-shrink: 0;
}

/* LINE CTA */
.flow-cta {
  background: linear-gradient(135deg, var(--pink-deeper), var(--pink-dark));
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  box-shadow: 0 8px 32px rgba(192,86,106,0.25);
  border: 1px solid rgba(255,255,255,0.20);
}
.flow-cta-title {
  font-family: var(--font-round);
  font-size: 17px; font-weight: 900; color: var(--white); margin-bottom: 6px;
}
.flow-cta-desc { font-size: 13px; color: rgba(255,255,255,0.75); }
.flow-line-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #06C755; color: var(--white);
  font-size: 14px; font-weight: 800;
  padding: 14px 24px; border-radius: 30px;
  text-decoration: none; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(6,199,85,0.35);
  transition: all .2s; flex-shrink: 0;
}
.flow-line-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(6,199,85,0.45); }

/* ══════════════════════════════
   案件列表
══════════════════════════════ */
.filter-bar {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 20px;
}
.cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-tab {
  font-size: 13px; font-weight: 600;
  padding: 7px 16px; border-radius: 24px;
  border: 1.5px solid var(--border-solid);
  background: var(--glass-white2); color: var(--text-muted);
  cursor: pointer; transition: all 0.2s; font-family: var(--font-body);
  backdrop-filter: blur(8px);
}
.cat-tab.active, .cat-tab:hover {
  background: rgba(255,255,255,0.85);
  border-color: var(--pink-dark); color: var(--pink-deep);
}
.cat-tab .cnt { font-size: 11px; opacity: 0.7; margin-left: 2px; }

.status-select {
  font-family: var(--font-body); font-size: 13px; color: var(--text);
  padding: 8px 36px 8px 14px;
  border: 1.5px solid var(--border-solid);
  border-radius: 24px;
  background: var(--glass-white2);
  backdrop-filter: blur(8px);
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23E8899A' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  transition: all 0.2s;
}
.status-select:focus { outline: none; border-color: var(--pink-dark); }

.table-wrap {
  background: var(--glass-white2);
  backdrop-filter: blur(16px);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.petition-table { width: 100%; border-collapse: collapse; }
.petition-table th {
  background: rgba(255,194,203,0.22);
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  padding: 12px 16px; text-align: left; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-solid);
}
.petition-table td {
  padding: 14px 16px; font-size: 13px;
  border-bottom: 1px solid rgba(255,194,203,0.15);
  vertical-align: middle;
}
.petition-table tr:last-child td { border-bottom: none; }
.petition-table tr:hover td { background: rgba(255,255,255,0.50); }

.td-id { font-family: monospace; font-size: 12px; color: var(--text-muted); }
.td-title { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-date { white-space: nowrap; color: var(--text-muted); font-size: 12px; }
.type-badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  background: rgba(255,194,203,0.35); color: var(--pink-deep);
}
.badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px; white-space: nowrap;
}
.badge-處理中 { background:#FFF3CD; color:#856404; }
.badge-已結案 { background:#D1F2EB; color:#1A7A5E; }
.badge-待受理 { background:rgba(255,194,203,0.35); color:var(--pink-deep); }
.badge-追蹤中 { background:#E8F4FD; color:#1565C0; }

.pagination {
  display: flex; align-items: center; gap: 6px;
  justify-content: center; padding: 20px 0 8px; flex-wrap: wrap;
}
.page-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--border-solid);
  background: var(--glass-white2); color: var(--text);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; font-family: var(--font-body);
  backdrop-filter: blur(8px);
}
.page-btn.active { background: var(--pink-dark); border-color: var(--pink-dark); color: var(--white); }
.page-btn:hover:not(.active):not(:disabled) { border-color: var(--pink-dark); color: var(--pink-deep); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.page-info { font-size: 12px; color: var(--text-muted); }

.loading-row, .empty-row {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 40px; color: var(--text-muted); font-size: 14px;
}
.loading-spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--border-solid);
  border-top-color: var(--pink-dark);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════
   案件查詢
══════════════════════════════ */
.query-card {
  max-width: 640px; margin: 0 auto;
  background: var(--glass-white2);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  padding: 36px 28px; box-shadow: var(--shadow);
}
.query-icon { font-size: 48px; margin-bottom: 12px; display: block; text-align: center; }
.query-card h2 {
  font-family: var(--font-round);
  font-size: 20px; font-weight: 900; color: var(--pink-deep);
  text-align: center; margin-bottom: 6px;
}
.query-card p {
  font-size: 13px; color: var(--text-muted); text-align: center;
  margin-bottom: 28px; line-height: 1.8;
}
.query-input-wrap { display: flex; gap: 10px; }
.query-input {
  flex: 1; font-size: 15px; font-family: var(--font-body);
  padding: 14px 18px; border-radius: 30px;
  border: 2px solid var(--border-solid);
  background: rgba(255,255,255,0.70); color: var(--text);
  transition: all 0.2s; letter-spacing: 0.05em;
  backdrop-filter: blur(8px);
}
.query-input:focus {
  outline: none; border-color: var(--pink-dark);
  box-shadow: 0 0 0 4px rgba(232,137,154,0.12);
  background: rgba(255,255,255,0.92);
}
.query-btn {
  padding: 14px 24px; border-radius: 30px;
  background: linear-gradient(135deg, var(--pink-dark), var(--pink-deep));
  color: var(--white); border: none; font-size: 14px; font-weight: 800;
  cursor: pointer; font-family: var(--font-body);
  transition: all 0.2s; white-space: nowrap; min-height: 52px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 16px rgba(192,86,106,0.30);
}
.query-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(192,86,106,0.40); }
.query-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.query-btn .spinner {
  width:18px;height:18px;border:2.5px solid rgba(255,255,255,0.4);
  border-top-color:#fff;border-radius:50%;animation:spin 0.7s linear infinite;display:none;
}
.query-btn.is-loading .spinner { display:block; }
.query-btn.is-loading .btn-label { display:none; }
.query-error {
  display:none; margin-top:12px;
  background:rgba(255,240,240,0.80); border:1px solid #FFCCCC;
  border-radius:12px; padding:12px 16px; font-size:13px; color:#C0392B;
  backdrop-filter: blur(8px);
}
.query-error.show { display:block; }
.query-result {
  display:none; margin-top:24px;
  background: rgba(255,248,249,0.80);
  backdrop-filter: blur(12px);
  border:1.5px solid var(--border-solid);
  border-radius:var(--radius); padding:24px;
  animation:fadeUp 0.4s ease;
}
.query-result.show { display:block; }
@keyframes fadeUp { from{opacity:0;transform:translateY(12px);}to{opacity:1;transform:translateY(0);} }
.qr-row {
  display:flex;gap:8px;align-items:flex-start;
  padding:10px 0;border-bottom:1px solid rgba(255,194,203,0.22);
  font-size:14px;
}
.qr-row:last-child { border-bottom:none; }
.qr-key { font-weight:700;color:var(--text-muted);min-width:90px; }
.qr-val { color:var(--text);flex:1; }
.qr-text { font-size:13px;line-height:1.8;color:var(--text); }
.qr-text.empty { color:var(--text-muted);font-style:italic; }
.qr-images { display:flex;flex-wrap:wrap;gap:10px;margin-top:12px; }
.qr-images img {
  width:110px;height:80px;object-fit:cover;
  border-radius:10px;border:1px solid var(--border-solid);
}

/* ══════════════════════════════
   常見問題
══════════════════════════════ */
.faq-list {
  max-width: 720px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 12px;
}
.faq-item {
  background: var(--glass-white2);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.faq-item:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.faq-q {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; cursor: pointer;
  font-size: 15px; font-weight: 700; color: var(--text);
  user-select: none;
}
.faq-q .q-icon { color: var(--pink-dark); margin-right: 10px; flex-shrink: 0; }
.faq-q .arrow { color: var(--pink-dark); transition: transform 0.3s; font-size: 18px; flex-shrink: 0; }
.faq-item.open .arrow { transform: rotate(180deg); }
.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 20px; font-size: 14px; color: var(--text-muted); line-height: 1.85;
}
.faq-item.open .faq-a { max-height: 300px; padding: 0 20px 18px; }

/* ══════════════════════════════
   FOOTER
══════════════════════════════ */
.site-footer {
  background: linear-gradient(135deg, var(--pink-deeper), var(--pink-dark));
  padding: 44px 20px 36px; text-align: center;
  position: relative; overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle 200px at 10% 50%, rgba(255,255,255,0.12) 0%, transparent 60%),
    radial-gradient(circle 150px at 90% 30%, rgba(255,255,255,0.10) 0%, transparent 60%),
    radial-gradient(circle  80px at 50% 80%, rgba(255,255,255,0.08) 0%, transparent 60%);
}
.footer-brand {
  font-family: var(--font-round);
  font-size: 20px; font-weight: 900; color: var(--white);
  margin-bottom: 8px; position: relative;
}
.footer-sub { font-size: 13px; color: rgba(255,255,255,0.70); margin-bottom: 24px; position: relative; }
.footer-social {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 20px; position: relative;
}
.footer-social-card {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.30);
  border-radius: 30px; padding: 10px 20px;
  text-decoration: none; color: var(--white);
  font-size: 13px; font-weight: 600; transition: all 0.2s;
}
.footer-social-card:hover { background: rgba(255,255,255,0.30); transform: translateY(-2px); }
.footer-copy { font-size: 11px; color: rgba(255,255,255,0.40); margin-top: 20px; position: relative; }

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dash-card-full { grid-column: 1; }
  .flow-steps { gap: 12px; }
  .flow-arrow { display: none; }
}

@media (max-width: 768px) {
  .nav-links  { display: none; }
  .hamburger  { display: flex; }

  /* Hero 手機版：泡泡縮小，保留兩顆 */
  .bubble:nth-child(n+3) { display: none; }
  .bubble:nth-child(1) { width:120px; height:120px; }
  .bubble:nth-child(2) { width: 60px; height: 60px; }

  .hero-unit  { padding: 48px 20px 56px; }
  .hero-body  { gap: 36px; }
  .hero-title { font-size: clamp(34px, 9vw, 52px); }
  .hero-sub   { font-size: 15px; }
  .hero-btns  { flex-direction: column; width: 100%; max-width: 320px; }
  .btn-primary, .btn-glass { width: 100%; justify-content: center; }

  /* 統計卡片：手機 2 欄 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  /* 主角卡 + 最多類別卡：跨兩欄滿版 */
  .stat-hero { grid-column: 1 / -1; }
  .stat-sub:last-child { grid-column: 1 / -1; }
  .stat-hero-num .stat-num { font-size: 60px; }
  .stat-num-pct { font-size: 30px; }
  .stat-sub .stat-num { font-size: 36px; }
  .stat-sub { padding: 20px 16px; }

  /* 儀表板 */
  .dashboard-grid { grid-template-columns: 1fr; }
  .dash-card-full { grid-column: 1; }
  .pie-wrap { flex-direction: column; align-items: center; }

  /* 流程 */
  .flow-steps { flex-direction: column; align-items: center; gap: 20px; }
  .flow-step  { max-width: 100%; width: 100%; }
  .flow-cta   { flex-direction: column; text-align: center; }

  /* 其他頁面 */
  .page-section { padding: 32px 16px; }
  .query-input-wrap { flex-direction: column; }
  .query-card { padding: 24px 18px; }
  .table-wrap { overflow-x: auto; }
  .petition-table th, .petition-table td { padding: 10px 12px; }
  .td-title   { max-width: 140px; }
  .bar-chart  { height: 110px; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 32px; }
  .hero-sub   { font-size: 14px; }
  .stats-grid { gap: 10px; }
  .stat-hero-num .stat-num { font-size: 52px; }
  .stat-sub .stat-num      { font-size: 30px; }
}
