
/* ===========================================================================
   智研网 UI 审计组件样式
   目标：让服务规则、反馈、空状态与后台动作进入同一套按钮、弹层和栅格系统。
   本文件在 v5 系统样式之后加载，专门覆盖旧规则造成的原生按钮回退。
   =========================================================================== */
:root {
  --ui13-ink:#171b2c;
  --ui13-muted:#737d91;
  --ui13-line:#e2e6f0;
  --ui13-soft:#f7f8fe;
  --ui13-primary:#5a69f4;
  --ui13-violet:#806ff0;
  --ui13-shadow:0 18px 46px rgba(28,36,80,.08);
}
button,
input,
select,
textarea { font:inherit; }
button { -webkit-appearance:none; appearance:none; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline:3px solid rgba(90,105,244,.24); outline-offset:3px; }
.button:disabled,
.footer-link-button:disabled,
.support-button:disabled { opacity:.52; cursor:not-allowed; transform:none; box-shadow:none; }

/* Header navigation uses the original coordinate system. */
.top-nav a { padding-left:19px; padding-right:19px; }
.top-nav a.active:before { left:21px; right:21px; }

/* Footer links and all policy actions are explicit components, never browser-default buttons. */
.service-footer nav { align-items:center; }
.service-footer .footer-link-button {
  display:inline-flex; align-items:center; justify-content:center; min-height:28px;
  border:1px solid transparent; border-radius:9px; background:transparent; color:#6e788b;
  padding:6px 8px; font-size:11px; font-weight:680; line-height:1; text-decoration:none;
  transition:background .16s ease,color .16s ease,border-color .16s ease;
}
.service-footer .footer-link-button:hover { color:#4f60e3; background:#f1f3ff; border-color:#e1e4ff; }

/* Service-rule confirmation state */
.service-consent-card { gap:18px; padding:24px; border-radius:20px; }
.service-consent-card.accepted { display:flex; align-items:center; justify-content:space-between; gap:18px; }
.consent-copy { display:flex; align-items:flex-start; gap:13px; }
.consent-copy > .icon { width:30px; height:30px; padding:7px; border-radius:10px; background:#eef1ff; color:#5b6cf1; }
.consent-copy h2 { margin:7px 0 7px; }
.consent-check { min-height:114px; padding:14px 15px; }
.policy-inline-link {
  display:inline-flex; align-items:center; min-height:24px; border:0; border-radius:7px;
  background:transparent; color:#5367e9; padding:2px 4px; margin:2px 0 0 -4px;
  font-size:11px; font-weight:760; text-decoration:underline; text-underline-offset:3px;
}
.policy-inline-link:hover { background:#f0f2ff; color:#4355dc; }
.consent-action-row { padding-top:6px; }
.consent-action-buttons,
.consent-accepted-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.consent-confirm-button { min-width:210px; min-height:44px; }
.support-button {
  display:inline-flex; align-items:center; justify-content:center; min-height:42px;
  padding:10px 14px; border:1px solid #dfe4ef; border-radius:999px; background:#fff;
  color:#526075; font-size:12px; font-weight:720; line-height:1; box-shadow:0 7px 17px rgba(35,43,78,.045);
  transition:background .16s ease,color .16s ease,border-color .16s ease,transform .16s ease;
}
.support-button:hover { border-color:#c8d0f8; background:#f6f7ff; color:#4c5fe0; transform:translateY(-1px); }
.consent-accepted-note { flex:1; min-width:0; padding:14px 15px; }
.consent-accepted-note > .icon { flex:0 0 auto; width:24px; height:24px; }
.consent-accepted-note b { display:block; color:#296849; font-size:13px; }
.consent-accepted-note p { margin:4px 0 0; }
.consent-status-label { display:inline-flex; margin:0 0 5px; color:#268352; font-size:10px; font-weight:800; letter-spacing:.11em; }
.consent-rules-button { min-height:38px; }

/* Site dialog: visual hierarchy, Escape close behavior and correct scroll boundary. */
body.site-modal-open { overflow:hidden; }
.site-modal-layer { z-index:1000; padding:24px; overflow-y:auto; align-items:center; }
.site-modal { width:min(740px,100%); max-height:calc(100dvh - 48px); overscroll-behavior:contain; }
.site-modal header { padding:25px 28px 19px; }
.site-modal header h2 { color:var(--ui13-ink); }
.modal-icon-button {
  display:grid; place-items:center; width:34px!important; height:34px!important; border:1px solid #e5e9f2!important;
  border-radius:10px!important; background:#f8f9fd!important; color:#68738a!important; font-size:20px!important;
}
.modal-icon-button:hover { background:#f0f2ff!important; color:#5265e8!important; border-color:#dbe0fb!important; }
.site-modal footer { padding:16px 28px 23px; }
.site-modal footer .modal-cancel-button { min-height:38px; }
.feedback-modal > label { padding-left:28px; padding-right:28px; }
.feedback-grid { padding-left:28px; padding-right:28px; }

/* The legacy pricing page has been removed. The account page keeps its existing action layout. */
.api-heading-actions { display:flex; align-items:center; gap:9px; flex-wrap:wrap; justify-content:flex-end; }
@media (max-width:760px) {
  .top-nav a { padding-left:10px; padding-right:10px; font-size:12px; }
  .top-nav a.active:before { left:11px; right:11px; }
  .service-consent-card { padding:18px; }
  .service-consent-card.accepted { display:grid; }
  .consent-check { min-height:0; }
  .consent-action-row { gap:13px; }
  .consent-action-buttons { justify-content:stretch; }
  .consent-action-buttons .button { width:100%; }
  .site-modal-layer { padding:12px; }
  .site-modal { max-height:calc(100dvh - 24px); }
  .site-modal header { padding:19px 18px 15px; }
  .site-modal footer { padding:13px 18px 18px; }
  .feedback-modal > label { padding-left:18px; padding-right:18px; }
  .feedback-grid { padding-left:18px; padding-right:18px; }
  .api-heading-actions { justify-content:flex-start; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { scroll-behavior:auto!important; transition-duration:.01ms!important; animation-duration:.01ms!important; }
}

/* Remaining utility actions that existed before v12 also receive explicit component treatment. */
.api-info .api-support-button { flex:0 0 auto; min-height:36px; padding:8px 12px; }
.compliance-check-grid .policy-inline-link { margin-top:1px; font-size:10px; }
.admin-modal-icon-button {
  display:grid; place-items:center; width:32px; height:32px; border:1px solid #e3e7f0;
  border-radius:10px; background:#f8f9fc; color:#657087; font-size:19px; line-height:1;
}
.admin-modal-icon-button:hover { border-color:#d6dcfa; background:#f0f2ff; color:#5165e6; }
.admin-modal-actions .admin-modal-cancel { min-height:38px; }
@media(max-width:760px){
  .api-shell,
  .api-page { overflow-x:hidden; }
  .api-info {
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:10px;
    min-width:0;
    max-width:100%;
    overflow:hidden;
  }
  .api-info > *,
  .api-info p,
  .api-info span {
    min-width:0;
    max-width:100%;
    white-space:normal;
    overflow-wrap:anywhere;
    word-break:normal;
  }
  .api-info .api-support-button { width:100%; justify-content:center; }
  .task-table,
  .task-filter-pills {
    max-width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }
}


/* R6: small additions inside the existing admin visual system. */
.admin-provider-model-group > header { gap: 12px; }
.admin-provider-api-button { margin-left: auto; white-space: nowrap; }
.admin-role-note { margin: 0 0 12px; color: #6f7b8c; font-size: 12px; line-height: 1.6; }
.admin-role-limit { margin: -2px 0 0; color: #7d8796; font-size: 12px; }
.admin-modal-check { display: flex !important; align-items: center; gap: 9px; font-weight: 600 !important; }
.admin-modal-check input { width: 16px; height: 16px; accent-color: #6067f6; }
@media (max-width: 760px) { .admin-provider-model-group > header { align-items: flex-start; flex-wrap: wrap; } .admin-provider-api-button { margin-left: 0; } }

/* ===========================================================================
   R12 · Account & compute center refinement
   Scope: restores a predictable interior safe area and replaces the browser
   native model select with a platform-level model picker.
   =========================================================================== */
:root {
  --zy-account-safe: clamp(20px, 2.15vw, 30px);
  --zy-account-section-gap: clamp(16px, 1.6vw, 22px);
}

html { scroll-padding-top: calc(var(--zy-shell-height, 84px) + 26px); }

/* The account page uses one vertical rhythm. Cards no longer depend on mixed
   bottom margins, so the content never visually presses against the next block. */
.api-shell .page-main.api-page {
  display: grid;
  gap: var(--zy-account-section-gap);
  padding-top: clamp(64px, 6.25vw, 92px);
  padding-bottom: clamp(58px, 6vw, 88px);
}
.api-shell .api-heading,
.api-shell .service-consent-card,
.api-shell .compute-balance-card,
.api-shell .api-grid { margin: 0; min-width: 0; }
.api-shell .api-heading {
  padding: 0 4px 2px;
  scroll-margin-top: calc(var(--zy-shell-height, 84px) + 28px);
}
.api-shell .api-heading h1 {
  margin-top: 14px;
  margin-bottom: 14px;
  line-height: 1.08;
}
.api-shell .api-heading p { max-width: 760px; padding-right: 14px; }

/* All content-bearing cards retain a deliberate inner edge. */
.api-shell .service-consent-card { padding: var(--zy-account-safe); }
.api-shell .compute-balance-card {
  gap: clamp(22px, 2.4vw, 34px);
  padding: var(--zy-account-safe);
}
.api-shell .compute-balance-main { padding-left: 2px; }
.api-shell .api-card { overflow: visible; }
.api-shell .card-top { padding: var(--zy-account-safe) var(--zy-account-safe) 16px; }
.api-shell .provider-form { padding: 0 var(--zy-account-safe) var(--zy-account-safe); }
.api-shell .compute-rule-card .compute-rule-grid {
  margin: 3px var(--zy-account-safe) 18px;
  gap: 10px;
}
.api-shell .compute-rule-card .compute-rule-grid > div {
  min-height: 70px;
  padding: 14px 13px;
}
.api-shell .compute-rule-card .billing-foot {
  padding: 13px var(--zy-account-safe) calc(var(--zy-account-safe) - 2px);
}
.api-shell .compute-ledger-list { margin-left: var(--zy-account-safe); margin-right: var(--zy-account-safe); }
.api-shell .usage-metrics { padding-left: var(--zy-account-safe); padding-right: var(--zy-account-safe); }
.api-shell .usage-chart { margin-left: var(--zy-account-safe); margin-right: var(--zy-account-safe); }

/* The redemption area also follows the same safe edge on every breakpoint. */
.api-shell .compute-redeem-form {
  gap: 11px;
  padding: 15px;
  border-radius: 16px;
}
.api-shell .compute-redeem-form input {
  min-height: 40px;
  padding-left: 12px;
  padding-right: 12px;
  border-radius: 11px;
}

/* ---------------------------------------------------------------------------
   Platform model picker
   This is intentionally not a styled native <select>: browser option menus
   ignore the visual language of the platform and vary by OS.
   --------------------------------------------------------------------------- */
.api-shell .inline-field.model-field {
  align-items: start;
  padding: 10px 0 4px;
}
.api-shell .inline-field.model-field > span { padding-top: 13px; }
.model-picker { position: relative; min-width: 0; }
.model-picker-trigger {
  width: 100%; min-height: 58px; border: 1px solid #dfe4ef; border-radius: 14px;
  display: flex; align-items: stretch; justify-content: space-between; gap: 12px;
  padding: 0 0 0 14px; overflow: hidden; color: #303a52; background: linear-gradient(135deg,#fff,#fbfcff);
  text-align: left; box-shadow: 0 3px 10px rgba(31,40,80,.025);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.model-picker-trigger:hover { border-color: #bcc5ed; background: #fff; }
.model-picker-trigger:focus-visible,
.model-picker.open .model-picker-trigger {
  border-color: #7381f2;
  box-shadow: 0 0 0 4px rgba(94,108,239,.11), 0 10px 22px rgba(47,57,117,.06);
}
.model-picker-trigger:disabled { cursor: not-allowed; opacity: .62; }
.model-picker-trigger-copy {
  min-width: 0; flex: 1; display: grid; align-content: center; gap: 3px; padding: 9px 0;
}
.model-picker-kicker { color: #8a93a4; font-size: 9px; font-weight: 760; letter-spacing: .08em; }
.model-picker-trigger strong {
  min-width: 0; overflow: hidden; color: #2e3851; font-size: 12px; font-weight: 780;
  line-height: 1.25; text-overflow: ellipsis; white-space: nowrap;
}
.model-picker-trigger small {
  min-width: 0; overflow: hidden; color: #788397; font-size: 10px; line-height: 1.25;
  text-overflow: ellipsis; white-space: nowrap;
}
.model-picker-chevron {
  width: 42px; flex: 0 0 42px; display: grid; place-items: center; color: #6976a5;
  border-left: 1px solid #edf0f6; background: rgba(246,248,255,.76);
}
.model-picker-chevron .icon { width: 16px; transition: transform .18s ease; transform: rotate(90deg); }
.model-picker.open .model-picker-chevron .icon { transform: rotate(-90deg); }
.model-picker-popover {
  position: absolute; inset: calc(100% + 8px) 0 auto; z-index: 70; max-height: 324px;
  overflow: auto; padding: 8px; border: 1px solid #dbe0ee; border-radius: 16px;
  background: rgba(255,255,255,.98); box-shadow: 0 20px 52px rgba(26,35,75,.17);
  opacity: 0; pointer-events: none; transform: translateY(-5px); visibility: hidden;
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}
.model-picker.open .model-picker-popover {
  opacity: 1; pointer-events: auto; transform: translateY(0); visibility: visible;
}
.model-picker-group { display: grid; gap: 3px; padding: 4px 0; }
.model-picker-group + .model-picker-group { margin-top: 4px; padding-top: 9px; border-top: 1px solid #edf0f6; }
.model-picker-group-label {
  display: block; padding: 0 9px 4px; color: #8993a5; font-size: 9px; font-weight: 820; letter-spacing: .11em;
}
.model-picker-option {
  width: 100%; display: grid; grid-template-columns: 25px minmax(0,1fr); gap: 8px; align-items: center;
  border: 1px solid transparent; border-radius: 11px; padding: 10px 9px; color: #364057; background: transparent; text-align: left;
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
}
.model-picker-option:hover { border-color: #e1e5fb; background: #f6f7ff; }
.model-picker-option:focus-visible { outline: 0; border-color: #aab4fa; background: #f4f6ff; }
.model-picker-option.is-selected { border-color: #dbe1ff; background: linear-gradient(135deg,#eff2ff,#faf9ff); }
.model-picker-option-mark {
  width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #e0e4ef; border-radius: 8px; color: transparent; background: #fff;
}
.model-picker-option-mark .icon { width: 13px; }
.model-picker-option.is-selected .model-picker-option-mark {
  border-color: #6070ed; color: #fff; background: linear-gradient(135deg,#5569f4,#826ef0);
  box-shadow: 0 5px 11px rgba(91,104,240,.2);
}
.model-picker-option-copy { min-width: 0; display: grid; gap: 3px; }
.model-picker-option-copy b { overflow: hidden; color: #313b55; font-size: 11px; font-weight: 770; text-overflow: ellipsis; white-space: nowrap; }
.model-picker-option-copy small { overflow: hidden; color: #7e889b; font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.model-picker.is-disabled .model-picker-chevron { opacity: .55; }

.api-shell .platform-model-note {
  margin-left: 144px;
  margin-top: 13px;
  padding: 12px 13px;
  border-radius: 12px;
}
.api-shell .provider-bottom { padding-top: 18px; }

@media (max-width: 980px) {
  .api-shell .compute-rule-card .compute-rule-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  :root { --zy-account-safe: 18px; --zy-account-section-gap: 14px; }
  .api-shell .page-main.api-page { padding-top: 42px; padding-bottom: 62px; }
  .api-shell .api-heading { padding-left: 1px; padding-right: 1px; }
  .api-shell .api-heading h1 { margin-top: 12px; font-size: clamp(38px, 12vw, 52px); }
  .api-shell .api-heading p { padding-right: 0; }
  .api-shell .compute-rule-card .compute-rule-grid { grid-template-columns: 1fr; margin-top: 2px; }
  .api-shell .inline-field.model-field { gap: 7px; }
  .api-shell .inline-field.model-field > span { padding-top: 0; }
  .api-shell .platform-model-note { margin-left: 0; margin-top: 12px; }
  .model-picker-popover { max-height: min(292px, 48vh); }
}

/* R17 research lab card */
.tool-visual.topic .topic-orbit{position:relative;width:128px;height:128px;border-radius:28px;background:linear-gradient(135deg,#f1f3ff,#fff);box-shadow:inset 0 0 0 1px #e1e6ff;overflow:hidden;display:grid;place-items:center}.topic-orbit:before{content:"";position:absolute;inset:20px;border:1px solid rgba(92,105,244,.28);border-radius:50%}.topic-orbit:after{content:"";position:absolute;left:22px;right:22px;top:63px;height:1px;background:rgba(92,105,244,.22);transform:rotate(-18deg)}.topic-orbit b{width:30px;height:30px;border-radius:12px;background:linear-gradient(135deg,#5368f6,#8b75ff);box-shadow:0 12px 24px rgba(83,104,246,.24)}.topic-ring{position:absolute;border:1px solid rgba(92,105,244,.28);border-radius:50%}.topic-ring.a{inset:32px}.topic-ring.b{inset:20px}.topic-ring.c{inset:8px}.topic-node{position:absolute;width:12px;height:12px;border-radius:50%;background:#6d7cff;box-shadow:0 0 0 6px rgba(109,124,255,.13)}.topic-node.n1{left:28px;bottom:32px}.topic-node.n2{right:30px;top:40px}.topic-node.n3{left:58px;top:58px}
.catalog-card.topic,.feature-card.topic{--tool-accent:#6675f1}
.catalog-card.topic{border-left:6px solid var(--tool-accent)}