:root {
  --bg: #f6f7fb;
  --panel: rgba(255, 255, 255, .82);
  --card: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: rgba(15, 23, 42, .08);
  --blue: #38a8ff;
  --cyan: #25d3c2;
  --violet: #7768ff;
  --dark: #101828;
  --radius: 20px;
  --shadow: 0 24px 70px rgba(31, 87, 126, .14), 0 8px 24px rgba(15, 23, 42, .05);
  --soft-shadow: 0 14px 36px rgba(15, 23, 42, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 18% -8%, rgba(56, 168, 255, .16), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(37, 211, 194, .12), transparent 24%),
    linear-gradient(180deg, #f8fafc 0%, #eef3f8 46%, #f8fbff 100%);
  line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
.wrap { width: min(1160px, calc(100% - 48px)); margin: 0 auto; }
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(248, 250, 252, .82);
  border-bottom: 1px solid rgba(226, 232, 240, .68);
  backdrop-filter: blur(22px);
}
.header-inner {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 900; white-space: nowrap; letter-spacing: -.02em;
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; overflow: hidden;
  background: conic-gradient(from 180deg, var(--cyan), var(--blue), var(--violet), var(--cyan));
  color: #fff; box-shadow: 0 12px 26px rgba(56, 168, 255, .24);
}
.brand-mark::before { content: "AI"; font-size: .72rem; font-weight: 950; letter-spacing: -.04em; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-mark:has(img)::before { content: none; }
.nav {
  justify-self: center; display: flex; align-items: center; gap: 22px;
  color: #344054; font-size: .88rem; font-weight: 650; flex-wrap: wrap;
}
.nav a { transition: color .18s; }
.nav a:hover, .nav a.active { color: #0277bd; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 10px 16px; border-radius: 999px;
  border: 1px solid transparent; background: #fff; color: var(--ink);
  font-size: .88rem; font-weight: 800; cursor: pointer;
  transition: transform .16s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-dark { color: #fff; background: linear-gradient(135deg, #101828, #1d2939); box-shadow: 0 10px 24px rgba(16, 24, 40, .22); }
.btn-outline { background: rgba(255,255,255,.9); border-color: rgba(15, 23, 42, .12); }
.btn-outline:hover { border-color: rgba(56, 168, 255, .45); color: #0277bd; }
.btn-cyan {
  color: #fff;
  background: linear-gradient(135deg, #25d3c2, #38a8ff);
  box-shadow: 0 12px 28px rgba(37, 211, 194, .28);
}
.page-hero { padding: 36px 0 20px; }
.page-hero h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.35rem); font-weight: 950;
  letter-spacing: -.03em; line-height: 1.2; margin: 0;
}
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 8px 0 22px;
}
.chip {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff;
  color: var(--muted); font-size: .84rem; font-weight: 700; cursor: pointer;
  transition: .18s;
}
.chip:hover { border-color: rgba(56, 168, 255, .4); color: #0277bd; }
.chip.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, #25d3c2, #38a8ff);
  box-shadow: 0 8px 20px rgba(56, 168, 255, .28);
}
.search-box {
  flex: 1 1 220px; min-width: 180px; max-width: 420px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px; min-height: 42px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff;
}
.search-box input {
  flex: 1; border: 0; outline: none; background: transparent;
  font-size: .9rem; color: var(--ink);
}
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  padding-bottom: 64px;
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 20px 18px;
  box-shadow: var(--soft-shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card .tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 700;
  background: rgba(56, 168, 255, .12); color: #0277bd; margin-bottom: 10px;
}
.card h3 { font-size: 1.05rem; font-weight: 850; margin-bottom: 8px; letter-spacing: -.02em; }
.card h3 a:hover { color: #0277bd; }
.card p { color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-top: 14px; font-size: .78rem; color: var(--muted); font-weight: 650;
}
.card .price { color: #0d9488; font-weight: 800; margin-left: auto; }
.empty, .err {
  grid-column: 1 / -1; text-align: center; padding: 48px 16px;
  color: var(--muted); font-size: .95rem;
}
.err { color: #e11d48; }
.section-block { margin-bottom: 36px; }
.section-block > h2 {
  font-size: 1.15rem; font-weight: 900; letter-spacing: -.02em; margin-bottom: 14px;
}
.site-footer {
  border-top: 1px solid var(--line); padding: 36px 0 48px;
  color: var(--muted); font-size: .85rem; text-align: center;
}
.mode-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.mode-tabs .tab {
  min-height: 42px; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-weight: 750; font-size: .9rem; cursor: pointer;
}
.mode-tabs .tab.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, #101828, #1d2939);
}
.panel { display: none; }
.panel.active { display: block; }
.chat-shell {
  display: grid; grid-template-columns: 1fr; gap: 16px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--soft-shadow);
  overflow: hidden; min-height: 480px;
}
@media (min-width: 900px) {
  .chat-shell { grid-template-columns: 280px 1fr; }
}
.chat-side {
  border-right: 1px solid var(--line); padding: 18px; background: rgba(248, 250, 252, .9);
}
.chat-side h3 { font-size: .95rem; margin-bottom: 12px; }
.suggest {
  display: block; width: 100%; text-align: left; margin-bottom: 8px;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); font-size: .82rem; font-weight: 650; cursor: pointer;
}
.suggest:hover { color: #0277bd; border-color: rgba(56, 168, 255, .35); }
.chat-main { display: flex; flex-direction: column; min-height: 480px; }
.chat-log {
  flex: 1; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px;
  max-height: 520px;
}
.bubble {
  max-width: min(92%, 640px); padding: 12px 14px; border-radius: 16px;
  font-size: .9rem; line-height: 1.6;
}
.bubble.user {
  align-self: flex-end; background: linear-gradient(135deg, #25d3c2, #38a8ff); color: #fff;
  border-bottom-right-radius: 6px;
}
.bubble.bot {
  align-self: flex-start; background: #f1f5f9; color: var(--ink);
  border-bottom-left-radius: 6px;
}
.bubble .hit {
  display: block; margin-top: 8px; padding: 8px 10px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line); font-size: .84rem;
}
.bubble .hit a { color: #0277bd; font-weight: 700; }
.chat-input {
  display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line);
}
.chat-input input {
  flex: 1; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); outline: none;
}
.chat-input input:focus { border-color: rgba(56, 168, 255, .5); }
.chat-input input:disabled,
.chat-input button:disabled {
  opacity: .55;
  cursor: not-allowed;
}
.suggest:disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}
.chat-login-gate {
  margin: 0 16px 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(56, 168, 255, .28);
  background: linear-gradient(135deg, rgba(37, 211, 194, .1), rgba(56, 168, 255, .1));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.chat-login-gate p {
  margin: 0;
  font-size: .88rem;
  color: var(--ink);
  line-height: 1.5;
  flex: 1;
  min-width: 200px;
}
.chat-login-gate[hidden] { display: none !important; }
.doc-detail {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--soft-shadow); margin-top: 16px;
}
.doc-detail pre {
  margin-top: 12px; padding: 14px; border-radius: 12px; overflow: auto;
  background: #0f172a; color: #e2e8f0; font-size: .78rem; line-height: 1.5;
}
.list-table-wrap {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--soft-shadow); margin-bottom: 48px;
}
.list-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.list-table th, .list-table td {
  padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top;
}
.list-table th {
  background: #f8fafc; color: var(--muted); font-weight: 750; font-size: .8rem;
  position: sticky; top: 0;
}
.list-table tr:last-child td { border-bottom: 0; }
.list-table a:hover { color: #0277bd; }
@media (max-width: 860px) {
  .header-inner { grid-template-columns: 1fr auto; gap: 12px; padding: 10px 0; }
  .nav { grid-column: 1 / -1; justify-self: start; overflow-x: auto; max-width: 100%; padding-bottom: 4px; gap: 16px; }
}
