/*
  智研网 · 统一页面框架 v5
  -----------------------------------------------------------------------
  目的：建立一个有限度自适应的全站 layout contract。
  首页、工具、账户与用量、任务记录、管理后台使用同一条内容左边线、
  同一套 Header 位置和同一套桌面 / 平板 / 手机断点。

  设计规则：
  1. 桌面端最大内容宽度固定在 1280px；大屏不无限横向拉伸。
  2. 宽度不足时先缩小左右留白，再让表格横向滚动；不压缩中文状态文字。
  3. 页面骨架统一，首页 / 工作台只允许内容层不同。
  4. 该文件替代 V3 / V4 的响应式布局层；V2 仅保留后台卡片视觉层。
*/

:root {
  --zy-frame-max: 1280px;
  --zy-frame-gutter: clamp(24px, 3.25vw, 48px);
  --zy-frame: min(var(--zy-frame-max), calc(100% - var(--zy-frame-gutter) - var(--zy-frame-gutter)));
  --zy-section-gap: clamp(28px, 4vw, 56px);
  --zy-card-radius: 18px;
}

/* ---------- Single site frame: header / footer / every page begins here ---------- */
.site-head .nav-shell,
.site-footer,
.home-shell .hero-home,
.home-shell .home-tools,
.home-shell .metric-strip,
.home-shell .home-note,
.tools-shell .page-main,
.api-shell .page-main,
.task-shell .page-main,
.admin-shell .admin-layout {
  width: var(--zy-frame);
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}

/* Header is deliberately identical on all pages. */
.site-head { height: 84px; }
.site-head .nav-shell { grid-template-columns: 1fr auto 1fr; }
.site-footer { padding-top: 30px; padding-bottom: 48px; }

/* Every content page follows the same first baseline beneath the header. */
.page-main { padding-top: clamp(48px, 5vw, 76px); padding-bottom: clamp(52px, 6vw, 86px); }
.tools-shell .page-heading,
.api-shell .api-heading,
.task-shell .task-heading,
.admin-shell .admin-page-title,
.admin-shell .admin-section-head { margin-top: 0; }

/* ---------- Home: same frame, presentation content remains intentionally distinct ---------- */
.home-shell .hero-home { padding-top: clamp(64px, 6vw, 94px); padding-bottom: clamp(42px, 4.5vw, 68px); }
.home-shell .home-tools { padding-top: 20px; }
.home-shell .metric-strip { margin-top: 34px; }
.home-shell .home-note { margin-top: 22px; margin-bottom: 58px; }

/* ---------- Admin: page-internal horizontal subnavigation, not a second website shell ---------- */
.admin-shell .admin-layout {
  display: block;
  min-height: calc(100vh - 84px);
  padding-top: clamp(28px, 3.5vw, 46px);
  padding-bottom: clamp(52px, 6vw, 86px);
}

.admin-shell .admin-sidebar {
  position: static;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  width: 100%;
  margin: 0 0 34px;
  padding: 12px 16px;
  border-radius: var(--zy-card-radius);
  overflow: hidden;
}

.admin-shell .admin-back,
.admin-shell .admin-side-note { display: none; }

.admin-shell .admin-side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 176px;
  margin: 0;
  padding: 0 18px 0 0;
  border: 0;
  border-right: 1px solid var(--admin-line, #e8ebf3);
}

.admin-shell .admin-sidebar nav {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  padding: 0;
  scrollbar-width: none;
}
.admin-shell .admin-sidebar nav::-webkit-scrollbar { display: none; }

.admin-shell .admin-nav-item {
  width: auto;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 12px;
  white-space: nowrap;
  word-break: keep-all;
}
.admin-shell .admin-nav-item:hover { transform: none; }

.admin-shell .admin-content { min-width: 0; }
.admin-shell .admin-page-title,
.admin-shell .admin-section-head {
  align-items: flex-end;
  margin-bottom: 30px;
}
.admin-shell .admin-page-title h1 { font-size: clamp(34px, 3vw, 46px); }

/* Admin tables use scroll rather than squeezing important operation data. */
.admin-shell .admin-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-shell .users-table .admin-table-head,
.admin-shell .users-table .admin-user-row { min-width: 1120px; }
.admin-shell .api-admin-table .admin-table-head,
.admin-shell .api-admin-table .admin-api-row { min-width: 940px; }
.admin-shell .admin-task-table .admin-table-head,
.admin-shell .admin-task-table .admin-task-row { min-width: 1040px; }
.admin-shell .admin-audit-table .admin-table-head,
.admin-shell .admin-audit-table .admin-audit-row { min-width: 980px; }

/* ---------- Task records: a proper workbench, not a compressed marketing form ---------- */
.task-shell .task-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 22px;
  margin-bottom: 28px;
}
.task-shell .task-heading > div { min-width: 0; }
.task-shell .task-heading .button { white-space: nowrap; }

/* Information hierarchy: status first; filters and search second. */
.task-shell .task-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 22px;
  padding: 13px;
  border: 1px solid #e6e9f1;
  border-radius: var(--zy-card-radius);
  background: rgba(255,255,255,.94);
  box-shadow: 0 12px 30px rgba(30,38,82,.045);
}

.task-shell .task-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px;
  border-radius: 13px;
  background: #f3f5fb;
  scrollbar-width: none;
}
.task-shell .task-filter-pills::-webkit-scrollbar { display: none; }
.task-shell .task-filter-pills button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 94px;
  height: 42px;
  margin: 0;
  padding: 0 16px;
  border-radius: 10px;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  line-height: 1;
}
.task-shell .task-filter-pills button i {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #8992a2;
}
.task-shell .task-filter-pills button:nth-child(2) i { background: #6c7df1; }
.task-shell .task-filter-pills button:nth-child(3) i { background: #28ad70; }
.task-shell .task-filter-pills button:nth-child(4) i { background: #e16066; }
.task-shell .task-filter-pills button.active i { background: #fff; }

.task-shell .task-searches {
  display: grid;
  grid-template-columns: minmax(150px, .56fr) minmax(150px, .56fr) minmax(280px, 1.7fr);
  gap: 10px;
  width: 100%;
  min-width: 0;
}
.task-shell .task-searches > * { min-width: 0; }
.task-shell .date-filter,
.task-shell .select-filter,
.task-shell .task-searches .search-box {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  height: 44px;
  border-radius: 12px;
}
.task-shell .task-searches .search-box { padding-left: 13px; padding-right: 13px; }
.task-shell .task-searches .search-box input { min-width: 0; }

/* Table fields keep their semantic width; horizontal scrolling is intentional. */
.task-shell .task-table { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.task-shell .task-head,
.task-shell .task-record,
.task-shell .task-footer {
  min-width: 1120px;
}
.task-shell .task-head,
.task-shell .task-record {
  grid-template-columns: minmax(235px,1.45fr) minmax(150px,1fr) minmax(92px,.65fr) minmax(150px,1.05fr) minmax(74px,.55fr) minmax(110px,.76fr) minmax(180px,1.15fr);
}
.task-shell .task-head span,
.task-shell .task-record span,
.task-shell .task-record time,
.task-shell .task-record .task-result { min-width: 0; }

/* Ensure the original medium breakpoint never hides fields for a desktop worktable. */
@media (min-width: 761px) {
  .task-shell .task-head span:nth-child(5),
  .task-shell .task-head span:nth-child(7),
  .task-shell .task-record > span:nth-child(5),
  .task-shell .task-record > .task-result { display: flex; }
}

/* ---------- Finite responsive contract ---------- */
@media (max-width: 1100px) {
  :root { --zy-frame-gutter: 28px; }
  .admin-shell .admin-sidebar {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 11px;
  }
  .admin-shell .admin-side-brand {
    min-width: 0;
    padding: 0 0 11px;
    border-right: 0;
    border-bottom: 1px solid var(--admin-line, #e8ebf3);
  }
  .admin-shell .admin-sidebar nav { width: 100%; }
  .admin-shell .admin-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-shell .admin-overview-grid { grid-template-columns: minmax(0, 1fr); }
  .task-shell .task-searches { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .task-shell .task-searches .search-box { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  :root { --zy-frame-gutter: 16px; }
  .site-head { height: 72px; }
  .site-head .nav-shell { grid-template-columns: 1fr auto; gap: 10px; }
  .site-head .top-nav { display: none; }
  .site-head .account-name { display: none; }
  .site-head .brand-copy strong { font-size: 16px; }
  .page-main { padding-top: 34px; padding-bottom: 58px; }
  .home-shell .hero-home { padding-top: 52px; }
  .admin-shell .admin-layout { padding-top: 22px; }
  .admin-shell .admin-sidebar { margin-bottom: 26px; padding: 11px; }
  .admin-shell .admin-nav-item { min-height: 40px; padding: 0 10px; }
  .admin-shell .admin-page-title,
  .admin-shell .admin-section-head { display: block; }
  .admin-shell .admin-scope,
  .admin-shell .admin-window,
  .admin-shell .admin-search { display: inline-flex; margin-top: 14px; }
  .admin-shell .admin-search { width: 100%; }
  .admin-shell .admin-metric-grid,
  .admin-shell .system-health-grid,
  .admin-shell .admin-tool-health-grid,
  .admin-shell .admin-usage-summary { grid-template-columns: minmax(0, 1fr); }
  .task-shell .task-heading { display: block; }
  .task-shell .task-heading .button { width: 100%; margin-top: 18px; }
  .task-shell .task-filter-pills { width: 100%; }
  .task-shell .task-filter-pills button { min-width: 88px; padding: 0 13px; }
  .task-shell .task-searches { grid-template-columns: minmax(0, 1fr); }
  .task-shell .task-searches .search-box { grid-column: auto; }
  .task-shell .task-head,
  .task-shell .task-record,
  .task-shell .task-footer { min-width: 1020px; }
}


/* ---------- v6 interaction completion: filters, modals and no-fake-controls ---------- */
.task-shell .task-control {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #e1e5ef;
}
.task-shell .task-control select,
.task-shell .page-size select {
  appearance: none;
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.task-shell .task-control svg { flex: 0 0 auto; color: #6f798a; }
.task-shell .page-size { display: inline-flex; align-items: center; min-height: 34px; }
.task-shell .page-size select { padding: 0 8px; }
.task-shell .task-footer button:disabled { opacity: .42; cursor: not-allowed; }

.api-key-visibility {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6a7484;
}
.api-key-visibility:hover { color: #244f76; }
.api-key-visibility .icon { width: 18px; height: 18px; }

.admin-user-row[hidden] { display: none !important; }
.admin-loading {
  display: grid;
  gap: 12px;
  min-height: 280px;
  align-content: center;
}
.admin-loading i {
  display: block;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, #eef1f6, #f9fafc, #eef1f6);
  background-size: 220% 100%;
  animation: zyPulse 1.2s ease-in-out infinite;
}
.admin-loading i:nth-child(1) { width: 38%; }
.admin-loading i:nth-child(2) { width: 72%; }
.admin-loading i:nth-child(3) { width: 54%; }
@keyframes zyPulse { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.admin-modal-layer {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .40);
  backdrop-filter: blur(5px);
}
.admin-modal {
  width: min(570px, 100%);
  max-height: min(86vh, 860px);
  overflow: auto;
  padding: 24px;
  border: 1px solid #e5e9f0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .25);
}
.admin-modal > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.admin-modal > header h2 { margin: 0; font-size: 22px; color: #1b2738; }
.admin-modal > header button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #f2f4f8;
  color: #5f6a7a;
  font-size: 20px;
}
.admin-modal label { display: grid; gap: 8px; margin: 14px 0; color: #374356; font-size: 13px; font-weight: 650; }
.admin-modal input,
.admin-modal textarea {
  width: 100%;
  border: 1px solid #dce2eb;
  border-radius: 10px;
  padding: 10px 11px;
  outline: 0;
  background: #fff;
  color: #243143;
}
.admin-modal input:focus,
.admin-modal textarea:focus { border-color: #668db8; box-shadow: 0 0 0 3px rgba(66, 117, 168, .12); }
.admin-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.admin-detail-list > div { padding: 11px 12px; border: 1px solid #edf0f5; border-radius: 11px; background: #fafbfc; }
.admin-detail-list dt { margin: 0 0 4px; color: #7a8595; font-size: 11px; }
.admin-detail-list dd { margin: 0; color: #2d3c50; font-size: 13px; overflow-wrap: anywhere; }
.admin-modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.admin-modal-actions > button:not(.button) { min-height: 40px; padding: 0 14px; border: 1px solid #dfe4ec; border-radius: 10px; background: #fff; color: #4b596c; }

@media (max-width: 760px) {
  .admin-modal-layer { padding: 14px; }
  .admin-modal { padding: 18px; border-radius: 16px; }
  .admin-detail-list { grid-template-columns: 1fr; }
}


/* ==========================================================================\n   智研网 · 运营管理统一工作台 v7\n   六个后台栏目固定在同一内容舞台：标题区、内容边界、卡片节奏和表格承载一致。\n   ========================================================================== */
:root { --zy-admin-stage: 1180px; }
.admin-shell .admin-layout {
  width: var(--zy-frame);
  max-width: none;
  margin-inline: auto;
  padding-top: clamp(30px, 3.5vw, 48px);
}
.admin-shell .admin-sidebar {
  width: 100%;
  max-width: none;
  min-height: 70px;
  margin-bottom: 26px;
  border: 1px solid #e6e9f1;
  border-radius: 20px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 12px 30px rgba(30,38,82,.045);
}
.admin-shell .admin-content {
  width: min(100%, var(--zy-admin-stage));
  max-width: none;
  min-width: 0;
  margin-inline: auto;
  display: grid;
  gap: 22px;
}
.admin-shell .admin-content > * {
  width: 100%;
  max-width: none;
  min-width: 0;
}
.admin-shell .admin-page-title,
.admin-shell .admin-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 132px;
  margin: 0 !important;
  padding: 28px 30px;
  border: 1px solid #e6e9f1;
  border-radius: 22px;
  background:
    radial-gradient(circle at 91% 10%, rgba(124,111,242,.13), transparent 15rem),
    linear-gradient(145deg, #fff 0%, #fbfbff 100%);
  box-shadow: 0 14px 34px rgba(30,38,82,.05);
}
.admin-shell .admin-page-title > *,
.admin-shell .admin-section-head > * { min-width: 0; }
.admin-shell .admin-page-title h1,
.admin-shell .admin-section-head h1,
.admin-shell .admin-section-head h2 { color: #1b2141; letter-spacing: -.06em; }
.admin-shell .admin-page-title p,
.admin-shell .admin-section-head p { max-width: 660px; }
.admin-shell .admin-section-head > .search-box { flex: 0 1 310px; min-width: 260px; }
.admin-shell .admin-metric-grid,
.admin-shell .admin-overview-grid,
.admin-shell .admin-usage-summary,
.admin-shell .system-health-grid,
.admin-shell .admin-tool-health-grid,
.admin-shell .admin-table,
.admin-shell .admin-privacy-note {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}
.admin-shell .admin-table {
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 15px 36px rgba(38,45,86,.055);
}
.admin-shell .users-table .admin-table-head,
.admin-shell .users-table .admin-user-row,
.admin-shell .api-admin-table .admin-table-head,
.admin-shell .api-admin-table .admin-api-row,
.admin-shell .admin-task-table .admin-table-head,
.admin-shell .admin-task-table .admin-task-row,
.admin-shell .admin-audit-table .admin-table-head,
.admin-shell .admin-audit-table .admin-audit-row { min-width: 1080px; }
.admin-shell .admin-metric-grid > *,
.admin-shell .admin-overview-grid > *,
.admin-shell .admin-usage-summary > *,
.admin-shell .system-health-grid > *,
.admin-shell .admin-tool-health-grid > * { min-width: 0; }

@media (max-width: 1210px) {
  :root { --zy-admin-stage: 100%; }
  .admin-shell .admin-content { width: 100%; }
}
@media (max-width: 760px) {
  .admin-shell .admin-sidebar { margin-bottom: 18px; border-radius: 16px; }
  .admin-shell .admin-content { gap: 16px; }
  .admin-shell .admin-page-title,
  .admin-shell .admin-section-head {
    display: block;
    min-height: 0;
    padding: 22px 18px;
    border-radius: 18px;
  }
  .admin-shell .admin-section-head > .search-box { width: 100%; min-width: 0; }
  .admin-shell .users-table .admin-table-head,
  .admin-shell .users-table .admin-user-row,
  .admin-shell .api-admin-table .admin-table-head,
  .admin-shell .api-admin-table .admin-api-row,
  .admin-shell .admin-task-table .admin-table-head,
  .admin-shell .admin-task-table .admin-task-row,
  .admin-shell .admin-audit-table .admin-table-head,
  .admin-shell .admin-audit-table .admin-audit-row { min-width: 960px; }
}


/* ===========================================================================
   智研网 · 全页画布修正 v8
   目的：后台不再拥有一个独立、可见边界的“窄页面”。背景铺满浏览器，
   Logo、运营管理导航、栏目标题与数据承载统一落在一条 1080px 栅格上。
   此段必须位于旧规则之后，以消除旧版不同栏目之间的宽度继承。
   =========================================================================== */
:root {
  --zy-admin-content-max: 1080px;
  --zy-admin-gutter: 32px;
}
html,
body,
#app {
  width: 100%;
  min-width: 0;
  min-height: 100%;
}
body {
  background:
    radial-gradient(circle at 92% 5%, rgba(139,117,255,.10), transparent 30rem),
    linear-gradient(180deg,#fff 0,#fcfcff 60%,#f7f8ff 100%);
}
.shell,
.admin-shell {
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 100vh;
}
.admin-shell {
  overflow-x: clip;
  background:
    radial-gradient(circle at 92% 4%, rgba(139,117,255,.13), transparent 30rem),
    radial-gradient(circle at 8% 16%, rgba(86,106,255,.08), transparent 27rem),
    linear-gradient(180deg,#fbfcff 0%,#f8f9ff 46%,#f7f8fc 100%);
}
.admin-shell .site-head {
  width: 100%;
  max-width: none;
  background: rgba(255,255,255,.84);
}
.admin-shell .site-head .nav-shell,
.admin-shell .admin-layout,
.admin-shell .site-footer {
  width: min(var(--zy-admin-content-max), calc(100% - var(--zy-admin-gutter) - var(--zy-admin-gutter)));
  max-width: none;
  margin-inline: auto;
}
.admin-shell .site-head .nav-shell {
  grid-template-columns: 1fr auto 1fr;
}
.admin-shell .admin-layout {
  display: block;
  min-width: 0;
  padding-top: 42px;
  padding-bottom: 80px;
}
.admin-shell .admin-sidebar,
.admin-shell .admin-content,
.admin-shell .admin-content > *,
.admin-shell .admin-panel,
.admin-shell .admin-table,
.admin-shell .admin-metric-grid,
.admin-shell .admin-overview-grid,
.admin-shell .admin-usage-summary,
.admin-shell .system-health-grid,
.admin-shell .admin-tool-health-grid,
.admin-shell .admin-privacy-note {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin-left: 0;
  margin-right: 0;
}
.admin-shell .admin-sidebar {
  margin-bottom: 28px;
}
.admin-shell .admin-content {
  display: grid;
  gap: 22px;
}
/* Content stays at one constant stage; wide tables scroll inside their own card only. */
.admin-shell .admin-table {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable both-edges;
}
.admin-shell .admin-page-title,
.admin-shell .admin-section-head {
  width: 100%;
  min-height: 132px;
}
.admin-shell [hidden] { display: none !important; }

@media (max-width: 760px) {
  :root { --zy-admin-gutter: 16px; }
  .admin-shell .admin-layout { padding-top: 22px; padding-bottom: 54px; }
  .admin-shell .site-head .nav-shell,
  .admin-shell .admin-layout,
  .admin-shell .site-footer {
    width: calc(100% - var(--zy-admin-gutter) - var(--zy-admin-gutter));
  }
}


/* ===========================================================================
   智研网 · 公共页头坐标修正 v9
   后台业务舞台仍保持固定宽度；公共品牌头不再继承后台 1080px 业务舞台。
   这样首页、运营管理、文献专题地图、MS-MR 的 Logo 都落在同一条全站坐标线上。
   =========================================================================== */
.admin-shell .site-head .nav-shell {
  width: min(var(--max), calc(100% - 96px));
  max-width: none;
  margin-inline: auto;
}
@media (max-width: 760px) {
  .admin-shell .site-head .nav-shell { width: calc(100% - 32px); }
}

/* ========================================================================
   智研网 v10 · 长条工具入口 + 平台模型服务与计费
   ======================================================================== */
.home-shell .feature-grid,
.tools-shell .catalog-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 16px;
}
.home-shell .feature-card {
  grid-template-columns: 196px minmax(0, 1fr) !important;
  min-height: 232px;
  padding: 20px 24px;
  align-items: stretch;
  position: relative;
  overflow: hidden;
}
.home-shell .feature-card::after,
.tools-shell .catalog-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #5267f6, #9678f5);
  opacity: .96;
}
.home-shell .feature-art {
  min-height: 188px;
  margin: 0;
  border-radius: 16px;
  background: linear-gradient(145deg, #f4f5ff, #fbfaff);
}
.home-shell .feature-copy {
  padding: 12px 8px 10px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto 1fr auto;
  column-gap: 22px;
  align-items: start;
}
.home-shell .feature-title,
.home-shell .feature-copy > p,
.home-shell .feature-copy > ul { grid-column: 1; }
.home-shell .feature-copy > p { max-width: 720px; margin: 10px 0 12px; }
.home-shell .feature-copy > ul {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 16px;
  width: 100%;
  align-self: center;
}
.home-shell .feature-actions {
  grid-column: 1 / -1;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #edf0f6;
}
.tools-shell .catalog-card {
  position: relative;
  grid-template-columns: 174px minmax(0, 1fr) auto !important;
  grid-template-rows: 1fr !important;
  min-height: 205px;
  gap: 20px;
  padding: 19px 22px;
  align-items: center;
}
.tools-shell .catalog-art {
  grid-row: 1 !important;
  align-self: stretch;
  border-radius: 15px;
  background: linear-gradient(145deg, #f4f5ff, #fbfaff);
}
.tools-shell .catalog-main { padding: 4px 0; }
.tools-shell .catalog-main p { max-width: 760px; margin: 9px 0 10px; }
.tools-shell .catalog-main ul {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px 14px;
}
.tools-shell .catalog-main .api-use { margin-top: 11px; }
.tools-shell .catalog-action {
  grid-column: auto !important;
  align-self: center !important;
  padding-left: 10px;
  white-space: nowrap;
}
.tools-shell .catalog-action .button { min-width: 104px; }

/* Account page is a platform model center rather than a user-credential form. */
.api-shell .top-grid { grid-template-columns: 1.12fr .88fr; }
.api-shell .provider-card,
.api-shell .billing-card { min-height: 330px; }
.platform-model-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 12px 0 0 144px;
  padding: 11px 12px;
  border: 1px solid #e3e7fb;
  border-radius: 11px;
  background: linear-gradient(135deg, #f7f8ff, #fbfaff);
  color: #707a91;
  font-size: 10px;
  line-height: 1.7;
}
.platform-model-note .icon { width: 15px; color: #596cef; margin-top: 1px; }
.platform-model-note b { color: #3f4cb8; }
.billing-summary { padding: 4px 22px 20px; }
.billing-summary > div {
  padding: 18px;
  border: 1px solid #e3e7fa;
  border-radius: 14px;
  background: radial-gradient(circle at 100% 0, rgba(129,112,245,.18), transparent 9rem), linear-gradient(135deg,#f8f9ff,#fff);
}
.billing-summary > div > span { display: block; color: #778199; font-size: 10px; }
.billing-summary > div > b { display: block; margin-top: 7px; color: #202852; font-size: 32px; letter-spacing: -.065em; }
.billing-summary > div > small { display: block; margin-top: 7px; color: #7f88a2; font-size: 10px; }
.billing-summary dl { margin: 16px 0 0; display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 8px; }
.billing-summary dl div { min-width: 0; padding: 10px 0; border-top: 1px solid #edf0f5; }
.billing-summary dt { color: #8a92a0; font-size: 9px; }
.billing-summary dd { margin: 5px 0 0; color: #44506a; font-size: 11px; font-weight: 760; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.billing-foot { display: flex; gap: 8px; align-items: flex-start; padding: 13px 22px 20px; color: #778197; font-size: 10px; line-height: 1.65; }
.billing-foot .icon { color: #586aef; width: 15px; }

/* Operator-only model service panel. */
.admin-provider-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 16px; }
.admin-provider-card { display: flex; align-items: center; gap: 13px; padding: 17px 18px; border: 1px solid #e5e8f1; border-radius: 16px; background: linear-gradient(135deg,#fff,#fbfcff); box-shadow: var(--shadow-soft); }
.admin-provider-card .provider-logo { flex: 0 0 auto; width: 34px; height: 34px; }
.admin-provider-card > div { min-width: 0; flex: 1; }
.admin-provider-card b { display: block; color: #28324a; font-size: 13px; }
.admin-provider-card p { margin: 5px 0 0; color: #7c8595; font-size: 10px; line-height: 1.6; }
.admin-model-service-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-model-service { min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px; border: 1px solid #e4e8f1; border-radius: 16px; background: #fff; box-shadow: var(--shadow-soft); }
.admin-model-service-head { grid-column: 1 / -1; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid #edf0f5; }
.admin-model-service-head h3 { margin: 5px 0 3px; color: #26304a; font-size: 16px; letter-spacing: -.045em; }
.admin-model-service-head small { color: #858e9d; font-size: 9px; }
.admin-model-service label { display: grid; min-width: 0; gap: 6px; color: #788291; font-size: 10px; }
.admin-model-service label.wide { grid-column: 1 / -1; }
.admin-model-service input:not([type="checkbox"]) { width: 100%; height: 38px; padding: 0 10px; border: 1px solid #e1e5ed; border-radius: 10px; outline: 0; background: #fff; color: #354059; font-size: 11px; }
.admin-model-service input:focus { border-color: #7884f4; box-shadow: 0 0 0 3px rgba(98,112,244,.11); }
.admin-model-service .model-enabled { display: flex; align-items: center; gap: 8px; padding-top: 15px; }
.admin-model-service .model-enabled input { accent-color: #5e70f5; }
.admin-model-service-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 13px; border-top: 1px solid #edf0f5; }
.admin-model-service-foot p { margin: 0; max-width: 420px; color: #7d8795; font-size: 10px; line-height: 1.6; }

@media (max-width: 900px) {
  .home-shell .feature-card { grid-template-columns: 154px minmax(0, 1fr) !important; }
  .home-shell .feature-copy > ul,
  .tools-shell .catalog-main ul { grid-template-columns: 1fr 1fr; }
  .tools-shell .catalog-card { grid-template-columns: 145px minmax(0, 1fr) !important; }
  .tools-shell .catalog-action { grid-column: 2 !important; align-self: end !important; }
  .api-shell .top-grid { grid-template-columns: 1fr; }
  .admin-model-service-list { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .home-shell .feature-card,
  .tools-shell .catalog-card { grid-template-columns: 1fr !important; }
  .home-shell .feature-art { min-height: 128px; }
  .tools-shell .catalog-art { min-height: 118px; grid-row: auto !important; }
  .home-shell .feature-copy { padding: 16px 2px 3px; display: flex; }
  .home-shell .feature-copy > ul,
  .tools-shell .catalog-main ul { grid-template-columns: 1fr; }
  .tools-shell .catalog-action { grid-column: auto !important; padding: 4px 0 0; }
  .platform-model-note { margin-left: 0; }
  .billing-summary dl { grid-template-columns: 1fr; }
  .admin-model-service { grid-template-columns: 1fr; }
  .admin-model-service label.wide,
  .admin-model-service-head,
  .admin-model-service-foot { grid-column: auto; }
  .admin-model-service-foot { align-items: flex-start; flex-direction: column; }
}

/* v11: multi-provider model service console. Provider keys remain write-only in the UI. */
.model-service-panel { display: grid; gap: 18px; }
.admin-service-onboarding { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.admin-service-create,
.admin-provider-config-card,
.admin-provider-model-group {
  min-width: 0;
  padding: 18px;
  border: 1px solid #e3e7f1;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(250,251,255,.96));
  box-shadow: var(--shadow-soft);
}
.admin-service-create { display: grid; gap: 14px; align-content: start; }
.admin-form-title { display: flex; align-items: flex-start; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid #edf0f5; }
.admin-form-title > span { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(135deg,#4654d9,#7c70f5); box-shadow: 0 10px 20px rgba(84,98,232,.22); }
.admin-form-title .icon { width: 16px; height: 16px; }
.admin-form-title b { display:block; color:#29334e; font-size:14px; }
.admin-form-title small { display:block; margin-top:4px; color:#818a9a; font-size:10px; line-height:1.55; }
.admin-service-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; }
.admin-service-form-grid label { display:grid; min-width:0; gap:6px; color:#788291; font-size:10px; }
.admin-service-form-grid label.wide { grid-column:1 / -1; }
.admin-service-form-grid input:not([type="checkbox"]),
.admin-service-form-grid select {
  width:100%; height:38px; min-width:0; padding:0 10px; border:1px solid #e0e5ee; border-radius:10px; outline:0; background:#fff; color:#354059; font-size:11px;
}
.admin-service-form-grid input:focus,
.admin-service-form-grid select:focus { border-color:#7884f4; box-shadow:0 0 0 3px rgba(98,112,244,.11); }
.admin-service-form-grid .model-enabled { display:flex; align-items:center; gap:8px; padding-top:15px; }
.admin-service-form-grid .model-enabled input { accent-color:#5e70f5; }
.admin-service-form-grid .model-enabled.destructive { color:#a66b72; }
.admin-provider-config,
.admin-model-catalog { display:grid; gap:14px; }
.admin-subhead { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; padding:0 3px; }
.admin-subhead .eyebrow { display:block; margin-bottom:7px; color:#6b78e8; font-size:9px; font-weight:800; letter-spacing:.12em; }
.admin-subhead h3 { margin:0; color:#26304a; font-size:18px; letter-spacing:-.055em; }
.admin-subhead p { margin:6px 0 0; color:#838c9c; font-size:10px; line-height:1.65; }
.admin-subhead > span { flex:0 0 auto; padding:7px 9px; border-radius:999px; color:#6070df; background:#f0f2ff; font-size:10px; font-weight:750; }
.admin-provider-config-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.admin-provider-config-card { display:grid; gap:13px; }
.admin-provider-card-top { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding-bottom:12px; border-bottom:1px solid #edf0f5; }
.admin-provider-card-top > div { display:flex; gap:10px; min-width:0; align-items:center; }
.admin-provider-card-top .provider-logo { width:34px; height:34px; flex:0 0 auto; display:grid; place-items:center; border-radius:11px; color:#fff; background:linear-gradient(135deg,#4f5ce2,#8374f5); font-size:13px; font-weight:800; }
.admin-provider-card-top b { display:block; color:#2b354d; font-size:13px; }
.admin-provider-card-top small { display:block; margin-top:4px; color:#8d95a2; font-size:9px; }
.admin-provider-model-group { display:grid; gap:14px; }
.admin-provider-model-group > header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-bottom:13px; border-bottom:1px solid #e9edf5; }
.admin-provider-model-group > header > div { display:flex; align-items:center; gap:10px; min-width:0; }
.admin-provider-model-group > header .provider-logo { width:32px; height:32px; display:grid; place-items:center; border-radius:10px; color:#5d6dec; background:#eef0ff; font-size:12px; font-weight:800; }
.admin-provider-model-group > header b { display:block; color:#2b354d; font-size:13px; }
.admin-provider-model-group > header small { display:block; margin-top:4px; color:#9098a6; font-size:9px; }
.model-service-panel .admin-model-service-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
.model-service-panel .admin-model-service { background:linear-gradient(145deg,#fff,#fcfcff); }
@media (max-width: 1100px) {
  .admin-service-onboarding,
  .admin-provider-config-list,
  .model-service-panel .admin-model-service-list { grid-template-columns:1fr; }
}
@media (max-width: 650px) {
  .admin-service-form-grid { grid-template-columns:1fr; }
  .admin-service-form-grid label.wide { grid-column:auto; }
  .admin-subhead { display:block; }
  .admin-subhead > span { display:inline-flex; margin-top:10px; }
}

/* R34_GENERATED_UI_APPLY: tool catalog accent bar unification */
.home-shell .feature-card,
.tools-shell .catalog-card {
  position: relative;
  overflow: hidden;
}
.home-shell .feature-card::after,
.tools-shell .catalog-card::after {
  inset: 18px auto 18px 18px !important;
  width: 7px !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #5368f7 0%, #7b73ff 48%, #8d70f4 100%) !important;
  opacity: .98 !important;
  box-shadow: 0 0 0 1px rgba(90, 101, 245, .04), 0 10px 18px rgba(90, 101, 245, .18) !important;
}
.home-shell .feature-card {
  padding-left: 34px !important;
}
.tools-shell .catalog-card {
  padding-left: 38px !important;
  border-color: #e7eaf1 !important;
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(252,253,255,.98)) !important;
}
.home-shell .feature-art,
.tools-shell .catalog-art {
  margin-left: 0 !important;
  border-radius: 17px !important;
}
.tools-shell .catalog-card .catalog-art {
  box-shadow: inset 0 0 0 1px rgba(93, 103, 246, .055);
}
.tools-shell .catalog-main {
  padding-left: 2px !important;
}
.tools-shell .catalog-wrap + .catalog-wrap,
.home-shell .feature-card + .feature-card {
  margin-top: 0;
}
@media (max-width: 650px) {
  .home-shell .feature-card::after,
  .tools-shell .catalog-card::after {
    inset: 14px auto 14px 14px !important;
  }
  .home-shell .feature-card,
  .tools-shell .catalog-card {
    padding-left: 30px !important;
  }
}

/* R35_AIGC_UPLOAD_UI_REBUILD: tool catalog accent bar unification */
.home-shell .feature-card,
.tools-shell .catalog-card {
  position: relative;
  overflow: hidden;
}
.home-shell .feature-card::after,
.tools-shell .catalog-card::after {
  inset: 18px auto 18px 18px !important;
  width: 7px !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #5368f7 0%, #7b73ff 48%, #8d70f4 100%) !important;
  opacity: .98 !important;
  box-shadow: 0 0 0 1px rgba(90, 101, 245, .04), 0 10px 18px rgba(90, 101, 245, .18) !important;
}
.home-shell .feature-card {
  padding-left: 34px !important;
}
.tools-shell .catalog-card {
  padding-left: 38px !important;
  border-color: #e7eaf1 !important;
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(252,253,255,.98)) !important;
}
.home-shell .feature-art,
.tools-shell .catalog-art {
  margin-left: 0 !important;
  border-radius: 17px !important;
}
.tools-shell .catalog-card .catalog-art {
  box-shadow: inset 0 0 0 1px rgba(93, 103, 246, .055);
}
.tools-shell .catalog-main {
  padding-left: 2px !important;
}
.tools-shell .catalog-wrap + .catalog-wrap,
.home-shell .feature-card + .feature-card {
  margin-top: 0;
}
@media (max-width: 650px) {
  .home-shell .feature-card::after,
  .tools-shell .catalog-card::after {
    inset: 14px auto 14px 14px !important;
  }
  .home-shell .feature-card,
  .tools-shell .catalog-card {
    padding-left: 30px !important;
  }
}


/* R13.4.9 OpenAlex public-key / BYOK account control */
.openalex-account-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 34px;
  padding: 30px;
  border: 1px solid rgba(20, 28, 56, .08);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(246,248,255,.96));
  box-shadow: 0 24px 70px rgba(32, 43, 90, .08);
}
.openalex-account-card h2 { margin: 6px 0 8px; font-size: 26px; }
.openalex-account-card p { margin: 0; color: #737d94; line-height: 1.7; }
.openalex-title-row { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; }
.openalex-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:24px; }
.openalex-stats > div { padding:14px 16px; border:1px solid rgba(40,52,94,.07); border-radius:16px; background:rgba(255,255,255,.78); }
.openalex-stats span { display:block; color:#8a93a9; font-size:12px; margin-bottom:6px; }
.openalex-stats b { font-size:15px; color:#171d30; }
.openalex-warm-note { display:flex; gap:12px; margin-top:18px; padding:14px 16px; border-radius:16px; background:#f2f4ff; color:#59637f; }
.openalex-warm-note svg { flex:0 0 auto; width:20px; height:20px; color:#5d67f6; }
.openalex-warm-note p { font-size:13px; }
.openalex-account-form { display:flex; flex-direction:column; gap:16px; padding:22px; border:1px solid rgba(40,52,94,.08); border-radius:20px; background:#fff; }
.openalex-account-form label { display:grid; gap:8px; }
.openalex-account-form label > span { font-size:13px; font-weight:700; color:#3e465b; }
.openalex-account-form input,
.openalex-account-form select { width:100%; min-height:48px; border:1px solid #e2e6f0; border-radius:14px; padding:0 14px; background:#fff; color:#171d30; }
.openalex-account-form > small { color:#8a93a9; line-height:1.6; }
.openalex-form-actions { display:flex; flex-wrap:wrap; gap:10px; }
.button.danger-lite { color:#c84343; border-color:#f1caca; background:#fff7f7; }
@media (max-width: 980px) {
  .openalex-account-card { grid-template-columns:1fr; }
}
@media (max-width: 650px) {
  .openalex-account-card { padding:20px; border-radius:22px; }
  .openalex-stats { grid-template-columns:1fr; }
  .openalex-title-row { flex-direction:column; }
}

/* R13.4.9 admin OpenAlex service */
.openalex-admin-config { grid-column: 1 / -1; }
.openalex-admin-config .admin-form-title { display:flex; align-items:center; gap:14px; }
.openalex-admin-config .admin-form-title > .status-tag { margin-left:auto; }
.admin-openalex-metrics { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:10px; margin:18px 0; }
.admin-openalex-metrics > div { padding:14px; border:1px solid rgba(30,42,82,.07); border-radius:14px; background:#f8f9fc; }
.admin-openalex-metrics span { display:block; font-size:11px; color:#8992a6; margin-bottom:6px; }
.admin-openalex-metrics b { font-size:18px; color:#171d30; }
.admin-openalex-actions { display:flex; gap:10px; flex-wrap:wrap; }
@media (max-width: 1100px) { .admin-openalex-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width: 650px) { .admin-openalex-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } }
