
/*
 * ============================================================
 * ⚠️  AI警告 - 修改前必读！
 * ============================================================
 * 
 * 这是设计系统唯一权威文件！
 * 
 * 规则：
 * 1. 所有样式修改直接改这个文件
 * 2. 禁止新建 fix-*.css 临时补丁
 * 3. 这个文件必须最后加载，是唯一权威
 * 4. 改完跑 npm run audit:code 检查
 * 
 * 违反规则 → 直接阻止commit！
 * 
 * ============================================================
 */

/**
 * 锦玥图像引擎 - 现代化设计系统 v2.0
 * 包含：设计Token、基础重置、组件库、工具类、响应式、暗色模式
 */

/* ==================== 设计Token ==================== */
:root {
  /* 主色调 - 靛蓝紫渐变系 */
  --color-primary-50: #eef2ff;
  --color-primary-100: #e0e7ff;
  --color-primary-200: #c7d2fe;
  --color-primary-300: #a5b4fc;
  --color-primary-400: #818cf8;
  --color-primary-500: #6366f1;
  --color-primary-600: #4f46e5;
  --color-primary-700: #4338ca;
  --color-primary-800: #3730a3;
  --color-primary-900: #312e81;

  /* 辅助色 - 紫色 */
  --color-secondary-500: #8b5cf6;
  --color-secondary-600: #7c3aed;

  /* 渐变色 */
  --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);

  /* 语义色 */
  --color-success: #10b981;
  --color-success-bg: #ecfdf5;
  --color-warning: #f59e0b;
  --color-warning-bg: #fffbeb;
  --color-danger: #ef4444;
  --color-danger-bg: #fef2f2;
  --color-info: #3b82f6;
  --color-info-bg: #eff6ff;

  /* 中性色 */
  --color-gray-50: #f8fafc;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1e293b;
  --color-gray-900: #0f172a;

  /* 背景色 */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-elevated: #ffffff;

  /* 文字色 */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  /* 边框色 */
  --border-primary: #e2e8f0;
  --border-secondary: #f1f5f9;
  --border-focus: #4f46e5;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

  /* 字号 */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  /* 字重 */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* 行高 */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* 间距 */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* 圆角 */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-primary: 0 4px 14px 0 rgba(79, 70, 229, 0.3);
  --shadow-primary-lg: 0 8px 24px 0 rgba(79, 70, 229, 0.4);

  /* 过渡动画 */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* 布局 */
  --container-max: 1200px;
  --header-height: 64px;
  --sidebar-width: 280px;

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;
  --z-tooltip: 500;
}

/* 暗色模式 */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-elevated: #1e293b;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-muted: #64748b;

  --border-primary: #334155;
  --border-secondary: #1e293b;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* ==================== 基础重置 ==================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
}

/* 选中文本颜色 */
::selection {
  background-color: var(--color-primary-200);
  color: var(--color-primary-900);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-400);
}

/* ==================== 布局组件 ==================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.main {
  min-height: calc(100vh - var(--header-height) - 200px);
  padding-bottom: var(--space-12);
}

.section {
  padding: var(--space-8) 0;
}

.grid {
  display: grid;
  gap: var(--space-4);
}
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* ==================== 按钮组件 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: 1.5;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* 主要按钮 */
.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: var(--shadow-primary-lg);
  transform: translateY(-1px);
}

/* 次要按钮 */
.btn-secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--border-primary);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-secondary);
  border-color: var(--color-gray-400);
}

/* 幽灵按钮 */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* 危险按钮 */
.btn-danger {
  background: var(--color-danger);
  color: white;
}
.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

/* 按钮尺寸 */
.btn-sm { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
.btn-lg { padding: var(--space-3) var(--space-6); font-size: var(--text-base); }
.btn-block { width: 100%; }

/* ==================== 卡片组件 ==================== */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-normal);
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-300);
}
.card-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-secondary);
}
.card-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}
.card-desc {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-1);
}

/* 工具卡片 */
.tool-card {
  display: block;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  transition: all var(--transition-normal);
  text-decoration: none;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-300);
}
.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: var(--space-3);
}
.tool-card h3 {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.tool-card p {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: var(--leading-relaxed);
}

/* ==================== 表单组件 ==================== */
.form-group {
  margin-bottom: var(--space-4);
}
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.form-input::placeholder {
  color: var(--text-muted);
}
.form-textarea {
  resize: vertical;
  min-height: 100px;
}
.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}
.form-error {
  font-size: var(--text-xs);
  color: var(--color-danger);
  margin-top: var(--space-1);
}

/* ==================== 徽章/标签 ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
  line-height: 1.5;
}
.badge-primary { background: var(--color-primary-100); color: var(--color-primary-700); }
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-gray { background: var(--bg-tertiary); color: var(--text-tertiary); }

/* ==================== 提示框 ==================== */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}
.alert-info { background: var(--color-info-bg); color: var(--color-info); border: 1px solid #bfdbfe; }
.alert-success { background: var(--color-success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.alert-warning { background: var(--color-warning-bg); color: #92400e; border: 1px solid #fde68a; }
.alert-danger { background: var(--color-danger-bg); color: #991b1b; border: 1px solid #fecaca; }

/* ==================== 进度条 ==================== */
.progress {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-normal);
}

/* ==================== 标签页 ==================== */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: var(--space-6);
}
.tab {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--color-primary-600);
  border-bottom-color: var(--color-primary-600);
}

/* ==================== 工具类 ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-muted { color: var(--text-muted); }
.text-primary-color { color: var(--color-primary-600); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }

.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.w-full { width: 100%; }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

.rounded-full { border-radius: var(--radius-full); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

/* ==================== 响应式 ==================== */
@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --text-3xl: 1.5rem;
    --text-4xl: 1.875rem;
  }
  .grid-cols-3, .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .container { padding: 0 var(--space-3); }
  .section { padding: var(--space-6) 0; }
}

@media (max-width: 480px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
  .btn { padding: var(--space-2) var(--space-3); }
}

/* ==================== 动画 ==================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fadeIn { animation: fadeIn var(--transition-normal) ease-out; }
.animate-slideUp { animation: slideUp var(--transition-normal) ease-out; }
.animate-slideDown { animation: slideDown var(--transition-normal) ease-out; }
.animate-scaleIn { animation: scaleIn var(--transition-normal) ease-out; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* 加载中状态 */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-gray-300);
  border-top-color: var(--color-primary-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== 统一设计系统权威样式 ===== */
/* 导航栏LOGO统一大小 */
.site-header .logo-icon,
.navbar .logo-icon,
header .logo-icon {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    object-fit: contain !important;
    border-radius: 8px !important;
}

/* 导航栏高度统一 */
.site-header,
.navbar {
    min-height: 60px !important;
    display: flex !important;
    align-items: center !important;
}

/* 语言切换栏统一样式 */
.lang-switcher-bar {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* ===== 导航栏LOGO统一样式 ===== */
.site-header .logo-icon,
.navbar .logo-icon,
header .logo-icon {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    object-fit: contain !important;
    border-radius: 8px !important;
    margin-right: 10px !important;
}

/* ===== 导航栏布局（权威） ===== */
.site-header .nav-container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    padding: 0 20px !important;
}

.nav-logo {
    display: flex !important;
    align-items: center !important;
}

.nav-links {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
}



/* ============================================================
   导航与移动端 —— 单一权威（design-system.css 末尾，最后加载）
   规则：移动端/导航问题只在本块维护，禁止再新建 fix/patch/temp CSS
   配套 JS：dropdown-manager.js 用 .active 类控制下拉与抽屉
   ============================================================ */

/* ---- lang switcher structural fallback (core/i18n.js contract): wrapper > button.lang-switcher + sibling .lang-dropdown. Visuals come from i18n-switcher.css; never add !important to .lang-dropdown display (core toggles inline display:block). ---- */
.lang-switcher-wrapper { position: relative; display: inline-flex; align-items: center; }
.lang-dropdown { display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 99990; }


/* ---- 桌面端默认：隐藏移动端专属元素 ---- */
.mobile-menu-toggle { display: none !important; }
.mobile-menu { display: none !important; }

/* ---- 移动端（<=768px）---- */
@media (max-width: 768px) {
  /* 头部静态布局，沿用玻璃拟态背景，不写死黑色、不 fixed 遮挡内容 */
  .site-header,
  .navbar {
    position: relative !important;
    top: auto !important;
    min-height: 56px !important;
  }
  .site-header .nav-container {
    padding: 0 14px !important;
    gap: 10px !important;
  }
  /* logo 紧凑，杜绝超大 logo */
  .site-header .logo-icon,
  .navbar .logo-icon,
  header .logo-icon {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    margin-right: 8px !important;
  }
  .logo-text { font-size: 16px !important; white-space: nowrap; }

  /* 隐藏桌面导航链接与桌面登录/注册按钮（入口收进抽屉菜单）*/
  .nav-links.desktop-nav,
  .nav-auth.desktop-auth {
    display: none !important;
  }

  /* 右侧操作区：语言切换 + 汉堡，横向排列不挤压 logo */
  .nav-actions {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-left: auto !important;
  }
  .lang-switcher-wrapper { position: relative !important; }
  .lang-switcher { top: auto !important; right: auto !important; padding: 6px 10px !important; font-size: 12px !important; }
  .lang-switcher .lang-flag { font-size: 13px; }

  /* 汉堡按钮显示 */
  .mobile-menu-toggle {
    display: flex !important;
    visibility: visible !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
  }

  /* 全屏抽屉菜单：默认隐藏，.active 才展开 */
  .mobile-menu {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 99995 !important;
    background: rgba(15, 15, 35, 0.98) !important;
    backdrop-filter: blur(8px);
    padding: max(72px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
    overflow-y: auto;
  }
  .mobile-menu.active { display: block !important; }
  .mobile-menu-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
  }
  .mobile-nav-link {
    display: block !important;
    padding: 15px 8px !important;
    font-size: 17px !important;
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }
  .mobile-menu-close {
    position: absolute !important;
    top: max(16px, env(safe-area-inset-top)) !important;
    right: 18px !important;
    width: 42px !important;
    height: 42px !important;
    font-size: 28px !important;
    line-height: 1 !important;
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    border-radius: 50% !important;
  }

  /* 语言下拉定位在按钮正下方，不飞出屏幕 */
  .lang-dropdown {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    min-width: 132px !important;
    z-index: 99999 !important;
  }

  /* 隐私安全条：静态文档流，不遮挡导航 */
  #privacy-security-banner {
    position: relative !important;
    top: auto !important;
    padding: 8px 40px 8px 14px !important;
    font-size: 12px !important;
  }
}

/* lang-name-mobile-fallback (single source of truth): Windows cannot render flag emoji, keep the language name visible on mobile. */
@media (max-width: 768px) {
  .site-header .lang-switcher-wrapper { position: relative !important; }
  .site-header .lang-switcher { top: auto !important; right: auto !important; }
  .site-header .lang-switcher .lang-name { display: inline !important; }
}

/* lang-dropdown-visible-fallback (single source of truth): core/i18n.js opens the menu via inline display:block; legacy CSS collapsed it with fixed height/opacity and a height animation. Neutralize with high specificity. */
.site-header .lang-switcher-wrapper .lang-dropdown[style*='display: block'],
.site-header .lang-switcher-wrapper .lang-dropdown[style*='display:block'] {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  animation: none !important;
  pointer-events: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 80vh !important;
  padding: 0 !important;
  bottom: auto !important;
  left: auto !important;
  overflow: visible !important;
}

/* TOOL-UNI-MOBILE: full-height mobile menu + lang dropdown width (single source) */
@media (max-width: 768px) {
  .mobile-menu { top: 0 !important; bottom: 0 !important; height: 100vh !important; height: 100dvh !important; max-height: 100dvh !important; }
  .site-header .lang-switcher-wrapper .lang-dropdown { min-width: 156px !important; }
}

/* M2 download: secondary portable button */
.download-btn-ghost{margin-top:14px;background:rgba(255,255,255,0.12)!important;box-shadow:none!important;font-size:15px!important;padding:12px 28px!important;}
.download-btn-ghost:hover{background:rgba(255,255,255,0.2)!important;}
