/* ==========================================================================
   BASE: Structure, Layout, Components
   --------------------------------------------------------------------------
   This file defines the SHAPE and BEHAVIOR of every component:
     - Box model (size, position, flex, grid)
     - Typography sizing (font-size, line-height, weight)
     - Spacing (margin, padding, gap)
     - Borders, radii, shadows (sourced from theme.css variables)
     - Responsive breakpoints
     - Interaction states (hover, focus, active — non-color)

   All visual values (color, font family, gradient) come from CSS custom
   properties defined in theme.css. To re-theme the site, swap theme.css.
   This file does not need to change.

   Load order in HTML:
     <link rel="stylesheet" href="css/theme.css">   <!-- variables first -->
     <link rel="stylesheet" href="css/base.css">    <!-- uses those vars -->
   ========================================================================== */

/* Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, picture, video { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; transition: color 0.2s; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

/* Layout shell
   ========================================================================== */
.app-frame {
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--color-surface);
  min-height: 100vh;
  box-shadow: 0 0 40px rgba(0,0,0,0.06);
  position: relative;
  overflow-x: hidden;
}
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 20px;
}
.app-frame > .container { max-width: 100%; padding: 0 16px; }

/* Skip link (a11y) */
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--color-primary); color: #fff;
  padding: 8px 16px; z-index: 9999; font-weight: 700;
}
.skip-link:focus { top: 0; }

/* Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  display: flex; align-items: center;
}
.site-header .container { display: flex; align-items: center; gap: 12px; width: 100%; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); color: var(--color-text); font-size: 1.25rem; }
.brand-logo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.search-input {
  width: 100%; padding: 8px 14px 8px 36px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border);
  font-family: inherit; font-size: 14px; color: var(--color-text);
}
.search-input:focus { outline: none; border-color: var(--color-accent); background-color: var(--color-surface); }
.header-nav-toggle { background: none; border: none; padding: 8px; margin-left: auto; color: var(--color-text); font-size: 1.5rem; flex-shrink: 0; }
.main-nav {
  position: fixed; inset: 0; background: rgba(255,255,255,0.98);
  z-index: 200; display: none; flex-direction: column; padding: 20px;
}
.main-nav.is-open { display: flex; }
.main-nav-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.main-nav-close { background: none; border: none; font-size: 1.5rem; padding: 8px; }
.main-nav-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.main-nav-list a {
  display: block; padding: 14px 16px; border-radius: var(--radius-md);
  background: var(--color-bg); color: var(--color-text); font-weight: 700; font-size: 1.1rem;
}
.main-nav-list a:hover { background: var(--color-accent-soft); color: var(--color-accent); }

/* Hero (homepage)
   ========================================================================== */
.hero {
  background: var(--gradient-hero);
  color: #fff;
  padding: 32px 20px 40px;
  position: relative;
  overflow: hidden;
}
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}
.hero::before { width: 200px; height: 200px; top: -80px; right: -50px; }
.hero::after { width: 140px; height: 140px; bottom: -40px; left: -30px; }
.hero-eyebrow {
  display: inline-block; padding: 4px 12px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.25); font-size: 12px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 12px;
}
.hero h1 { color: #fff; font-size: 2rem; margin-bottom: 8px; text-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.hero-tagline { font-size: 1rem; opacity: 0.95; margin: 0 0 20px; }
.hero-cta { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; background: #fff; color: var(--color-accent); border-radius: var(--radius-pill); font-weight: 800; box-shadow: var(--shadow-card); }
.hero-cta:hover { color: var(--color-pink); transform: translateY(-2px); box-shadow: var(--shadow-hover); }

/* Ad slot (AdSense)
   ========================================================================== */
.ad-slot {
  display: block;
  margin: 24px auto;
  padding: 28px 12px 12px;
  text-align: center;
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  min-height: 100px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  clear: both;
}
.ad-slot::before {
  content: 'Advertisement';
  position: absolute; top: 6px; left: 8px; right: 8px;
  font-size: 9px; color: var(--color-muted); text-transform: uppercase;
  letter-spacing: 0.1em; line-height: 1;
  pointer-events: none;
}
.ad-slot-header {
  min-height: 100px;
  margin: 0 0 16px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  padding: 16px 12px;
}
.ad-slot-inarticle {
  min-height: 250px;
  max-width: 336px;
  margin: 32px auto;
  padding: 28px 12px 16px;
}
.ad-slot-footer {
  min-height: 90px;
  max-width: 728px;
  margin: 32px auto;
  padding: 28px 12px 16px;
}
@media (min-width: 1024px) {
  .ad-slot-footer { max-width: 970px; }
}

/* Section
   ========================================================================== */
.section { padding: 32px 0; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; padding: 0 4px; }
.section-title { font-size: 1.5rem; margin: 0; }
.section-link { font-size: 14px; font-weight: 700; color: var(--color-primary); }

/* Category chips
   ========================================================================== */
.category-chips { display: flex; gap: 8px; padding: 0 4px 16px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.category-chips::-webkit-scrollbar { display: none; }
.category-chip {
  flex-shrink: 0; padding: 8px 16px; border-radius: var(--radius-pill);
  background: var(--color-surface); border: 1.5px solid var(--color-border);
  font-size: 14px; font-weight: 700; color: var(--color-text);
  white-space: nowrap; transition: all 0.2s;
}
.category-chip:hover, .category-chip.is-active {
  background: var(--chip-color, var(--color-accent));
  color: #fff;
  border-color: var(--chip-color, var(--color-accent));
}

/* Article card
   ========================================================================== */
.article-grid { display: flex; flex-direction: column; gap: 16px; }
.article-card {
  display: block; background: var(--gradient-card); border-radius: var(--radius-md);
  overflow: hidden; box-shadow: var(--shadow-card); transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none; color: inherit;
}
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.article-card > a {
  display: flex; flex-direction: column; align-items: stretch;
  width: 100%; text-decoration: none; color: inherit;
}
.article-card-cover {
  width: 100%; aspect-ratio: 16 / 9; flex-shrink: 0;
  background: var(--color-accent-soft); position: relative; overflow: hidden;
}
.article-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-card-cover-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem; color: var(--color-accent);
  background: linear-gradient(135deg, var(--color-accent-soft) 0%, var(--color-bg) 100%),
              url('../images/placeholder.png') center/cover no-repeat;
}
.article-card-cat {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.95); color: var(--color-accent);
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  z-index: 2;
}
.article-card-body {
  flex: 1; min-width: 0; padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.article-card-title {
  font-size: 1.0625rem; font-weight: 800; line-height: 1.3;
  margin: 0; color: var(--color-text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--color-muted); margin: 0;
}
.article-card-author-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--color-accent-soft); object-fit: cover;
}
.article-card-author-name { font-weight: 600; color: var(--color-text); }
.article-card-date { color: var(--color-muted); }
.article-card-meta-dot { color: var(--color-border); margin: 0 2px; }
.article-card-excerpt {
  font-size: 13px; line-height: 1.5; color: var(--color-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin: 0;
}
.article-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0; }
.article-card-tag {
  padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--color-tag-bg); font-size: 10px; color: var(--color-accent); font-weight: 600;
}

/* Modifier: 3-column compact grid (for related articles suggestions)
   Cards are already vertical by default — only need to set the grid */
.article-grid--cols-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.article-grid--cols-3 .article-card-cover-fallback { font-size: 2rem; }
.article-grid--cols-3 .article-card-body { padding: 10px 12px 12px; gap: 4px; }
.article-grid--cols-3 .article-card-title { font-size: 0.9rem; -webkit-line-clamp: 2; }
.article-grid--cols-3 .article-card-excerpt { display: none; }
.article-grid--cols-3 .article-card-meta { font-size: 10px; }
.article-grid--cols-3 .article-card-tags { display: none; }
.article-grid--cols-3 .article-card-cat { font-size: 9px; padding: 2px 7px; }

/* Author card
   ========================================================================== */
.author-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.author-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  padding: 20px 16px; background: var(--color-surface);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}
.author-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.author-avatar {
  width: 80px; height: 80px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-accent-soft); object-fit: cover;
  border: 3px solid var(--color-accent-soft);
}
.author-name { font-size: 1rem; font-weight: 800; margin: 0; }
.author-specialty { font-size: 12px; color: var(--color-accent); font-weight: 700; margin: 0; }
.author-bio { font-size: 13px; color: var(--color-muted); line-height: 1.45; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.author-count { font-size: 11px; color: var(--color-muted); margin: 0; }

/* List page (list.html)
   ========================================================================== */
.list-toolbar {
  display: flex; flex-direction: column; gap: 12px; padding: 16px 4px;
  border-bottom: 1px solid var(--color-border);
}
.list-toolbar-row { display: flex; align-items: center; gap: 8px; }
.list-toolbar-label { font-size: 12px; color: var(--color-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; min-width: 60px; }
.list-sort-select {
  padding: 8px 12px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border); background: var(--color-surface);
  font-family: inherit; font-size: 14px; color: var(--color-text);
}
.list-count { font-size: 13px; color: var(--color-muted); padding: 12px 4px; }
.list-empty { text-align: center; padding: 60px 20px; color: var(--color-muted); }
.list-empty-paw { font-size: 4rem; margin-bottom: 12px; }
.list-loadmore { display: block; width: 100%; padding: 14px; margin: 20px 0; background: var(--color-accent-soft); color: var(--color-accent); border: none; border-radius: var(--radius-pill); font-weight: 800; font-size: 15px; }

/* Article page (article.html)
   ========================================================================== */
.article-page main { padding: 0 0 40px; }
.article-page-layout {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 16px;
}
.article-breadcrumb {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  font-size: 12px; color: var(--color-muted); padding: 16px 4px 0;
}
.article-breadcrumb a { color: var(--color-muted); }
.article-breadcrumb a:hover { color: var(--color-accent); }
.article-breadcrumb-sep { opacity: 0.5; }
.article-header { padding: 16px 4px 20px; }
.article-category { display: inline-block; padding: 4px 12px; border-radius: var(--radius-pill); background: var(--color-accent); color: #fff; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.article-title { font-size: 1.75rem; line-height: 1.2; margin: 0 0 12px; }
.article-excerpt { font-size: 1.05rem; line-height: 1.55; color: var(--color-muted); margin: 0 0 16px; }
.article-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--color-muted); }
.article-author-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--color-accent-soft); object-fit: cover; }
.article-author-name { font-weight: 800; color: var(--color-text); }
.article-meta-divider { color: var(--color-border); }
.article-cover {
  aspect-ratio: 16/9; background: var(--color-accent-soft);
  margin: 16px 0; border-radius: var(--radius-md); overflow: hidden;
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-cover-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 5rem; color: var(--color-accent);
  background: linear-gradient(135deg, var(--color-accent-soft) 0%, var(--color-bg) 100%);
}
.article-content { font-size: 1.0625rem; line-height: 1.75; color: var(--color-text); word-wrap: break-word; overflow-wrap: break-word; }
.article-content h2 { font-size: 1.5rem; margin: 2em 0 0.5em; padding-top: 8px; }
.article-content h3 { font-size: 1.25rem; margin: 1.5em 0 0.5em; }
.article-content p { margin: 0 0 1.25em; }
.article-content ul, .article-content ol { margin: 0 0 1.25em; padding-left: 1.5em; }
.article-content li { margin: 0 0 0.5em; }
.article-content img { border-radius: var(--radius-md); margin: 1.5em 0; }
.article-content blockquote {
  border-left: 4px solid var(--color-accent); padding: 12px 16px;
  background: var(--color-accent-soft); margin: 1.5em 0; border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
}
.article-content code {
  background: #f5f5f5; padding: 2px 6px; border-radius: 4px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.9em;
}
.article-content pre {
  background: #2d3436; color: #f5f5f5; padding: 16px; border-radius: var(--radius-md);
  overflow-x: auto; font-size: 13px; line-height: 1.5;
}
.article-content pre code { background: none; padding: 0; color: inherit; }
.article-content a { text-decoration: underline; text-decoration-color: var(--color-accent-soft); text-underline-offset: 3px; }
.article-content a:hover { text-decoration-color: var(--color-accent); }

/* Article tags */
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.article-tag {
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: var(--color-tag-bg); color: var(--color-accent); font-size: 13px; font-weight: 700;
  text-decoration: none; transition: all 0.2s;
}
.article-tag:hover { background: var(--color-accent); color: #fff; }

/* Share bar */
.share-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 16px; margin: 20px 0;
  background: var(--color-bg); border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
.share-label { font-size: 13px; font-weight: 700; color: var(--color-muted); margin-right: 4px; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-surface); color: var(--color-text);
  text-decoration: none; border: 1.5px solid var(--color-border); transition: all 0.2s;
}
.share-btn:hover { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.share-btn svg { width: 18px; height: 18px; fill: currentColor; }
.share-btn--copy { font-size: 11px; font-weight: 800; width: auto; padding: 0 12px; }

/* Author box (in article) */
.author-box {
  display: flex; gap: 16px; padding: 20px;
  background: var(--color-bg); border-radius: var(--radius-md);
  margin: 24px 0; border: 1px solid var(--color-border);
}
.author-box-avatar { width: 80px; height: 80px; border-radius: 50%; flex-shrink: 0; background: var(--color-accent-soft); object-fit: cover; }
.author-box-name { font-size: 1.15rem; font-weight: 800; margin: 0 0 4px; }
.author-box-specialty { font-size: 13px; color: var(--color-accent); font-weight: 700; margin-bottom: 8px; }
.author-box-bio { font-size: 14px; line-height: 1.5; color: var(--color-text); margin: 0 0 8px; }
.author-box-link { font-size: 13px; font-weight: 700; }

/* Prev/Next */
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
.article-nav-link {
  display: block; padding: 14px; background: var(--color-surface);
  border: 1.5px solid var(--color-border); border-radius: var(--radius-md); text-decoration: none; color: var(--color-text);
}
.article-nav-link:hover { border-color: var(--color-accent); }
.article-nav-direction { font-size: 11px; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.article-nav-title { font-size: 14px; font-weight: 700; line-height: 1.35; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-nav-prev { text-align: left; }
.article-nav-next { text-align: right; }

/* Related articles */
.related-articles { margin: 32px 0; }
.related-articles h2 { font-size: 1.25rem; margin: 0 0 16px; }

/* Author page (author.html)
   ========================================================================== */
.author-page-header {
  background: var(--gradient-hero); color: #fff;
  padding: 32px 20px; text-align: center;
}
.author-page-avatar {
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,0.2); margin: 0 auto 16px;
  border: 4px solid rgba(255,255,255,0.4); object-fit: cover;
}
.author-page-name { color: #fff; font-size: 2rem; margin: 0 0 4px; }
.author-page-specialty { font-size: 0.875rem; opacity: 0.95; margin: 0 0 12px; font-weight: 700; }
.author-page-bio { font-size: 1rem; line-height: 1.6; max-width: 600px; margin: 0 auto; opacity: 0.95; }
.author-page-stats { display: flex; gap: 16px; justify-content: center; margin-top: 20px; font-size: 14px; }
.author-page-stat { text-align: center; }
.author-page-stat strong { display: block; font-size: 1.5rem; font-family: var(--font-display); }

/* Footer
   ========================================================================== */
.site-footer {
  background: #2D3436; color: #dde4e6;
  padding: 32px 20px 24px; margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; margin-bottom: 24px; }
@media (min-width: 481px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-col h3 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 12px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; font-size: 13px; }
.footer-col a { color: #dde4e6; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #4A5456; padding-top: 16px; font-size: 12px; color: #95a5a6; text-align: center; }
.footer-bottom a { color: #95a5a6; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; font-family: var(--font-display); font-size: 1.25rem; color: #fff; }

/* Static page (privacy/terms/contact/404)
   ========================================================================== */
.static-page { padding: 32px 0 60px; }
.static-page h1 { font-size: 1.75rem; }
.static-page h2 { font-size: 1.25rem; margin-top: 1.5em; }
.static-page p, .static-page li { font-size: 15px; line-height: 1.7; }
.static-page ul, .static-page ol { padding-left: 1.25em; }

/* Utilities
   ========================================================================== */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

/* Focus styles (a11y) */
:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; border-radius: 4px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .article-card:hover { transform: none; }
}

/* Desktop (PC 居中显示 mobile-frame style)
   ========================================================================== */
@media (min-width: 769px) {
  .app-frame {
    margin: 24px auto;
    border-radius: var(--radius-lg);
    min-height: calc(100vh - 48px);
    overflow: hidden;
  }
  .ad-slot-header { min-height: 90px; max-width: 728px; margin-left: auto; margin-right: auto; }
}

/* Search page (search.html) — Google mobile style
   ========================================================================== */
.site-header--search { height: var(--header-height); }
.site-header--search .container { gap: 8px; }
.header-back {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  color: var(--color-text);
  flex-shrink: 0;
}
.header-back:hover { background: var(--color-bg); color: var(--color-accent); }
.header-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--color-text);
  flex: 1;
  min-width: 0;
}

/* Large pill search bar (Google-style) */
.search-bar-large {
  display: flex; align-items: center; gap: 12px;
  margin: 12px 16px 8px;
  padding: 10px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.search-bar-large:focus-within {
  border-color: var(--color-accent);
}
.search-bar-large .search-icon {
  width: 20px; height: 20px;
  color: var(--color-muted);
  flex-shrink: 0;
}
.search-bar-large input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  font-size: 16px;
  font-family: inherit;
  color: var(--color-text);
  padding: 4px 0;
}
.search-bar-large input::placeholder { color: var(--color-muted); }
.search-bar-large .search-clear {
  background: none; border: none; padding: 0;
  color: var(--color-muted); font-size: 1.1rem;
  cursor: pointer; display: none;
  flex-shrink: 0; line-height: 1;
  width: 24px; height: 24px;
  border-radius: 50%;
}
.search-bar-large .search-clear:hover { background: var(--color-bg); color: var(--color-text); }
.search-bar-large.has-text .search-clear { display: flex; align-items: center; justify-content: center; }

/* Category filter tabs (Google "All/Images/News" style) */
.search-tabs {
  display: flex; gap: 8px;
  padding: 8px 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: var(--header-height);
  background: var(--color-surface);
  z-index: 10;
}
.search-tabs::-webkit-scrollbar { display: none; }
.search-tab {
  flex-shrink: 0;
  padding: 7px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.search-tab:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.search-tab.is-active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* Result count status line */
.search-status {
  padding: 12px 16px 4px;
  font-size: 12px;
  color: var(--color-muted);
  display: none;
}
.search-status.is-visible { display: block; }

/* Result list */
.search-results { padding: 4px 16px 16px; }
.search-result {
  display: flex; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--color-bg); }
.search-result-thumb {
  width: 72px; height: 72px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-accent-soft) 0%, var(--color-bg) 100%),
              url('../images/placeholder.png') center/cover no-repeat;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  color: var(--color-accent);
  overflow: hidden;
  position: relative;
}
.search-result-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.search-result-content {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.search-result-breadcrumb {
  font-size: 11px;
  color: var(--color-muted);
  display: flex; align-items: center; gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.search-result-breadcrumb-sep { opacity: 0.5; }
.search-result-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.3;
  margin: 2px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.search-result:hover .search-result-title { text-decoration: underline; }
.search-result-excerpt {
  font-size: 13px;
  color: var(--color-text);
  line-height: 1.45;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.search-result-meta {
  font-size: 11px;
  color: var(--color-muted);
  margin-top: 4px;
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.search-result-author-avatar {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--color-accent-soft); object-fit: cover;
  flex-shrink: 0;
}
.search-result-author-name { font-weight: 600; color: var(--color-text); }
.search-result-meta-dot { color: var(--color-border); }
.search-result mark {
  padding: 0 2px;
  border-radius: 2px;
}

/* Initial state: suggestions */
.search-suggestions { padding: 20px 16px 32px; display: block; }
.search-suggestions[hidden] { display: none; }
.search-suggestion-section { margin-bottom: 28px; }
.search-suggestion-section:last-child { margin-bottom: 0; }
.search-suggestion-title {
  font-size: 12px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  margin: 0 0 12px;
  font-family: var(--font-body);
}
.search-suggestion-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.search-suggestion-chip {
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.search-suggestion-chip:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-soft);
}
.search-suggestion-chip:active { transform: scale(0.97); }

.search-suggestion-cats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.search-suggestion-cat {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s;
}
.search-suggestion-cat:hover {
  border-color: var(--color-accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.search-suggestion-cat-emoji { font-size: 1.5rem; }

/* Empty state */
.search-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-muted);
  display: none;
}
.search-empty.is-visible { display: block; }
.search-empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.6; }
.search-empty-title {
  font-size: 1.1rem;
  color: var(--color-text);
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 400;
}
.search-empty-suggestion { font-size: 14px; margin: 0 0 20px; }
.search-empty-cta {
  display: inline-block;
  padding: 10px 20px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-pill);
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
}
.search-empty-cta:hover { background: var(--color-primary-dark); color: #fff; }

/* Loading state */
.search-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-muted);
  font-size: 14px;
  display: none;
}
.search-loading.is-visible { display: block; }
.search-loading-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: search-spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes search-spin { to { transform: rotate(360deg); } }

/* Print (AdSense compliance: clean print) */
@media print {
  .site-header, .site-footer, .ad-slot, .share-bar, .article-nav, .related-articles { display: none; }
  body { background: #fff; }
  .app-frame { box-shadow: none; max-width: 100%; }
}
