/* ==========================================================================
   chrome.css — 公告条 / 导航 / 下拉 / 抽屉 / 页脚
   ========================================================================== */

/* ---------------- 顶部公告条 40px ---------------- */
.notice {
  position: relative;
  flex: none;
  height: var(--banner-h);
  background: var(--color-notice-bg);
  color: var(--color-notice-ink);
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 20;
}
.notice__track {
  display: flex;
  gap: 8px;                       /* 实测：条目之间 gap 8px */
  min-width: max-content;
  animation: marquee 20s linear infinite;
}
.notice__set { display: flex; align-items: center; gap: 8px; flex: none; white-space: nowrap; }
.notice__item { font-size: 13px; line-height: 22px; white-space: nowrap; flex: none; }
.notice__item b { font-weight: 600; }
.notice__link {
  font-size: 13px; line-height: 22px;
  color: inherit; text-decoration: underline; white-space: nowrap;
}
.notice__fade {
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  padding: 0 16px 0 8px;
  height: 100%;
  display: flex; align-items: center;
  background: linear-gradient(to right, rgba(0, 0, 0, 0), var(--color-notice-bg) 42%);
}
.notice__close {
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  color: inherit; cursor: pointer;
  transition: opacity .15s var(--ease-std);
}
.notice__close:hover { opacity: .7; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
body.notice-off .notice { display: none; }
body.notice-off .hero-portal { min-height: 100vh; }

/* ---------------- 导航 ---------------- */
.nav-wrap { position: sticky; top: 0; z-index: 10; width: 100%; }
.nav {
  display: none;
  width: 100%;
  height: var(--nav-h);
  padding: 4px 0;
  background: transparent;
  transition: background-color .3s var(--ease-std), box-shadow .3s var(--ease-std), backdrop-filter .3s var(--ease-std);
}
@media (min-width: 920px) { .nav { display: block; } }

.nav.is-stuck {
  background: var(--nav-stuck-bg);
  backdrop-filter: var(--nav-blur);
  -webkit-backdrop-filter: var(--nav-blur);
  box-shadow: 0 1px 0 var(--color-border-warm);
}
.nav__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  height: 100%;
  width: calc(100% - (var(--gutter) * 2));
  max-width: var(--container);
  margin-inline: auto;
}
.nav__brand { display: flex; align-items: center; gap: 12px; justify-self: start; }
.nav__menu  { display: flex; align-items: center; gap: 4px; justify-self: center; }
.nav__right { display: flex; align-items: center; gap: 8px; justify-self: end; }

/* 桌面窄屏：菜单项收紧，保证 7 项导航仍以页面中心为轴 */
@media (max-width: 1180px) and (min-width: 920px) {
  .nav__inner .nav__menu { gap: 2px; }
  .nav__inner .nav__menu .nav__link { padding-inline: 8px; }
}

/* 字标：132x16 横向比例，文本实现（不复刻官方 logo 图形） */
.wordmark {
  display: inline-grid;
  grid-template-columns: max-content;
  grid-auto-rows: max-content;
  align-items: center;
  justify-items: start;
  line-height: 0;
  height: 16px;
  width: 131px;
  color: var(--color-highlight);
}
.wordmark--sm { width: auto; }
.wordmark__glyph, .wordmark__txt {
  font-family: var(--font-hero);
  font-size: 21px; font-weight: 700;
  line-height: 16px;
  letter-spacing: -.01em;
}
.wordmark__tail {
  position: absolute;
  margin-left: 8px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--color-text-secondary);
  letter-spacing: .06em;
  white-space: nowrap;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 8px 12px;
  border-radius: var(--r-6);
  font-size: 14px;
  line-height: 22px;
  color: var(--color-text);
  white-space: nowrap;
  transition: color .15s var(--ease-std), background-color .15s var(--ease-std);
}
.nav__link:hover { background: var(--color-hover); color: var(--color-text-strong); }
.nav__link--strong { color: var(--color-text-strong); }
.nav__caret { transition: transform .2s var(--ease-std); }
.nav__dd { position: relative; }
.nav__dd:hover .nav__caret,
.nav__dd.is-open .nav__caret { transform: rotate(180deg); }

/* 触发词与菜单之间视觉上留了 6px 缝隙：补一块透明命中区，
   鼠标从触发词下移到菜单时不会因为离开 .nav__dd 而把菜单收起。
   命中区只覆盖触发词自身宽度，避免同时命中相邻的下拉。 */
.nav__dd::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 14px;
  z-index: 29;
}
/* 左侧“模型与价格”菜单比触发词宽（246 vs 110），命中区跟着菜单加宽，
   侧向移动也不会掉出桥；右侧账户/主题下拉保持触发词宽度，避免串开。 */
.nav__dd:not(.nav__dd--right)::after { left: -70px; right: -70px; }

/* 下拉 */
.dd {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translate(-50%, 6px);
  min-width: 246px;
  padding: 8px;
  background: var(--color-card);
  border: 1px solid var(--color-border-warm);
  border-radius: var(--r-12);
  box-shadow: 0 12px 32px var(--color-shadow);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s var(--ease-std), transform .18s var(--ease-std), visibility .18s;
  z-index: 30;
}
.dd--sm { min-width: 132px; }
.nav__dd:hover .dd,
.nav__dd.is-open .dd { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0); }
.dd__item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; border-radius: var(--r-8);
  transition: background .15s var(--ease-std);
}
.dd__item:hover { background: var(--color-surface-hover); }
.dd__t { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--color-text-strong); }
.dd__d { font-size: 12px; line-height: 18px; color: var(--color-text-secondary); }
.dd__row { display: block; padding: 8px 10px; border-radius: var(--r-8); font-size: 14px; line-height: 20px; }
.dd__row:hover { background: var(--color-surface-hover); }
.dd__foot { margin-top: 6px; padding: 8px 10px 4px; border-top: 1px solid var(--color-border-warm); font-size: 13px; color: var(--color-text-secondary); }
.dd__foot a:hover { color: var(--color-text-strong); }

/* 主题三态开关：沿用 mimo 的 .dd 与 chip 尺寸，不新增组件形态 */
.theme-seg {
  display: flex; align-items: center; gap: 2px;
  height: 32px; padding: 2px;
  border: 1px solid var(--color-border-warm);
  border-radius: var(--r-999);
}
.theme-seg button {
  height: 26px; padding: 0 10px; border-radius: var(--r-999);
  font-size: 12px; line-height: 16px; color: var(--color-text-secondary);
  font-family: var(--font-mono);
  transition: background-color .15s var(--ease-std), color .15s var(--ease-std);
}
.theme-seg button[aria-pressed="true"] { background: var(--color-invert); color: var(--color-on-invert); }
.theme-seg button:hover:not([aria-pressed="true"]) { background: var(--color-hover); color: var(--color-text-strong); }

/* 账户下拉：一个入口，二级菜单放登录 / 注册取 Key / 控制台 */
.nav__dd--right .dd {
  left: auto; right: 0;
  transform: translate(0, 6px);
  min-width: 258px;
}
.nav__dd--right:hover .dd,
.nav__dd--right.is-open .dd { transform: translate(0, 0); }
.nav__account {
  min-width: 0; height: 36px; padding: 4px 14px;
  gap: 6px;
  font-size: 14px; font-weight: 500;
}
.nav__account .nav__caret { width: 12px; height: 12px; }
.nav__dd--right .dd__d { line-height: 17px; }
@media (max-width: 919px) {
  .nav__account__full { display: none; }
  .nav__dd--right .dd { min-width: 236px; }
}

/* 配色下拉：触发器只占一颗小胶囊，三个模式收进菜单 */
.theme-dd .dd { min-width: 148px; }
.theme-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 10px;
  border: 1px solid var(--color-border-warm); border-radius: var(--r-999);
  background: transparent; color: var(--color-text-secondary);
  transition: color .15s var(--ease-std), border-color .15s var(--ease-std);
}
.theme-trigger:hover { color: var(--color-text-strong); border-color: var(--color-line); }
.theme-trigger > svg:first-child { width: 14px; height: 14px; }
.theme-trigger__label { font-family: var(--font-mono); font-size: 12px; line-height: 16px; }
.theme-dd .nav__caret { width: 11px; height: 11px; }
.dd--theme .dd__row {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; text-align: left;
  font-size: 14px; line-height: 20px;
  color: var(--color-text);
}
.dd--theme .dd__row.is-on { color: var(--color-text-strong); font-weight: 600; }
.dd__tick { font-family: var(--font-mono); font-size: 12px; color: var(--color-text-strong); }
.dd__tick::before { content: ""; }
.dd__row.is-on .dd__tick::before,
.theme-row.is-on .dd__tick::before { content: "✓"; }

/* 抽屉里的配色：同三个选项，竖向排列 */
.drawer__label { padding: 14px 4px 4px; font-size: 12px; color: var(--color-text-secondary); }
.theme-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  text-align: left;
}
.theme-row.is-on { color: var(--color-text-strong); font-weight: 600; }

/* 汉堡 / 抽屉（<920） */
.nav__burger { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 36px; height: 36px; align-items: center; }
.nav__burger span { display: block; width: 18px; height: 1.5px; background: var(--color-text-strong); transition: transform .25s var(--ease-std), opacity .2s; }
@media (min-width: 920px) { .nav__burger { display: none; } }
@media (max-width: 919px) { .nav .nav__menu { display: none; } .nav { display: block; } }

.drawer { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .32); opacity: 0; visibility: hidden; transition: opacity .3s var(--ease-std), visibility .3s; }
.drawer.is-open { opacity: 1; visibility: visible; }
.drawer__panel {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: min(340px, 86vw);
  padding: 20px 22px 32px;
  background: var(--color-bg-page);
  display: flex; flex-direction: column; gap: 4px;
  transform: translateX(100%);
  transition: transform .45s var(--ease-out-expo);
}
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; height: 44px; margin-bottom: 12px; }
.drawer__close { width: 36px; height: 36px; display: grid; place-items: center; }
.drawer__link { padding: 12px 4px; font-size: 16px; line-height: 22px; border-bottom: 1px solid var(--color-border-warm); }
.drawer__cta { margin-top: 18px; height: 44px; border-radius: var(--r-999); background: var(--color-invert); color: var(--color-on-invert); display: flex; align-items: center; justify-content: center; font-size: 14px; }

/* ---------------- 页脚（mimo 黑底，两主题通用） ---------------- */
.footer {
  width: 100%;
  background: #000;
  color: #fff;
  padding: 40px 16px 24px;
  font-family: var(--font-main);
}
@media (min-width: 768px) { .footer { padding: 80px 60px 32px; } }

.footer__top { display: flex; flex-direction: column; gap: 24px; padding-bottom: 40px; }
@media (min-width: 1280px) { .footer__top { flex-direction: row; justify-content: space-between; gap: 0; padding-bottom: 65px; } }
.footer__left { display: flex; flex-direction: column; gap: 24px; flex: none; }
.footer__brand { display: flex; flex-direction: column; gap: 19px; }
.footer__blurb { font-size: 14px; line-height: 22px; color: rgba(255, 255, 255, .55); max-width: 34ch; }
.footer__social { display: flex; align-items: center; gap: 12px; height: 36px; }
.footer__social > a {
  flex: none; width: 36px; height: 36px;
  display: grid; place-items: center;
  color: #fff;
  transition: opacity .2s var(--ease-std);
}
.footer__social > a:hover { opacity: .8; }
.footer__social svg { width: 20px; height: 20px; }

.footer__cols { display: none; flex-wrap: wrap; gap: 64px; justify-content: center; }
@media (min-width: 1280px) { .footer__cols { display: flex; } }
@media (max-width: 1279px) { .footer__cols { display: flex; gap: 40px 56px; } }
.fcol { display: flex; flex-direction: column; gap: 24px; min-width: 100px; }
.fcol__h { height: 24px; font-size: 16px; line-height: 24px; font-weight: 600; color: #fff; }
.fcol__list { display: flex; flex-direction: column; gap: 16px; }
.fcol__list a { font-size: 14px; line-height: 21px; color: rgba(255, 255, 255, .8); white-space: nowrap; transition: color .15s var(--ease-std); }
.fcol__list a:hover { color: #fff; }

.footer__bottom { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding-top: 24px; }
@media (min-width: 1280px) { .footer__bottom { flex-direction: row; align-items: center; justify-content: space-between; padding-top: 32px; } }
.fine { font-size: 12px; line-height: 21.6px; color: #666; }
.fine a { color: inherit; }
.sep { padding: 0 4px; }

/* ------------------- 自定义光标（mimo chrome.css:268-274 搬运） ------------------- */
.cursor-ring, .cursor-dot { position: fixed; top: 0; left: 0; pointer-events: none; border-radius: 50%; opacity: 0; z-index: 200; }
.cursor-ring { width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1px solid var(--color-text-secondary); transition: opacity .3s, width .2s var(--ease-std), height .2s var(--ease-std), border-color .2s; }
.cursor-dot  { width: 5px;  height: 5px;  margin: -2.5px 0 0 -2.5px; background: var(--color-text-strong); transition: opacity .3s; }
body.has-cursor { cursor: none; }
body.has-cursor a, body.has-cursor button { cursor: none; }
.cursor-ring.is-hot { width: 52px; height: 52px; border-color: var(--accent); }
@media (hover: none), (pointer: coarse) { .cursor-ring, .cursor-dot { display: none; } }
