/* =====================================================================
   MaxMind 官网 · Gemini 风格复刻
   风格来源：用户提供的 Gemini API 中文复刻页
   —— 顶部导航 / 深色 hero 大字 / 三卡 / 页脚
   配色沿用 Gemini 那套（浅色 header + Google 蓝 + 深色 hero）
   内容、品牌、链接全部为 MaxMind 自有

   字体（全部自托管，CSP default-src 'self' 会拦掉外域）：
     · Google Sans —— 2025 年 Google 已免费开放该字体，可合法自托管
       （https://fonts.google.com/license/googlerestricted）
       取 Google Fonts css2 API 的 v71 版，子集化后每份仅 7KB
     · Noto Sans SC —— 中文字形，沿用官网现有那份（404 片按需加载）
   ===================================================================== */

@font-face {
  font-family: 'Google Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/official/fonts/google-sans-400.woff2) format('woff2');
}

@font-face {
  font-family: 'Google Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/official/fonts/google-sans-500.woff2) format('woff2');
}

@font-face {
  font-family: 'Google Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/official/fonts/google-sans-700.woff2) format('woff2');
}

* { box-sizing: border-box; }

/* Google Sans 只有拉丁字形；中文按浏览器自动回落机制交给 Noto Sans SC
   （Noto 的 404 个分片 @font-face 由官网 style.css 提供，这里不重复声明）。
   顺序不能反 —— 反了英文也会变 Noto。 */
body {
  margin: 0;
  font-family: 'Google Sans', 'Noto Sans SC', Arial, "Microsoft YaHei", sans-serif;
  color: #f1f3f4;
  background: #060606;
}

button, input, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 0; }
a { text-decoration: none; color: inherit; }

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid #8ab4f8;
  outline-offset: 4px;
}

[hidden] { display: none !important; }

/* ---------------- 顶部导航 ---------------- */
.header {
  height: 50px;
  background: #ffffff;
  color: #202124;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid #e8eaed;
  position: relative;
  z-index: 5;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -1.3px;
  white-space: nowrap;
  color: #202124;
}

.brand svg { width: 27px; height: 27px; color: #1a73e8; }

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 14px;
  color: #0065ff;
}

.search {
  width: 200px;
  height: 36px;
  background: #f1f3f4;
  border: 0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  color: #5f6368;
  text-align: left;
}

.search svg { width: 20px; height: 20px; flex: none; }

.search .key {
  margin-left: auto;
  font-size: 12px;
  color: #80868b;
  border: 1px solid #dadce0;
  border-radius: 3px;
  padding: 0 5px;
  line-height: 16px;
}

.icon-btn {
  background: transparent;
  color: #5f6368;
  padding: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 36px;
}

.icon-btn svg { width: 24px; height: 24px; }

/* 语言下拉 */
.language { position: relative; }

.lang-btn {
  height: 36px;
  width: 140px;
  border: 1px solid #dadce0;
  background: #ffffff;
  border-radius: 4px;
  color: #5f6368;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.lang-btn svg { width: 22px; height: 22px; flex: none; }

.arrow {
  border: 5px solid transparent;
  border-top-color: #5f6368;
  transform: translateY(3px);
}

.menu {
  position: absolute;
  top: 43px;
  right: 0;
  background: #ffffff;
  color: #202124;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 6px;
  min-width: 170px;
  box-shadow: 0 6px 24px #0002;
  z-index: 20;
}

.menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px;
  background: none;
  border-radius: 5px;
  color: inherit;
}

.menu button:hover { background: #f1f3f4; }

/* 语言勾号：只有当前选中的那项显示 */
.menu .tick { display: none; color: #1a73e8; font-weight: 700; margin-left: 4px; }
html[lang="zh-CN"] .menu button[data-lang="cn"] .tick,
html[lang="en"] .menu button[data-lang="en"] .tick { display: inline; }

/* 右侧文字链 + 主按钮 */
.nav > a { color: #0065ff; white-space: nowrap; }

.nav-cta {
  background: #1a73e8;
  color: #ffffff !important;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 13px;
}

/* ---------------- 公告条 ---------------- */
.announcement {
  min-height: 64px;
  background: #1a73e8;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  padding: 0 16px;
  text-align: center;
}

.announcement a {
  color: #ffffff;
  text-decoration: underline;
  white-space: nowrap;
}

/* ---------------- 语言提示条 ---------------- */
.translation {
  min-height: 64px;
  background: #f1f3f4;
  color: #5f6368;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  font-size: 14px;
  padding: 14px 24px;
}

.translated { font-size: 12px; color: #777777; white-space: nowrap; }
.translation-copy { max-width: 560px; line-height: 20px; }

.english {
  border: 1px solid #dadce0;
  background: #ffffff;
  color: #0065ff;
  border-radius: 4px;
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.english:hover { background: #f8f9fa; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  min-height: 820px;
  overflow: hidden;
  background: #060606;
}

/* Hero 主视觉：m15.png 自带 "20" 大字，不能跟标题抢。
   处理：压低存在感 + 只从 hero 底部边缘透出，中部保持干净。 */
.art {
  position: absolute;
  left: 50%;
  bottom: 0;
  top: auto;
  width: 1920px;
  max-width: none;
  height: 950px;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: .38;
  /* 上下都淡出：中段（标题所在处）干净，边缘才有氛围 */
  mask-image: linear-gradient(to top, #000 0%, transparent 55%, transparent 78%, #000 100%);
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 55%, transparent 78%, #000 100%);
}

/* 主视觉是 <img>，要能盖住 hero 又不影响布局 */
.hero > img.art { z-index: 0; }

.intro {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-top: 150px;
}

.intro h1 {
  margin: 0;
  font-size: 96px;
  line-height: 1.16;
  letter-spacing: -4px;
  font-weight: 400;
}

.subtitle {
  font-size: 20px;
  line-height: 28px;
  font-weight: 400;
  max-width: 600px;
  margin: 30px auto 0;
  color: #bdc1c6;
  padding: 0 24px;
}

.primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  height: 58px;
  padding: 0 24px;
  background: linear-gradient(100deg, #0944ff, #438eff);
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  border-radius: 40px;
  margin-top: 50px;
}

.primary:hover { filter: brightness(1.12); }

/* ---------------- 三张卡片 ---------------- */
.cards {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 88px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 0 24px;
}

.card {
  min-height: 220px;
  border: 1px solid #202631;
  border-radius: 24px;
  background: linear-gradient(130deg, #11141c, #0e0e16);
  text-align: center;
  padding: 40px 28px 34px;
}

.card h2 { font-size: 20px; line-height: 28px; margin: 0 0 16px; letter-spacing: -.5px; }

.card p { font-size: 14px; line-height: 22px; color: #929bad; margin: 0; min-height: 44px; }

.outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 20px;
  border: 1px solid #303744;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 32px;
  background: transparent;
  color: #f1f3f4;
}

.outline:hover { background: #202631; border-color: #5f7190; }

/* ---------------- 页脚 ---------------- */
.footer {
  color: #8e96a5;
  padding: 24px;
  text-align: center;
  font-size: 12px;
  background: #060606;
  line-height: 20px;
}

.footer a { text-decoration: underline; }

/* ---------------- 搜索弹层 ---------------- */
dialog {
  border: 1px solid #343c4c;
  border-radius: 20px;
  background: #141821;
  color: #f1f3f4;
  max-width: 620px;
  width: calc(100% - 32px);
  padding: 28px;
  box-shadow: 0 20px 80px #0008;
}

dialog::backdrop { background: #0009; }

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.dialog-head h2 { margin: 0; font-size: 22px; }

.close { background: none; color: #c8d0df; font-size: 28px; padding: 0 4px; }

.search-input {
  width: 100%;
  height: 48px;
  border: 1px solid #556178;
  border-radius: 8px;
  background: #090d14;
  color: #ffffff;
  padding: 0 14px;
  font-size: 16px;
}

.results { display: grid; gap: 8px; margin-top: 16px; }

.result {
  display: block;
  padding: 14px;
  border-radius: 8px;
  background: #202633;
  color: #f1f3f4;
}

.result:hover { background: #2a3448; }

.result small { display: block; margin-top: 6px; color: #a6afc1; }

/* ---------------- 浅色主题（Gemini 的 .light 那套） ---------------- */
body.light { background: #ffffff; color: #202124; }

body.light .hero,
body.light .footer { background: #f8faff; }

body.light .intro h1 { color: #202124; }
body.light .subtitle { color: #536078; }
body.light .card { background: #ffffff; border-color: #d6dfec; color: #202124; }
body.light .card p { color: #596779; }
body.light .outline { color: #202124; }
body.light .outline:hover { background: #eef3fb; border-color: #9db6de; }
body.light .art { opacity: .2; }
body.light .footer { color: #5f6368; }

/* ---------------- 动画：出现在 ease-out，消失用 linear ---------------- */
@media (prefers-reduced-motion: no-preference) {
  .intro h1,
  .subtitle,
  .primary,
  .card {
    animation: mmArrive cubic-bezier(0.16, 1, 0.3, 1) backwards;
  }
  .intro h1 { animation-duration: .52s; }
  .subtitle { animation-duration: .56s; animation-delay: .06s; }
  .primary  { animation-duration: .5s;  animation-delay: .12s; }
  .card:nth-child(1) { animation-duration: .56s; animation-delay: .16s; }
  .card:nth-child(2) { animation-duration: .56s; animation-delay: .22s; }
  .card:nth-child(3) { animation-duration: .56s; animation-delay: .28s; }

  .menu { animation: mmPop cubic-bezier(0.32, 0.72, 0, 1) .18s backwards; transform-origin: top right; }
  dialog[open] { animation: mmPop cubic-bezier(0.32, 0.72, 0, 1) .22s backwards; }
}

@keyframes mmArrive {
  from { opacity: 0; transform: translateY(14px) scale(.96); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* 弹出类：从触发元素长出来。注意 @keyframes 里不写 var() */
@keyframes mmPop {
  from { opacity: 0; transform: scale(.9); filter: blur(4px); }
  to   { opacity: 1; transform: scale(1); filter: none; }
}

/* ---------------- 响应式 ---------------- */
@media (min-width: 1600px) {
  .cards { width: calc(100% - 464px); }
}

@media (max-width: 1200px) {
  .nav { gap: 18px; }
  .search { width: 160px; }
  .translation { padding: 14px 24px; justify-content: flex-start; gap: 16px; }
  .translation-copy { font-size: 12px; }
  .cards { margin-left: 28px; margin-right: 28px; }
  .card { padding: 32px 20px; }
  .card h2 { font-size: 18px; }
}

@media (max-width: 800px) {
  .header { padding: 0 16px; height: 60px; gap: 12px; }
  .brand { font-size: 23px; }
  .nav { gap: 14px; }
  .nav > a:not(.nav-cta) { display: none; }
  .search { width: 36px; justify-content: center; padding: 0; }
  .search span { display: none; }
  .search .key { display: none; }
  .lang-btn { width: 42px; }
  .lang-btn span { display: none; }
  .translation { min-height: 78px; gap: 8px; flex-wrap: wrap; justify-content: center; }
  .translation-copy { width: 100%; }
  .intro { padding: 100px 24px 0; }
  .intro h1 { font-size: 76px; }
  .subtitle { font-size: 18px; max-width: 580px; }
  .cards { grid-template-columns: 1fr; margin: 70px 20px 0; }
  .card { min-height: 200px; }
  .hero { padding-bottom: 30px; }
  .art { left: 48%; width: 1200px; height: 620px; transform: translateX(-50%) scale(.75); transform-origin: bottom center; }
  .announcement { font-size: 13px; }
  .primary { margin-top: 36px; }
  .footer { line-height: 20px; }
}

/* ---------------- 可访问性兜底三档 ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .art { opacity: .5; }
}

@media (prefers-contrast: more) {
  .card { border-color: #5f7190; }
  .card p, .subtitle { color: #d5dae6; }
  .outline { border-color: #6f83a8; }
}

@media (prefers-reduced-transparency: reduce) {
  .card { background: #0e0e16; backdrop-filter: none; }
  .menu, dialog { backdrop-filter: none; }
}
