/* ===== Reskin theme (visual only). Load last. ===== */
:root {
  --primary: #0066cc;
  --primary-light: #3385d6;
  --primary-dark: #0055b3;
  --accent: #0066cc;
  --accent-light: #3385d6;
  --success: #237a4b;
  --danger: #b42318;
  --warning: #9a5b12;
  --bg: #f5f5f7;
  --white: #ffffff;
  --text: #1d1d1f;
  --text-light: #6e6e73;
  --border: #dedee3;
  --border-strong: #b8b8bd;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.07);
  --radius: 8px;
  --radius-lg: 12px;
  --sky-50: #f0f9ff;
  --sky-100: #e0f2fe;
  --sky-700: #0369a1;
  --page-shell: min(1920px, calc(100vw - 160px));
  --home-search-max: min(760px, 92vw);
  --home-stats-max: min(920px, 96vw);
  --reskin-banner-h: 0px;
}

/* Sticky footer + 版心主区 */
.page.active > .footer,
.page.active > .site-footer {
  margin-top: auto;
}
.footer,
.site-footer {
  margin-top: 0;
}

/* 内容页统一版心（后台 / 首页 / 搜索 / 登录自管宽度） */
#page-xref > .page-main,
#page-activities > .page-main,
#page-about > .page-main,
#page-favorites > .page-main,
#page-history > .page-main,
#page-detail > .page-main,
#page-updates > .page-main {
  max-width: var(--page-shell);
  margin-left: auto;
  margin-right: auto;
  padding: 24px clamp(16px, 2.5vw, 40px);
  width: 100%;
  box-sizing: border-box;
}
#page-login > .page-main {
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#page-login.page.active {
  min-height: calc(100vh - var(--reskin-banner-h, 33px));
  height: auto;
  max-height: none;
  overflow: auto;
}
#page-login > .footer,
#page-login > .site-footer {
  display: none;
}
#page-advisor.page.active {
  /* 整页锁在一屏内，禁止外层滚动 */
  height: calc(100vh - var(--reskin-banner-h, 33px));
  max-height: calc(100vh - var(--reskin-banner-h, 33px));
  min-height: calc(100vh - var(--reskin-banner-h, 33px));
  overflow: hidden;
}
body:has(#page-advisor.active) {
  overflow: hidden;
  height: 100vh;
}
#page-advisor > .page-main {
  max-width: var(--page-shell);
  margin-left: auto;
  margin-right: auto;
  padding: 12px clamp(16px, 2.5vw, 40px) 16px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}
#page-advisor > .footer,
#page-advisor > .site-footer {
  margin-top: 0;
}
#page-search > .page-main {
  width: 100%;
  padding-bottom: 24px;
}
#page-admin.page.active {
  height: calc(100vh - var(--reskin-banner-h, 33px));
  max-height: calc(100vh - var(--reskin-banner-h, 33px));
  min-height: calc(100vh - var(--reskin-banner-h, 33px));
  overflow: hidden;
}
body:has(#page-admin.active) {
  overflow: hidden;
  height: 100vh;
}
#page-admin > .page-main {
  max-width: none;
  padding: 0;
  width: 100%;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#page-admin > .header > .header-inner {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 24px;
}
#page-admin > .footer,
#page-admin > .site-footer {
  display: none;
}
#page-admin .admin-layout {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  align-self: stretch;
}
#page-admin .admin-sidebar {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#page-admin .admin-content {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#page-home > .page-main {
  width: 100%;
  padding: 0;
  background: var(--bg);
}

/* 交叉检索 / 收藏等去掉旧 inline 宽限，跟随 page-main 版心 */
#page-xref > .page-main > div,
#page-favorites > .page-main > div,
#page-history > .page-main > div,
#page-updates > .page-main > div,
#page-about > .page-main > div {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  width: 100%;
  box-sizing: border-box;
}

.advisor-layout {
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  flex: 1 1 0;
  min-height: 0;
  align-items: flex-start;
  overflow: hidden;
  height: 100%;
}
.advisor-chat {
  border-radius: 12px;
  border-color: var(--sky-100);
  box-shadow: none;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}
.advisor-header {
  background: color-mix(in srgb, var(--sky-50) 70%, #fff);
  border-bottom-color: var(--sky-100);
  flex: 0 0 auto;
}
.advisor-header .title {
  color: var(--sky-700);
}
.advisor-chat .ai-chat-messages {
  /* 仅此处滚动，外层不滚动 */
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: transparent;
}
.advisor-slots {
  align-self: flex-start;
  flex: 0 0 280px;
  max-width: 300px;
  height: auto;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  position: static;
  top: auto;
}
.advisor-chat .ai-chat-input-area,
.advisor-chat .advisor-input-hint,
.advisor-chat .advisor-scroll-bottom {
  flex: 0 0 auto;
}
.page-activities-wrap {
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}
.detail-page-wrap {
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}
.login-page {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background: linear-gradient(165deg, #f3f9fd 0%, #e4f1fa 42%, #d5eaf6 100%);
}
.login-shell {
  border: none;
  box-shadow: 0 12px 36px rgba(42, 106, 148, 0.14);
}
.login-card {
  box-shadow: none;
  border: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI',
    'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.header {
  height: 56px;
  padding: 0;
  background: rgba(245, 245, 247, 0.9);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
}
.header-inner {
  max-width: var(--page-shell);
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(16px, 2.5vw, 40px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.header-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  line-height: 1.1;
  white-space: nowrap;
}
.logo svg {
  display: none;
}
.logo .brand-zh {
  font-weight: 700;
  color: var(--text);
}
.logo .brand-en {
  font-weight: 700;
  font-size: 1em;
  color: var(--text);
  letter-spacing: -0.03em;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.header-nav-primary a {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  border-radius: 6px;
  background: transparent;
  white-space: nowrap;
}
.header-nav-primary a:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #000;
}
.header-nav-primary a.active {
  background: rgba(0, 0, 0, 0.06);
  color: #000;
}
.header-nav-secondary a {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 450;
  color: var(--text-light);
  border-radius: 6px;
  background: transparent;
  white-space: nowrap;
}
.header-nav-secondary a:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}
.header-nav-secondary a.active {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-right .role-badge,
.header [data-auth-role-badge] {
  display: none !important;
}
.header-right .btn,
.header-right .btn-sm {
  font-size: 12px;
  min-height: 28px;
  padding: 0 10px;
}
#uh-fab,
#ca-fab {
  display: none !important;
}
.user-avatar {
  background: #1d1d1f;
  box-shadow: none;
}

.btn {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.02);
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: none;
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}
.btn-outline {
  background: var(--white);
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover {
  background: #f2f2f4;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-accent {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-accent:hover {
  background: var(--primary-dark);
}
.btn-sm {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

/* 首页顶区：淡雅浅蓝 → 向下渐变到页面底色，与下方内容平滑衔接 */
.home-top {
  background: linear-gradient(
    180deg,
    #f3f9fd 0%,
    #e8f3fb 28%,
    #e4f0f7 55%,
    #eef2f5 78%,
    var(--bg) 100%
  );
  position: relative;
  overflow: visible;
  padding-bottom: 36px;
}
.home-top::before {
  display: none;
}
.home-top > .hero,
.home-top > .stats-bar {
  position: relative;
  z-index: 1;
}
.hero {
  background: transparent;
  color: #1e4a66;
  padding: 44px 24px 20px;
  position: relative;
  z-index: 1;
  overflow: visible;
}
.hero::before {
  display: none;
}
.hero h1 {
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-shadow: none;
  color: #163a52;
  max-width: 820px;
  margin: 0 auto 14px;
}
.hero p {
  opacity: 1;
  color: #5a7388;
  font-size: 15px;
  max-width: 640px;
  margin: 0 auto 22px;
  line-height: 1.6;
}
.search-mode-pills {
  background: transparent;
  border-radius: 50px;
  padding: 0;
  margin-bottom: 14px;
}
.search-mode-pills button {
  color: #333;
  border-radius: 50px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(42, 106, 148, 0.1);
  padding: 8px 18px;
}
.search-mode-pills button.active {
  background: #fff;
  color: #333;
  box-shadow: 0 2px 10px rgba(42, 106, 148, 0.1);
}
.search-mode-pills button.active .pill-ai {
  background: #e67e22;
  color: #fff;
}
.search-box {
  max-width: 680px;
  border-radius: 50px;
  border: 1px solid rgba(42, 106, 148, 0.12);
  padding: 5px;
  box-shadow: 0 8px 28px rgba(42, 106, 148, 0.12);
  background: #fff;
}
.search-box .search-btn {
  background: #e67e22;
  border-radius: 50px;
  min-height: 44px;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 600;
}
.search-box .search-btn:hover {
  background: #d35400;
}

.stat-card,
.cat-item,
.vp-card,
.param-chip-item,
.detail-header,
.detail-section,
.login-card {
  border-radius: var(--radius-lg);
  box-shadow: none;
}
.param-chip-item:hover {
  border-color: var(--border-strong);
  box-shadow: none;
  background: color-mix(in srgb, var(--bg) 40%, #fff);
}
.param-chip-item .chip-head .model-name {
  color: var(--text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  line-height: 1.35;
}
.param-chip-item .chip-head {
  align-items: flex-start;
  gap: 12px;
}
.param-chip-item .chip-head .model-info {
  min-width: 0;
  flex: 1 1 auto;
}
.param-chip-item .chip-head > .btn-detail,
.param-chip-item .chip-head > a.btn-detail,
.param-chip-item .chip-head > div[style*="display:flex"] {
  flex-shrink: 0;
}
.param-chip-item .chip-head .vendor-tag,
.detail-spec-value .vendor-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  background: #eff6ff;
  color: #1e40af;
  border-radius: 6px;
  font-weight: 600;
}
.param-chip-item .chip-head .pkg-tag {
  background: #fff7ed;
  color: #c2410c;
  border-radius: 6px;
  font-weight: 600;
  display: inline-block;
  max-width: 9.5em;
  padding: 2px 8px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  cursor: help;
}
/* 详情页空间充足：封装/型号原样完整展示，不做截断美化 */
.detail-spec-value .pkg-tag {
  background: #fff7ed;
  color: #c2410c;
  border-radius: 6px;
  font-weight: 600;
  display: inline;
  max-width: none;
  padding: 2px 8px;
  font-size: 12px;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  cursor: inherit;
  line-height: 1.45;
}
.detail-title-block h1 {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.param-chip-item .chip-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  max-width: 42%;
}
.param-chip-item .chip-head-actions .btn-detail,
.param-chip-item .chip-head-actions .btn-datasheet {
  white-space: nowrap;
  flex-shrink: 0;
}
.param-chip-item .match-tags-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.param-chip-item .match-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  cursor: help;
  white-space: nowrap;
}
.param-chip-item .match-level-badge {
  display: inline-block;
  max-width: 10em;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  flex-shrink: 0;
}
.btn-similar-domestic {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
  vertical-align: middle;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid #86efac;
  background: #f0fdf4;
  color: #166534;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-similar-domestic:hover {
  background: #dcfce7;
  border-color: #4ade80;
}
.btn-similar-domestic.is-active {
  background: #fff;
  border-color: var(--border-strong, #cbd5e1);
  color: var(--text, #334155);
}
.btn-similar-domestic.is-active:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}
.btn-similar-domestic-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  min-width: 20px;
  padding: 0 4px;
  border-radius: 4px;
  background: #16a34a;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}
.param-chip-item .chip-head .status-tag,
.detail-header .status-tag,
.param-item .status-tag,
.detail-spec-value .status-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  background: #fef2f2;
  color: #b91c1c;
  margin: 0;
}
.param-chip-item .chip-head .status-tag.active,
.detail-header .status-tag.active,
.param-item .status-tag.active,
.detail-spec-value .status-tag.active {
  background: #ecfdf5;
  color: #047857;
}
.param-chip-item .chip-head .status-tag.eol,
.detail-header .status-tag.eol,
.param-item .status-tag.eol,
.detail-spec-value .status-tag.eol {
  background: #fef2f2;
  color: #b91c1c;
}
.param-chip-item .chip-head .status-tag.nrnd,
.detail-header .status-tag.nrnd,
.param-item .status-tag.nrnd,
.detail-spec-value .status-tag.nrnd {
  background: #fffbeb;
  color: #b45309;
}
.param-chip-item .chip-head .status-tag.preview,
.detail-header .status-tag.preview,
.param-item .status-tag.preview,
.detail-spec-value .status-tag.preview {
  background: #eff6ff;
  color: #1d4ed8;
}
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.detail-header .vendor-tag {
  margin-top: 0;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: #eff6ff;
  color: #1e40af;
}
.detail-header .status-tag {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}
.detail-header .status-tag:empty,
.detail-header .vendor-tag:empty {
  display: none;
}
.param-chip-item .chip-head .btn-detail {
  min-height: 28px;
  padding: 0 12px;
  font-size: 12px;
  border-color: var(--border);
  color: var(--text);
}
.param-chip-item .chip-head .btn-detail:hover {
  background: #f2f2f4;
  color: var(--text);
}

.detail-header h1 {
  color: var(--text);
  letter-spacing: -0.04em;
}
.detail-header .top-row {
  align-items: flex-start;
}
.detail-tabs {
  display: none;
}
.detail-tabs button {
  padding: 0 0 12px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-light);
  border-radius: 0;
}
.detail-tabs button:first-child,
.detail-tabs button:last-child {
  border-radius: 0;
}
.detail-tabs button.active {
  background: transparent;
  color: var(--text);
  border-color: transparent;
  border-bottom-color: var(--primary);
  font-weight: 650;
}

.advisor-chat {
  border-radius: 12px;
  border-color: var(--sky-100);
  box-shadow: none;
}
.advisor-header {
  background: color-mix(in srgb, var(--sky-50) 70%, #fff);
  border-bottom-color: var(--sky-100);
}
.advisor-header .title {
  color: var(--sky-700);
}
.advisor-chat .ai-chat-messages {
  /* 保持与上方 flex 滚动约定一致，避免后写规则冲掉 */
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: transparent;
}
.advisor-chat .msg-avatar {
  display: none !important;
}
.advisor-chat .ai-msg .msg-avatar {
  display: none !important;
}
.advisor-chat .user-msg .msg-bubble {
  background: var(--primary);
  color: #fff;
  border-color: color-mix(in srgb, var(--primary) 80%, #000);
}
.advisor-example {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #0ea5e9;
  border-radius: 8px;
}
.advisor-example:hover {
  background: #f1f5f9;
  transform: none;
}
.ai-chat-input-area .ai-send-btn {
  background: var(--primary);
  border-radius: 8px;
}

.data-table th,
.chip-table th {
  background: var(--primary);
}

.toast {
  border-radius: 10px;
  background: #1d1d1f;
  font-size: 12px;
}

.btn:hover,
.btn-sm:hover,
.advisor-export:hover {
  transform: none;
}

/* ===== Layout alignment with frontend-user ===== */

.section {
  max-width: var(--page-shell);
  margin-left: auto;
  margin-right: auto;
  padding: 40px clamp(16px, 2.5vw, 40px);
  width: 100%;
  box-sizing: border-box;
}

/* 首页区块微调 */
#page-home .section {
  padding-top: 32px;
  padding-bottom: 48px;
}
#page-home .search-box {
  max-width: var(--home-search-max);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.section-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0;
}
.section-desc {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
  margin-bottom: 0;
}
.section > .section-desc {
  margin-bottom: 12px;
}
.btn-text {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  white-space: nowrap;
}
.btn-text:hover {
  text-decoration: underline;
}

.home-top .stats-bar {
  max-width: var(--home-stats-max);
  margin: 8px auto 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}
.home-top .stat-card {
  padding: 20px 16px;
  text-align: center;
  border: 1px solid rgba(42, 106, 148, 0.1);
  background: var(--white);
  margin: 0;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(42, 106, 148, 0.1);
}
.home-top .stat-card .num {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #2a5f8a;
  line-height: 1.2;
}
.home-top .stat-card .label {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 6px;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}
/* 首页常用选型：一行多列，随分辨率自适应；折叠时默认展示约 4 行（大屏 6×4=24） */
#page-home .cat-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.cat-grid.cat-collapsed .cat-item:nth-child(n + 25) {
  display: none;
}
.cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.cat-item:hover {
  background: #f7f7f8;
  border-color: var(--border-strong);
  transform: none;
  box-shadow: none;
}
.cat-item .icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #eeeef0;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
}
.cat-item .cat-meta {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.cat-item .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
}
.cat-item .count {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.3;
  margin: 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.tool-card {
  display: block;
  padding: 18px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.tool-card:hover {
  background: #f7f7f8;
}
.tool-card .tool-name {
  font-size: 14px;
  font-weight: 500;
}
.tool-card p {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-light);
}

.hero-cta-row {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-hero-primary,
.btn-hero-secondary {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-hero-ico {
  font-size: 14px;
  line-height: 1;
}
.btn-hero-primary {
  background: linear-gradient(135deg, #3a7ca5, #2a5f8a);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(42, 95, 138, 0.22);
}
.btn-hero-primary:hover {
  background: linear-gradient(135deg, #4589b3, #336a96);
}
.btn-hero-secondary {
  background: var(--white);
  color: #1e4d6b;
  border-color: rgba(42, 106, 148, 0.22);
  box-shadow: 0 2px 8px rgba(42, 106, 148, 0.08);
}
.btn-hero-secondary:hover {
  background: #f8fafc;
}
.hero-cta-hint {
  font-size: 13px;
  color: #6b8499;
}

/* Search: left filters / right results */
.search-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  max-width: var(--page-shell);
  margin: 0 auto;
  padding: 0 clamp(16px, 2.5vw, 40px) 32px;
  align-items: start;
}
.search-filters-aside {
  position: sticky;
  top: 72px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  padding: 16px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  max-height: 600px;
  overflow: hidden;
}
.search-filters-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.refine-bar--sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.search-filters-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.28) transparent;
}
.search-filters-body::-webkit-scrollbar {
  width: 4px;
}
.search-filters-body::-webkit-scrollbar-track {
  background: transparent;
}
.search-filters-body::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.28);
  border-radius: 999px;
}
.search-filters-body::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.42);
}
.refine-bar--sidebar .rb-label {
  display: none;
}
.refine-bar--sidebar .rb-divider,
.refine-bar--sidebar .filter-visual-divider {
  display: none;
}
.refine-bar--sidebar .rb-select,
.refine-bar--sidebar select,
.refine-bar--sidebar .filter-full {
  width: 100%;
  min-width: 0 !important;
  max-width: none;
  height: 36px;
  box-sizing: border-box;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  padding: 0 10px;
}
.sidebar-filter-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.refine-bar--sidebar .filter-field,
.refine-bar--sidebar .filter-group-item.filter-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
}
.refine-bar--sidebar .filter-field-label,
.refine-bar--sidebar .filter-range-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
  line-height: 1.3;
}
.refine-bar--sidebar .filter-group-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  border: none;
  padding: 0;
  background: transparent;
  align-items: stretch;
}
.refine-bar--sidebar .filter-dual-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.refine-bar--sidebar .filter-dual-row .rb-select {
  flex: 1 1 0;
  min-width: 0 !important;
  width: auto;
}
.refine-bar--sidebar.filters-collapsed .filter-field--overflow {
  display: none !important;
}
.refine-bar--sidebar .filter-range-block {
  gap: 8px;
}
.refine-bar--sidebar .filter-range-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.refine-bar--sidebar .filter-range-inputs {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.refine-bar--sidebar .filter-range-input {
  flex: 1 1 0;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 36px;
  text-align: left;
}
.refine-bar--sidebar .filter-range-sep {
  flex: 0 0 auto;
  color: var(--text-light);
  font-size: 13px;
  line-height: 1;
}
.refine-bar--sidebar .filter-empty-hint {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
}
.refine-bar--sidebar .rb-more {
  align-self: flex-start;
  padding: 0;
  font-size: 12px;
  color: var(--text-light);
  background: transparent;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
/* 仅作用于本地追加筛选项，不影响上方原有 dual-row / 等级生命周期 */
.cfg-filter-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.cfg-filter {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
}
.cfg-filter .filter-field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
  line-height: 1.3;
}
.cfg-filter-stack .cfg-filter-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: 36px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  padding: 0 10px;
}
.cfg-filter-range-inputs {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.cfg-filter-range-inputs .cfg-filter-input {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}
.cfg-filter-range-sep {
  flex: 0 0 auto;
  color: var(--text-light);
  font-size: 13px;
}
/* 「更多筛选」展开时：本地配置纵向排列，不沿用 filter-extra 的横向 wrap */
.filter-extra.show:has(.cfg-filter-stack) {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
}
.sidebar-filter-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  width: 100%;
  flex-shrink: 0;
}
.sidebar-filter-actions .btn,
.sidebar-filter-actions .rb-btn {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  height: 36px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}
.sidebar-filter-actions .btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.sidebar-filter-actions .btn-outline {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
}
.search-results-main {
  min-width: 0;
}
.result-summary {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
}
#searchPageBar {
  max-width: var(--page-shell) !important;
  margin: 0 auto !important;
  padding: 16px clamp(16px, 2.5vw, 40px) 8px !important;
}
/* 搜索框、示例与下方结果内容区同宽 */
#searchPageBar .unified-search-bar,
#searchPageBar #semanticExamples {
  max-width: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
}
#searchPageBar #semanticExamples {
  margin-top: 12px;
  padding-left: 20px !important;
  padding-right: 20px !important;
}
#searchSqlPanel,
#semanticDimensions {
  max-width: var(--page-shell) !important;
  padding-left: clamp(16px, 2.5vw, 40px) !important;
  padding-right: clamp(16px, 2.5vw, 40px) !important;
}

/* Detail page — 跟随 #page-detail > .page-main 版心 */
.detail-page-wrap {
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}
.detail-header {
  border: none;
  background: transparent;
  padding: 0 0 8px;
  margin-bottom: 8px;
}
.detail-header .top-row {
  align-items: flex-start;
  gap: 16px;
}
.detail-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-light);
}
.detail-title-block h1 {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1.15;
  margin: 0;
}
.detail-subtitle {
  margin: 8px 0 0;
  max-width: 30rem;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-light);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
  overflow: hidden;
}
.detail-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  align-self: flex-start;
}
.detail-actions-row .btn,
.detail-actions-row .ca-action-btn,
.detail-actions-row .btn-similar {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
  border-radius: 6px;
}
.detail-actions-row .btn-similar {
  border: 1px solid var(--primary);
  color: var(--primary);
  background: var(--white);
  cursor: pointer;
}
.detail-actions-row .btn-detail-prev {
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--white);
  cursor: pointer;
}
.detail-actions-row .btn-detail-prev:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.detail-full-codes {
  margin-top: 12px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--primary) 6%, #fff);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text);
}
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}
.detail-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px 24px;
  overflow: hidden;
}
.detail-card-body {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.detail-block-title {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
}
.detail-block-body {
  min-width: 0;
}
.detail-tabs {
  display: none;
}
.detail-tabs button {
  padding: 14px 0 12px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-light);
  border-radius: 0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: -1px;
}
.detail-tabs button:first-child,
.detail-tabs button:last-child {
  border-radius: 0;
}
.detail-tabs button.active {
  background: transparent;
  color: var(--text);
  border-color: transparent;
  border-bottom-color: var(--primary);
  font-weight: 650;
}
.detail-tab-panel[hidden] {
  display: none !important;
}
.detail-spec-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.detail-spec-cell {
  padding: 14px 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.detail-spec-label {
  display: block;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 6px;
}
.detail-spec-value {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
  line-height: 1.45;
}
.detail-spec-value .vendor-tag,
.detail-spec-value .pkg-tag,
.detail-spec-value .status-tag {
  font-weight: 600;
}
.detail-spec-value .pkg-tag {
  max-width: none;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.detail-prose {
  margin-bottom: 20px;
}
.detail-prose:last-child {
  margin-bottom: 0;
}
.detail-prose h3,
.detail-prose h4 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  border: none;
  padding: 0;
}
.detail-prose p {
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-light);
  white-space: pre-wrap;
}
.detail-empty {
  padding: 28px 8px;
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
}
.detail-similar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.detail-similar-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.detail-similar-list li:last-child {
  border-bottom: none;
}
.detail-similar-link {
  border: none;
  background: none;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.detail-similar-link:hover {
  color: var(--primary);
  text-decoration: underline;
}
.detail-similar-mfr {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-light);
  font-weight: 400;
}
.detail-similar-score {
  font-size: 12px;
  color: var(--text-light);
  flex-shrink: 0;
}
.detail-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.detail-side-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  padding: 16px;
}
.detail-side-card h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  border: none;
  padding: 0;
}
.detail-side-card p,
.detail-side-meta {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.55;
  white-space: pre-line;
}
.detail-ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 32px;
  padding: 0 14px;
}
.detail-tags .grade-tag {
  display: none;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.detail-tags .grade-tag.has-value {
  display: inline-block;
}
#ca-report-btn {
  display: none !important;
}
.detail-header .status-tag:empty,
.detail-header .vendor-tag:empty,
.detail-header .grade-tag:empty {
  display: none;
}
.detail-back {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  padding-bottom: 8px;
}
.detail-back .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 160px;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  border-radius: 10px;
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #fff;
  cursor: pointer;
}
.detail-back .btn:hover {
  background: var(--primary-dark, #0f3d5c);
  border-color: var(--primary-dark, #0f3d5c);
  color: #fff;
}

@media (max-width: 1200px) {
  .detail-spec-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .stats-bar,
  .tool-grid {
    grid-template-columns: 1fr 1fr;
  }
  .cat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .search-layout,
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .search-filters-aside {
    position: static;
  }
  .detail-spec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .stats-bar,
  .tool-grid {
    grid-template-columns: 1fr;
  }
  .cat-grid {
    grid-template-columns: 1fr;
  }
  .detail-spec-grid {
    grid-template-columns: 1fr;
  }
}

/* 首页分类网格断点（覆盖 features.css 的 !important） */
@media (max-width: 1500px) {
  #page-home .cat-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 1200px) {
  #page-home .cat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 900px) {
  #page-home .cat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 640px) {
  #page-home .cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  #page-home .cat-item {
    padding: 12px;
  }
  #page-home .cat-item .icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

/* 页脚版权居中 */
.site-footer-inner {
  justify-content: center;
  text-align: center;
  gap: 6px 20px;
}

/* ===== Favorites page ===== */
.fav-page-wrap {
  width: 100%;
  box-sizing: border-box;
}
.fav-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.fav-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
}
.fav-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
}
.fav-desc {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.55;
}
.fav-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fav-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.fav-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fav-type-tab {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  line-height: 1.2;
}
.fav-type-tab:hover {
  border-color: var(--border-strong);
}
.fav-type-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.fav-search {
  position: relative;
  min-width: 200px;
  flex: 0 1 260px;
}
.fav-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: 0.55;
  pointer-events: none;
}
.fav-search input {
  width: 100%;
  box-sizing: border-box;
  height: 36px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-size: 13px;
  outline: none;
}
.fav-search input:focus {
  border-color: var(--primary-light);
}
.fav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.fav-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.fav-card.selected {
  border-color: var(--primary-light);
  background: color-mix(in srgb, var(--primary) 4%, #fff);
}
.fav-check {
  flex: 0 0 auto;
  margin-top: 4px;
  cursor: pointer;
}
.fav-card-main {
  flex: 1 1 auto;
  min-width: 0;
}
.fav-card-mfr {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}
.fav-card-pn {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.3;
  word-break: break-all;
}
.fav-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.fav-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text-light);
  background: var(--bg);
  border-radius: 6px;
}
.fav-card-date {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-light);
}
.fav-card-actions {
  display: flex;
  flex-direction: row;
  gap: 8px;
  flex-shrink: 0;
}
.fav-filter-empty {
  grid-column: 1 / -1;
  padding: 32px 16px;
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 50%, #fff);
}
.fav-empty-panel {
  margin-top: 8px;
  padding: 40px 20px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 55%, #fff);
}
.fav-empty-panel h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
}
.fav-empty-panel p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-light);
}
@media (max-width: 760px) {
  .fav-grid {
    grid-template-columns: 1fr;
  }
  .fav-title {
    font-size: 24px;
  }
  .fav-card {
    flex-wrap: wrap;
  }
  .fav-card-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ===== History page ===== */
.history-page-wrap {
  width: 100%;
  box-sizing: border-box;
}
.history-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.history-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
}
.history-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
}
.history-desc {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--text-light);
  max-width: 36em;
  line-height: 1.55;
}
.history-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.history-paused-banner {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 70%, #fff);
  font-size: 13px;
  color: var(--text-light);
}
.history-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.history-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 18px 8px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}
.history-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.history-card-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
}
.history-card-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-light);
}
.history-link-btn {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 0;
  white-space: nowrap;
}
.history-link-btn:hover {
  text-decoration: underline;
}
.history-list {
  flex: 1;
  min-height: 0;
}
.history-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 12px 2px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.history-item:last-child {
  border-bottom: none;
}
.history-item:hover .history-item-title {
  color: var(--primary);
}
.history-item-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.35;
}
.history-item-meta {
  font-size: 12px;
  color: var(--text-light);
}
.history-empty {
  padding: 28px 8px;
  font-size: 13px;
  color: var(--text-light);
  text-align: center;
}
.history-footer-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.history-footer-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
}
.history-footer-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}
.history-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 760px) {
  .history-columns {
    grid-template-columns: 1fr;
  }
  .history-title {
    font-size: 24px;
  }
}

/* ===== About page ===== */
.about-page-wrap {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.about-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 28px;
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.about-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
}
.about-hero-title {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.25;
}
.about-hero-lead {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-light);
}
.about-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 45%, #fff);
  align-self: stretch;
}
.about-stat {
  padding: 18px 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.about-stat:nth-child(2n) {
  border-right: none;
}
.about-stat:nth-child(n + 3) {
  border-bottom: none;
}
.about-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.about-stat-label {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.4;
}
.about-block-head {
  margin-bottom: 12px;
}
.about-block-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.about-block-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-light);
}
.about-intro-box {
  padding: 22px 24px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.about-intro-box p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}
.about-intro-box p:last-child {
  margin-bottom: 0;
}
.about-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.about-contact-card {
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.about-contact-label {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 8px;
}
.about-contact-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.about-contact-value a {
  color: inherit;
  text-decoration: none;
}
.about-contact-value a:hover {
  color: var(--primary);
}
.about-contact-meta {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-light);
}
@media (max-width: 860px) {
  .about-hero-card,
  .about-contact-grid {
    grid-template-columns: 1fr;
  }
  .about-hero-title {
    font-size: 22px;
  }
}

@media (max-width: 768px) {
  .home-top {
    padding-bottom: 28px;
  }
  .home-top .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    max-width: 560px;
  }
  .home-top .stat-card .num {
    font-size: 24px;
  }
  .hero-cta-hint {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .home-top .stats-bar {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .search-box .search-btn {
    padding: 10px 20px;
    min-height: 40px;
  }
}

