/* ============================================================
   柠木工作室 · Nimu Studio
   三主题玻璃拟态样式（Glass / Light / Dark）
   ============================================================ */

/* ---------- 主题令牌 ---------- */
:root {
  /* ===== 品牌粉彩系（取自 logo 字标「Nimu」渐变）===== */
  /* ① 面：浅。按钮底、标签底、图标底、色斑 —— 直接用粉彩本色 */
  --mint:  #cbecbd;
  /* ② 线：中。渐变文字、下划线、边框 —— 深一档，看得见但不重 */
  --lilac-m: #b48ccd;
  --pink-m:  #eb9cb6;
  --mint-m:  #8cc274;
  /* ③ 字：深。只在必须有对比度的小字上用（正文链接）*/
  /* 渐变：下划线用中间调 */
  --grad-deco: linear-gradient(90deg, var(--lilac-m), var(--pink-m) 50%, var(--mint-m));
  /* 语义强调色（浅底 / 深底两套）
     粉色是「文字色」不是「装饰色」：#cf6b8e 好看但只有 3.4:1（低于 WCAG AA 的 4.5:1），
     所以文字一律用加深一档的 #b8455f（4.85:1 达标），色相不变，仍然属于品牌粉 */
  --rose:   #b8455f;   /* 链接 / 强调 / eyebrow —— 小字用，必须达标 */
  --rose-l: #f0a8c2;   /* 深色主题下反向提亮 */
  --leaf:   #558f42;   /* 标签、事实绿 */
  --ink:    #43304f;   /* 浅粉按钮上的深色字 */
  /* 按钮：浅粉底（配深色字，不是深底白字）*/
  --grad-btn: linear-gradient(135deg, #dcc2ec, #f9c0d0 55%, #d3ebc6);
  --radius: 20px;
  --maxw: 1180px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* 玻璃（默认） */
body.theme-glass {
  --bg: #f4f2f6;
  --bg-grad: radial-gradient(1200px 700px at 12% 8%, #faf1fb 0%, transparent 60%),
             radial-gradient(1000px 640px at 88% 18%, #eaf4ef 0%, transparent 62%),
             linear-gradient(160deg, #f5f0f8 0%, #f0f4f3 52%, #f6f0f6 100%);
  --text: #241f18;
  --text-dim: #5c5447;
  /* 玻璃感的关键：底色要够透，背景的色斑才能透上来被 blur 糊开。
     .62 太实了，看着就是一块白板 */
  --card-bg: rgba(255, 255, 255, .30);
  --card-bd: rgba(255, 255, 255, .78);
  --card-sh: 0 10px 34px rgba(86, 70, 100, .11), inset 0 1px 0 rgba(255, 255, 255, .95);
  --nav-bg: rgba(255, 255, 255, .42);
  --blob-o: .48;
}

/* 浅色 */
body.theme-light {
  --bg: #ffffff;
  --bg-grad: linear-gradient(180deg, #fffdf8 0%, #ffffff 40%, #f7faf9 100%);
  --text: #1c1915;
  --text-dim: #5f584e;
  --card-bg: #ffffff;
  --card-bd: #eae4da;
  --card-sh: 0 2px 14px rgba(60, 50, 30, .07), 0 1px 3px rgba(60, 50, 30, .05);
  --nav-bg: rgba(255, 255, 255, .86);
  --blob-o: .30;
}

/* 深色 */
body.theme-dark {
  --bg: #14161a;
  --bg-grad: radial-gradient(1100px 680px at 10% 6%, #2b2a24 0%, transparent 60%),
             radial-gradient(900px 620px at 90% 14%, #1e2b28 0%, transparent 62%),
             linear-gradient(160deg, #14161a 0%, #191d1c 55%, #16181c 100%);
  --text: #f4f1ea;
  --text-dim: #b6ada0;
  --card-bg: rgba(255, 255, 255, .06);
  --card-bd: rgba(255, 255, 255, .13);
  --card-sh: 0 10px 36px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .07);
  --nav-bg: rgba(22, 24, 28, .72);
  /* 深色底上全部改用浅色粉彩，保证对比 */
  --lilac-m: #c8b2e0;
  --pink-m:  #f9c0d0;
  --mint-m:  #cbecbd;
  --blob-o: .34;
}

/* 深色主题下绿色系文字提亮，保证对比度 */
body.theme-dark .facts b { color: var(--mint); }
/* eyebrow 跟着换成深色主题的粉，和 .card-link 保持一致 */
body.theme-dark .eyebrow { color: var(--rose-l); }
body.theme-dark .sec-head h2::after,
body.theme-dark .about-text h2::after { opacity: .9; }
/* 粉色系强调在暗底上同样要提亮（#cf6b8e 在深色卡片上几乎看不见） */
body.theme-dark .card-link,
body.theme-dark .about-text strong,
body.theme-dark .foot-beian a:hover { color: var(--rose-l); }
/* 字标是浅底设计，深色下提亮保证可见 */
body.theme-dark .brand-logo,
body.theme-dark .hero-logo,
body.theme-dark .foot-logo { filter: brightness(1.75) saturate(1.1) contrast(1.02); }

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

em { font-style: normal; }

/* ---------- 背景光斑 ---------- */
.bg-deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(64px); opacity: var(--blob-o);
        transition: opacity .4s var(--ease); }
/* 色斑是 position:fixed（不随滚动），必须铺满整个视口 ——
   否则滚到卡片区时背后是空的，玻璃面板就没东西可透，看着像白板 */
.b1 { width: 50vw; height: 50vw; left: -12vw; top: -16vw;    background: #e1d2f2; }
.b2 { width: 44vw; height: 44vw; right: -10vw; top: 2vw;     background: #fbd7e3; }
.b3 { width: 42vw; height: 42vw; left: 14vw;  bottom: -18vw; background: #d7edd4; }
.b4 { width: 38vw; height: 38vw; left: 34vw;  top: 32vw;     background: #e7dcf7; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  padding: 10px 16px 0;
  background: transparent;
  pointer-events: none;               /* 只让玻璃条本身可点 */
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 20px;
  pointer-events: auto;
  background: var(--nav-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--card-bd);
  border-radius: var(--radius);       /* 与卡片统一 20px 圆角 */
  box-shadow: var(--card-sh);
  transition: box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.nav.scrolled .nav-inner { box-shadow: 0 10px 34px rgba(86, 70, 100, .16); }

.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand-logo { height: 30px; width: auto; }

/* 字标是浅色设计，浅底上补一点饱和度/对比，避免「Nimu」渐变发飘 */
.brand-logo, .hero-logo, .foot-logo { filter: saturate(1.22) contrast(1.10); }

/* 无障碍：视觉隐藏但仍可被读屏/SEO 读到 */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.nav-links { margin-left: auto; display: flex; gap: 26px; font-size: 15px; }
.nav-links a { color: var(--text-dim); position: relative; padding: 4px 0; transition: color .25s var(--ease); }
.nav-links a::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--lilac-m), var(--pink-m)); border-radius: 2px;
  transition: right .3s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { right: 0; }

.theme-switch {
  display: flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--card-bg); border: 1px solid var(--card-bd);
  box-shadow: var(--card-sh); flex: 0 0 auto;
}
.theme-switch button {
  border: 0; cursor: pointer; font: inherit; font-size: 12.5px;
  padding: 5px 12px; border-radius: 999px; color: var(--text-dim);
  background: transparent; transition: all .22s var(--ease); white-space: nowrap;
}
.theme-switch button:hover { color: var(--text); }
.theme-switch button.active {
  color: var(--ink); background: var(--grad-btn);
  box-shadow: 0 2px 8px rgba(150, 120, 175, .28);
}

/* 语言切换：样式与主题切换一致，但更紧凑（三个只放 中 / EN / 日）*/
.lang-switch {
  display: flex; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--card-bg); border: 1px solid var(--card-bd);
  box-shadow: var(--card-sh); flex: 0 0 auto;
}
.lang-switch button, .lang-switch a { text-decoration: none; display: inline-block;
  border: 0; cursor: pointer; font: inherit; font-size: 12px;
  padding: 5px 9px; border-radius: 999px; color: var(--text-dim);
  background: transparent; transition: all .22s var(--ease); white-space: nowrap;
}
.lang-switch button:hover, .lang-switch a:hover { color: var(--text); }
.lang-switch button.active, .lang-switch a.active {
  color: var(--ink); background: var(--grad-btn);
  box-shadow: 0 2px 8px rgba(150, 120, 175, .28);
}

/* ---------- 首屏 ---------- */
.hero { position: relative; z-index: 1; padding: 72px 0 40px; }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 52px; align-items: center; }

.eyebrow {
  display: inline-block; margin: 0 0 16px; font-size: 13px; letter-spacing: .16em;
  /* 用品牌粉，和 slogan / 按钮 / 链接同一支。
     原来用 --leaf 深绿，在粉紫系的首屏里只有它一个绿，显得脱节 */
  color: var(--rose); text-transform: uppercase;
  padding: 5px 14px; border-radius: 999px;
  background: var(--card-bg); border: 1px solid var(--card-bd);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.hero-logo { width: min(420px, 80%); height: auto; margin: 0 0 20px; }

.slogan {
  margin: 0 0 20px; font-size: clamp(16px, 2vw, 20px); font-weight: 700;
  background: linear-gradient(100deg, var(--lilac-m), var(--pink-m) 52%, var(--mint-m));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* 主句用渐变（继承父元素 background-clip:text），副句用弱色。
   注意只能对「第二个」span 设颜色 —— 否则主句也会被染成灰色 */
.slogan span + span { color: var(--text-dim); font-weight: 500; }
.lede { margin: 0 0 30px; color: var(--text-dim); font-size: 16px; max-width: 46ch; }

.cta { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: 999px; font-size: 15px; font-weight: 600;
  border: 1px solid var(--card-bd); background: var(--card-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--card-sh);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .25s var(--ease), border-color .25s var(--ease);
}
.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(180, 140, 205, .5);
  /* 阴影交给下面的「距离衰减」规则统一驱动，这里只做位移 */
}
.btn-primary {
  color: var(--ink); border-color: transparent;
  background: var(--grad-btn);
  font-weight: 700;
}
.btn-primary:hover { filter: brightness(1.06); }

/* ---------- 首屏展示台 ---------- */
.hero-art { display: flex; justify-content: center; align-items: flex-end; }

.art-stage {
  position: relative; width: 100%; max-width: 520px;
  display: flex; justify-content: center; align-items: flex-end;
  padding-bottom: 46px;                 /* 给底部名牌留位置 */
}

/* 背后的大光晕（呼吸） */
.art-aura {
  position: absolute; left: 50%; top: 44%;
  width: 92%; aspect-ratio: 1 / 1; transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%,
              rgba(255, 255, 255, .85) 0%,
              rgba(249, 192, 208, .55) 34%,
              rgba(200, 178, 224, .30) 58%,
              rgba(200, 178, 224, 0) 74%);
  filter: blur(6px);
  animation: breathe 7s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1);    opacity: .90; }
  50%      { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
}

/* 装饰细环（缓慢旋转） */
.art-ring {
  position: absolute; left: 50%; top: 44%;
  width: 86%; aspect-ratio: 1 / 1; transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed rgba(180, 140, 205, .45);
  animation: spin 60s linear infinite;
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.art-stage img {
  position: relative; z-index: 2;
  width: auto; max-width: 100%; max-height: 560px;
  filter: drop-shadow(0 24px 36px rgba(100, 80, 120, .22));
  animation: floaty 6.5s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* 浮动关键词标签 */
.art-chip {
  position: absolute; z-index: 3; white-space: nowrap;
  padding: 6px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--text-dim);
  background: var(--card-bg); border: 1px solid var(--card-bd);
  box-shadow: var(--card-sh);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  animation: floaty 7.5s ease-in-out infinite;
}
.art-chip.c1 { left: -2%; top: 15%; animation-delay: -.6s; }
.art-chip.c2 { left: -7%; top: 45%; animation-delay: -2.4s; }
.art-chip.c3 { right: -7%; top: 29%; animation-delay: -4.1s; }

/* 星光 */
.art-spark {
  position: absolute; z-index: 3; line-height: 1;
  color: var(--lilac-m); font-size: 13px;
  animation: twinkle 3.4s ease-in-out infinite;
}
.art-spark.s1 { left: 11%; top: 5%;     font-size: 11px; animation-delay: -.2s; }
.art-spark.s2 { right: 9%; top: 11%;                     animation-delay: -1.3s; }
.art-spark.s3 { left: 3%;  bottom: 27%; font-size: 10px; animation-delay: -2.2s; }
.art-spark.s4 { right: 5%; bottom: 33%; font-size: 15px; animation-delay: -3s; }
@keyframes twinkle {
  0%, 100% { opacity: .22; transform: scale(.85); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* 底部名牌 */
.art-name {
  position: absolute; z-index: 3; bottom: 0; left: 50%;
  transform: translateX(-50%); margin: 0; white-space: nowrap;
  padding: 7px 20px; border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--text);
  background: var(--card-bg); border: 1px solid var(--card-bd);
  box-shadow: var(--card-sh);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}
/* 「Yuri」两处统一：首字母大写，配色与「GitHub 主页」按钮同一套
   （紫 -> 粉 -> 绿 三色；直接复用 --grad-deco，深色主题会自动换成浅色档） */
.art-name em,
.mascot em {
  font-style: normal;
  text-transform: none;
  background: var(--grad-deco);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.art-name em {
  margin-left: 7px; font-size: 11px; font-weight: 600; letter-spacing: .08em;
}

@media (prefers-reduced-motion: reduce) {
  .art-aura, .art-ring, .art-stage img, .art-chip, .art-spark { animation: none; }
}

/* ---------- 通用板块 ---------- */
.section { position: relative; z-index: 1; padding: 66px 0; }
/* 点导航跳转时，标题不要被吸顶导航盖住 */
.hero, .section, #top { scroll-margin-top: 92px; }

.sec-head { text-align: center; margin-bottom: 44px; }
.sec-head h2 {
  margin: 0 0 10px; font-size: clamp(25px, 3vw, 34px); font-weight: 800; letter-spacing: -.01em;
}
.sec-head h2::after {
  content: ''; display: block; width: 46px; height: 3px; margin: 14px auto 0;
  border-radius: 3px; background: var(--grad-deco);
}
.sec-head p { margin: 0; color: var(--text-dim); font-size: 15.5px; }

/* ---------- 卡片 ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

.card {
  position: relative; padding: 28px 26px 24px; border-radius: var(--radius);
  background: var(--card-bg); border: 1px solid var(--card-bd);
  box-shadow: var(--card-sh);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
  overflow: hidden;
}
.card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9), transparent);
  opacity: .8;
}
/* hover 只做位移；辉光由文件末尾的「距离衰减」规则统一驱动 */
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(180, 140, 205, .6);
}

.card-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  font-size: 23px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(200, 178, 224, .45), rgba(249, 192, 208, .45));
  border: 1px solid var(--card-bd);
}
.card h3 { margin: 0 0 10px; font-size: 19px; font-weight: 700; letter-spacing: -.005em; }
.card p { margin: 0 0 16px; color: var(--text-dim); font-size: 14.6px; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.tags span {
  font-size: 12px; padding: 3px 11px; border-radius: 999px;
  color: var(--leaf); background: rgba(203, 235, 189, .55);
  border: 1px solid rgba(140, 194, 116, .45);
}
body.theme-dark .tags span { color: var(--mint); background: rgba(203, 235, 189, .14); border-color: rgba(203, 235, 189, .30); }

.card-link { font-size: 14.5px; font-weight: 600; color: var(--rose); transition: gap .25s var(--ease); }
.card-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.contact-cards { grid-template-columns: repeat(3, 1fr); }
.contact-card { text-align: center; }
.contact-card .card-icon { margin: 0 auto 14px; }
.contact-card h3 { margin-bottom: 6px; }
.contact-card p { margin: 0; font-weight: 600; color: var(--text); letter-spacing: .04em; }

/* ---------- 关于 ---------- */
.about { display: grid; grid-template-columns: .62fr 1.38fr; gap: 56px; align-items: center; }
.about-art { text-align: center; }
.about-art img {
  width: 240px; height: 240px; margin: 0 auto; border-radius: 50%;
  border: 3px solid var(--card-bd); box-shadow: 0 14px 40px rgba(100, 80, 120, .18);
}
.mascot { margin: 18px 0 0; font-size: 14px; font-weight: 600; color: var(--text-dim); }
.mascot em { letter-spacing: .06em; }
.mascot-en {
  margin: 7px 0 0; font-size: 11.5px; font-weight: 600; color: var(--text-dim);
  letter-spacing: .34em; text-indent: .34em;   /* 字间距拉开；indent 补偿末字后的多余空隙，保证视觉居中 */
  text-transform: uppercase; opacity: .75;
}

.about-text h2 { margin: 0 0 18px; font-size: clamp(24px, 3vw, 32px); font-weight: 800; }
.about-text h2::after {
  content: ''; display: block; width: 46px; height: 3px; margin-top: 14px;
  border-radius: 3px; background: var(--grad-deco);
}
.about-text p { margin: 0 0 16px; color: var(--text-dim); font-size: 15.6px; }
.about-text strong { color: var(--rose); font-weight: 700; }

.facts { list-style: none; margin: 24px 0 0; padding: 0; border-top: 1px solid var(--card-bd); }
.facts li {
  display: flex; gap: 16px; padding: 11px 0;
  border-bottom: 1px solid var(--card-bd); font-size: 14.6px; color: var(--text-dim);
}
.facts b {
  flex: 0 0 52px; color: var(--leaf); font-weight: 700;
}

/* ---------- 页脚 ---------- */
.footer {
  position: relative; z-index: 1; margin-top: 40px; padding: 52px 24px 46px;
  text-align: center; border-top: 1px solid var(--card-bd);
  background: var(--card-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.foot-logo { width: min(250px, 62vw); height: auto; margin: 0 auto 16px; opacity: .95; }
.foot-copy { margin: 0 0 12px; color: var(--text-dim); font-size: 13.5px; }
.foot-beian { margin: 0; font-size: 13.5px; display: flex; flex-wrap: wrap;
  justify-content: center; gap: 8px 10px; }
.foot-beian a {
  color: var(--text-dim); padding: 3px 10px; border-radius: 8px;
  border: 1px solid var(--card-bd); transition: color .25s var(--ease);
}
/* 公安备案：图标在前、编号在右（按规定格式）*/
.foot-beian a.gongan { display: inline-flex; align-items: center; gap: 5px; }
.foot-beian a.gongan img { width: 20px; height: 22px; display: block; flex: 0 0 auto; }
.foot-beian a:hover { color: var(--rose); }

/* ---------- 滚动淡入 ---------- */
/* 只有 JS 可用时才隐藏（html.js 由 <head> 里的内联脚本加上）。
   否则 JS 被禁用 / IntersectionObserver 不支持时，整页内容会停在 opacity:0 看不见 */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 36px; }
  .hero-art { order: -1; }
  .cards, .contact-cards { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .about-text h2::after { margin-left: auto; margin-right: auto; }
  .facts li { justify-content: center; text-align: left; }
  /* 展示台：单列时收窄，标签往内收，别溢出 */
  .art-stage { max-width: 420px; }
  .art-chip.c1 { left: 0; }
  .art-chip.c2 { left: -2%; }
  .art-chip.c3 { right: -2%; }

  /* 单列时立绘和文字都居中对齐。
     原来只给 .about 加了居中，hero 还是左对齐 → 上面立绘居中、下面文字靠左，看着歪 */
  .hero-text { text-align: center; }
  .hero-text .cta { justify-content: center; }
  .hero-text .lede { margin-left: auto; margin-right: auto; }
  /* 注意：img 被全局重置成了 display:block，text-align:center 管不到它
     （只对行内内容生效），block 元素必须靠 auto 外边距居中 */
  .hero-logo { margin-left: auto; margin-right: auto; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 18px; }

  /* ---- 导航：加大触摸目标 + 刘海屏安全区 ---- */
  .nav {
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    padding-left: calc(12px + env(safe-area-inset-left, 0px));
    padding-right: calc(12px + env(safe-area-inset-right, 0px));
  }
  .nav-inner { padding: 8px 10px; gap: 7px; flex-wrap: wrap; }
  .nav-links { display: none; }
  .brand { padding: 6px 0; }             /* 撑高触摸区 */
  .brand-logo { height: 18px; }          /* 30px 时字标宽约 204px，会把切换器挤出屏幕 */
  /* 两个切换器都要收得很紧：英文 Glass/Light/Dark、日文 グラス/ライト/ダーク
     比中文「玻璃/浅色/深色」宽得多，不收紧会在 EN/JA 下横向溢出 */
  .lang-switch { margin-left: auto; padding: 2px; }
  .lang-switch button, .lang-switch a { padding: 6px 5px; font-size: 10.5px; }
  .theme-switch { padding: 2px; }
  .theme-switch button { padding: 6px 5px; font-size: 10.5px; }

  /* ---- 首屏：立绘收小，让品牌名回到首屏内 ----
     原来 art-stage 300px → 立绘约 482px，加上名牌后整块 600px，
     品牌名被推到 745px（视口 844），首屏几乎看不到内容 */
  .hero { padding: 26px 0 18px; }
  .hero-inner { gap: 22px; }
  .art-stage { max-width: 230px; padding-bottom: 38px; }
  /* max-width 和 max-height 同时存在时浏览器不保证保持长宽比：
     230 宽 + 560 高会把立绘拉变形，所以这里必须把 max-height 放开 */
  .art-stage img { max-height: none; height: auto; }
  /* 桌面端 stage(520) 比立绘(约348) 宽，光晕/装饰环露在外面；
     手机端 stage 宽度等于立绘宽度，92%/86% 的光晕和环会被立绘整个盖住 →
     这里必须反向放大到超过 100%，装饰才看得见 */
  .art-aura { width: 134%; }
  .art-ring { width: 124%; }
  /* 星光保留（很小，不占位），标签太挤才藏 */
  .art-spark { font-size: 11px; }
  .art-spark.s4 { font-size: 12px; }
  /* 标签在窄屏会压到立绘上，藏掉；星光很小不占位，保留 */
  .art-chip { display: none; }
  .art-name { font-size: 12px; padding: 6px 14px; }

  /* ---- 板块：收紧留白 ---- */
  .section { padding: 42px 0; }
  .sec-head { margin-bottom: 30px; }
  .cards, .contact-cards { grid-template-columns: 1fr; }
  .card { padding: 22px 20px 18px; }

  /* ---- 触摸目标：文字链接加高（移动端建议 ≥44px）---- */
  .card-link { display: inline-block; padding: 9px 0; }
  .btn { flex: 1 1 auto; justify-content: center; min-height: 46px; }

  /* ---- 联系卡片改横向（图标在左），竖向省掉一半 ----
     原来是竖向卡片：图标+标题+说明各占一行，三张卡将近 700px */
  .contact-card {
    display: flex; align-items: center; gap: 16px;
    text-align: left; padding: 16px 20px;
  }
  .contact-card .card-icon { margin: 0; flex: 0 0 auto; }
  .contact-card h3 { margin: 0 0 2px; font-size: 17px; }
  .contact-card p { margin: 0; }
  .contact-card p a { display: inline-block; padding: 4px 0; }

  /* ---- 关于 ---- */
  .about-art img { width: 170px; height: 170px; }
  .facts b { flex: 0 0 44px; }

  /* ---- 页脚：底部安全区 ---- */
  .footer { padding-bottom: calc(34px + env(safe-area-inset-bottom, 0px)); }
  .foot-beian a { display: inline-block; padding: 7px 12px; }
}

/* 超窄屏（320~360px，如 iPhone SE1 / 老安卓）：字标和主题按钮再收一档，
   否则两者相加会超过视口宽度造成横向滚动 */
@media (max-width: 360px) {
  .nav-inner { padding: 7px 10px; gap: 6px; }
  .brand-logo { height: 18px; }
  .lang-switch button, .lang-switch a { padding: 5px 5px; font-size: 10px; }
  .theme-switch button { padding: 5px 6px; font-size: 10.5px; }
  .art-stage { max-width: 175px; }   /* 320x568 屏很矮，再收一档品牌名才进得了首屏 */
  .art-name { font-size: 11.5px; padding: 5px 12px; }
  .about-art img { width: 150px; height: 150px; }
}

/* ============================================================
   鼠标泛光
   ① 页面级：一团极淡的环境光跟着鼠标跑（--gx/--gy）
   ② 面板级：按「鼠标到面板的距离」平滑衰减（--near 0~1）
      越近越亮、越远越弱，超出 RANGE(240px) 就是 0（不发光）
      不需要 hover —— 鼠标还没碰到面板就已经开始亮了
   ============================================================ */

/* ① 页面级环境光 —— 刻意做成「无感」：
      半径 1100px + 多段长衰减，看不出圆的边界，只当环境光在微微偏移 */
.cursor-light {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0; transition: opacity .9s var(--ease);
  background: radial-gradient(1100px circle at var(--gx, 50%) var(--gy, 32%),
              rgba(255, 255, 255, .17) 0%,
              rgba(248, 200, 226, .11) 22%,
              rgba(226, 178, 240, .07) 45%,
              rgba(206, 168, 232, .04) 68%,
              rgba(198, 162, 222, 0) 100%);
}
html.has-pointer .cursor-light { opacity: 1; }
body.theme-dark .cursor-light {
  background: radial-gradient(1100px circle at var(--gx, 50%) var(--gy, 32%),
              rgba(226, 190, 246, .10) 0%,
              rgba(206, 178, 236, .06) 30%,
              rgba(198, 162, 222, .03) 58%,
              rgba(198, 162, 222, 0) 100%);
}

/* ② 面板距离衰减辉光 —— --near=0 时模糊半径和 alpha 都是 0，等于没有 */
.card, .nav-inner, .btn { --near: 0; }

.card, .nav-inner, .nav.scrolled .nav-inner {
  box-shadow:
    var(--card-sh),
    0 0 calc(var(--near, 0) * 30px) rgba(226, 138, 194, calc(var(--near, 0) * .42)),
    0 0 calc(var(--near, 0) * 62px) rgba(198, 162, 222, calc(var(--near, 0) * .26));
}
.btn {
  box-shadow:
    var(--card-sh),
    0 0 calc(var(--near, 0) * 20px) rgba(226, 138, 194, calc(var(--near, 0) * .40)),
    0 0 calc(var(--near, 0) * 40px) rgba(198, 162, 222, calc(var(--near, 0) * .22));
}

/* 深色主题：同样的距离衰减，颜色换成更亮的浅紫 */
body.theme-dark .card,
body.theme-dark .nav-inner,
body.theme-dark .nav.scrolled .nav-inner {
  box-shadow:
    var(--card-sh),
    0 0 calc(var(--near, 0) * 34px) rgba(206, 178, 236, calc(var(--near) * .42)),
    0 0 calc(var(--near, 0) * 68px) rgba(206, 178, 236, calc(var(--near) * .24));
}
body.theme-dark .btn {
  box-shadow:
    var(--card-sh),
    0 0 calc(var(--near) * 24px) rgba(206, 178, 236, calc(var(--near) * .40)),
    0 0 calc(var(--near, 0) * 46px) rgba(206, 178, 236, calc(var(--near) * .22));
}

/* ============================================================
   UI 审查改进（按 ui-new 的 UI Audit 协议）
   原则：只补「缺失的交互状态与无障碍」，不动既定设计语言
   （粉彩玻璃 / 三主题 / 柠月琉璃 / 金色头像环 全部保留）
   ============================================================ */

/* 1) 键盘焦点环
      原来整站没有任何 :focus 样式，键盘用户在链接和按钮上完全
      看不到焦点在哪，属于 WCAG 2.4.7 问题 */
:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
}
/* 圆角元素把焦点环也贴合形状 */
.btn:focus-visible,
.theme-switch button:focus-visible,
.lang-switch a:focus-visible,
.foot-beian a:focus-visible { outline-offset: 2px; border-radius: 999px; }
/* 鼠标点击不留焦点环，只有键盘操作用户才看到 */
:focus:not(:focus-visible) { outline: none; }

/* 2) 按压反馈
      原来只有 :hover，点下去没有任何触感；补上「轻压」并加快回弹 */
.btn:active { transform: translateY(0) scale(.97); }
/* 注意：必须保持悬停时的高度(-5px)，否则点下去会往下跳 3px，
   看起来像泛光断了一下。这里只压缩一点点做「按压」触感 */
.card:active { transform: translateY(-5px) scale(.995); }
.theme-switch button:active,
.lang-switch a:active { transform: scale(.94); }
.btn:active, .card:active,
.theme-switch button:active, .lang-switch a:active { transition-duration: .08s; }

/* 3) 标题行高
      中文大标题在默认 1.5 行高下显得松散，收到 1.22 更紧凑有力；
      正文反向放宽到 1.72，长段落更好读 */
.sec-head h2, .about-text h2 { line-height: 1.22; }
.lede, .sec-head p, .card p, .about-text p { line-height: 1.72; }

/* 4) 区块节奏对齐 8pt 网格（66 → 72）*/
.section { padding: 72px 0; }

/* 5) 选中文字与滚动条统一到品牌色（默认蓝色很出戏）*/
::selection { background: rgba(235, 156, 182, .26); color: var(--text); }
html { scrollbar-color: rgba(180, 140, 205, .42) transparent; }
body.theme-dark ::selection { background: rgba(249, 192, 208, .26); color: #fff; }
body.theme-dark { scrollbar-color: rgba(206, 178, 236, .38) transparent; }
