:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-deep: #ffffff;
  --surface: rgba(255, 255, 255, 0.58);
  --surface-solid: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.42);
  --text: #1d1d1f;
  --text-soft: #3a3a3c;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);
  --accent: #0071e3;
  --accent-strong: #0066cc;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --danger: #d70015;
  --danger-soft: #fff2f3;
  --danger-line: #ffd0d5;
  --ok: #1a7f37;
  --warn: #9a6700;
  --warn-soft: #fff9e6;
  --warn-line: #f3dfa2;
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 12px 36px rgba(0, 0, 0, 0.07);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "Segoe UI Variable", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei UI", system-ui, sans-serif;
}

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

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.84)),
    url("/static/wallpaper.png") center top / cover no-repeat fixed,
    var(--bg);
  background-attachment: fixed, fixed, fixed;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
}

::selection {
  color: var(--text);
  background: var(--accent-soft);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
  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;
}

/* ---------- 登录 / 错误页 ---------- */

.auth-page {
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.auth-page .site-main {
  display: grid;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  place-items: center;
}

.auth-shell {
  width: 100%;
  max-width: 460px;
}

.auth-card {
  position: relative;
  padding: 38px 36px 30px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.auth-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  content: "";
  background: linear-gradient(90deg, #2563eb, #0ea5e9, #22c55e);
}

.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  min-width: 0;
}

.brand--auth {
  justify-content: center;
  margin-bottom: 18px;
}

.brand-mark {
  display: inline-grid;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  color: #fff;
  place-items: center;
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.3);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-copy p {
  margin: 2px 0 0;
  overflow: hidden;
  font-size: 12.5px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-card h1 {
  margin: 0;
  font-size: clamp(25px, 4vw, 30px);
  font-weight: 750;
  letter-spacing: -0.03em;
  text-align: center;
}

.auth-subtitle {
  margin: 9px 0 24px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form label {
  font-size: 13px;
  font-weight: 650;
  color: var(--text-soft);
}

.auth-form input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-form input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.auth-form .btn {
  margin-top: 8px;
}

.fineprint {
  margin: 20px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.error-card {
  text-align: center;
}

.error-code {
  margin: 0;
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.04em;
}

.error-card h1 {
  margin-top: 14px;
}

.error-card .auth-subtitle {
  margin-bottom: 22px;
}

/* ---------- 主界面 ---------- */

.app-page {
  padding: 0 24px 20px;
}

.topbar {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1240px;
  padding: 22px 0 18px;
  margin: 0 auto;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 0 0 auto;
}

.model-pill {
  max-width: 220px;
  padding: 6px 11px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 999px;
}

.topbar form {
  margin: 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 0.97fr);
  gap: 18px;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
}

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

.panel-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

textarea {
  width: 100%;
  min-height: 388px;
  padding: 15px 16px;
  color: var(--text);
  line-height: 1.75;
  resize: vertical;
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea::placeholder {
  color: var(--muted);
  opacity: 0.9;
}

textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 13%, transparent);
}

.input-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
}

.counter {
  flex: 0 0 auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.counter.is-near {
  color: var(--warn);
}

.counter.is-full {
  font-weight: 700;
  color: var(--danger);
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 15px;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.2;
  color: var(--text-soft);
  white-space: nowrap;
  background: var(--surface-solid);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: background-color 0.16s ease, border-color 0.16s ease,
    color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.btn:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--accent);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.24);
}

.btn-primary:hover:not(:disabled) {
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.32);
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 12.5px;
}

.btn-block {
  width: 100%;
}

.voice-btn svg {
  width: 14px;
  height: 14px;
}

.voice-btn.is-listening {
  color: #fff;
  background: #ef4444;
  border-color: #ef4444;
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.14);
  animation: voice-pulse 1.2s ease-in-out infinite;
}

@keyframes voice-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(239, 68, 68, 0.04);
  }
}

.voice-toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 100;
  max-width: min(90vw, 460px);
  padding: 10px 15px;
  font-size: 13px;
  color: var(--text);
  text-align: center;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(31, 64, 135, 0.18);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}

.voice-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.voice-toast.is-error {
  color: var(--danger);
  background: rgba(255, 245, 244, 0.9);
  border-color: var(--danger-line);
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.ocr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.ocr-status {
  font-size: 12.5px;
  color: var(--muted);
}

.ocr-status.is-ok {
  color: var(--ok);
}

.ocr-status.is-error {
  color: var(--danger);
}

.ocr-preview {
  max-width: 100%;
  max-height: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.field-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.copy-helper {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.result-panel {
  position: relative;
  min-height: 540px;
}

.empty-state {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  padding: 28px;
  text-align: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-md);
}

.empty-state p {
  margin: 10px 0 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--text-soft);
}

.empty-state span:last-child {
  font-size: 12.5px;
  color: var(--muted);
}

.empty-icon {
  display: grid;
  width: 54px;
  height: 54px;
  color: var(--accent);
  place-items: center;
  background: var(--accent-soft);
  border-radius: 16px;
}

.empty-icon svg {
  width: 29px;
  height: 29px;
}

.answer {
  flex: 1;
  min-height: 380px;
  max-height: 560px;
  padding: 17px 18px;
  margin: 0;
  overflow: auto;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
}

.notice {
  flex: 1 1 220px;
  font-size: 12px;
  color: var(--warn);
  text-align: right;
}

.alert {
  padding: 12px 14px;
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-sm);
}

.result-panel > .alert {
  margin-top: 12px;
  margin-bottom: 0;
}

.page-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1240px;
  padding: 16px 2px 0;
  margin: 0 auto;
  font-size: 11.5px;
  color: var(--muted);
}

.footer-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .result-panel {
    min-height: 0;
  }

  .empty-state,
  .answer {
    min-height: 250px;
  }
}

@media (max-width: 640px) {
  .app-page {
    padding: 0 14px 16px;
  }

  .topbar {
    align-items: flex-start;
    padding-top: 16px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .brand-mark svg {
    width: 22px;
    height: 22px;
  }

  .brand-copy h1 {
    font-size: 17px;
  }

  .brand-copy p {
    font-size: 11.5px;
  }

  .model-pill {
    display: none;
  }

  .panel {
    padding: 16px;
  }

  .panel-head {
    align-items: flex-start;
  }

  .hint {
    max-width: 52%;
    white-space: normal;
  }

  textarea {
    min-height: 290px;
  }

  .input-toolbar {
    align-items: flex-start;
  }

  .toolbar-actions {
    gap: 6px;
  }

  .toolbar-actions .btn {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 12.5px;
  }

  .counter {
    padding-top: 10px;
  }

  .auth-card {
    padding: 30px 22px 24px;
  }

  .page-footer {
    justify-content: center;
    text-align: center;
  }
}

/* ---------- 站点导航 / 新闻 / 家庭留言 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1240px;
  padding: 13px 24px;
  margin: 0 auto;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand--nav {
  color: inherit;
  text-decoration: none;
}

.brand--nav .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.brand--nav .brand-mark svg {
  width: 21px;
  height: 21px;
}

.brand--nav .brand-copy {
  display: grid;
  gap: 0;
  line-height: 1.2;
}

.brand--nav .brand-copy strong {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand--nav .brand-copy small {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.site-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.nav-link {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.16s ease, background-color 0.16s ease;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.is-active {
  color: var(--accent-strong);
  background: var(--surface-solid);
  box-shadow: 0 3px 10px rgba(31, 64, 135, 0.08);
}

.site-user {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 0 0 auto;
}

.user-name {
  max-width: 110px;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-user form {
  margin: 0;
}

.site-main {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
}

.page-head {
  display: flex;
  gap: 22px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 28px 0 18px;
}

.page-head h1 {
  margin: 4px 0 0;
  font-size: clamp(25px, 3.4vw, 36px);
  font-weight: 780;
  letter-spacing: -0.045em;
}

.eyebrow {
  margin: 0;
  font-size: 10.5px;
  font-weight: 750;
  color: var(--accent);
  letter-spacing: 0.18em;
}

.page-subtitle {
  max-width: 720px;
  margin: 7px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}

.news-head-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 0 0 auto;
}

.category-tabs {
  display: flex;
  gap: 7px;
  padding: 5px 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex: 0 0 auto;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.category-tab:hover {
  color: var(--text);
  border-color: var(--accent);
}

.category-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  box-shadow: 0 7px 18px rgba(37, 99, 235, 0.22);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-bottom: 18px;
}

.news-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 5px 20px rgba(31, 64, 135, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.news-card:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.news-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  font-size: 11.5px;
  color: var(--muted);
}

.news-source {
  max-width: 65%;
  overflow: hidden;
  font-weight: 650;
  color: var(--accent-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-title {
  margin: 0;
  font-size: 16px;
  font-weight: 720;
  line-height: 1.45;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.news-title a {
  color: var(--text);
  text-decoration: none;
}

.news-title a:hover {
  color: var(--accent);
}

.news-summary {
  display: -webkit-box;
  margin: 9px 0 12px;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.read-more {
  margin-top: auto;
  font-size: 12px;
  font-weight: 650;
  color: var(--accent);
  text-decoration: none;
}

.read-more:hover {
  text-decoration: underline;
}

.f1-picks {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  margin: 0 0 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 20px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(38px) saturate(180%);
  -webkit-backdrop-filter: blur(38px) saturate(180%);
}

.f1-picks-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.f1-picks-copy strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.f1-picks-copy span {
  font-size: 11.5px;
  color: var(--muted);
}

.f1-pick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.f1-pick {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 7px 10px;
  font-size: 11px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.f1-pick a {
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.f1-pick a:hover {
  text-decoration: underline;
}

.source-errors {
  padding: 10px 14px;
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-sm);
}

.source-errors summary {
  cursor: pointer;
  font-weight: 650;
}

.source-errors ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.alert--warn {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: var(--warn-line);
}

.empty-state--large {
  min-height: 320px;
  background: var(--surface);
}

.chat-shell {
  display: flex;
  flex-direction: column;
  height: min(64vh, 620px);
  min-height: 420px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}

.chat-empty p {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: var(--text-soft);
}

.chat-empty span {
  font-size: 12px;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: min(78%, 620px);
  animation: message-in 0.18s ease both;
}

.chat-message.no-animate {
  animation: none;
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.is-mine {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-message-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 4px;
  font-size: 10.5px;
  color: var(--muted);
}

.chat-sender {
  font-weight: 700;
  color: var(--text-soft);
}

.chat-bubble {
  padding: 10px 13px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 4px 14px 14px 14px;
}

.chat-message.is-mine .chat-bubble {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  border-radius: 14px 4px 14px 14px;
}

.chat-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 12px 14px;
  background: var(--surface-solid);
  border-top: 1px solid var(--line);
}

.chat-form textarea {
  flex: 1;
  min-height: 44px;
  max-height: 140px;
  padding: 10px 12px;
  line-height: 1.55;
  resize: none;
  border-radius: 12px;
}

.chat-form .btn {
  min-height: 44px;
}

.chat-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-solid);
  border-top: 1px solid var(--line);
}

.chat-status {
  min-height: 14px;
  color: var(--ok);
}

.chat-status.is-error {
  color: var(--danger);
}

@media (max-width: 860px) {
  .news-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 11px 14px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .site-user {
    margin-left: auto;
  }

  .page-head {
    align-items: flex-start;
    padding-top: 20px;
  }

  .page-head--news {
    flex-direction: column;
    gap: 10px;
  }

  .news-head-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 560px) {
  .site-header {
    align-items: center;
  }

  .brand--nav .brand-copy small {
    display: none;
  }

  .nav-link {
    padding: 7px 11px;
    font-size: 12.5px;
  }

  .chat-shell {
    height: 66vh;
    min-height: 380px;
    border-radius: 16px;
  }

  .chat-messages {
    padding: 13px;
  }

  .chat-message {
    max-width: 88%;
  }

  .chat-form {
    padding: 10px;
  }

  .chat-footer .hint {
    display: none;
  }
}

/* ---------- 首页：Apple 液态玻璃布局 ---------- */

.home-hero {
  position: relative;
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 34px 34px 30px;
  margin: 22px 0 18px;
  overflow: hidden;
  background:
    radial-gradient(640px 260px at 10% -20%, rgba(94, 132, 255, 0.26), transparent 70%),
    radial-gradient(520px 240px at 100% 0%, rgba(186, 104, 255, 0.18), transparent 72%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 32px;
  box-shadow:
    0 26px 70px rgba(37, 64, 143, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
}

.home-hero::after {
  position: absolute;
  top: -80px;
  right: 6%;
  width: 220px;
  height: 220px;
  content: "";
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55), transparent 68%);
  border-radius: 50%;
  pointer-events: none;
}

.home-hero > div {
  min-width: 0;
}

.home-hero h1 {
  max-width: 780px;
  margin: 7px 0 0;
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 760;
  line-height: 1.08;
  letter-spacing: -0.06em;
  overflow-wrap: anywhere;
}

.hero-status {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 7px;
  align-items: center;
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.home-section {
  padding: 6px 0 4px;
}

.section-head {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px 0 8px;
}

.section-head h2 {
  margin: 4px 0 0;
  font-size: clamp(21px, 2.6vw, 28px);
  font-weight: 740;
  letter-spacing: -0.035em;
}

.section-head--inline {
  align-items: center;
  padding: 0 0 12px;
}

.text-link {
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--accent);
  text-decoration: none;
}

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

.section-links {
  display: flex;
  flex: 0 0 auto;
  gap: 14px;
  align-items: center;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 8px 0 18px;
}

.video-card {
  padding: 22px;
  background:
    radial-gradient(440px 200px at 0% 0%, rgba(99, 132, 255, 0.14), transparent 72%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.28));
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 24px;
  box-shadow:
    0 16px 42px rgba(31, 64, 135, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
}

.video-icon {
  display: grid;
  width: 44px;
  height: 44px;
  color: var(--accent);
  place-items: center;
  background: var(--accent-soft);
  border-radius: 14px;
}

.video-icon svg {
  width: 24px;
  height: 24px;
}

.video-card h2 {
  margin: 14px 0 5px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.video-card p {
  min-height: 42px;
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--muted);
}

.video-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.notice-card {
  padding: 14px 16px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid var(--line);
  border-radius: 16px;
}

@media (max-width: 980px) {
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .video-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .section-links {
    gap: 8px;
  }

  .section-links .text-link {
    font-size: 11.5px;
  }
}

.home-news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.news-card--compact {
  padding: 15px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.28));
  border-color: rgba(255, 255, 255, 0.64);
  border-radius: 20px;
  box-shadow:
    0 12px 34px rgba(31, 64, 135, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

.news-card--compact .news-title {
  font-size: 14.5px;
}

.news-card--compact .news-summary {
  -webkit-line-clamp: 2;
  margin-bottom: 0;
}

.glass-empty {
  padding: 38px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 22px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.glass-empty p {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}

.glass-empty span {
  font-size: 12px;
  color: var(--muted);
}

.home-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  padding: 22px 0 8px;
}

.glass-panel {
  min-width: 0;
  padding: 20px;
  background:
    radial-gradient(520px 220px at 0% 0%, rgba(99, 132, 255, 0.12), transparent 70%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.26));
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 28px;
  box-shadow:
    0 22px 58px rgba(31, 64, 135, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
}

.chat-shell--compact {
  height: 350px;
  min-height: 0;
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.assistant-embed-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assistant-input {
  min-height: 104px;
  max-height: 180px;
  padding: 12px 13px;
  line-height: 1.65;
  background: rgba(255, 255, 255, 0.44);
  border-color: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
}

.assistant-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.result-panel--compact {
  min-height: 0;
  padding: 0;
  margin-top: 2px;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.empty-state--compact {
  min-height: 104px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.6);
}

.answer--compact {
  min-height: 104px;
  max-height: 190px;
  padding: 12px 13px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.38);
  border-color: rgba(255, 255, 255, 0.68);
  border-radius: 16px;
}

.result-panel--compact .result-actions {
  padding-top: 8px;
}

/* 白色液态玻璃：更厚的模糊 + 更轻的白色 */
.panel,
.news-card,
.site-header,
.home-hero,
.glass-panel,
.news-card--compact,
.video-card,
.auth-card,
.chat-shell {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.5));
  border-color: rgba(255, 255, 255, 0.86);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(46px) saturate(190%);
  -webkit-backdrop-filter: blur(46px) saturate(190%);
}

.site-header {
  background: rgba(255, 255, 255, 0.58);
}

.home-hero {
  background:
    radial-gradient(620px 260px at 8% -20%, rgba(0, 113, 227, 0.08), transparent 70%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.55));
}

.hero-side {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.online-card {
  min-width: 190px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 16px;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(34px) saturate(180%);
  -webkit-backdrop-filter: blur(34px) saturate(180%);
}

.online-card-top {
  display: flex;
  gap: 16px;
  align-items: baseline;
  justify-content: space-between;
}

.online-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.online-card-top strong {
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.online-devices {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 5px;
}

.online-device {
  font-size: 10.5px;
  color: var(--text-soft);
  white-space: nowrap;
}

.online-card.is-live .status-dot {
  background: #34c759;
}

.hero-status {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.84);
}

.category-tab,
.model-pill,
.source-errors,
.notice-card,
.glass-empty {
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
}

/* AI 助手完整对话页 */
.assistant-page {
  display: grid;
  gap: 14px;
  width: min(100%, 980px);
  margin: 0 auto;
}

.assistant-head {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px;
}

.assistant-head-copy h1 {
  margin: 4px 0 6px;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.assistant-head-copy p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.assistant-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.select-wrap {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 7px 10px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.select-wrap select {
  max-width: 170px;
  padding: 0;
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}

.thinking-toggle {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 8px 11px;
  font-size: 11px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.thinking-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.assistant-chat {
  display: flex;
  flex-direction: column;
  min-height: 580px;
  max-height: calc(100vh - 250px);
  overflow: hidden;
}

.chat-log {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 16px;
  min-height: 320px;
  padding: 22px 22px 8px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  max-width: 88%;
}

.chat-message--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-avatar {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  font-size: 9.5px;
  font-weight: 800;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.chat-message--user .chat-avatar {
  color: #fff;
  background: var(--accent);
  border-color: transparent;
}

.chat-message-body {
  min-width: 0;
}

.chat-bubble {
  padding: 12px 15px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px 18px 18px 7px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.045);
}

.chat-bubble p {
  margin: 0 0 7px;
}

.chat-bubble p:last-child {
  margin-bottom: 0;
}

.chat-message--user .chat-bubble {
  color: #fff;
  background: var(--accent);
  border-color: transparent;
  border-radius: 18px 18px 7px 18px;
  box-shadow: 0 10px 24px rgba(0, 113, 227, 0.18);
}

.chat-message-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 18px;
  padding: 4px 4px 0;
  font-size: 10px;
  color: var(--muted);
}

.chat-message--user .chat-message-meta {
  justify-content: flex-end;
}

.chat-copy {
  padding: 0;
  font: inherit;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.chat-copy:hover {
  color: var(--accent);
}

.chat-message--typing .chat-bubble {
  color: var(--muted);
  animation: chatPulse 1.3s ease-in-out infinite;
}

@keyframes chatPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.chat-status {
  min-height: 18px;
  padding: 0 24px;
  font-size: 11px;
  color: var(--muted);
}

.chat-status.is-warn { color: var(--warn); }
.chat-status.is-ok { color: var(--ok); }

.chat-composer {
  padding: 10px 14px 14px;
  border-top: 1px solid var(--line);
}

.chat-composer textarea {
  width: 100%;
  min-height: 74px;
  max-height: 180px;
  padding: 12px 14px;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
  resize: vertical;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
}

.chat-composer textarea:focus {
  border-color: rgba(0, 113, 227, 0.45);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.08);
}

.chat-composer-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding-top: 9px;
}

.chat-composer-tools,
.chat-composer-send {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.char-count {
  font-size: 10.5px;
  color: var(--muted);
}

.char-count.is-near {
  color: var(--warn);
}

.ocr-status {
  padding: 0 20px 12px;
  font-size: 11px;
  color: var(--muted);
}

.assistant-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  padding: 0 4px;
  font-size: 11px;
  color: var(--muted);
}

.assistant-tips button {
  padding: 6px 10px;
  font: inherit;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.assistant-tips button:hover {
  color: var(--accent);
  border-color: rgba(0, 113, 227, 0.28);
}

.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;
}

@media (max-width: 760px) {
  .assistant-head {
    flex-direction: column;
    padding: 18px;
  }

  .assistant-head-actions {
    justify-content: flex-start;
  }

  .assistant-chat {
    min-height: 66vh;
    max-height: none;
  }

  .chat-message {
    max-width: 94%;
  }

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

@media (max-width: 1080px) {
  .home-news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .home-bottom {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-shell--compact {
    height: 330px;
  }
}

@media (max-width: 640px) {
  .home-hero {
    align-items: flex-start;
    padding: 24px 20px;
    margin-top: 14px;
    border-radius: 24px;
  }

  .home-hero h1 {
    font-size: 34px;
  }

  .hero-status {
    display: none;
  }

  .hero-side {
    width: 100%;
    align-items: stretch;
  }

  .f1-picks {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .f1-pick-links {
    justify-content: flex-start;
  }

  .online-card {
    min-width: 0;
    width: 100%;
  }

  .home-news-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .glass-panel {
    padding: 15px;
    border-radius: 22px;
  }

  .section-head {
    align-items: center;
  }

  .section-head .text-link {
    max-width: 45%;
    text-align: right;
  }
}

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

