/* ═══════════════════════════════════════════════════════════════════════════
   SmallWeb — Apple Design System
   遵循: DESIGN.md · Apple Human Interface Guidelines
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────────────────────── */

:root {
  /* Surfaces — DESIGN.md §Colors */
  --canvas:            #ffffff;
  --canvas-parchment:  #f5f5f7;
  --ink:               #1d1d1f;
  --ink-muted:         #86868b;
  --primary:           #0066cc;   /* Action Blue */
  --primary-focus:     #0071e3;
  --primary-on-dark:   #2997ff;
  --hairline:          rgba(60, 60, 67, 0.12);

  /* Fortune colors */
  --fortune-bg:        #fffbeb;
  --fortune-border:    #fde68a;

  /* Typography — DESIGN.md §Typography */
  --font-display: 'Inter', system-ui, -apple-system, 'SF Pro Display', 'PingFang SC', sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, 'SF Pro Text', 'PingFang SC', sans-serif;

  /* Radii — DESIGN.md §Shapes */
  --radius-sm:   8px;
  --radius-md:   11px;
  --radius-lg:   18px;
  --radius-pill: 9999px;

  /* Shadows — DESIGN.md §Elevation */
  --shadow-card:  0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md:    0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg:    0 20px 60px rgba(0, 0, 0, 0.12);
  --shadow-img:   0 3px 5px 30px rgba(0, 0, 0, 0.22);  /* single product shadow */

  /* Spacing — 4px grid */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   32px;
  --space-xxl:  48px;
  --space-sec:  80px;

  /* Animation */
  --ease-out:  0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset & Base ─────────────────────────────────────────────────────── */

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

html, body {
  height: 100%; overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 17px;           /* DESIGN.md: body at 17px */
  font-weight: 400;
  line-height: 1.47;
  letter-spacing: -0.022em;  /* DESIGN.md: -0.374px ≈ -0.022em at 17px */
  color: var(--ink);
  background: var(--canvas-parchment);
}

.hidden { display: none !important; }

/* ── Links ────────────────────────────────────────────────────────────── */

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Inputs: Pill-shaped ──────────────────────────────────────────────── */

.input-pill {
  display: block;
  width: 100%;
  padding: 12px 20px;
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-pill);
  outline: none;
  transition: box-shadow var(--ease-out), border-color var(--ease-out);
}
.input-pill:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.18);
}
.input-pill::placeholder { color: #aeaeb2; }

/* ── Buttons: Pill grammar ───────────────────────────────────────────── */

.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn-pill:active { transform: scale(0.95); }   /* DESIGN.md: system-wide micro-interaction */

/* Primary — Action Blue pill */
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { opacity: 0.92; }
.btn-primary:focus-visible {
  outline: 2px solid var(--primary-focus);
  outline-offset: 2px;
}

/* Secondary — outlined ghost pill */
.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-secondary:hover { background: rgba(0, 102, 204, 0.04); }

/* Icon button */
.btn-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  color: var(--ink-muted);
  cursor: pointer;
  transition: background var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn-icon:hover { background: rgba(0, 0, 0, 0.04); }
.btn-icon:active { background: rgba(0, 0, 0, 0.08); }

/* ── Auth Page ────────────────────────────────────────────────────────── */

.auth-page {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--canvas-parchment);
}

.auth-card {
  width: 100%; max-width: 400px;
  padding: var(--space-xxl) var(--space-xl);
}

.auth-hero { text-align: center; margin-bottom: var(--space-xl); }

.auth-logo {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 600;
  letter-spacing: -0.011em;
  color: var(--ink);
}

.auth-tagline {
  font-size: 17px; color: var(--ink-muted);
  margin-top: var(--space-xs);
  letter-spacing: -0.022em;
}

.auth-form { display: none; }
.auth-form.active { display: block; }

.field { margin-bottom: var(--space-md); }

.auth-switch {
  text-align: center; margin-top: var(--space-lg);
  font-size: 14px; color: var(--ink-muted);
}
.auth-switch a { font-weight: 500; }

.auth-error {
  background: #fef2f2; color: #991b1b;
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 14px; text-align: center; margin-top: var(--space-md);
  border: 1px solid #fecaca;
}

/* ── Dashboard Layout ─────────────────────────────────────────────────── */

.dashboard {
  height: 100vh; display: flex; flex-direction: column;
}

/* ── Top Section (20vh) ──────────────────────────────────────────────── */

.top-section {
  flex: 0 0 20vh;
  min-height: 150px;
  background: var(--canvas);
  border-bottom: 0.5px solid var(--hairline);
  display: flex; align-items: center;
}

.top-content {
  width: 100%; max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-xl);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-lg);
}

.greeting-block { flex-shrink: 1; min-width: 0; }

.greeting-text {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 600;
  letter-spacing: -0.011em;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.greeting-text .username { color: var(--primary); }

.action-block {
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}

/* Fortune Pill — frosted glass card */
.fortune-pill {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  min-width: 0;
}

.fortune-emoji { font-size: 1.5rem; flex-shrink: 0; }

.fortune-body {
  font-size: 14px; font-weight: 400;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 200px;
}

.fortune-refresh {
  background: none; border: none;
  font-size: 18px; color: var(--ink-muted);
  cursor: pointer; padding: 2px; flex-shrink: 0;
  border-radius: 50%;
  transition: transform 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.fortune-refresh:hover { color: var(--ink); }
.fortune-refresh:active { transform: rotate(180deg); }

/* ── Bottom Section (80vh) ───────────────────────────────────────────── */

.bottom-section {
  flex: 1;
  display: flex; flex-direction: column;
  overflow: hidden;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-xl);
}

.hotspots-bar {
  display: flex; align-items: center; gap: var(--space-md);
  flex-shrink: 0; margin-bottom: var(--space-md);
}

.hotspots-heading {
  font-family: var(--font-display);
  font-size: 21px; font-weight: 600;
  letter-spacing: 0.011em;
  color: var(--ink);
}

/* Platform Tabs — pill chip group */
.platform-tabs {
  display: flex; gap: 4px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-pill);
  padding: 3px;
}

.tab-pill {
  padding: 7px 18px;
  font-family: var(--font-body);
  font-size: 14px; font-weight: 400;
  color: var(--ink-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--ease-out);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.tab-pill.active {
  background: var(--canvas);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 500;
}
.tab-pill:hover:not(.active) { color: var(--ink); }

/* Hotspots Scrollable List */
.hotspots-scroll {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar — subtle */
.hotspots-scroll::-webkit-scrollbar { width: 5px; }
.hotspots-scroll::-webkit-scrollbar-track { background: transparent; }
.hotspots-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }

.loading-text {
  text-align: center; padding: 60px 20px;
  font-size: 15px; color: var(--ink-muted);
}

/* ── Hotspot Card ─────────────────────────────────────────────────────── */

.hotspot-card {
  display: block;
  background: var(--canvas);
  padding: var(--space-md) 20px;
  border-radius: var(--radius-lg);
  text-decoration: none; color: inherit;
  transition: transform var(--ease-out), box-shadow var(--ease-out);
  border: 0.5px solid transparent;
  box-shadow: var(--shadow-card);
}
.hotspot-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--hairline);
  text-decoration: none;
}
.hotspot-card:active { transform: scale(0.985); }

.hotspot-title {
  font-size: 17px; font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.022em;
  margin-bottom: 2px;
}

.hotspot-desc {
  font-size: 14px; color: var(--ink-muted);
  line-height: 1.43;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hotspot-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink-muted);
}

.hotspot-meta .lang-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary);
}

/* ── Word Count Modal (frosted glass) ────────────────────────────────── */

.modal-glass {
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-sheet {
  background: var(--canvas);
  border-radius: 20px;
  width: 90%; max-width: 640px;
  max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: sheetIn var(--ease-spring);
}

@keyframes sheetIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 0.5px solid var(--hairline);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600;
  letter-spacing: -0.011em;
}

.modal-body {
  padding: 24px; overflow-y: auto;
}

.input-area {
  width: 100%; height: 180px;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 16px; line-height: 1.5;
  color: var(--ink);
  background: var(--canvas-parchment);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  resize: vertical;
  outline: none;
  transition: border-color var(--ease-out), box-shadow var(--ease-out);
}
.input-area:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.12);
}
.input-area::placeholder { color: #aeaeb2; }

.modal-body .btn-pill { margin-top: var(--space-md); }

/* Word Count Result */
.wc-result {
  margin-top: var(--space-lg);
  animation: fadeUp 0.3s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wc-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
}

.wc-stat {
  text-align: center;
  background: var(--canvas-parchment);
  border-radius: var(--radius-md);
  padding: 14px 8px;
}

.wc-val {
  display: block;
  font-family: var(--font-display);
  font-size: 28px; font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.011em;
}

.wc-lbl {
  font-size: 12px; color: var(--ink-muted);
  margin-top: 2px;
}

.wc-paras {
  margin-top: var(--space-md);
  display: flex; flex-direction: column; gap: 8px;
}

.para-stat {
  background: var(--canvas-parchment);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  border-left: 3px solid var(--primary);
}

.para-text {
  font-size: 14px; color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.43;
}

.para-count {
  font-size: 12px; color: var(--ink-muted);
}

.para-count strong { color: var(--primary); font-weight: 600; }

/* ── Logout Button ────────────────────────────────────────────────────── */

.btn-logout {
  position: fixed; bottom: 24px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--canvas);
  border: 0.5px solid var(--hairline);
  font-size: 18px; color: var(--ink-muted);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  transition: all var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn-logout:hover { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.btn-logout:active { transform: scale(0.95); }

/* ── Toast ────────────────────────────────────────────────────────────── */

.toast-glass {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  z-index: 2000;
  padding: 10px 24px;
  font-size: 15px; font-weight: 500;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
}

.toast-glass.error { background: #991b1b; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Empty State ──────────────────────────────────────────────────────── */

.empty-state {
  text-align: center; padding: 60px 20px; color: var(--ink-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ── Responsive: Tablet Landscape ≤ 833px ────────────────────────────────
   DESIGN.md: 834px switch — stacks single-column */

@media (max-width: 833px) {
  .top-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 0 var(--space-md);
  }

  .greeting-text { font-size: 24px; }

  .action-block {
    flex-wrap: wrap;
    width: 100%;
  }

  .fortune-pill { flex: 1; min-width: 0; }
  .fortune-body { max-width: 140px; }

  .hotspots-bar {
    flex-wrap: wrap; gap: 10px;
  }

  .platform-tabs {
    width: 100%; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .platform-tabs::-webkit-scrollbar { display: none; }

  .hotspots-heading { font-size: 19px; }
}

/* ── Responsive: Phone ≤ 640px ───────────────────────────────────────────
   DESIGN.md: single-column stack, padding tighten */

@media (max-width: 640px) {
  .top-section {
    flex: 0 0 auto;
    min-height: auto;
    padding: var(--space-md) 0;
  }

  .top-content {
    padding: 0 var(--space-md);
    gap: 12px;
  }

  .greeting-text { font-size: 22px; }

  .action-block {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .fortune-pill {
    justify-content: flex-start;
    width: 100%;
    border-radius: var(--radius-lg);
  }

  .fortune-body { max-width: none; flex: 1; }

  .btn-secondary { width: 100%; text-align: center; }

  .bottom-section {
    padding: var(--space-md);
  }

  .hotspots-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .hotspots-heading { font-size: 17px; }

  .tab-pill { font-size: 13px; padding: 6px 14px; }

  .hotspot-card { padding: 14px 16px; border-radius: var(--radius-md); }

  .wc-summary { grid-template-columns: 1fr 1fr; }

  .modal-sheet {
    width: 95%;
    max-width: none;
    border-radius: 16px;
    max-height: 90vh;
  }

  .detail-sheet {
    width: 95%;
    max-width: none;
    border-radius: 16px;
    max-height: 92vh;
  }

  .detail-title { font-size: 16px; }

  .btn-logout { bottom: 16px; right: 16px; width: 40px; height: 40px; }
}

/* ── Responsive: Small Phone ≤ 419px ──────────────────────────────────────
   DESIGN.md: hero typography drops to 28px */

@media (max-width: 419px) {
  .greeting-text { font-size: 20px; }

  .auth-card { padding: var(--space-xl) var(--space-md); }
  .auth-logo { font-size: 28px; }

  .hotspot-title { font-size: 15px; }
  .hotspot-desc { font-size: 13px; }

  .wc-val { font-size: 24px; }

  .top-section { padding: 12px 0; }
}

/* ── LLM Settings Modal ────────────────────────────────────────────────── */

.llm-hint {
  font-size: 14px; color: var(--ink-muted);
  margin-bottom: var(--space-md); line-height: 1.47;
}

/* Provider presets */
.llm-presets {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: var(--space-lg);
}

.preset-lbl {
  font-size: 13px; color: var(--ink-muted); margin-right: 2px;
}

.preset-chip {
  padding: 5px 12px;
  font-family: var(--font-body);
  font-size: 13px; font-weight: 400;
  color: var(--primary);
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.preset-chip:hover {
  background: rgba(0, 102, 204, 0.06);
}

.preset-chip:active {
  background: var(--primary);
  color: #fff;
}

.field-lbl {
  display: block;
  font-size: 14px; font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: -0.022em;
}

.llm-actions {
  display: flex; gap: 10px;
  margin-top: var(--space-lg);
}

.llm-status {
  margin-top: var(--space-md);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px; text-align: center;
  animation: fadeUp 0.3s ease;
}

.llm-status.success {
  background: #f0fdf4; color: #166534;
  border: 1px solid #bbf7d0;
}

.llm-status.error {
  background: #fef2f2; color: #991b1b;
  border: 1px solid #fecaca;
}

/* ── Hotspot Detail Sheet ──────────────────────────────────────────────── */

.detail-sheet {
  background: var(--canvas);
  border-radius: 20px;
  width: 90%; max-width: 720px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: sheetIn var(--ease-spring);
}

.detail-top {
  display: flex; align-items: center;
  padding: 16px 20px;
  border-bottom: 0.5px solid var(--hairline);
  flex-shrink: 0;
}

.detail-title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 600;
  letter-spacing: -0.011em;
  color: var(--ink);
  flex: 1; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.detail-top-spacer { width: 44px; flex-shrink: 0; }

.detail-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Loading spinner */
.detail-loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 20px; gap: 16px;
}

.loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--hairline);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Detail sections */
.detail-cached {
  text-align: center;
  font-size: 12px; color: var(--ink-muted);
  margin-bottom: var(--space-lg);
  padding: 4px 12px;
  background: var(--canvas-parchment);
  border-radius: var(--radius-pill);
  display: inline-block;
}

.detail-section {
  margin-bottom: var(--space-lg);
  animation: fadeUp 0.35s ease both;
}

.detail-section:nth-child(1) { animation-delay: 0.05s; }
.detail-section:nth-child(2) { animation-delay: 0.10s; }
.detail-section:nth-child(3) { animation-delay: 0.15s; }
.detail-section:nth-child(4) { animation-delay: 0.20s; }
.detail-section:nth-child(5) { animation-delay: 0.25s; }
.detail-section:nth-child(6) { animation-delay: 0.30s; }

.detail-section h4 {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.022em;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--hairline);
}

.detail-section p,
.detail-section .sec-text {
  font-size: 15px; line-height: 1.6;
  color: var(--ink);
  white-space: pre-line;
}

.detail-section ul {
  list-style: none; padding: 0; margin: 0;
}

.detail-section ul li {
  font-size: 15px; line-height: 1.6;
  color: var(--ink);
  padding: 4px 0 4px 16px;
  position: relative;
}

.detail-section ul li::before {
  content: "•";
  color: var(--primary);
  position: absolute; left: 0;
  font-weight: 600;
}

.detail-source {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: var(--space-lg);
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 15px; font-weight: 500;
  text-decoration: none;
  transition: opacity var(--ease-out), transform var(--ease-out);
  animation: fadeUp 0.35s ease 0.35s both;
}

.detail-source:hover {
  opacity: 0.92; text-decoration: none; color: #fff;
}

.detail-source:active { transform: scale(0.95); }

.detail-error {
  text-align: center; padding: 40px 20px;
}

.detail-error .empty-icon {
  font-size: 3rem; margin-bottom: 12px;
}

.detail-error p {
  font-size: 15px; color: var(--ink-muted);
  line-height: 1.5;
}

/* ── Markdown 渲染 ──────────────────────────────────────────────────── */

.md-body h2 {
  font-size: 18px; font-weight: 600; color: var(--ink);
  margin: 0 0 10px; padding-bottom: 8px;
  border-bottom: 0.5px solid var(--hairline);
}

.md-body h3 {
  font-size: 16px; font-weight: 600; color: var(--ink);
  margin: 16px 0 8px;
}

.md-body p {
  font-size: 15px; line-height: 1.7; color: var(--ink);
  margin: 0 0 10px;
}

.md-body ul, .md-body ol {
  margin: 8px 0; padding-left: 20px;
}

.md-body li {
  font-size: 15px; line-height: 1.7; color: var(--ink);
  margin-bottom: 4px;
}

.md-body strong {
  font-weight: 600; color: var(--ink);
}

.md-body code {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 13px; background: var(--canvas-parchment);
  padding: 2px 6px; border-radius: 4px;
  color: var(--primary);
}

.md-body pre {
  background: #1e1e1e; color: #d4d4d4;
  padding: 14px 16px; border-radius: 12px;
  overflow-x: auto; margin: 10px 0;
}

.md-body pre code {
  background: none; padding: 0; color: inherit;
  font-size: 13px; line-height: 1.6;
}

.md-body a {
  color: var(--primary); text-decoration: none;
}

.md-body a:hover {
  text-decoration: underline;
}

.md-body blockquote {
  border-left: 3px solid var(--primary);
  margin: 10px 0; padding: 4px 14px;
  color: var(--ink-muted); font-style: italic;
}

.md-body img {
  max-width: 100%; border-radius: 10px; margin: 8px 0;
}

.md-body hr {
  border: none; border-top: 0.5px solid var(--hairline);
  margin: 16px 0;
}

/* ── Accessibility ────────────────────────────────────────────────────── */

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

/* Focus ring for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--primary-focus);
  outline-offset: 2px;
}
