/* ==========================================================================
   KiteSearch & DroidCraft Android Tech Blog — Clean Minimalist Swiss UI
   ========================================================================== */

:root {
  --bg-page: #ffffff;
  --bg-subtle: #f8f9fa;
  --bg-elevated: #ffffff;
  --bg-chip: #f1f3f4;
  --bg-chip-hover: #e4e7eb;

  --text-primary: #202124;
  --text-secondary: #4d5156;
  --text-muted: #5f6368;
  --border-light: #e5e7eb;
  --border-input: #dfe1e5;

  --brand-blue: #1a73e8;
  --brand-blue-hover: #1557b0;
  --brand-coral: #ea4335;
  --brand-amber: #fbbc04;
  --brand-green: #34a853;
  --link-blue: #1a0dab;
  --link-visited: #681da8;

  /* Android Dev Tech Blog Tokens (DroidCraft) */
  --android-green: #0f8a5f;
  --android-green-soft: #e6f6ef;
  --android-ink: #111827;
  --android-code-bg: #161b22;
  --android-code-fg: #e6edf3;

  --shadow-pill: 0 1px 6px rgba(32, 33, 36, 0.14);
  --shadow-pill-hover: 0 2px 10px rgba(32, 33, 36, 0.22);
  --shadow-popover: 0 10px 30px rgba(15, 23, 42, 0.14);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.08);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas, Monaco, monospace;
}

[data-theme="dark"] {
  --bg-page: #18191c;
  --bg-subtle: #202227;
  --bg-elevated: #24262c;
  --bg-chip: #2d3038;
  --bg-chip-hover: #393d47;

  --text-primary: #e8eaed;
  --text-secondary: #bdc1c6;
  --text-muted: #9aa0a6;
  --border-light: #32353d;
  --border-input: #434752;

  --brand-blue: #8ab4f8;
  --brand-blue-hover: #aecbfa;
  --brand-coral: #f28b82;
  --brand-amber: #fdd663;
  --brand-green: #81c995;
  --link-blue: #8ab4f8;
  --link-visited: #c58af9;

  --android-green: #3ddc84;
  --android-green-soft: rgba(61, 220, 132, 0.14);
  --android-ink: #f3f4f6;
  --android-code-bg: #0d1117;
  --android-code-fg: #e6edf3;

  --shadow-pill: 0 2px 8px rgba(0, 0, 0, 0.36);
  --shadow-pill-hover: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-popover: 0 14px 36px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea {
  font-family: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-root {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Shared Controls & Long-Press Magnifying Glass Button
   ========================================================================== */
.icon-circle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.14s ease, color 0.14s ease, transform 0.12s ease;
}

.icon-circle-btn:hover {
  background: var(--bg-chip);
  color: var(--text-primary);
}

.icon-circle-btn:active {
  transform: scale(0.94);
}

.icon-circle-btn svg {
  width: 19px;
  height: 19px;
}

/* Long-press magnifying glass trigger (discreet circular hold ring) */
.lens-trigger {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  transition: color 0.14s ease, background-color 0.14s ease, transform 0.12s ease;
}

.lens-trigger:hover {
  color: var(--brand-blue);
  background: var(--bg-chip);
}

.lens-trigger.holding {
  color: var(--brand-blue);
  transform: scale(0.94);
}

.lens-trigger.ai-armed {
  color: var(--android-green);
}

.lens-trigger .lens-svg {
  width: 19px;
  height: 19px;
  position: relative;
  z-index: 1;
}

.lens-hold-ring {
  position: absolute;
  inset: 1px;
  width: 34px;
  height: 34px;
  transform: rotate(-90deg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.lens-trigger.holding .lens-hold-ring {
  opacity: 1;
}

.lens-hold-ring circle {
  fill: none;
  stroke: var(--brand-blue);
  stroke-width: 2.2;
  stroke-dasharray: 94.2;
  stroke-dashoffset: 94.2;
  stroke-linecap: round;
}

.lens-trigger.holding .lens-hold-ring circle {
  animation: holdFill 0.56s linear forwards;
}

@keyframes holdFill {
  from { stroke-dashoffset: 94.2; }
  to { stroke-dashoffset: 0; }
}

/* Hidden AI Prompt Drawer (blends naturally like an advanced search filter panel) */
.secret-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-popover);
  padding: 16px 18px;
  z-index: 50;
  text-align: left;
}

.secret-panel[hidden] {
  display: none;
}

.secret-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.secret-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.secret-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--android-green);
}

.secret-field {
  margin-bottom: 10px;
}

.secret-field label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.secret-textarea,
.secret-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-input);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  outline: none;
}

.secret-textarea:focus,
.secret-input:focus {
  border-color: var(--brand-blue);
  background: var(--bg-elevated);
}

.secret-textarea {
  min-height: 78px;
  resize: vertical;
}

.secret-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.secret-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.secret-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Homepage (Clean Google-inspired Minimalist Layout)
   ========================================================================== */
.home-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
}

.home-top-link {
  font-size: 13.5px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  cursor: pointer;
}

.home-top-link:hover {
  background: var(--bg-chip);
  color: var(--text-primary);
}

.home-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 20px 88px;
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  user-select: none;
}

.wordmark-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.wordmark-letters {
  font-size: clamp(40px, 6.4vw, 62px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  display: inline-flex;
}

.wordmark-letters .l1 { color: var(--brand-blue); }
.wordmark-letters .l2 { color: var(--brand-coral); }
.wordmark-letters .l3 { color: var(--brand-amber); }
.wordmark-letters .l4 { color: var(--brand-blue); }
.wordmark-letters .l5 { color: var(--brand-green); }
.wordmark-letters .l6 { color: var(--text-primary); font-weight: 500; }

.search-form {
  width: 100%;
  max-width: 584px;
  position: relative;
}

.search-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 48px;
  padding: 0 10px 0 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-input);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-pill);
  transition: box-shadow 0.16s ease, border-color 0.16s ease;
}

.search-pill:hover,
.search-pill:focus-within {
  box-shadow: var(--shadow-pill-hover);
  border-color: transparent;
}

.search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
  padding: 0 4px;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.home-btn-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.btn {
  height: 38px;
  padding: 0 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.btn:hover {
  border-color: var(--border-input);
  background: var(--bg-elevated);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.btn.primary {
  background: var(--brand-blue);
  color: #ffffff;
}

[data-theme="dark"] .btn.primary {
  color: #0b1220;
  font-weight: 600;
}

.btn.primary:hover {
  background: var(--brand-blue-hover);
  border-color: transparent;
}

.home-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 28px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-muted);
}

.home-footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.home-footer-links button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.home-footer-links button:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* ==========================================================================
   SERP (Search Results Page)
   ========================================================================== */
.serp-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-light);
  padding: 16px 24px 0;
}

.serp-header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1180px;
}

.serp-brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px 0;
  flex-shrink: 0;
}

.serp-brand-btn .wordmark-logo {
  width: 26px;
  height: 26px;
}

.serp-brand-btn .wordmark-letters {
  font-size: 22px;
}

.serp-header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.serp-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-left: 152px;
  max-width: 1180px;
  overflow-x: auto;
  scrollbar-width: none;
}

.serp-tabs-bar::-webkit-scrollbar {
  display: none;
}

.serp-tab {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.serp-tab.active {
  color: var(--brand-blue);
  border-bottom-color: var(--brand-blue);
}

.serp-main {
  max-width: 1180px;
  padding: 16px 24px 64px 176px;
}

.serp-stats {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 26px;
  max-width: 652px;
}

.result-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-origin {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-favicon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-blue);
}

.result-favicon img {
  width: 16px;
  height: 16px;
  display: block;
}

.result-favicon.android-badge {
  background: var(--android-green-soft);
  border-color: transparent;
  color: var(--android-green);
}

.result-favicon svg {
  width: 16px;
  height: 16px;
}

.result-origin-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.result-site {
  font-size: 13.5px;
  color: var(--text-primary);
  font-weight: 500;
}

.result-url {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-link {
  display: inline;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.32;
  color: var(--link-blue);
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: 2px 0;
  text-align: left;
  cursor: pointer;
}

.result-link:hover {
  text-decoration: underline;
}

.result-link:visited,
.result-link.visited {
  color: var(--link-visited);
}

.result-snippet {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.62;
  color: var(--text-secondary);
}

.result-date {
  color: var(--text-muted);
  margin-right: 5px;
}

.result-snippet mark {
  background: transparent;
  color: var(--text-primary);
  font-weight: 600;
}

.result-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.meta-chip {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
}

/* Loading Skeletons on SERP */
.skeleton-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 652px;
}

.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-chip) 25%, var(--bg-subtle) 50%, var(--bg-chip) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
  max-width: 652px;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
  color: var(--brand-blue);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.page-btn.active {
  background: var(--brand-blue);
  color: #ffffff;
  border-color: transparent;
}

[data-theme="dark"] .page-btn.active {
  color: #0b1220;
}

/* ==========================================================================
   Android Developer Technical Blog View (Slot #2 Click-Through Page)
   ========================================================================== */
.blog-shell {
  min-height: 100vh;
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.blog-navbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-light);
  padding: 0 24px;
}

.blog-navbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.blog-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.blog-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--android-green-soft);
  color: var(--android-green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.blog-brand-icon svg {
  width: 20px;
  height: 20px;
}

.blog-brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--android-ink);
}

.blog-brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 6px;
  font-weight: 400;
}

.blog-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.blog-nav-item {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.blog-nav-item:hover {
  background: var(--bg-chip);
  color: var(--text-primary);
}

.blog-nav-item.active {
  color: var(--android-green);
  font-weight: 600;
}

.blog-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 28px 24px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}

.blog-article-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 32px 36px;
  box-shadow: var(--shadow-card);
}

.blog-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.blog-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--android-green-soft);
  color: var(--android-green);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.blog-title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--android-ink);
}

.blog-author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

.blog-author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.blog-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f8a5f, #1a73e8);
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.blog-author-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.blog-author-meta {
  font-size: 12.5px;
  color: var(--text-muted);
}

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

.blog-tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}

/* Rendered Markdown Body inside the Android Blog Post */
.markdown-body {
  font-size: 15.5px;
  line-height: 1.82;
  color: var(--text-primary);
  word-break: break-word;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 26px 0 12px;
  line-height: 1.35;
  color: var(--android-ink);
}

.markdown-body h2 {
  font-size: 21px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

.markdown-body h3 {
  font-size: 17.5px;
}

.markdown-body p {
  margin: 0 0 14px;
  color: var(--text-secondary);
}

.markdown-body ul,
.markdown-body ol {
  margin: 0 0 16px;
  padding-left: 22px;
  color: var(--text-secondary);
}

.markdown-body li {
  margin-bottom: 6px;
}

.markdown-body blockquote {
  margin: 16px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--android-green);
  background: var(--bg-subtle);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
}

.markdown-body code.inline-code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-chip);
  color: var(--text-primary);
}

.code-block {
  margin: 18px 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--android-code-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.code-block-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  font-size: 12px;
  color: #9ca3af;
}

.copy-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: #e5e7eb;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--android-code-fg);
}

/* Blog Comments Section (Discreet Multi-Turn Follow-up to Gemini AI) */
.blog-comments {
  margin-top: 36px;
  padding-top: 26px;
  border-top: 1px solid var(--border-light);
}

.blog-comments h2 {
  font-size: 18px;
  margin: 0 0 14px;
}

.comment-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.comment-card {
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
}

.comment-card.author-reply {
  border-left: 3px solid var(--android-green);
  background: var(--bg-elevated);
}

.comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 8px;
}

.comment-author {
  font-weight: 600;
  color: var(--text-primary);
}

.comment-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--android-green-soft);
  color: var(--android-green);
  margin-left: 6px;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-textarea {
  width: 100%;
  min-height: 82px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-input);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 14.5px;
  resize: vertical;
  outline: none;
}

.comment-textarea:focus {
  border-color: var(--android-green);
  background: var(--bg-elevated);
}

.comment-form-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Blog Sidebar */
.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.blog-side-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}

.blog-side-card h3 {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0 0 12px;
}

.side-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.side-stat-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.side-stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
}

.side-post-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-post-link {
  display: block;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.45;
  padding: 4px 0;
}

.side-post-link:hover {
  color: var(--android-green);
}

.side-post-meta {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Modal & Toast */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-popover);
  z-index: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h2 {
  font-size: 17px;
  margin: 0;
}

.modal-body {
  padding: 18px 20px 22px;
  font-size: 14px;
  color: var(--text-secondary);
}

.status-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.status-pill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  font-size: 13.5px;
}

.modal-section {
  margin-top: 14px;
}

.modal-section h3 {
  font-size: 14.5px;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.modal-section ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

.modal-section code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-chip);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: #202124;
  color: #ffffff;
  font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 120;
}

[data-theme="dark"] .toast {
  background: #e8eaed;
  color: #18191c;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .serp-tabs-bar {
    padding-left: 0;
  }
  .serp-main {
    padding: 16px 20px 56px;
  }
  .blog-container {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .serp-header {
    padding: 12px 14px 0;
  }
  .serp-header-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .serp-header-row .search-form {
    order: 3;
    flex: 1 0 100%;
    max-width: none;
  }
  .serp-main {
    padding: 14px 14px 48px;
  }
  .blog-navbar {
    padding: 0 14px;
  }
  .blog-brand-sub,
  .blog-nav-links .hide-mobile {
    display: none;
  }
  .blog-container {
    padding: 16px 12px 56px;
  }
  .blog-article-card {
    padding: 20px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* v4 stealth lens + blog spinner overrides */
.lens-trigger.holding, .lens-trigger.ai-armed { color: var(--text-muted); transform: none; }
.lens-hold-ring { display: none; }
.btn { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.blog-loading-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 56px 16px; color: var(--text-muted); font-size: 14px; }
.blog-spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--border-light); border-top-color: var(--android-green); animation: blogSpin 0.75s linear infinite; }
@keyframes blogSpin { to { transform: rotate(360deg); } }

/* v6 multimodal attachments & markdown h4/hr */
.search-pill.drag-over, .comment-textarea.drag-over { border-color: var(--brand-blue) !important; box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.16); }
.attach-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.attach-strip[hidden] { display: none; }
.attach-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 240px; padding: 5px 8px 5px 6px; border-radius: 10px; border: 1px solid var(--border-light); background: var(--bg-subtle); font-size: 12.5px; color: var(--text-primary); }
.attach-thumb { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border-light); }
.attach-file-badge { width: 30px; height: 30px; border-radius: 6px; background: var(--bg-chip); color: var(--brand-blue); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.attach-file-badge svg { width: 16px; height: 16px; }
.attach-meta { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.attach-size { font-size: 11px; color: var(--text-muted); }
.attach-remove { width: 20px; height: 20px; border-radius: 50%; border: 0; background: transparent; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex-shrink: 0; }
.attach-remove:hover { background: var(--bg-chip-hover); color: var(--text-primary); }
.attach-remove svg { width: 12px; height: 12px; }
.markdown-body h4 { font-size: 15.5px; font-weight: 600; margin: 18px 0 8px; color: var(--android-ink); }
.markdown-body hr { border: 0; border-top: 1px solid var(--border-light); margin: 20px 0; }

/* v8 account login button, pure solid single-letter avatar & auth modal */
.auth-trigger-wrap { position: relative; display: inline-flex; align-items: center; }
.signin-pill-btn { height: 34px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--brand-blue); color: #ffffff; font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background-color 0.14s ease, box-shadow 0.14s ease; }
[data-theme="dark"] .signin-pill-btn { color: #0b1220; font-weight: 600; }
.signin-pill-btn:hover { background: var(--brand-blue-hover); box-shadow: 0 1px 4px rgba(26, 115, 232, 0.32); }
.avatar-circle-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; color: #ffffff; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; user-select: none; transition: transform 0.12s ease, box-shadow 0.14s ease; }
.avatar-circle-btn:hover { box-shadow: 0 0 0 3px var(--bg-chip); }
.avatar-circle-btn:active { transform: scale(0.95); }
.account-popover { position: absolute; top: calc(100% + 10px); right: 0; width: 268px; padding: 20px 18px 16px; border-radius: 18px; background: var(--bg-elevated); border: 1px solid var(--border-light); box-shadow: var(--shadow-popover); z-index: 80; text-align: center; }
.account-popover[hidden] { display: none; }
.account-avatar-lg { width: 58px; height: 58px; border-radius: 50%; margin: 0 auto 10px; color: #ffffff; font-size: 26px; font-weight: 600; display: flex; align-items: center; justify-content: center; user-select: none; }
.account-welcome { font-size: 15.5px; font-weight: 600; color: var(--text-primary); margin: 0 0 4px; word-break: break-all; }
.account-sub { font-size: 12.5px; color: var(--text-muted); margin: 0 0 16px; }
.account-popover-actions { display: flex; flex-direction: column; gap: 8px; }
.account-popover-actions .btn { width: 100%; border-radius: 999px; }
.auth-modal-card { width: min(390px, 100%); padding: 28px 26px 24px; text-align: center; }
.auth-modal-logo { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.auth-modal-logo .wordmark-logo { width: 28px; height: 28px; }
.auth-modal-logo .wordmark-letters { font-size: 22px; }
.auth-modal-title { font-size: 20px; font-weight: 600; margin: 4px 0 6px; color: var(--text-primary); }
.auth-modal-desc { font-size: 13.5px; color: var(--text-muted); margin: 0 0 20px; }
.auth-field { text-align: left; margin-bottom: 18px; }
.auth-field label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; }
.auth-input { width: 100%; height: 44px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--border-input); background: var(--bg-subtle); color: var(--text-primary); font-size: 15px; outline: none; }
.auth-input:focus { border-color: var(--brand-blue); background: var(--bg-elevated); }
.auth-modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }


/* Markdown Tables & Top-Right ZH/EN Language Toggle */
.md-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--border-light);
  border-radius: 10px;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.55;
}

.markdown-body th,
.markdown-body td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  color: var(--text-secondary);
}

.markdown-body th {
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-weight: 600;
}

.markdown-body tr:last-child td {
  border-bottom: 0;
}

.lang-toggle-btn {
  height: 34px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.lang-toggle-btn:hover {
  background: var(--bg-chip);
  border-color: var(--border-input);
  color: var(--text-primary);
}

.lang-toggle-btn:active {
  transform: scale(0.96);
}

.lang-toggle-btn .lang-opt {
  color: var(--text-muted);
  transition: color 0.14s ease;
}

.lang-toggle-btn .lang-opt.active {
  color: var(--text-primary);
  font-weight: 700;
}

.lang-toggle-btn .lang-sep {
  opacity: 0.45;
  font-weight: 400;
}
