/* 大衛の電子攻略站 - Bright Modern Tech Blog */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-primary: #f8f9fc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f4ff;
  --bg-code: #f1f5f9;
  --bg-dark: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-light: rgba(37, 99, 235, 0.08);
  --accent-hover: #1d4ed8;
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.1);
  --cyan: #0891b2;
  --cyan-dim: rgba(8, 145, 178, 0.08);
  --green: #059669;
  --green-dim: rgba(5, 150, 105, 0.08);
  --purple: #7c3aed;
  --purple-dim: rgba(124, 58, 237, 0.08);
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --max-width: 1140px;
  --header-height: 64px;
  --content-width: 720px;
  --transition: 0.2s ease;
  --font-body: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 16px); }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  font-size: 16px;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; }

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo { display: flex; align-items: center; gap: 12px; color: var(--text-primary); font-weight: 700; font-size: 1.1rem; }
.site-logo img { height: 80px; width: auto; margin: -10px 0; }
.site-logo .logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.site-logo .logo-main { color: var(--text-primary); font-size: 1.05rem; font-weight: 800; }
.site-logo .logo-sub { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); font-weight: 400; }

.nav-menu { display: flex; list-style: none; gap: 4px; }
.nav-menu a {
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
}
.nav-menu a:hover, .nav-menu a.active {
  color: var(--accent);
  background: var(--accent-light);
}

.mobile-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.3rem; cursor: pointer; }

/* ===== AD BANNERS ===== */
.ad-banner {
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  border: 2px dashed var(--accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  transition: border-color var(--transition);
}
.ad-banner:hover { border-color: var(--amber); }
.ad-placeholder { text-align: center; padding: 12px; }
.ad-label { font-size: 0.82rem; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.ad-size { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 4px; }
.ad-cta { font-size: 0.78rem; color: var(--amber); font-weight: 600; }

.ad-header { max-width: var(--max-width); margin: 16px auto; padding: 0 24px; height: 90px; }
.ad-header .ad-banner { width: 100%; height: 90px; }
.ad-sidebar .ad-banner { width: 100%; height: 250px; }
.ad-inline { margin: 28px 0; height: 100px; }
.ad-inline .ad-banner { height: 100%; }

/* ===== BLOG INTRO ===== */
.blog-intro {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 16px;
}

.blog-intro .intro-greeting {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
  background: var(--bg-secondary);
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.blog-intro .intro-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 3px solid var(--accent-light);
  flex-shrink: 0;
}

.blog-intro .intro-text h1 { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); line-height: 1.5; }
.blog-intro .intro-text p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

.blog-intro .intro-text .typing-cursor {
  display: inline-block; width: 2px; height: 16px;
  background: var(--accent); margin-left: 2px;
  animation: blink 1s step-end infinite; vertical-align: middle;
}

@keyframes blink { 50% { opacity: 0; } }

/* ===== CONTENT LAYOUT ===== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 36px;
  padding: 28px 24px 48px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.main-content { min-width: 0; }
.sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: calc(var(--header-height) + 20px); align-self: start; }

/* ===== SECTION HEADERS ===== */
.section { margin-bottom: 40px; }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}

.section-title {
  font-size: 1.15rem; font-weight: 700; color: var(--text-primary);
}

.section-title::before { content: '# '; color: var(--accent); font-family: var(--font-mono); font-weight: 400; }

.section-link { font-size: 0.82rem; font-family: var(--font-mono); color: var(--text-muted); }
.section-link:hover { color: var(--accent); }

/* ===== BLOG POST LIST ===== */
.post-list { display: flex; flex-direction: column; gap: 0; }

.post-item {
  display: flex; gap: 16px; padding: 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition);
  color: inherit; text-decoration: none;
  border-radius: var(--radius-sm);
}

.post-item:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

.post-item .post-accent { width: 4px; border-radius: 4px; flex-shrink: 0; align-self: stretch; }
.post-accent-amber { background: var(--amber); }
.post-accent-cyan { background: var(--cyan); }
.post-accent-green { background: var(--green); }
.post-accent-purple { background: var(--purple); }

.post-item .post-body { flex: 1; min-width: 0; }
.post-item .post-title { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; transition: color var(--transition); }
.post-item:hover .post-title { color: var(--accent); }
.post-item .post-excerpt { font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.post-item .post-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono);
}

/* Category pills */
.cat-pill {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600; font-family: var(--font-body);
}
.cat-slots { background: var(--amber-dim); color: var(--amber); }
.cat-casinos { background: var(--cyan-dim); color: var(--cyan); }
.cat-guides { background: var(--green-dim); color: var(--green); }
.cat-rtp { background: var(--purple-dim); color: var(--purple); }

/* ===== CARD GRID ===== */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 0; }

.card {
  display: flex; gap: 16px; padding: 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition);
  color: inherit; text-decoration: none; border-radius: var(--radius-sm);
}
.card:hover { background: var(--bg-card-hover); box-shadow: var(--shadow-sm); transform: translateX(4px); }
.card .card-accent { width: 4px; border-radius: 4px; flex-shrink: 0; }
.card .card-body { flex: 1; }
.card-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono); }
.card-title { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; transition: color var(--transition); }
.card:hover .card-title { color: var(--accent); }
.card-excerpt { font-size: 0.88rem; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { display: flex; align-items: center; gap: 12px; font-size: 0.78rem; color: var(--text-muted); margin-top: 8px; font-family: var(--font-mono); }

/* ===== SIDEBAR WIDGETS ===== */
.widget {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.widget-about { text-align: center; }
.widget-about .widget-avatar { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 10px; display: block; border: 3px solid var(--accent-light); }
.widget-about .widget-name { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.widget-about .widget-bio { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.7; }

.widget-title {
  font-size: 0.88rem; font-weight: 700; margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 2px solid var(--accent); color: var(--text-primary);
}

.widget-list { list-style: none; }
.widget-list li { padding: 7px 0; border-bottom: 1px solid var(--border-subtle); }
.widget-list li:last-child { border-bottom: none; }
.widget-list a { color: var(--text-secondary); font-size: 0.85rem; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.widget-list a:hover { color: var(--accent); }
.cat-count { margin-left: auto; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); background: var(--bg-code); padding: 1px 7px; border-radius: 10px; font-family: var(--font-mono); }

/* ===== BREADCRUMB ===== */
.breadcrumb {
  max-width: var(--max-width); margin: 0 auto; padding: 14px 24px;
  font-size: 0.8rem; font-family: var(--font-mono); color: var(--text-muted);
  background: var(--bg-secondary); border-bottom: 1px solid var(--border-subtle);
}
.breadcrumb a { color: var(--accent); font-weight: 500; }
.breadcrumb a:hover { color: var(--accent-hover); }
.breadcrumb .sep { margin: 0 8px; color: var(--text-muted); opacity: 0.5; }

/* ===== CATEGORY PAGE ===== */
.category-hero { max-width: var(--max-width); margin: 0 auto; padding: 36px 24px 20px; }
.category-hero h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; color: var(--text-primary); }
.category-hero p { color: var(--text-secondary); font-size: 0.95rem; max-width: 600px; }

/* ===== ARTICLE PAGE ===== */
.article-layout {
  display: grid; grid-template-columns: 1fr 240px; gap: 40px;
  max-width: 1000px; margin: 0 auto; padding: 0 24px 48px;
}
.article-main { min-width: 0; }

.article-header { max-width: var(--content-width); padding: 28px 0 20px; }
.article-header h1 { font-size: 1.8rem; font-weight: 800; line-height: 1.4; margin-bottom: 16px; color: var(--text-primary); }

.article-author {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color);
}
.article-author img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--accent-light); }
.article-author .author-info { font-size: 0.85rem; }
.article-author .author-name { color: var(--text-primary); font-weight: 700; }
.article-author .author-date { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.78rem; }

.article-meta { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 0.82rem; font-family: var(--font-mono); }

.article-content { max-width: var(--content-width); }
.article-content h2 {
  font-size: 1.35rem; font-weight: 800; margin: 40px 0 16px; color: var(--accent);
  padding-bottom: 8px; border-bottom: 2px solid var(--accent-light);
}
.article-content h3 { font-size: 1.1rem; font-weight: 700; margin: 28px 0 10px; color: var(--text-primary); }
.article-content p { margin-bottom: 18px; color: var(--text-secondary); line-height: 1.9; }
.article-content ul, .article-content ol { margin: 14px 0; padding-left: 24px; color: var(--text-secondary); }
.article-content li { margin-bottom: 8px; }
.article-content strong { color: var(--text-primary); font-weight: 700; }

.article-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 20px; margin: 24px 0;
  background: var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-primary); font-size: 0.95rem;
}

.article-content .info-box {
  background: var(--bg-code); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); padding: 20px 24px; margin: 24px 0;
}
.article-content .info-box h4 { color: var(--accent); margin-bottom: 10px; font-family: var(--font-mono); font-size: 0.92rem; }

.article-content .david-note {
  background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
  border-left: 4px solid var(--green);
  padding: 16px 20px; margin: 24px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem; color: var(--text-primary);
}
.article-content .david-note::before { content: '💡 大衛筆記：'; font-weight: 700; color: var(--green); display: block; margin-bottom: 4px; font-size: 0.85rem; }

.article-content table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 0.9rem; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
.article-content th, .article-content td { padding: 12px 16px; text-align: left; }
.article-content th { background: var(--accent); color: #fff; font-weight: 600; font-size: 0.85rem; }
.article-content td { color: var(--text-secondary); border-bottom: 1px solid var(--border-subtle); background: var(--bg-secondary); }
.article-content tr:hover td { background: var(--accent-light); }

.article-content code {
  font-family: var(--font-mono); background: var(--bg-code);
  padding: 2px 8px; border-radius: 4px; font-size: 0.85em; color: var(--accent);
}

/* TOC sidebar */
.toc-sidebar { position: sticky; top: calc(var(--header-height) + 20px); align-self: start; }
.toc { }
.ad-article-sidebar { margin-top: 20px; }
.ad-article-sidebar .ad-banner { height: 250px; }
.toc-title { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--accent); }
.toc-list { list-style: none; }
.toc-list li { padding: 4px 0; }
.toc-list a {
  color: var(--text-muted); font-size: 0.78rem; line-height: 1.5;
  display: block; padding: 3px 0 3px 12px;
  border-left: 2px solid var(--border-color); transition: all var(--transition);
}
.toc-list a:hover { color: var(--accent); border-left-color: var(--accent); }

/* Related */
.related-posts { margin-top: 48px; padding-top: 28px; border-top: 2px solid var(--border-color); }
.related-posts h3 { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg-dark); border-top: none; padding: 40px 24px 20px; margin-top: 60px;
}
.footer-inner { max-width: var(--max-width); margin: 0 auto; display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-brand { max-width: 340px; }
.footer-brand .footer-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 700; color: #e2e8f0; font-size: 0.95rem; }
.footer-brand p { color: #94a3b8; font-size: 0.82rem; line-height: 1.7; }
.footer-links { display: flex; gap: 40px; }
.footer-col h4 { font-size: 0.82rem; font-weight: 700; margin-bottom: 12px; color: #e2e8f0; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 6px; }
.footer-col a { color: #94a3b8; font-size: 0.8rem; }
.footer-col a:hover { color: #f59e0b; }

.footer-bottom {
  max-width: var(--max-width); margin: 24px auto 0; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center; color: #64748b; font-size: 0.75rem; font-family: var(--font-mono);
}

/* ===== ABOUT PAGE ===== */
.about-page { max-width: var(--content-width); margin: 0 auto; padding: 36px 24px 48px; }
.about-hero {
  display: flex; align-items: center; gap: 24px; margin-bottom: 36px; padding: 28px;
  background: var(--bg-secondary); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}
.about-hero img { width: 88px; height: 88px; border-radius: 50%; border: 3px solid var(--accent-light); }
.about-hero h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; }
.about-hero p { font-size: 0.92rem; color: var(--text-secondary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .content-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .article-layout { grid-template-columns: 1fr; }
  .article-layout .toc-sidebar { display: none; }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none; position: absolute; top: var(--header-height); left: 0; right: 0;
    flex-direction: column; background: var(--bg-secondary); padding: 16px;
    border-bottom: 1px solid var(--border-color); box-shadow: var(--shadow-md);
  }
  .nav-menu.active { display: flex; }
  .mobile-toggle { display: block; }
  .blog-intro .intro-greeting { flex-direction: column; text-align: center; padding: 20px; }
  .blog-intro .intro-avatar { width: 56px; height: 56px; }
  .blog-intro .intro-text h1 { font-size: 1rem; }
  .category-hero h1 { font-size: 1.3rem; }
  .article-header h1 { font-size: 1.4rem; }
  .footer-inner { flex-direction: column; }
  .footer-links { flex-direction: column; gap: 20px; }
  .ad-header { padding: 0 16px; }
  .about-hero { flex-direction: column; text-align: center; }
}
