:root {
  color-scheme: light;
  --ink: #171b21;
  --muted: #767d87;
  --paper: #f7f8f5;
  --white: #fff;
  --line: rgba(23, 27, 33, 0.1);
  --blue: #2765d7;
  --amber: #c98a13;
  --green: #3f8168;
  --font: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --serif: "Songti SC", "STSong", serif;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 27, 33, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 27, 33, 0.02) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
img { display: block; }

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1160px, calc(100% - 48px));
  height: 82px;
  margin: 0 auto;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 0.06em;
}

.header-brand img {
  border-radius: 11px;
  box-shadow: 0 5px 16px rgba(31, 43, 59, 0.12);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 38px);
  color: #6d747d;
  font-size: 12px;
}

.site-header nav a {
  position: relative;
  padding: 8px 0;
}

.site-header nav a::after {
  position: absolute;
  right: 0;
  bottom: 3px;
  left: 0;
  height: 1px;
  background: var(--ink);
  content: "";
  transform: scaleX(0);
  transition: transform 180ms ease;
}

.site-header nav a:hover::after { transform: scaleX(1); }

.search-layout,
.section-layout {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
}

.search-layout { padding: 72px 0 90px; }
.section-layout { padding: 58px 0 100px; }

.search-heading {
  width: min(100%, 780px);
  margin: 0 auto 56px;
  text-align: center;
}

.section-kicker {
  margin: 0 0 15px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.23em;
}

.search-heading h1,
.section-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.045em;
}

.search-heading h1 { font-size: clamp(34px, 5.4vw, 58px); }

.result-search-form {
  display: flex;
  align-items: center;
  width: min(100%, 680px);
  min-height: 62px;
  margin: 32px auto 0;
  padding: 7px 7px 7px 21px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 48px rgba(31, 43, 59, 0.09);
}

.result-search-form > img { opacity: 0.58; }

.result-search-form input {
  min-width: 0;
  flex: 1;
  height: 46px;
  padding: 0 15px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
}

.result-search-form button {
  height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: var(--ink);
  cursor: pointer;
  font-size: 12px;
}

.result-shell {
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.69);
  box-shadow: 0 22px 70px rgba(31, 43, 59, 0.07);
}

.result-meta {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--line);
}

.result-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.result-meta h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 650;
  letter-spacing: -0.04em;
}

.result-count,
.group-count {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
  font-size: 10px;
}

.result-count { padding: 8px 12px; }

.result-groups {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.result-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.result-group-product { --group-color: var(--blue); }
.result-group-document { --group-color: var(--amber); }
.result-group-discussion { --group-color: var(--green); }

.group-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.group-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--group-color) 10%, white);
}

.group-head h3,
.group-head p { margin: 0; }
.group-head h3 { font-size: 14px; }
.group-head p { margin-top: 3px; color: var(--muted); font-size: 10px; }
.group-count { margin-left: auto; padding: 6px 9px; }

.result-list { display: grid; }

.result-item {
  position: relative;
  display: block;
  padding: 18px 58px 18px 20px;
  border-bottom: 1px solid var(--line);
  transition: background 160ms ease;
}

.result-item:last-child { border-bottom: 0; }
.result-item:hover { background: rgba(247, 248, 245, 0.78); }

.item-meta {
  display: block;
  margin-bottom: 7px;
  color: var(--group-color);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.result-item strong {
  display: block;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.result-item p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.item-arrow {
  position: absolute;
  top: 50%;
  right: 22px;
  color: #9da2a8;
  transform: translateY(-50%);
  transition: color 160ms ease, transform 160ms ease;
}

.result-item:hover .item-arrow {
  color: var(--group-color);
  transform: translate(3px, -50%);
}

.empty-state {
  padding: 66px 20px;
  text-align: center;
}

.empty-state h3 { margin: 0; font-size: 20px; }
.empty-state p { margin: 11px auto 20px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.suggestions a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 11px; }
.suggestions a:hover { border-color: var(--blue); color: var(--blue); }

.section-page { --accent: var(--blue); --accent-soft: rgba(39, 101, 215, 0.09); }
.section-page.library-theme { --accent: var(--amber); --accent-soft: rgba(201, 138, 19, 0.1); }
.section-page.forum-theme { --accent: var(--green); --accent-soft: rgba(63, 129, 104, 0.1); }

.section-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(36px, 6vw, 70px);
  border: 1px solid var(--line);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 22px 70px rgba(31, 43, 59, 0.07);
}

.section-hero::after {
  position: absolute;
  top: -140px;
  right: -80px;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 68%);
  content: "";
  pointer-events: none;
}

.section-hero .section-kicker { color: var(--accent); }
.section-hero h1 { max-width: 650px; font-size: clamp(40px, 6vw, 72px); }

.section-intro {
  max-width: 620px;
  margin: 22px 0 0;
  color: #626a74;
  font-size: 14px;
  line-height: 1.9;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 29px;
}

.section-actions a {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.section-actions a:first-child {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.section-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
  margin-top: 18px;
}

.preview-panel,
.status-panel {
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.64);
}

.panel-label {
  display: block;
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.17em;
}

.preview-panel h2,
.status-panel h2 { margin: 0; font-size: 21px; letter-spacing: -0.03em; }
.preview-panel p,
.status-panel p { margin: 11px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }

.field-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 24px;
}

.field-preview span {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: #676f78;
  background: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 25px;
  color: var(--muted);
  font-size: 11px;
}

.status-line i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 34px;
  border-top: 1px solid var(--line);
  color: #8b9198;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.site-footer a:hover { color: var(--ink); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(39, 101, 215, 0.28);
  outline-offset: 3px;
}

@media (max-width: 700px) {
  .site-header {
    width: calc(100% - 36px);
    height: 70px;
  }

  .header-brand strong { display: none; }
  .site-header nav { gap: 14px; font-size: 10px; }
  .search-layout, .section-layout { width: calc(100% - 32px); }
  .search-layout { padding: 50px 0 70px; }
  .section-layout { padding: 35px 0 70px; }
  .search-heading { margin-bottom: 34px; }
  .result-search-form { min-height: 58px; padding-left: 17px; }
  .result-search-form input { font-size: 14px; }
  .result-search-form button { padding: 0 16px; }
  .result-shell { padding: 17px; border-radius: 23px; }
  .result-meta { align-items: start; }
  .result-count { margin-top: 2px; }
  .group-head { padding: 15px; }
  .result-item { padding: 16px 43px 16px 16px; }
  .item-arrow { right: 16px; }
  .section-hero { padding: 32px 25px; border-radius: 26px; }
  .section-grid { grid-template-columns: 1fr; }
  .preview-panel, .status-panel { border-radius: 22px; }
  .site-footer { width: calc(100% - 36px); }
}

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

/* 统一搜索工作表 */
.search-sheet-page {
  --sheet-green: #287a52;
  --sheet-green-soft: #eaf4ee;
  --sheet-blue: #2765d7;
  --sheet-blue-soft: #edf3ff;
  --sheet-red: #b95348;
  --sheet-red-soft: #fbefed;
  background:
    radial-gradient(circle at 86% 8%, rgba(40, 122, 82, 0.08), transparent 24%),
    linear-gradient(rgba(23, 27, 33, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 27, 33, 0.02) 1px, transparent 1px),
    #f2f4f1;
  background-size: auto, 36px 36px, 36px 36px, auto;
}

.sheet-site-header,
.search-sheet-page .site-footer {
  width: min(1240px, calc(100% - 48px));
}

.sheet-search-layout {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 58px 0 92px;
}

.sheet-search-hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(420px, 1.25fr);
  align-items: end;
  gap: clamp(34px, 6vw, 92px);
}

.sheet-heading-copy h1,
.sheet-heading-copy p {
  margin: 0;
}

.sheet-heading-copy h1 {
  font-family: var(--serif);
  font-size: clamp(37px, 5vw, 62px);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.sheet-heading-copy > p:last-child {
  margin-top: 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.sheet-search-form {
  display: flex;
  align-items: center;
  min-height: 62px;
  padding: 7px 7px 7px 21px;
  border: 1px solid rgba(23, 27, 33, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 46px rgba(31, 43, 59, 0.08);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.sheet-search-form:focus-within {
  border-color: rgba(40, 122, 82, 0.5);
  box-shadow: 0 18px 54px rgba(40, 122, 82, 0.11), 0 0 0 4px rgba(40, 122, 82, 0.07);
}

.sheet-search-form > img { opacity: 0.56; }

.sheet-search-form input {
  min-width: 0;
  flex: 1;
  height: 46px;
  padding: 0 15px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.sheet-search-form button {
  height: 46px;
  padding: 0 19px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: #1c2229;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: background 180ms ease, transform 180ms ease;
}

.sheet-search-form button:hover {
  background: var(--sheet-green);
  transform: translateX(2px);
}

.source-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 38px 0 14px;
}

.source-chip {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(23, 27, 33, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.source-chip img { flex: 0 0 auto; }
.source-chip > span { min-width: 0; }
.source-chip strong,
.source-chip small { display: block; }
.source-chip strong { font-size: 11px; }
.source-chip small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.ai-assist {
  position: relative;
  overflow: hidden;
  margin: 0 0 14px;
  border: 1px solid rgba(23, 27, 33, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.96), rgba(240, 245, 241, 0.9)),
    #fff;
  box-shadow: 0 13px 38px rgba(31, 43, 59, 0.07);
}

.ai-assist::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #1f6d49 0 72%, #d39a2f 72% 82%, #171b21 82% 100%);
  content: "";
}

.ai-assist-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 16px 18px 14px;
}

.ai-assist-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  background: #18221d;
  box-shadow: 0 8px 20px rgba(24, 34, 29, 0.16);
}

.ai-assist-mark span {
  font-family: Georgia, serif;
  font-size: 13px;
  font-style: italic;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.ai-assist-mark i {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ca39f;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.ai-assist[data-state="ready"] .ai-assist-mark i {
  background: #69d39b;
  box-shadow: 0 0 0 3px rgba(105, 211, 155, 0.15);
}

.ai-assist[data-state="busy"] .ai-assist-mark i {
  background: #e0a63e;
  box-shadow: 0 0 0 3px rgba(224, 166, 62, 0.16);
  animation: ai-status-pulse 1.1s ease-in-out infinite;
}

.ai-assist[data-state="error"] .ai-assist-mark i,
.ai-assist[data-state="offline"] .ai-assist-mark i { background: #c26a61; }

.ai-assist-copy { min-width: 0; }
.ai-assist-kicker {
  display: block;
  margin-bottom: 4px;
  color: #2b7753;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.ai-assist-copy h2,
.ai-assist-copy p { margin: 0; }
.ai-assist-copy h2 { font-size: 14px; letter-spacing: -0.015em; }
.ai-assist-copy p {
  margin-top: 4px;
  overflow: hidden;
  color: #757d77;
  font-size: 9px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-assist-trigger {
  min-width: 108px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #1c2229;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.03em;
  transition: background 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.ai-assist-trigger:hover:not(:disabled) {
  background: var(--sheet-green);
  transform: translateY(-1px);
}

.ai-assist-trigger:disabled {
  color: #909792;
  background: #e7ebe8;
  cursor: not-allowed;
}

.ai-assist-panel {
  padding: 0 18px 18px;
  border-top: 1px solid #dce2dd;
  background:
    linear-gradient(rgba(40, 122, 82, 0.022) 1px, transparent 1px),
    rgba(251, 252, 250, 0.94);
  background-size: 100% 32px;
  animation: ai-panel-in 220ms ease both;
}

.ai-assist-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 8px 0;
  border-bottom: 1px solid #e1e5e2;
  color: #687069;
  font-size: 9px;
}

.ai-assist-context-copy {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ai-assist-context-copy > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  font-weight: 700;
}

.ai-assist-context-copy > span i {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: #d39a2f;
}

.ai-assist-context-copy strong {
  min-width: 0;
  overflow: hidden;
  color: #2b312d;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-assist-context-copy small {
  flex: 0 0 auto;
  color: #969c97;
  font-size: 8px;
}

.ai-assist-actions {
  display: flex;
  gap: 7px;
  flex: 0 0 auto;
}

.ai-assist-actions button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #d5ddd7;
  border-radius: 9px;
  color: #59615b;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.ai-assist-actions button:first-child {
  border-color: rgba(40, 122, 82, 0.2);
  color: #226b49;
  background: #eaf4ee;
}

.ai-assist-actions button:hover {
  border-color: var(--sheet-green);
  color: var(--sheet-green);
  background: #fff;
}

.ai-assist-messages {
  display: grid;
  gap: 10px;
  max-height: 520px;
  padding: 16px 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.ai-message {
  width: min(100%, 920px);
  border: 1px solid #dfe4e0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.ai-message-user {
  width: max-content;
  max-width: min(82%, 720px);
  margin-left: auto;
  border-color: #2d7654;
  color: #fff;
  background: #2d7654;
}

.ai-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px 0;
}

.ai-message-head strong {
  color: #256744;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ai-message-head small { color: #969c97; font-size: 8px; }
.ai-message-user .ai-message-head { display: none; }

.ai-message-body {
  padding: 10px 13px 13px;
  color: #303733;
  font-size: 12px;
  line-height: 1.82;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ai-message-user .ai-message-body {
  padding: 10px 13px;
  color: #fff;
  font-size: 11px;
  line-height: 1.65;
}

.ai-message-error {
  border-color: rgba(185, 83, 72, 0.28);
  background: var(--sheet-red-soft);
}

.ai-message-error .ai-message-head strong,
.ai-message-error .ai-message-body { color: #97483f; }

.ai-citations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 13px 13px;
}

.ai-citations > span {
  width: 100%;
  color: #969c97;
  font-size: 8px;
  letter-spacing: 0.06em;
}

.ai-citations a,
.ai-citations em {
  max-width: 100%;
  padding: 6px 9px;
  overflow: hidden;
  border: 1px solid #d9dfda;
  border-radius: 8px;
  color: #56625a;
  background: #f7f9f7;
  font-size: 9px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-citations a:hover { border-color: var(--sheet-green); color: var(--sheet-green); }

.ai-message-loading .ai-message-body {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 48px;
}

.ai-message-loading .ai-message-body i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #438363;
  animation: ai-loading 900ms ease-in-out infinite;
}

.ai-message-loading .ai-message-body i:nth-child(2) { animation-delay: 120ms; }
.ai-message-loading .ai-message-body i:nth-child(3) { animation-delay: 240ms; }

.ai-assist-form {
  padding: 14px;
  border: 1px solid #dbe1dc;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.ai-assist-form > label {
  display: block;
  margin-bottom: 8px;
  color: #677069;
  font-size: 9px;
  font-weight: 700;
}

.ai-assist-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 9px;
}

.ai-assist-composer textarea {
  width: 100%;
  min-height: 52px;
  max-height: 130px;
  padding: 10px 11px;
  resize: vertical;
  border: 1px solid #dbe0dc;
  border-radius: 10px;
  outline: 0;
  color: #29312c;
  background: #fafbfa;
  font-size: 11px;
  line-height: 1.6;
}

.ai-assist-composer textarea:focus { border-color: rgba(40, 122, 82, 0.55); }

.ai-assist-composer button {
  min-width: 70px;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--sheet-green);
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

.ai-assist-composer button:disabled { opacity: 0.45; cursor: not-allowed; }
.ai-assist-disclaimer { margin: 10px 2px 0; color: #939994; font-size: 8px; line-height: 1.6; }

@keyframes ai-panel-in {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ai-status-pulse {
  50% { opacity: 0.45; transform: scale(0.82); }
}

@keyframes ai-loading {
  50% { opacity: 0.35; transform: translateY(-3px); }
}

.workbook {
  overflow: clip;
  scroll-margin-top: 86px;
  border: 1px solid rgba(23, 27, 33, 0.14);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 72px rgba(31, 43, 59, 0.11);
  animation: workbook-in 520ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.workbook-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 12px 18px;
  color: #fff;
  background: #1f6d49;
}

.workbook-name,
.workbook-summary,
.save-state {
  display: flex;
  align-items: center;
}

.workbook-name { gap: 11px; }
.workbook-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 800;
}

.workbook-name strong,
.workbook-name small { display: block; }
.workbook-name strong { font-size: 12px; letter-spacing: 0.04em; }
.workbook-name small { margin-top: 3px; color: rgba(255, 255, 255, 0.67); font-size: 9px; }
.workbook-summary { gap: 18px; color: rgba(255, 255, 255, 0.88); font-size: 10px; }
.save-state { gap: 7px; }
.save-state i { width: 7px; height: 7px; border-radius: 50%; background: #79d8a6; box-shadow: 0 0 0 4px rgba(121, 216, 166, 0.15); }

.mobile-sheet-hint { display: none; }

.sheet-scroller {
  position: relative;
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
  outline: 0;
  overscroll-behavior-x: contain;
}

.sheet-scroller:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(40, 122, 82, 0.18);
}

.search-sheet {
  width: 100%;
  min-width: 1060px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 11px;
}

.row-number-column { width: 64px; }
.content-column { width: calc((100% - 64px) / 3); }

.search-sheet thead {
  position: sticky;
  top: 0;
  z-index: 4;
}

.search-sheet th,
.search-sheet td {
  border-right: 1px solid #dfe3df;
  border-bottom: 1px solid #dfe3df;
}

.search-sheet tr > *:last-child { border-right: 0; }

.sheet-corner {
  height: 64px;
  color: #798079;
  background: #e9eeea;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
}

.column-heading {
  position: relative;
  height: 64px;
  padding: 12px 48px 12px 16px;
  background: #f4f6f4;
  text-align: left;
}

.column-heading::before {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  content: "";
}

.heading-article::before { background: var(--sheet-blue); }
.heading-video::before { background: var(--sheet-red); }
.heading-data::before { background: var(--sheet-green); }

.column-title strong { display: block; color: #252a27; font-size: 13px; }
.column-count {
  position: absolute;
  top: 50%;
  right: 13px;
  display: grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  padding: 0 7px;
  border: 1px solid #d8ddd8;
  border-radius: 999px;
  color: #747c75;
  background: #fff;
  font-size: 9px;
  transform: translateY(-50%);
}

.sheet-row-number {
  height: 72px;
  padding: 0;
  color: #8b918c;
  background: #f4f6f4;
  font-size: 10px;
  font-weight: 550;
  text-align: center;
  vertical-align: middle;
}

.sheet-cell {
  position: relative;
  height: 72px;
  padding: 0;
  background: #fff;
  vertical-align: middle;
  transition: background 150ms ease;
}

.search-sheet tbody tr:hover .sheet-cell { background: #fbfcfb; }
.search-sheet tbody tr:hover .sheet-row-number { color: var(--sheet-green); background: #edf3ef; }

.sheet-result-link {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: 71px;
  padding: 10px 38px 10px 15px;
}

.sheet-result-link strong,
.sheet-result-link small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-result-link strong {
  color: #282e2a;
  font-size: 11px;
  font-weight: 680;
}

.sheet-result-link small {
  margin-top: 5px;
  color: #8a908b;
  font-size: 9px;
}

.cell-arrow {
  position: absolute;
  top: 50%;
  right: 14px;
  color: #abb0ac;
  font-size: 13px;
  transform: translateY(-50%);
  transition: color 150ms ease, transform 150ms ease;
}

.sheet-cell-article .sheet-result-link:hover strong,
.sheet-cell-article .sheet-result-link:hover .cell-arrow { color: var(--sheet-blue); }
.sheet-cell-video .sheet-result-link:hover strong,
.sheet-cell-video .sheet-result-link:hover .cell-arrow { color: var(--sheet-red); }
.sheet-cell-data .sheet-result-link:hover strong,
.sheet-cell-data .sheet-result-link:hover .cell-arrow { color: var(--sheet-green); }
.sheet-result-link:hover .cell-arrow { transform: translate(2px, -50%); }

.sheet-cell-data.has-grafana .sheet-result-link { padding-bottom: 19px; }
.sheet-cell-data.has-grafana .cell-arrow { top: 34%; }

.sheet-local-detail {
  position: absolute;
  right: 10px;
  bottom: 6px;
  z-index: 2;
  padding: 2px 5px;
  border-radius: 5px;
  color: #6f7872;
  background: #eef4f0;
  font-size: 8px;
  line-height: 1.4;
}

.sheet-local-detail:hover { color: #fff; background: var(--sheet-green); }

.sheet-cell.is-empty {
  padding: 0 15px;
  color: #c3c7c4;
  font-size: 10px;
  text-align: center;
}

.source-placeholder {
  display: block;
  padding: 8px 10px;
  border: 1px dashed #d7dbd7;
  border-radius: 9px;
  background: #fafbfa;
  text-align: left;
}

.source-placeholder strong,
.source-placeholder small { display: block; }
.source-placeholder strong { color: #747b76; font-size: 10px; }
.source-placeholder small { margin-top: 4px; color: #a1a6a2; font-size: 8px; }

.sheet-empty {
  min-width: 720px;
  padding: 72px 24px;
  text-align: center;
}

.sheet-empty strong { font-size: 18px; }
.sheet-empty p { margin: 10px 0 20px; color: var(--muted); font-size: 11px; }
.sheet-suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.sheet-suggestions a { padding: 7px 11px; border: 1px solid #d9ded9; border-radius: 999px; color: #687069; background: #fff; font-size: 10px; }
.sheet-suggestions a:hover { border-color: var(--sheet-green); color: var(--sheet-green); }

.workbook-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border-top: 1px solid #d8ded9;
  background: #f4f6f4;
}

.result-view-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  color: #607068;
  font-size: 10px;
  font-weight: 700;
}

.result-view-label span { width: 7px; height: 7px; border-radius: 50%; background: var(--sheet-green); }

.visible-range { justify-self: end; color: #8a918b; font-size: 9px; }

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

@media (max-width: 780px) {
  .sheet-site-header,
  .search-sheet-page .site-footer,
  .sheet-search-layout {
    width: calc(100% - 32px);
  }

  .sheet-search-layout { padding: 38px 0 68px; }
  .sheet-search-hero { grid-template-columns: 1fr; gap: 25px; }
  .sheet-heading-copy h1 { font-size: 42px; }
  .sheet-search-form { min-height: 58px; padding-left: 17px; }
  .sheet-search-form input { font-size: 13px; }
  .sheet-search-form button { padding: 0 14px; }
  .source-strip { margin-top: 26px; gap: 6px; }
  .source-chip { align-items: center; padding: 10px; }
  .source-chip img { width: 18px; height: 18px; }
  .source-chip strong { font-size: 10px; }
  .ai-assist-head {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 11px;
    padding: 14px;
  }
  .ai-assist-mark { width: 40px; height: 40px; border-radius: 11px; }
  .ai-assist-copy h2 { font-size: 13px; }
  .ai-assist-copy p { white-space: normal; }
  .ai-assist-trigger {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 44px;
  }
  .ai-assist-panel { padding: 0 14px 14px; }
  .ai-assist-context { align-items: stretch; flex-wrap: wrap; gap: 9px; padding: 10px 0; }
  .ai-assist-context-copy {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px 8px;
    width: 100%;
  }
  .ai-assist-context-copy small { grid-column: 1 / -1; }
  .ai-assist-actions { width: 100%; }
  .ai-assist-actions button { flex: 1; min-height: 44px; }
  .ai-assist-messages { max-height: none; }
  .ai-message-user { max-width: 92%; }
  .ai-message-body { font-size: 11px; }
  .ai-assist-composer { grid-template-columns: 1fr; }
  .ai-assist-composer button { min-height: 44px; }
  .ai-citations a,
  .ai-citations em { overflow-wrap: anywhere; white-space: normal; }
  .workbook { border-radius: 15px; }
  .workbook-bar { min-height: 62px; padding: 10px 12px; }
  .workbook-summary { gap: 8px; }
  .save-state { display: none; }
  .workbook-name strong { font-size: 10px; }
  .mobile-sheet-hint {
    display: block;
    padding: 8px 12px;
    border-bottom: 1px solid #d8ded9;
    color: #607068;
    background: #eef4f0;
    font-size: 9px;
    text-align: center;
  }
  .search-sheet { min-width: 920px; }
  .row-number-column { width: 54px; }
  .content-column { width: 288px; }
  .visible-range { display: none; }
}

/* 卓虎数据详情 */
.data-detail-page {
  background:
    radial-gradient(circle at 82% 12%, rgba(40, 122, 82, 0.09), transparent 25%),
    var(--paper);
}

.data-detail-layout {
  width: min(1000px, calc(100% - 48px));
  margin: 0 auto;
  padding: 54px 0 92px;
}

.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 17px;
  color: #8a908b;
  font-size: 10px;
}

.detail-breadcrumb a:hover { color: var(--ink); }

.data-detail-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 24px 72px rgba(31, 43, 59, 0.09);
}

.data-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 34px;
  padding: clamp(28px, 5vw, 54px);
  border-bottom: 1px solid var(--line);
}

.data-detail-header h1 {
  max-width: 650px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 50px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.18;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}

.detail-tags span {
  padding: 7px 10px;
  border: 1px solid rgba(40, 122, 82, 0.18);
  border-radius: 999px;
  color: #2d704d;
  background: #edf6f0;
  font-size: 9px;
}

.source-button {
  display: block;
  flex: 0 0 auto;
  padding: 12px 15px;
  border-radius: 12px;
  color: #fff;
  background: #246f4c;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.source-button:hover { background: #1b593d; }

.detail-source-actions {
  display: grid;
  flex: 0 0 auto;
  gap: 8px;
}

.source-button-secondary {
  border: 1px solid rgba(40, 122, 82, 0.22);
  color: #286d4c;
  background: #eff6f1;
}

.source-button-secondary:hover { color: #fff; background: #286d4c; }

.data-notice {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  padding: 20px clamp(28px, 5vw, 54px);
  border-bottom: 1px solid var(--line);
  background: #f5f8f5;
}

.data-notice strong { color: #2d704d; font-size: 10px; }
.data-notice p { margin: 0; color: #747c76; font-size: 10px; line-height: 1.7; }

.data-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 0;
  padding: clamp(25px, 5vw, 48px);
}

.data-fields > div {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 15px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.data-fields > div:nth-child(odd) { padding-right: 28px; }
.data-fields > div:nth-child(even) { padding-left: 28px; border-left: 1px solid var(--line); }
.data-fields dt { color: #8b918c; font-size: 10px; }
.data-fields dd { margin: 0; color: #2d322f; font-size: 11px; font-weight: 650; word-break: break-word; }

.data-detail-error {
  padding: 80px 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  text-align: center;
}

.data-detail-error strong { font-size: 19px; }
.data-detail-error p { margin: 10px 0 18px; color: var(--muted); font-size: 11px; }
.data-detail-error a { color: #2d704d; font-size: 11px; font-weight: 700; }

@media (max-width: 700px) {
  .data-detail-layout { width: calc(100% - 32px); padding: 36px 0 68px; }
  .data-detail-card { border-radius: 22px; }
  .data-detail-header { display: block; padding: 28px 23px; }
  .detail-source-actions { display: flex; flex-wrap: wrap; margin-top: 24px; }
  .source-button { display: inline-block; }
  .data-notice { grid-template-columns: 1fr; gap: 8px; padding: 18px 23px; }
  .data-fields { grid-template-columns: 1fr; padding: 20px 23px 28px; }
  .data-fields > div { grid-template-columns: 90px 1fr; }
  .data-fields > div:nth-child(odd),
  .data-fields > div:nth-child(even) { padding-right: 0; padding-left: 0; border-left: 0; }
}
