/* ==========================================================================
   小胖联机 · base.css
   设计语言：Cloud Crisp — 清爽浅蓝白画布 + 皇家蓝主色 + 精致卡片层次（支持暗色切换）
   本文件只放：字体、语义变量、重置、排版、布局与动效基元。
   ========================================================================== */

/* ---------- 字体 ---------- */
@font-face {
  font-family: "XP Letter Hand";
  src: url("../fonts/letter-handwriting.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF,
    U+FFFD;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/chakra-petch-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/chakra-petch-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* ---------- 语义变量（全站采用 100% 免费可商用字体：Nunito / Space Grotesk / Chakra Petch + HarmonyOS Sans / MiSans / 思源黑体） ---------- */
:root {
  color-scheme: light;

  --font-sans: "HarmonyOS Sans SC", "MiSans", "Alibaba PuHuiTi 3.0",
    "Source Han Sans SC", "Noto Sans CJK SC", "Noto Sans SC",
    "WenQuanYi Micro Hei", sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --font-label: "Chakra Petch", var(--font-display);
  --font-mono: ui-monospace, "JetBrains Mono", "Cascadia Mono",
    "Liberation Mono", monospace;

  /* 画布与表面（薄荷奶白 · 轻可爱极简风） */
  --bg: #f9faf6;
  --bg-soft: #f0f6f2;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f8f5;
  --surface-3: #e6f2ec;
  --line: rgba(27, 38, 33, 0.08);
  --line-strong: rgba(27, 38, 33, 0.15);
  --line-soft: rgba(27, 38, 33, 0.045);

  /* 文字 */
  --text: #1b2621;
  --text-dim: #54665d;
  --text-faint: #778a80;
  --text-inverse: #ffffff;

  /* 品牌色（清新薄荷绿主轴 + 暖杏桃点缀，彻底告别麦块蓝） */
  --brand: #10b981;
  --brand-soft: #059669;
  --brand-deep: #047857;
  --brand-text: #059669;
  --brand-ink: #ffffff;
  --aqua: #14b8a6;
  --azure: #38bdf8;
  --violet: #8b5cf6;
  --amber: #f59e0b;
  --rose: #fb7185;

  /* 渐变 */
  --grad-brand: linear-gradient(135deg, #10b981 0%, #22c55e 52%, #14b8a6 100%);
  --grad-aurora: radial-gradient(62% 42% at 50% 0%, rgba(16, 185, 129, 0.11), transparent 72%),
    radial-gradient(44% 36% at 86% 12%, rgba(251, 146, 60, 0.08), transparent 70%),
    radial-gradient(42% 36% at 14% 20%, rgba(56, 189, 248, 0.07), transparent 68%);
  --grad-text: linear-gradient(100deg, #059669 0%, #10b981 55%, #14b8a6 100%);

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(16, 56, 40, 0.04);
  --shadow-sm: 0 4px 16px -4px rgba(16, 56, 40, 0.06), 0 1px 3px rgba(16, 56, 40, 0.035);
  --shadow-md: 0 14px 34px -12px rgba(16, 56, 40, 0.10), 0 4px 12px -4px rgba(16, 56, 40, 0.045);
  --shadow-lg: 0 26px 64px -20px rgba(16, 56, 40, 0.15), 0 8px 22px -8px rgba(16, 56, 40, 0.06);
  --shadow-glow: 0 14px 32px -10px rgba(16, 185, 129, 0.36);
  --ring: 0 0 0 1px var(--line) inset;

  /* 圆角（更圆润轻可爱） */
  --r-xs: 10px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-2xl: 30px;
  --r-full: 999px;

  /* 排版 */
  --fs-display: clamp(2.45rem, 4.6vw, 3.6rem);
  --fs-h1: clamp(2.1rem, 3.6vw, 3rem);
  --fs-h2: clamp(1.65rem, 2.7vw, 2.35rem);
  --fs-h3: clamp(1.12rem, 1.45vw, 1.3rem);
  --fs-body: 0.965rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.78rem;
  --fs-label: 0.72rem;

  /* 布局 */
  --container: 1180px;
  --gutter: clamp(14px, 3vw, 28px);
  --section-y: clamp(40px, 5vw, 68px);
  --header-h: 62px;

  /* 动效 */
  --ease-out: cubic-bezier(0.22, 0.75, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.42, 0.5, 1);
  --t-fast: 0.16s;
  --t-base: 0.24s;
  --t-slow: 0.55s;
}

/* ---------- 暗色主题（深林薄荷 · 极客护眼暗色） ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1311;
  --bg-soft: #121b18;
  --bg-elev: #17231f;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-3: rgba(255, 255, 255, 0.115);
  --line: rgba(167, 243, 208, 0.12);
  --line-strong: rgba(167, 243, 208, 0.24);
  --line-soft: rgba(167, 243, 208, 0.07);

  --text: #eef6f2;
  --text-dim: #9bb3a7;
  --text-faint: #748e81;
  --text-inverse: #0d1311;

  --brand: #10b981;
  --brand-soft: #34d399;
  --brand-deep: #059669;
  --brand-text: #34d399;
  --brand-ink: #ffffff;
  --aqua: #2dd4bf;
  --azure: #38bdf8;
  --violet: #a78bfa;
  --amber: #fbbf24;
  --rose: #fb7185;

  --grad-text: linear-gradient(96deg, #6ee7b7 0%, #34d399 50%, #5eead4 100%);
  --grad-aurora: radial-gradient(60% 50% at 50% 0%, rgba(16, 185, 129, 0.16), transparent 72%),
    radial-gradient(50% 45% at 85% 20%, rgba(251, 146, 60, 0.10), transparent 70%),
    radial-gradient(45% 40% at 15% 32%, rgba(16, 185, 129, 0.1), transparent 70%);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 8px 22px -10px rgba(0, 0, 0, 0.65);
  --shadow-md: 0 22px 54px -22px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 42px 104px -38px rgba(0, 0, 0, 0.9), 0 6px 22px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 20px 52px -18px rgba(59, 130, 246, 0.45);
  --ring: 0 0 0 1px var(--line) inset, 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

/* ---------- 重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1,
h2,
h3,
h4,
h5,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}
h1,
h2,
h3,
h4 {
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
  -webkit-user-drag: none;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}
table {
  border-collapse: collapse;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}
::selection {
  background: var(--brand);
  color: #ffffff;
}
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

/* 滚动条 */
@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 999px;
    border: 3px solid var(--bg);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--text) 40%, transparent);
  }
}

/* ---------- 柔和云端极光底 ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: var(--grad-aurora);
  opacity: 1;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
}
html[data-theme="dark"] body::after {
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

@keyframes aurora-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-1.5%, 1%, 0) scale(1.04);
  }
  100% {
    transform: translate3d(1.5%, -1%, 0) scale(1.02);
  }
}

/* ---------- 排版工具 ---------- */
.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mono {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.label {
  font-family: var(--font-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: var(--fs-label);
}
.muted {
  color: var(--text-dim);
}
.faint {
  color: var(--text-faint);
}
.ink {
  color: var(--text);
}
.lead {
  font-size: clamp(1rem, 1.25vw, 1.12rem);
  line-height: 1.8;
  color: var(--text-dim);
}
.body-sm {
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--text-dim);
}
.nowrap {
  white-space: nowrap;
}
.tnum {
  font-variant-numeric: tabular-nums;
}

/* ---------- 布局 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide {
  max-width: 1440px;
}
.section {
  position: relative;
  padding-block: var(--section-y);
}
.section--tight {
  padding-block: clamp(48px, 6vw, 84px);
}
.section-line {
  border-top: 1px solid var(--line);
}
.stack > * + * {
  margin-top: var(--stack-gap, 16px);
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.grid {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.center {
  text-align: center;
}

/* ---------- 动效 ---------- */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes pop-in {
  0% {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes float-y {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
@keyframes pulse-dot {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 60%, transparent);
  }
  70% {
    box-shadow: 0 0 0 7px transparent;
  }
}
@keyframes marquee-x {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}
@keyframes shine-sweep {
  0% {
    transform: translateX(-120%) skewX(-18deg);
  }
  60%,
  100% {
    transform: translateX(220%) skewX(-18deg);
  }
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* 入场动画只在 JS 确认能观察到元素时才启用，避免脚本失效导致内容永久不可见 */
html.xp-reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0ms);
  will-change: opacity, transform;
}
html.xp-reveal-ready [data-reveal].is-in {
  opacity: 1;
  transform: none;
}
.no-js [data-reveal] {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------------------------
   减少动态效果
   ---------------------------------------------------------------------------
   系统里开了「减弱动态效果」（macOS 辅助功能里那一项）时，浏览器会报
   prefers-reduced-motion: reduce。默认必须尊重它 —— 这是无障碍要求，
   对前庭功能敏感的人，漂浮/缩放/循环动画会造成真实不适。

   但原来这里一刀切把所有动画和过渡都压到 0.001ms，结果是整个站"死了"：
   状态点不闪、按钮点了没反馈、加载圈不转 —— 连"正在发生什么"都看不出来。

   所以加一个站内开关：`html[data-motion="on"]` 时不受系统设置影响。
   默认不设这个属性（= 跟随系统），由用户在导航栏里主动打开。
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="on"]) {
    scroll-behavior: auto;
  }
  html:not([data-motion="on"]) *,
  html:not([data-motion="on"]) *::before,
  html:not([data-motion="on"]) *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html:not([data-motion="on"]) [data-reveal] {
    opacity: 1;
    transform: none;
  }

  /* 但**加载指示器**必须留着转：它不是装饰，是"请求还在进行"的唯一信号。
     转圈被冻住的话，用户会以为页面卡死然后反复点。 */
  html:not([data-motion="on"]) .spinner {
    animation-duration: 0.9s !important;
    animation-iteration-count: infinite !important;
  }
}

/* ---------------------------------------------------------------------------
   [hidden] 必须真的隐藏
   ---------------------------------------------------------------------------
   HTML 的 hidden 属性靠 UA 样式表里的 `display: none` 生效，而**任何作者样式里的
   display 都会盖掉它**（UA 规则的优先级最低）。
   真实踩过：动效开关按钮 `hidden` 了却照样显示，因为 `.nav-icon-btn { display: grid }`。
   这类 bug 很隐蔽 —— 逻辑是对的，只是"隐藏"没生效。
   --------------------------------------------------------------------------- */
[hidden] {
  display: none !important;
}

/* ---------- 可访问性 ---------- */
.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;
}
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 999;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 0.2s;
}
.skip-link:focus {
  transform: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 860px) {
  :root {
    --header-h: 60px;
    --section-y: clamp(32px, 6vw, 52px);
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  :root {
    --header-h: 56px;
    --section-y: clamp(24px, 5vw, 38px);
  }
  body {
    font-size: 14.5px;
    line-height: 1.6;
  }
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }
  .between {
    align-items: flex-start;
  }
}

/* ==========================================================================
   可爱风主题（html[data-style="cute"]）+ 风格切换胶囊 + 新手一封信弹窗
   可在导航栏、控制台侧栏、实例设置中一键在「可爱风」与「正常风」之间切换
   ========================================================================== */
html[data-style="cute"] {
  --font-sans: "Nunito", "HarmonyOS Sans SC", "MiSans", "LXGW WenKai",
    "Source Han Sans SC", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  --font-display: "Nunito", "HarmonyOS Sans SC", "MiSans",
    "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 14px;
  --r-xs: 11px;
}

html, body {
  overflow-x: clip;
}

/* 可爱风唯美樱花背景层（fixed 伪元素，桌面与手机 Safari 均流畅不抖动） */
html[data-style="cute"] body {
  background: transparent;
  position: relative;
}
html[data-style="cute"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 244, 251, 0.22) 55%, rgba(240, 247, 255, 0.30) 100%),
    url("../img/bg-cute-sakura.jpg") center / cover no-repeat;
  pointer-events: none;
}
html[data-style="cute"] .p-home-hero-bg,
html[data-style="cute"] .p-home-hero-bg::after {
  opacity: 0;
  pointer-events: none;
}
html[data-style="cute"] .p-home-ann {
  background: linear-gradient(90deg, rgba(244, 114, 182, 0.90) 0%, rgba(129, 140, 248, 0.90) 55%, rgba(56, 189, 248, 0.90) 100%);
}
html[data-style="cute"][data-theme="dark"] body::before {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.78) 0%, rgba(24, 20, 44, 0.82) 100%),
    url("../img/bg-cute-sakura.jpg") center / cover no-repeat;
}

/* 可爱风毛玻璃卡片与柔和樱花粉阴影 */
html[data-style="cute"][data-theme="light"] .site-header,
html[data-style="cute"]:not([data-theme="dark"]) .site-header {
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom-color: rgba(244, 114, 182, 0.16);
}
html[data-style="cute"][data-theme="light"] .footer,
html[data-style="cute"]:not([data-theme="dark"]) .footer {
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(14px);
}
html[data-style="cute"][data-theme="light"] .panel,
html[data-style="cute"][data-theme="light"] .card,
html[data-style="cute"][data-theme="light"] .mk-rail-card,
html[data-style="cute"][data-theme="light"] .mk-info-card,
html[data-style="cute"][data-theme="light"] .lu-stat,
html[data-style="cute"][data-theme="light"] .p-pl-card,
html[data-style="cute"][data-theme="light"] .p-mp-card,
html[data-style="cute"][data-theme="light"] .p-gcq,
html[data-style="cute"]:not([data-theme="dark"]) .panel,
html[data-style="cute"]:not([data-theme="dark"]) .card,
html[data-style="cute"]:not([data-theme="dark"]) .mk-rail-card,
html[data-style="cute"]:not([data-theme="dark"]) .mk-info-card,
html[data-style="cute"]:not([data-theme="dark"]) .lu-stat,
html[data-style="cute"]:not([data-theme="dark"]) .p-pl-card,
html[data-style="cute"]:not([data-theme="dark"]) .p-mp-card,
html[data-style="cute"]:not([data-theme="dark"]) .p-gcq {
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(14px) saturate(1.15);
  border-radius: 20px;
  border-color: rgba(244, 114, 182, 0.22);
  box-shadow: 0 12px 30px -14px rgba(236, 72, 153, 0.18), 0 4px 12px -4px rgba(99, 102, 241, 0.10);
  transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 220ms ease, border-color 180ms ease;
}

/* 可爱风飘落樱花花瓣层（仅可爱风启用，不阻挡任何点击） */
.xp-cute-petals {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  overflow: hidden;
}
html[data-style="cute"] .xp-cute-petals {
  display: block;
}
@media (prefers-reduced-motion: reduce) {
  html[data-style="cute"] .xp-cute-petals {
    display: none;
  }
}
.xp-petal {
  position: absolute;
  top: -28px;
  left: var(--x, 50%);
  width: var(--sz, 13px);
  height: calc(var(--sz, 13px) * 0.78);
  border-radius: 150% 0 150% 0;
  background: linear-gradient(135deg, rgba(255, 198, 224, 0.92) 0%, rgba(255, 148, 194, 0.82) 100%);
  box-shadow: 0 2px 8px rgba(244, 114, 182, 0.28);
  opacity: 0;
  will-change: transform, opacity;
  animation:
    xpPetalFall var(--dur, 12s) linear var(--delay, 0s) infinite,
    xpPetalSway var(--sway-dur, 4.2s) ease-in-out var(--delay, 0s) infinite alternate;
}
.xp-petal:nth-child(3n) {
  background: linear-gradient(135deg, rgba(255, 232, 243, 0.95) 0%, rgba(251, 182, 206, 0.86) 100%);
}
.xp-petal:nth-child(5n) {
  background: linear-gradient(135deg, rgba(224, 231, 255, 0.9) 0%, rgba(249, 168, 212, 0.82) 100%);
}
@keyframes xpPetalFall {
  0% {
    transform: translate3d(0, -10vh, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.88;
  }
  85% {
    opacity: 0.78;
  }
  100% {
    transform: translate3d(var(--drift, 80px), 112vh, 0) rotate(320deg);
    opacity: 0;
  }
}
@keyframes xpPetalSway {
  0% { margin-left: 0; }
  100% { margin-left: var(--sway, 34px); }
}

html[data-style="cute"] .btn,
html[data-style="cute"] .lu-btn,
html[data-style="cute"] .lu-navbtn,
html[data-style="cute"] .mk-act-btn {
  border-radius: 999px;
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1), filter 160ms ease, box-shadow 180ms ease;
}

html[data-style="cute"] .btn:hover:not(:disabled),
html[data-style="cute"] .mk-act-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

html[data-style="cute"] .btn-primary,
html[data-style="cute"] .lu-navbtn.is-active {
  background: linear-gradient(135deg, #f472b6 0%, #818cf8 55%, #38bdf8 100%);
  border-color: transparent;
  box-shadow: 0 8px 22px -8px rgba(244, 114, 182, 0.55);
}

/* 顶部与侧栏「可爱风 / 正常风」切换胶囊 */
.style-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(244, 114, 182, 0.32);
  background: linear-gradient(135deg, rgba(252, 231, 243, 0.9), rgba(224, 231, 255, 0.85));
  color: var(--text, #0f172a);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 180ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 180ms ease;
}
.style-pill-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -6px rgba(244, 114, 182, 0.45);
}
html[data-style="normal"] .style-pill-btn {
  border-color: var(--line-strong, rgba(15, 23, 42, 0.14));
  background: var(--surface-2, #f1f5fb);
}

/* 首页可爱吉祥物悬浮徽章（仅可爱风展示） */
.xp-cute-hero-mascot {
  display: none;
}
html[data-style="cute"] .xp-cute-hero-mascot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(236, 253, 245, 0.88));
  border: 1px solid rgba(52, 211, 153, 0.32);
  box-shadow: 0 12px 28px -12px rgba(16, 185, 129, 0.25);
  max-width: 440px;
}
.xp-cute-hero-mascot img {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  object-fit: cover;
  flex: none;
  box-shadow: 0 6px 14px -4px rgba(59, 130, 246, 0.24);
}
.xp-cute-hero-mascot b {
  display: block;
  font-size: 13.5px;
  color: #0f172a;
}
.xp-cute-hero-mascot span {
  display: block;
  font-size: 12px;
  color: #475569;
  margin-top: 2px;
}

/* 写给小胖联机的小伙伴们 · 空投欢迎信（降落伞 / 热气球随机降落 + 4套随机信纸，全风格通用） */
.xp-skymail-fab {
  position: fixed;
  right: 20px;
  bottom: 22px;
  z-index: 88;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(244, 114, 182, 0.35);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(252, 231, 243, 0.92));
  color: #0f172a;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px -10px rgba(236, 72, 153, 0.42), 0 4px 12px -4px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(12px);
  animation: xpFabFloat 3.4s ease-in-out infinite;
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 200ms ease;
}
html[data-style="normal"] .xp-skymail-fab {
  border-color: rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.95));
  box-shadow: 0 12px 26px -10px rgba(37, 99, 235, 0.35), 0 4px 12px -4px rgba(15, 23, 42, 0.12);
}
html[data-theme="dark"] .xp-skymail-fab {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.94), rgba(49, 46, 129, 0.90));
  color: #f8fafc;
  border-color: rgba(165, 180, 252, 0.36);
}
.xp-skymail-fab:hover {
  transform: translateY(-3px) scale(1.03);
}
.xp-skymail-fab svg {
  width: 24px;
  height: 24px;
  flex: none;
}
@keyframes xpFabFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* 进入实例列表或控制台后隐藏右下角悬浮「空投来信」，避免手机端遮挡按钮与终端输入 */
body[data-page="console"] .xp-skymail-fab,
body[data-page="instances"] .xp-skymail-fab {
  display: none !important;
}
/* 停留 5 秒后弹出的小胖联机小屋欢迎卡片（点击弹出空投来信，控制台/实例页不显示） */
body[data-page="console"] .xp-mascot-pop,
body[data-page="instances"] .xp-mascot-pop {
  display: none !important;
}
.xp-mascot-pop {
  position: fixed;
  right: 20px;
  bottom: 22px;
  z-index: 88;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(350px, calc(100vw - 28px));
  padding: 10px 36px 10px 12px;
  border-radius: 20px;
  border: 1.5px solid rgba(52, 211, 153, 0.38);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(236, 253, 245, 0.94));
  box-shadow: 0 16px 36px -12px rgba(16, 185, 129, 0.34), 0 6px 16px -6px rgba(15, 23, 42, 0.12);
  color: #0f172a;
  cursor: pointer;
  opacity: 0;
  transform: translate3d(0, 24px, 0) scale(0.95);
  transition: opacity 320ms ease, transform 380ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 200ms ease;
}
.xp-mascot-pop[hidden] { display: none !important; }
.xp-mascot-pop.is-show {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}
.xp-mascot-pop:hover {
  transform: translate3d(0, -3px, 0) scale(1.01);
  box-shadow: 0 20px 42px -12px rgba(236, 72, 153, 0.32), 0 6px 16px -6px rgba(15, 23, 42, 0.14);
}
html[data-theme="dark"] .xp-mascot-pop {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.96), rgba(22, 46, 48, 0.94));
  border-color: rgba(52, 211, 153, 0.36);
  color: #f8fafc;
}
.xp-mascot-pop img {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  flex: none;
  box-shadow: 0 6px 14px -4px rgba(59, 130, 246, 0.25);
}
.xp-mascot-pop-txt b {
  display: block;
  font-size: 13.5px;
  line-height: 1.3;
}
.xp-mascot-pop-txt span {
  display: block;
  font-size: 12px;
  color: var(--text-dim, #475569);
  margin-top: 3px;
}
html[data-theme="dark"] .xp-mascot-pop-txt span {
  color: #cbd5e1;
}
.xp-mascot-pop-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 0;
  background: rgba(148, 163, 184, 0.18);
  color: inherit;
  font-size: 11px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.xp-mascot-pop-close:hover {
  background: rgba(148, 163, 184, 0.32);
}
@media (max-width: 640px) {
  .xp-mascot-pop {
    right: 12px;
    left: 12px;
    bottom: 14px;
    max-width: none;
  }
}

/* 弹窗打开时暂停背后花瓣动画，保证空投降落 60fps 丝滑不掉帧 */
body.xp-letter-open .xp-petal {
  animation-play-state: paused;
}

.xp-letter-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(15, 23, 42, 0.62);
  overflow-y: auto;
  animation: xpModalFade 200ms ease-out both;
}
@keyframes xpModalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.xp-letter-modal[hidden] { display: none !important; }

.xp-letter-stage {
  position: relative;
  width: min(740px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
  transform-origin: top center;
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}
.xp-letter-modal.is-dropping[data-delivery="parachute"] .xp-letter-stage {
  animation: xpParachuteDrop 0.92s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.xp-letter-modal.is-dropping[data-delivery="balloon"] .xp-letter-stage {
  animation: xpBalloonDrop 0.98s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes xpParachuteDrop {
  0%   { opacity: 0; transform: translate3d(0, -68vh, 0) rotate(-6deg) scale(0.9); }
  55%  { opacity: 1; transform: translate3d(10px, -6vh, 0) rotate(2.5deg) scale(0.99); }
  82%  { opacity: 1; transform: translate3d(-4px, 4px, 0) rotate(-1deg) scale(1.005); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
}
@keyframes xpBalloonDrop {
  0%   { opacity: 0; transform: translate3d(48px, -68vh, 0) rotate(5deg) scale(0.88); }
  58%  { opacity: 1; transform: translate3d(-10px, -5vh, 0) rotate(-2deg) scale(0.99); }
  84%  { opacity: 1; transform: translate3d(3px, 4px, 0) rotate(0.8deg) scale(1.005); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
}

.xp-letter-carrier {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: -14px;
  z-index: 2;
  pointer-events: none;
  will-change: transform;
  animation: xpCarrierBob 3.6s ease-in-out 1s infinite;
}
.xp-letter-carrier svg {
  width: 96px;
  height: 82px;
  display: block;
}
.xp-letter-badge {
  margin-top: -6px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #f472b6, #818cf8);
  box-shadow: 0 6px 14px -4px rgba(129, 140, 248, 0.65);
  letter-spacing: 0.02em;
}
@keyframes xpCarrierBob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-6px) rotate(1.5deg); }
}

.xp-letter-card {
  position: relative;
  width: 100%;
  max-height: 78dvh;
  overflow-y: auto;
  border-radius: 26px;
  padding: 30px 30px 24px;
  background:
    radial-gradient(60% 55% at 88% 12%, rgba(251, 207, 232, 0.36), transparent 65%),
    radial-gradient(50% 50% at 10% 88%, rgba(196, 181, 253, 0.28), transparent 65%),
    #ffffff;
  border: 1.5px solid rgba(244, 114, 182, 0.28);
  box-shadow: 0 28px 70px -20px rgba(15, 23, 42, 0.42);
  color: #0f172a;
}

/* 4套随机信纸皮肤 */
.xp-letter-modal[data-letter-theme="sakura"] .xp-letter-card {
  background:
    radial-gradient(58% 55% at 90% 10%, rgba(251, 182, 206, 0.42), transparent 65%),
    radial-gradient(52% 52% at 8% 90%, rgba(224, 231, 255, 0.45), transparent 65%),
    #fffafc;
  border-color: rgba(244, 114, 182, 0.36);
}
.xp-letter-modal[data-letter-theme="sakura"] .xp-letter-title::before {
  background: linear-gradient(180deg, #f472b6, #a855f7);
}
.xp-letter-modal[data-letter-theme="sakura"] .xp-letter-ok {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  box-shadow: 0 8px 18px -6px rgba(236, 72, 153, 0.52);
}

.xp-letter-modal[data-letter-theme="mint"] .xp-letter-card {
  background:
    radial-gradient(60% 55% at 88% 12%, rgba(167, 243, 208, 0.42), transparent 65%),
    radial-gradient(50% 50% at 10% 88%, rgba(186, 230, 253, 0.42), transparent 65%),
    #f9fffd;
  border-color: rgba(16, 185, 129, 0.34);
}
.xp-letter-modal[data-letter-theme="mint"] .xp-letter-title::before {
  background: linear-gradient(180deg, #10b981, #3b82f6);
}
.xp-letter-modal[data-letter-theme="mint"] .xp-letter-badge {
  background: linear-gradient(135deg, #10b981, #38bdf8);
}

.xp-letter-modal[data-letter-theme="parchment"] .xp-letter-card {
  background:
    radial-gradient(58% 55% at 88% 12%, rgba(253, 230, 138, 0.42), transparent 65%),
    radial-gradient(50% 50% at 10% 88%, rgba(254, 215, 170, 0.38), transparent 65%),
    #fffdf5;
  border-color: rgba(245, 158, 11, 0.36);
}
.xp-letter-modal[data-letter-theme="parchment"] .xp-letter-title::before {
  background: linear-gradient(180deg, #f59e0b, #f97316);
}
.xp-letter-modal[data-letter-theme="parchment"] .xp-letter-badge {
  background: linear-gradient(135deg, #f59e0b, #fb7185);
}
.xp-letter-modal[data-letter-theme="parchment"] .xp-letter-ok {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  box-shadow: 0 8px 18px -6px rgba(245, 158, 11, 0.5);
}

.xp-letter-modal[data-letter-theme="starry"] .xp-letter-card {
  background:
    radial-gradient(1.5px 1.5px at 14% 18%, rgba(255, 255, 255, 0.85), transparent 60%),
    radial-gradient(1.5px 1.5px at 78% 22%, rgba(196, 181, 253, 0.9), transparent 60%),
    radial-gradient(1.8px 1.8px at 42% 12%, rgba(125, 211, 252, 0.9), transparent 60%),
    radial-gradient(1.5px 1.5px at 88% 76%, rgba(255, 255, 255, 0.8), transparent 60%),
    radial-gradient(60% 55% at 85% 15%, rgba(99, 102, 241, 0.34), transparent 65%),
    radial-gradient(50% 50% at 12% 85%, rgba(56, 189, 248, 0.24), transparent 65%),
    linear-gradient(145deg, #111827 0%, #1e1b4b 100%);
  border-color: rgba(165, 180, 252, 0.42);
  color: #f8fafc;
}
.xp-letter-modal[data-letter-theme="starry"] .xp-letter-title { color: #f8fafc; }
.xp-letter-modal[data-letter-theme="starry"] .xp-letter-body p { color: #e2e8f0; }
.xp-letter-modal[data-letter-theme="starry"] .xp-letter-sign { color: #cbd5e1; }
.xp-letter-modal[data-letter-theme="starry"] .xp-letter-contacts {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(165, 180, 252, 0.25);
  color: #f1f5f9;
}
.xp-letter-modal[data-letter-theme="starry"] .xp-letter-copy {
  background: rgba(255, 255, 255, 0.14);
  color: #e0e7ff;
  border-color: rgba(165, 180, 252, 0.35);
}
.xp-letter-modal[data-letter-theme="starry"] .xp-letter-close {
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.18);
}
.xp-letter-modal[data-letter-theme="starry"] .xp-letter-foot {
  border-top-color: rgba(255, 255, 255, 0.12);
}
.xp-letter-modal[data-letter-theme="starry"] .xp-letter-mascot img {
  mix-blend-mode: normal;
  box-shadow: 0 12px 26px -8px rgba(56, 189, 248, 0.45);
}
.xp-letter-modal[data-letter-theme="starry"] .xp-letter-badge {
  background: linear-gradient(135deg, #6366f1, #38bdf8);
}
.xp-letter-modal[data-letter-theme="starry"] .xp-letter-ok {
  background: linear-gradient(135deg, #6366f1 0%, #38bdf8 100%);
  box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.6);
}

.xp-letter-reroll {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}
.xp-letter-modal[data-letter-theme="starry"] .xp-letter-reroll {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(165, 180, 252, 0.35);
}
.xp-letter-reroll:hover { transform: translateY(-1px); }

@media (max-width: 720px) {
  .xp-skymail-fab {
    right: 14px;
    bottom: 16px;
    height: 40px;
    padding: 0 12px 0 9px;
    font-size: 12px;
  }
  .xp-letter-carrier svg {
    width: 78px;
    height: 66px;
  }
}
.xp-letter-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
  color: #475569;
  font-size: 14px;
  cursor: pointer;
}
.xp-letter-close:hover { background: #f1f5f9; color: #0f172a; }
.xp-letter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 20px;
  align-items: end;
}
@media (max-width: 680px) {
  .xp-letter-card { padding: 22px 18px 18px; }
  .xp-letter-grid { grid-template-columns: minmax(0, 1fr); }
  .xp-letter-mascot { max-width: 160px; margin: 0 auto; }
}
.xp-letter-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: "XP Letter Hand", "LXGW WenKai", var(--font-sans);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #0f172a;
}
.xp-letter-title::before {
  content: "";
  width: 5px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, #34d399, #3b82f6);
}
.xp-letter-body p {
  margin: 0 0 10px;
  font-family: "XP Letter Hand", "LXGW WenKai", var(--font-sans);
  font-size: 18.5px;
  line-height: 1.85;
  letter-spacing: 0.02em;
  color: #1e293b;
}
.xp-letter-contacts {
  margin: 14px 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(241, 245, 251, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.16);
  display: grid;
  gap: 7px;
  font-size: 13.5px;
}
.xp-letter-contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.xp-letter-copy {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  background: #ffffff;
  color: #2563eb;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.xp-letter-copy:hover { background: #2563eb; color: #ffffff; }
.xp-letter-sign {
  text-align: right;
  font-family: "XP Letter Hand", "LXGW WenKai", var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  color: #334155;
  margin-top: 8px;
}
.xp-letter-mascot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.xp-letter-mascot img {
  width: 100%;
  max-width: 200px;
  height: auto;
  border-radius: 20px;
  mix-blend-mode: multiply;
}
.xp-letter-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.xp-letter-ok {
  height: 38px;
  padding: 0 22px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 60%, #10b981 100%);
  color: #ffffff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 8px 18px -6px rgba(37, 99, 235, 0.45);
}
.xp-letter-ok:hover { filter: brightness(1.06); }

/* 界面个性化设置卡片（正常风 / 可爱风切换） */
.xp-style-card {
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, rgba(15, 23, 42, 0.09));
  margin-bottom: 14px;
}
.xp-style-card h4 { margin: 0 0 4px; font-size: 14.5px; }
.xp-style-card p { margin: 0 0 12px; font-size: 12px; color: var(--text-dim, #64748b); }
.xp-style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 560px) { .xp-style-grid { grid-template-columns: minmax(0, 1fr); } }
.xp-style-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--line, rgba(15, 23, 42, 0.1));
  background: var(--bg-elev, #ffffff);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--text, #0f172a);
}
.xp-style-opt.is-on {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.06);
}
.xp-style-opt b { display: block; font-size: 13.5px; }
.xp-style-opt small { display: block; font-size: 11.5px; color: var(--text-dim, #64748b); margin-top: 2px; }
.xp-style-card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.xp-style-opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.xp-style-opts .xp-style-opt {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.xp-style-opts .xp-style-opt span {
  font-size: 12px;
  color: var(--text-dim, #64748b);
}
.xp-style-opt-ico {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex: none;
  background: linear-gradient(135deg, rgba(251, 207, 232, 0.5), rgba(196, 181, 253, 0.4));
}

/* 全站手机端适配增强（可爱风切换、首页吉祥物、欢迎信弹窗、账户风格卡） */
@media (max-width: 720px) {
  .style-pill-btn {
    height: 32px;
    padding: 0 10px;
    font-size: 11.5px;
  }
  html[data-style="cute"] .xp-cute-hero-mascot {
    max-width: 100%;
    padding: 10px 12px;
    gap: 10px;
  }
  .xp-cute-hero-mascot img {
    width: 52px;
    height: 52px;
    border-radius: 13px;
  }
  .xp-style-opts {
    grid-template-columns: minmax(0, 1fr);
  }
  .xp-letter-modal {
    padding: 10px;
  }
  .xp-letter-card {
    padding: 20px 16px 16px;
    border-radius: 20px;
    max-height: 92dvh;
  }
  .xp-letter-title {
    font-size: 18px;
    padding-right: 28px;
  }
  .xp-letter-body p {
    font-size: 13.5px;
    line-height: 1.7;
  }
  .xp-letter-contact-row {
    flex-wrap: wrap;
    gap: 6px;
  }
  .xp-letter-mascot img {
    max-width: 132px;
  }
  .xp-letter-foot {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .xp-letter-ok {
    width: 100%;
  }
}

/* ==========================================================================
   开业狂欢活动专区（11.30–12.30）+ 优惠券展示卡
   ========================================================================== */
.xp-promo-sec {
  padding: 26px 0 8px;
}
.xp-promo-shell {
  border-radius: 24px;
  padding: 24px 26px;
  background:
    radial-gradient(50% 60% at 92% 8%, rgba(244, 114, 182, 0.22), transparent 65%),
    radial-gradient(45% 55% at 6% 92%, rgba(99, 102, 241, 0.16), transparent 65%),
    rgba(255, 255, 255, 0.86);
  border: 1.5px solid rgba(244, 114, 182, 0.28);
  box-shadow: 0 18px 40px -22px rgba(236, 72, 153, 0.28);
  backdrop-filter: blur(14px);
}
html[data-theme="dark"] .xp-promo-shell {
  background:
    radial-gradient(50% 60% at 92% 8%, rgba(244, 114, 182, 0.18), transparent 65%),
    rgba(20, 24, 42, 0.86);
  border-color: rgba(244, 114, 182, 0.26);
}
.xp-promo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.xp-promo-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  margin-bottom: 8px;
}
.xp-promo-title-wrap h2 {
  margin: 0 0 6px;
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.25;
}
.xp-promo-em {
  background: linear-gradient(135deg, #ec4899, #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.xp-promo-title-wrap p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-dim, #475569);
}
.xp-promo-coupon-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 241, 242, 0.96), rgba(238, 242, 255, 0.96));
  border: 1.5px dashed rgba(236, 72, 153, 0.48);
}
html[data-theme="dark"] .xp-promo-coupon-box {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(244, 114, 182, 0.45);
}
.xp-promo-coupon-val {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-right: 12px;
  border-right: 1px dashed rgba(236, 72, 153, 0.35);
}
.xp-promo-coupon-val b {
  font-size: 26px;
  line-height: 1;
  color: #e11d48;
}
.xp-promo-coupon-val span {
  font-size: 11px;
  font-weight: 700;
  color: #be123c;
  margin-top: 2px;
}
.xp-promo-coupon-meta strong {
  display: block;
  font-size: 13.5px;
}
.xp-promo-coupon-meta small {
  display: block;
  font-size: 11.5px;
  color: var(--text-dim, #64748b);
  margin-top: 2px;
}
.xp-promo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 980px) {
  .xp-promo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .xp-promo-shell { padding: 18px 14px; border-radius: 20px; }
  .xp-promo-grid { grid-template-columns: minmax(0, 1fr); }
  .xp-promo-coupon-box { width: 100%; justify-content: space-between; flex-wrap: wrap; }
}
.xp-promo-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.24);
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 200ms ease;
}
html[data-theme="dark"] .xp-promo-card {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(148, 163, 184, 0.22);
}
.xp-promo-card.is-hot {
  border-color: rgba(244, 114, 182, 0.48);
  box-shadow: 0 10px 26px -14px rgba(236, 72, 153, 0.35);
}
.xp-promo-card:hover {
  transform: translateY(-3px);
}
.xp-promo-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.xp-promo-cpu {
  font-size: 11.5px;
  font-weight: 750;
  color: var(--brand-text, #2563eb);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
}
.xp-promo-badge {
  font-size: 11px;
  font-weight: 800;
  color: #be123c;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(251, 113, 133, 0.16);
}
.xp-promo-card h3 {
  margin: 0;
  font-size: 16px;
}
.xp-promo-spec {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-dim, #64748b);
}
.xp-promo-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.xp-promo-price-row strong {
  font-size: 24px;
  color: #e11d48;
}
.xp-promo-price-row strong i {
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  margin-left: 2px;
}
.xp-promo-price-row del {
  font-size: 12.5px;
  color: var(--text-faint, #94a3b8);
}
.xp-promo-save {
  font-size: 11px;
  font-weight: 800;
  color: #059669;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.12);
}
.xp-promo-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed rgba(148, 163, 184, 0.24);
}
.xp-promo-stack {
  font-size: 12px;
  color: var(--text-dim, #475569);
}
.xp-promo-stack b {
  color: #e11d48;
}

/* 商城与个人中心优惠券徽章 */
.xp-store-promo-del {
  font-size: 11.5px;
  color: var(--text-faint, #94a3b8);
  text-decoration: line-through;
  margin-left: 6px;
  font-weight: 500;
}
.xp-acc-coupon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 241, 242, 0.9), rgba(238, 242, 255, 0.9));
  border: 1.5px dashed rgba(236, 72, 153, 0.42);
}
html[data-theme="dark"] .xp-acc-coupon {
  background: rgba(30, 41, 59, 0.85);
}
.xp-acc-coupon b { font-size: 13.5px; color: #be123c; display: block; }
html[data-theme="dark"] .xp-acc-coupon b { color: #fda4af; }
.xp-acc-coupon small { font-size: 11.5px; color: var(--text-dim, #64748b); display: block; margin-top: 2px; }

/* 商店页双栏切换条（第一栏：商店套餐与开业特惠 / 第二栏：充值卡与卡密兑换） */
.xp-store-tabs-bar {
  position: sticky;
  top: var(--header-h, 70px);
  z-index: 40;
  padding: 12px 0;
  background: rgba(248, 250, 255, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line, rgba(15, 23, 42, 0.08));
}
html[data-theme="dark"] .xp-store-tabs-bar {
  background: rgba(15, 23, 42, 0.88);
}
.xp-store-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid var(--line, rgba(15, 23, 42, 0.08));
  max-width: 100%;
}
.xp-store-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim, #475569);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}
.xp-store-tab:hover {
  color: var(--text, #0f172a);
}
.xp-store-tab.is-active {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #ffffff;
  box-shadow: 0 8px 18px -8px rgba(37, 99, 235, 0.55);
}
html[data-style="cute"] .xp-store-tab.is-active {
  background: linear-gradient(135deg, #f472b6 0%, #818cf8 55%, #38bdf8 100%);
  box-shadow: 0 8px 18px -8px rgba(244, 114, 182, 0.55);
}
.xp-store-tab-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  color: inherit;
}
.xp-store-tab:not(.is-active) .xp-store-tab-badge {
  background: rgba(236, 72, 153, 0.14);
  color: #be123c;
}
@media (max-width: 640px) {
  .xp-store-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    border-radius: 16px;
  }
  .xp-store-tab {
    height: 38px;
    padding: 0 10px;
    font-size: 12.5px;
    border-radius: 12px;
  }
  .xp-store-tab-badge { display: none; }
}

/* ==========================================================================
   全站桌面与手机端尺寸与比例精调（紧凑、清晰、首屏更聚焦）
   ========================================================================== */
@media (max-width: 640px) {
  /* 顶栏更精致紧凑 */
  .nav-inner { padding-inline: 12px; gap: 6px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .brand-name b { font-size: 0.92rem; }
  .brand-name span { display: none; }
  .style-pill-btn { height: 30px; padding: 0 9px; font-size: 11px; }
  .nav-icon-btn { width: 32px; height: 32px; }

  /* 首页首屏与三栏指标保持单行 3 列，避免第 3 项换行 */
  .p-home-hero { padding-top: 20px; padding-bottom: 24px; }
  .p-home-title { font-size: clamp(26px, 7.2vw, 32px); line-height: 1.2; }
  .p-home-mini-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .p-home-mini-stats > div {
    padding: 8px 6px;
  }
  .p-home-mini-stats dt { font-size: 10.5px; white-space: nowrap; }
  .p-home-mini-stats dd b { font-size: 15px; }
  .p-home-mini-stats dd span { font-size: 10.5px; }

  /* 开业特惠专区与领券卡在手机端更紧凑对齐 */
  .xp-promo-sec { padding: 14px 0 4px; }
  .xp-promo-shell { padding: 14px 12px; border-radius: 18px; }
  .xp-promo-head { gap: 12px; margin-bottom: 12px; }
  .xp-promo-title-wrap h2 { font-size: 18px; }
  .xp-promo-title-wrap p { font-size: 12px; }
  .xp-promo-coupon-box {
    padding: 10px 12px;
    gap: 10px;
    border-radius: 14px;
  }
  .xp-promo-coupon-box .btn {
    width: 100%;
    justify-content: center;
  }
  .xp-promo-grid { gap: 10px; }
  .xp-promo-card {
    padding: 12px 13px;
    gap: 6px;
    border-radius: 15px;
  }
  .xp-promo-card h3 { font-size: 15px; }
  .xp-promo-price-row strong { font-size: 20px; }
  .xp-promo-card-foot { padding-top: 7px; }

  /* 商店页头部、双栏条与选配弹窗精调 */
  .p-store-hero { padding: 18px 0 16px; }
  .p-store-title { font-size: 24px; }
  .xp-store-tabs-bar { padding: 8px 0; }
  .p-buy-card { padding: 16px; }
  .p-store-seg {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .p-store-seg-btn {
    padding: 6px 4px;
    font-size: 12px;
    min-height: 36px;
    justify-content: center;
  }
  .p-buy-terms,
  .p-store-plan-tip {
    white-space: normal;
    text-overflow: clip;
    overflow: visible;
    line-height: 1.5;
  }

  /* 个人中心与实例页头部更紧凑 */
  .p-acc-hero { padding: 20px 0 16px; }
  .p-acc-title { font-size: 24px; }

  /* 右下角小胖小屋弹出提示更轻巧不遮挡 */
  .xp-mascot-pop {
    right: 12px;
    left: 12px;
    bottom: 12px;
    padding: 8px 34px 8px 10px;
    gap: 10px;
    border-radius: 16px;
  }
  .xp-mascot-pop img {
    width: 42px;
    height: 42px;
    border-radius: 11px;
  }
  .xp-mascot-pop-txt b { font-size: 12.5px; }
  .xp-mascot-pop-txt span { font-size: 11px; margin-top: 2px; }
}


/* ==========================================================================
   薄荷奶白 · 轻可爱极简风（默认 normal 主题）+ 全站移动端深度适配
   仅作用于非樱花可爱模式（html:not([data-style="cute"])），樱花模式保持原样。
   ========================================================================== */

html:not([data-style="cute"]) body {
  background-color: var(--bg);
  background-image:
    radial-gradient(58% 36% at 12% 0%, rgba(16, 185, 129, 0.08), transparent 68%),
    radial-gradient(48% 34% at 88% 4%, rgba(251, 146, 60, 0.07), transparent 65%);
  background-attachment: fixed;
}

html[data-theme="dark"]:not([data-style="cute"]) body {
  background-image:
    radial-gradient(56% 36% at 15% 0%, rgba(16, 185, 129, 0.12), transparent 68%),
    radial-gradient(46% 32% at 88% 6%, rgba(251, 146, 60, 0.07), transparent 65%);
}

/* 顶部导航：轻透奶白磨砂 + 圆润胶囊按钮 */
html:not([data-style="cute"]) .site-header,
html:not([data-style="cute"]) .xp-header {
  background: rgba(249, 250, 246, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

html[data-theme="dark"]:not([data-style="cute"]) .site-header,
html[data-theme="dark"]:not([data-style="cute"]) .xp-header {
  background: rgba(13, 19, 17, 0.84);
}

html:not([data-style="cute"]) .nav-link.is-active,
html:not([data-style="cute"]) .nav-links a.is-active {
  background: rgba(16, 185, 129, 0.12);
  color: var(--brand-deep);
  border-radius: 999px;
}

html[data-theme="dark"]:not([data-style="cute"]) .nav-link.is-active,
html[data-theme="dark"]:not([data-style="cute"]) .nav-links a.is-active {
  color: #6ee7b7;
}

/* 轻可爱圆润按钮与卡片层次 */
html:not([data-style="cute"]) .btn-primary {
  background: var(--grad-brand);
  border-color: transparent;
  border-radius: 999px;
  box-shadow: 0 8px 20px -8px rgba(16, 185, 129, 0.48);
  transition: transform 0.16s var(--ease-spring), box-shadow 0.18s ease, filter 0.16s ease;
}

html:not([data-style="cute"]) .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -8px rgba(16, 185, 129, 0.56);
  filter: brightness(1.03);
}

html:not([data-style="cute"]) .btn-outline,
html:not([data-style="cute"]) .btn-quiet,
html:not([data-style="cute"]) .style-pill-btn {
  border-radius: 999px;
}

html:not([data-style="cute"]) .style-pill-btn {
  background: rgba(16, 185, 129, 0.10);
  color: var(--brand-deep);
  border: 1px solid rgba(16, 185, 129, 0.24);
  font-weight: 700;
}

html[data-theme="dark"]:not([data-style="cute"]) .style-pill-btn {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.28);
}

html:not([data-style="cute"]) .panel,
html:not([data-style="cute"]) .p-buy-card,
html:not([data-style="cute"]) .p-mp-card,
html:not([data-style="cute"]) .p-st-card,
html:not([data-style="cute"]) .modal-box {
  border-radius: var(--r-lg);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

html:not([data-style="cute"]) .p-buy-card.is-active,
html:not([data-style="cute"]) .p-buy-item[aria-checked="true"] {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14), var(--shadow-sm);
}

/* 控制台侧栏与胶囊导航（柔和薄荷奶白，不再像麦块） */
html:not([data-style="cute"]) .lu-side {
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
}

html:not([data-style="cute"]) .lu-navbtn.is-active,
html:not([data-style="cute"]) .p-inst-navbtn[aria-selected="true"],
html:not([data-style="cute"]) .p-mp-cat.is-on,
html:not([data-style="cute"]) .p-mp-tag.is-on {
  background: rgba(16, 185, 129, 0.13);
  color: var(--brand-deep);
  border-color: rgba(16, 185, 129, 0.30);
  border-radius: 12px;
}

html[data-theme="dark"]:not([data-style="cute"]) .lu-navbtn.is-active,
html[data-theme="dark"]:not([data-style="cute"]) .p-inst-navbtn[aria-selected="true"],
html[data-theme="dark"]:not([data-style="cute"]) .p-mp-cat.is-on,
html[data-theme="dark"]:not([data-style="cute"]) .p-mp-tag.is-on {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.18);
}

/* ---------------- 全站手机端深度适配（<= 768px & <= 520px） ---------------- */
html,
body {
  overflow-x: clip;
}

@media (max-width: 768px) {
  :root {
    --header-h: 56px;
    --gutter: 14px;
    --section-y: 30px;
  }

  .container {
    padding-inline: 14px;
  }

  /* 弹窗在手机端更舒展、可滚动不截断 */
  .modal-box {
    width: calc(100vw - 20px) !important;
    max-width: 100% !important;
    max-height: 88dvh;
    border-radius: 18px;
  }

  .modal-body {
    max-height: calc(88dvh - 128px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 横向可滚动标签条（节点状态分组 / 整合包分类 / 纯净端分类） */
  .p-st-groups,
  .p-mp-catbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .p-st-groups::-webkit-scrollbar,
  .p-mp-catbar::-webkit-scrollbar {
    display: none;
  }

  .p-st-group-btn,
  .p-mp-cat {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* 控制台顶部按钮与文件操作条不挤压换行 */
  .p-pane-head,
  .p-files-bar,
  .p-mp-topbar,
  .p-mp-filters {
    gap: 8px;
  }

  .p-pane-tools {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* 控制台日志黑框手机端高度适中 */
  .p-log,
  .p-term-out {
    max-height: 52vh;
    font-size: 12px;
  }

  /* 表格容器平滑横滑 */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 520px) {
  /* 商店购买弹窗：CPU / 内存 / 带宽 / 硬盘 四格自动转 2x2，绝不挤爆 */
  #buySpecs.p-buy-specs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  /* SFTP 键值对单列清晰排列 */
  .p-sftp-kv > div {
    flex-wrap: wrap;
    gap: 6px;
  }

  .p-sftp-kv code {
    word-break: break-all;
    max-width: 100%;
  }

  /* 顶栏手机端隐藏文字式样切换里的冗长字符，保证按钮不换行 */
  .nav-actions {
    gap: 6px;
  }

  .style-pill-btn {
    padding: 5px 9px;
    font-size: 12px;
  }
}

.avatar, #acctAvatar, #accAvatar {
  position: relative;
  overflow: hidden;
}
.xp-qq-avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
  z-index: 1;
}

.d-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: var(--bg-soft, rgba(16, 185, 129, 0.08));
  border: 1px solid var(--line, rgba(15, 23, 42, 0.08));
  color: inherit;
  text-decoration: none;
}
.d-user-card .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent, #10b981);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.d-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.d-user-meta b {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.d-user-meta small {
  font-size: 12px;
  color: var(--muted, #64748b);
}

/* ==========================================================================
   全站桌面端宽屏 + 平板 + 手机端全面自适应增强
   ========================================================================== */
img, svg, video, canvas, iframe { max-width: 100%; }
main, section, .panel, .card, .p-pane { min-width: 0; }

/* PC 宽屏（>= 1440px）适度舒展容器，避免两侧留白过多 */
@media (min-width: 1440px) {
  :root {
    --container: min(1240px, 92vw);
  }
}

/* 平板 / 小屏笔记本（<= 1080px） */
@media (max-width: 1080px) {
  .nav-inner { gap: 10px; }
}

/* 手机端深度适配与防横向溢出（<= 768px & <= 640px & <= 440px） */
@media (max-width: 768px) {
  .toast-stack {
    right: 10px;
    left: 10px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    max-width: none;
  }
}

@media (max-width: 640px) {
  .modal {
    padding: 10px !important;
    align-items: center;
  }
  .modal-box {
    display: flex;
    flex-direction: column;
    width: calc(100vw - 20px) !important;
    max-width: 100% !important;
    max-height: calc(92dvh - env(safe-area-inset-bottom));
    border-radius: 18px;
    overflow: hidden;
  }
  .modal-head,
  .modal-foot {
    flex: 0 0 auto;
  }
  .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .modal-foot {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* 触控表单防 iOS 自动放大 & 舒适点击区域 */
  .input,
  textarea.input,
  select.input {
    font-size: 16px;
    min-height: 40px;
  }
  .btn:not(.btn-sm):not(.mk-term-iconbtn):not(.xp-error-bar-copy):not(.xp-error-bar-close) {
    min-height: 40px;
  }

  /* 个人中心标签条与表单自适应 */
  .p-acc-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .p-acc-tabs::-webkit-scrollbar { display: none; }
  .p-acc-tabs > * { flex: 0 0 auto; white-space: nowrap; }
  .p-acc-av-actions .btn,
  .p-acc-inline .btn { flex: 1 1 auto; justify-content: center; }

  .nav-actions { gap: 5px; }
  .nav-actions .btn,
  .nav-actions .style-pill-btn { white-space: nowrap; }
}

@media (max-width: 480px) {
  .modal-foot > .btn,
  .p-fb-foot-acts > .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .p-acc-av-card { padding: 12px; }
  .p-acc-card { padding: 16px; }
}
