/* ===== Reset & Base ===== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  --tg-blue:#0088cc;
  --tg-blue-dark:#006699;
  --tg-blue-light:#e8f4fd;
  --tg-blue-lighter:#f0f8ff;
  --text-primary:#222;
  --text-secondary:#555;
  --text-muted:#888;
  --bg-white:#fff;
  --bg-light:#f7f9fc;
  --border-color:#e0e6ed;
  --shadow-sm:0 1px 3px rgba(0,0,0,.08);
  --shadow-md:0 2px 8px rgba(0,0,0,.1);
  --shadow-lg:0 4px 16px rgba(0,0,0,.12);
  --radius:8px;
  --radius-lg:12px;
  --max-width:1200px;
  --header-height:64px;
}
html{font-size:16px;scroll-behavior:smooth}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans TC","Microsoft JhengHei",Roboto,Helvetica,Arial,sans-serif;
  color:var(--text-primary);
  background:var(--bg-light);
  line-height:1.7;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}
a{color:var(--tg-blue);text-decoration:none;transition:color .2s}
a:hover{color:var(--tg-blue-dark);text-decoration:underline}
img{max-width:100%;height:auto}
ul,ol{list-style:none}

/* ===== Utility ===== */
.container{max-width:var(--max-width);margin:0 auto;padding:0 20px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.text-center{text-align:center}

/* ===== Header ===== */
.site-header{
  background:var(--tg-blue);
  color:#fff;
  position:sticky;
  top:0;
  z-index:100;
  box-shadow:var(--shadow-md);
}
.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  height:var(--header-height);
}
.logo{display:flex;align-items:center;gap:10px;color:#fff;font-weight:700;font-size:1.25rem}
.logo:hover{text-decoration:none;color:#fff}
.logo svg{width:36px;height:36px;flex-shrink:0}
.logo span{white-space:nowrap}

/* Hamburger */
.nav-toggle{display:none;background:none;border:none;color:#fff;cursor:pointer;padding:8px}
.nav-toggle svg{width:28px;height:28px}

.header-nav ul{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end}
.header-nav a{
  color:rgba(255,255,255,.9);
  padding:6px 12px;
  border-radius:var(--radius);
  font-size:.9rem;
  transition:background .2s,color .2s;
}
.header-nav a:hover{background:rgba(255,255,255,.15);color:#fff;text-decoration:none}

/* Mobile nav */
@media(max-width:900px){
  .nav-toggle{display:block}
  .header-nav{
    display:none;
    position:absolute;
    top:var(--header-height);
    left:0;right:0;
    background:var(--tg-blue-dark);
    padding:12px 20px;
    box-shadow:var(--shadow-lg);
  }
  .header-nav.open{display:block}
  .header-nav ul{flex-direction:column;gap:2px}
  .header-nav a{display:block;padding:10px 12px;font-size:1rem}
}

/* ===== Hero ===== */
.hero{
  background:linear-gradient(135deg,var(--tg-blue) 0%,#00aced 100%);
  color:#fff;
  padding:48px 20px;
  text-align:center;
}
.hero h1{font-size:2rem;margin-bottom:8px}
.hero .tagline{font-size:1.15rem;opacity:.9;margin-bottom:20px}
.hero .cta-btn{
  display:inline-block;
  background:#fff;
  color:var(--tg-blue);
  padding:12px 32px;
  border-radius:50px;
  font-weight:700;
  font-size:1rem;
  transition:transform .2s,box-shadow .2s;
  box-shadow:var(--shadow-md);
}
.hero .cta-btn:hover{transform:translateY(-2px);box-shadow:var(--shadow-lg);text-decoration:none}

/* ===== Section headings ===== */
.section-title{
  font-size:1.5rem;
  font-weight:700;
  margin:40px 0 20px;
  padding-bottom:10px;
  border-bottom:3px solid var(--tg-blue);
  display:inline-block;
}

/* ===== Category Grid ===== */
.cat-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(160px,1fr));
  gap:12px;
  margin-bottom:40px;
}
.cat-card{
  background:var(--bg-white);
  border:1px solid var(--border-color);
  border-radius:var(--radius);
  padding:14px 16px;
  text-align:center;
  font-size:.95rem;
  font-weight:500;
  transition:border-color .2s,box-shadow .2s,transform .2s;
  color:var(--text-primary);
}
.cat-card:hover{
  border-color:var(--tg-blue);
  box-shadow:var(--shadow-md);
  transform:translateY(-2px);
  text-decoration:none;
  color:var(--tg-blue);
}

/* ===== Group List ===== */
.group-list{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
  gap:16px;
  margin-bottom:40px;
}
.group-card{
  background:var(--bg-white);
  border:1px solid var(--border-color);
  border-radius:var(--radius);
  padding:16px 20px;
  transition:border-color .2s,box-shadow .2s,transform .2s;
  display:flex;
  align-items:center;
  gap:12px;
}
.group-card:hover{
  border-color:var(--tg-blue);
  box-shadow:var(--shadow-md);
  transform:translateY(-2px);
  text-decoration:none;
}
.group-card .icon{
  width:40px;height:40px;flex-shrink:0;
  background:var(--tg-blue-light);
  border-radius:50%;
  display:flex;align-items:center;justify-content:center;
}
.group-card .icon svg{width:20px;height:20px;fill:var(--tg-blue)}
.group-card .info{min-width:0}
.group-card .info h3{font-size:.95rem;font-weight:600;color:var(--text-primary);margin-bottom:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.group-card .info p{font-size:.8rem;color:var(--text-muted)}

/* ===== Blog List ===== */
.blog-list{margin-bottom:40px}
.blog-item{
  background:var(--bg-white);
  border:1px solid var(--border-color);
  border-radius:var(--radius);
  padding:16px 20px;
  margin-bottom:12px;
  transition:border-color .2s,box-shadow .2s;
}
.blog-item:hover{border-color:var(--tg-blue);box-shadow:var(--shadow-sm)}
.blog-item a{font-weight:600;font-size:1rem}
.blog-item .date{font-size:.8rem;color:var(--text-muted);margin-top:4px}

/* ===== Page Content ===== */
.page-content{
  background:var(--bg-white);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm);
  padding:32px;
  margin:32px auto;
  max-width:900px;
}
.page-content h1{font-size:1.75rem;margin-bottom:16px;color:var(--tg-blue)}
.page-content h2{font-size:1.3rem;margin:24px 0 12px;color:var(--text-primary)}
.page-content p{margin-bottom:14px;color:var(--text-secondary)}

/* breadcrumb */
.breadcrumb{font-size:.85rem;color:var(--text-muted);margin-bottom:20px}
.breadcrumb a{color:var(--tg-blue)}
.breadcrumb span{margin:0 6px}

/* ===== Form ===== */
.form-group{margin-bottom:20px}
.form-group label{display:block;font-weight:600;margin-bottom:6px;font-size:.95rem}
.form-group input,.form-group select,.form-group textarea{
  width:100%;
  padding:10px 14px;
  border:1px solid var(--border-color);
  border-radius:var(--radius);
  font-size:1rem;
  font-family:inherit;
  transition:border-color .2s;
}
.form-group input:focus,.form-group select:focus,.form-group textarea:focus{
  outline:none;
  border-color:var(--tg-blue);
  box-shadow:0 0 0 3px rgba(0,136,204,.15);
}
.form-group textarea{resize:vertical;min-height:100px}
.btn-primary{
  display:inline-block;
  background:var(--tg-blue);
  color:#fff;
  border:none;
  padding:12px 32px;
  border-radius:var(--radius);
  font-size:1rem;
  font-weight:600;
  cursor:pointer;
  transition:background .2s;
}
.btn-primary:hover{background:var(--tg-blue-dark)}

/* ===== Sidebar / Category page ===== */
.category-page-list{margin-bottom:40px}
.category-page-list .group-card{margin-bottom:0}

/* ===== Footer ===== */
.site-footer{
  background:#1a2a3a;
  color:rgba(255,255,255,.75);
  padding:32px 20px;
  margin-top:auto;
  font-size:.9rem;
}
.footer-inner{
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  align-items:center;
  gap:16px;
}
.footer-links{display:flex;gap:20px;flex-wrap:wrap}
.footer-links a{color:rgba(255,255,255,.75)}
.footer-links a:hover{color:#fff}

/* ===== Responsive ===== */
@media(max-width:600px){
  .hero h1{font-size:1.5rem}
  .hero .tagline{font-size:1rem}
  .cat-grid{grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:8px}
  .group-list{grid-template-columns:1fr}
  .page-content{padding:20px;margin:16px}
  .section-title{font-size:1.25rem}
  .footer-inner{flex-direction:column;text-align:center}
}
