
/*
 * ============================================================
 * ⚠️  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; }

  /* 汉堡按钮显示（单一权威：尺寸/线条自包含，不依赖 .navbar/.glassmorphism 等祖先类，矩阵落地页同样生效）*/
  .mobile-menu-toggle {
    display: inline-flex !important;
    visibility: visible !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px !important;
    padding: 0 !important;
    gap: 5px !important;
    background: rgba(255, 255, 255, 0.10) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    z-index: 100001 !important;
    box-sizing: border-box !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  .mobile-menu-toggle span {
    display: block !important;
    width: 20px !important;
    height: 2px !important;
    margin: 0 !important;
    background: #ffffff !important;
    border-radius: 2px !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;}

/* ============================================================
   通用内容组件（抽离工具页内联样式，单一权威，2026-09-18）
   ============================================================ */
.tip-muted{padding:16px;background:#f8f9fa;border-radius:8px;font-size:13px;color:#7f8c8d;line-height:1.8;}
.tip-muted-sm{padding:12px;background:#f8f9fa;border-radius:8px;font-size:13px;color:#7f8c8d;line-height:1.6;margin-bottom:16px;}
.tip-info{margin-top:16px;padding:12px;background:#f0f7ff;border-radius:8px;font-size:12px;color:#1e40af;line-height:1.6;}
.tip-warn{padding:12px;background:#fef3c7;border-radius:8px;font-size:12px;color:#92400e;line-height:1.6;margin-bottom:16px;}
.callout-info{background:#f0f9ff;padding:20px;border-radius:10px;border-left:4px solid #3b82f6;margin-bottom:30px;}
.callout-warn{margin-top:24px;padding:20px;background:#f8fafc;border-radius:8px;border-left:4px solid #f59e0b;}
.guide-card{text-align:center;padding:80px 20px;background:#fff;border-radius:12px;border:1px solid #eef0f3;margin:20px 0;}
.btn-inline-primary{display:inline-block;padding:10px 24px;background:#4f46e5;color:#fff;border-radius:8px;text-decoration:none;font-size:14px;}
.btn-inline-secondary{display:inline-block;padding:10px 24px;background:#f1f5f9;color:#475569;border-radius:8px;text-decoration:none;font-size:14px;}

/* ============================================================
   HDR-MOBILE-FIX-20260918 移动端顶栏可读性 + 登录入口（单一权威，最后加载）
   根因：移动端顶栏是白色毛玻璃，但站名/汉堡线继承白色导致几乎隐形；登录注册在抽屉最底部。
   仅作用于 <=768px，桌面端不受影响。
   ============================================================ */
@media (max-width: 768px) {
  /* 统一浅色毛玻璃顶栏，保证深色文字可靠可读；紧凑 56px */
  .site-header,
  header.site-header,
  .navbar.glassmorphism-nav {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 1px 8px rgba(15, 23, 42, 0.05) !important;
  }
  .site-header, .navbar { min-height: 56px !important; padding-top: 0 !important; padding-bottom: 0 !important; }
  .site-header .nav-container { min-height: 56px; padding-top: 0 !important; padding-bottom: 0 !important; }

  /* 站名深色高对比 */
  .site-header .logo-text,
  .navbar .logo-text,
  header .logo-text {
    color: #0f172a !important;
    font-weight: 700 !important;
    letter-spacing: 0.2px;
    text-shadow: none !important;
  }
  .site-header .logo-subtitle,
  .navbar .logo-subtitle { color: rgba(15, 23, 42, 0.55) !important; }

  /* 汉堡：浅底深线，匹配白色毛玻璃 */
  .mobile-menu-toggle {
    background: rgba(15, 23, 42, 0.05) !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
  }
  .mobile-menu-toggle span { background: #334155 !important; }

  /* 抽屉：登录/注册用 order 提到最前并按钮化（不改各页 HTML） */
  .mobile-menu-content { display: flex !important; flex-direction: column !important; }
  .mobile-menu-content .mobile-nav-link[href="/login.html"] {
    order: -2; margin-top: 10px; padding: 14px 16px !important; text-align: center;
    font-size: 16px !important; font-weight: 600; color: #eef2ff !important;
    background: rgba(255, 255, 255, 0.10) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important; border-radius: 12px;
  }
  .mobile-menu-content .mobile-nav-link[href*="tab=register"] {
    order: -1; padding: 15px 16px !important; text-align: center;
    font-size: 16px !important; font-weight: 700; color: #ffffff !important;
    background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
    border: none !important; border-radius: 12px; margin-bottom: 12px;
  }
}

/* ============================================================
   无障碍 / SEO：仅供屏幕阅读器与搜索引擎的 visually-hidden（sr-only）
   全屏编辑器类 Web App 用它放置 H1，不占视觉布局
   ============================================================ */
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important;}

/* ============================================================
   工具页标准结构（/tools/* 单一权威，替代内联样式，跨工具页复用）
   规则：工具页不再写 style="..."，统一用下列 class；视觉值取自原内联与 style.css
   ============================================================ */

/* 上传区主标题：语义 H2，视觉等同原 .drop-zone h3（桌面 18px/600） */
.drop-zone h2.tool-upload-title,
.upload-area h2.tool-upload-title {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 600;
}
@media (max-width: 768px) {
  .drop-zone h2.tool-upload-title,
  .upload-area h2.tool-upload-title {
    font-size: 18px !important;
    margin-bottom: 8px;
    color: #1e1b4b !important;
    font-weight: 700 !important;
  }
}

/* 设置面板标题：语义 H2，视觉等同原 .settings-panel h3 */
.settings-panel h2.tool-settings-title {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--text-primary);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

/* 结果区标题：语义 H3，视觉等同原 .result-area h4 最终值（18px/600/#166534） */
.result-area h3.tool-result-title {
  color: #166534;
  font-size: 18px;
  margin-bottom: 16px;
  font-weight: 600;
}

/* 功能性初始隐藏：刻意不加 !important，JS 可用 element.style.display 覆盖 */
.tool-hidden { display: none; }

/* 上传区粘贴提示 */
.tool-paste-hint { font-size: 12px; color: #667eea; margin-top: 8px; }

/* 批量结果区 */
.tool-batch-summary { font-size: 14px; margin-bottom: 8px; }
.tool-batch-actions { margin-top: 14px; }

/* 处理模式三列网格 + 模式按钮小字（.mode-btn 为既有类） */
.tool-mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mode-btn small { display: block; color: #94a3b8; margin-top: 2px; }

/* 设置项浅色说明 */
.tool-field-hint { font-size: 12px; color: #95a5a6; margin-top: 4px; }

/* FAQ 区块：仅外层加一个 class，内部标题/正文由层级选择器接管，零内联 */
.tool-faq {
  margin-top: 32px;
  padding: 28px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #eef0f3;
}
.tool-faq > div { margin-bottom: 12px; }
.tool-faq > div:last-child { margin-bottom: 0; }
.tool-faq h2 { font-size: 20px; margin-bottom: 12px; color: #2c3e50; }
.tool-faq h3 { font-size: 15px; margin-bottom: 4px; color: #34495e; }
.tool-faq p { font-size: 14px; color: #7f8c8d; }

/* 工具页广告位间距：按投放位属性命中，替代各页内联 margin */
.ad-slot[data-ad-position="top-banner"] { margin: 15px 0; }
.ad-slot[data-ad-position="bottom"] { margin-top: 25px; }

/* ============================================================
   工具页标准结构·批次2（结果/设置辅助文字、并排表单、切换面板）
   ============================================================ */
/* 结果区辅助文字：14px 主说明 / 13px 次级说明（打印尺寸等） */
.result-area .tool-result-note { font-size: 14px; margin-bottom: 12px; }
.result-area .tool-result-sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
/* 工具页弱化小字提示 */
.tool-hint-muted { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.tool-lock-hint { font-size: 12px; color: var(--text-muted); margin: 6px 0 12px; }
/* 格式说明（补既有 .fmt-desc 缺失的间距） */
.fmt-desc { margin-top: 8px; }
/* 结果区底部按钮行收紧（默认 .result-actions 为 20px） */
.tool-result-actions { margin-top: 14px; }
/* 批量结果汇总（位于进度条之后） */
.tool-batch-summary-top { margin-top: 10px; font-size: 14px; }
/* 等比例行：宽高并排表单项去掉默认下边距 */
.rs-ratio-row .field.form-group { margin: 0; }

/* ============================================================
   批次3：透明 file-input 覆盖层工具页（base64/blur/border/grayscale/
   grid/remove-watermark/rotate/rounded/to-ico）
   - 透明文件输入铺满拖拽区接收点击（保留 onclick stopPropagation，
     绝不 display:none，否则点不动/无文件选择器）
   - 工具页标准标题结构（与 compress/convert/resize 一致）
   ============================================================ */
.drop-zone.has-overlay { position: relative; overflow: hidden; }
.file-input-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; z-index: 100; margin: 0; padding: 0;
  appearance: none; -webkit-appearance: none; border: none; background: transparent;
}

/* 预览区小标题：复刻原 .preview-area h4（16/600，颜色继承 --text-primary，无外边距） */
.preview-area h3.tool-preview-title,
#previewSection h3.tool-preview-title {
  font-size: 16px; font-weight: 600; line-height: 1.25;
  color: var(--text-primary); margin: 0;
}
/* to-ico 多尺寸预览（原内联 mb12 + #0f172a） */
#previewSection h3.tool-preview-title { color: #0f172a; margin: 0 0 12px; }

/* 颜色选择器（边框/去水印） */
.tool-color-input { width: 100%; height: 40px; cursor: pointer; padding: 2px; }
.preset-colors { display: flex; gap: 8px; margin-bottom: 16px; }
.color-preset {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #ddd; cursor: pointer; padding: 0; flex: none;
}
.color-preset.cp-white { background: #ffffff; }
.color-preset.cp-black { background: #000000; }
.color-preset.cp-gray  { background: #f5f5f5; }
.color-preset.cp-pink  { background: #ffe4e1; }
.color-preset.cp-blue  { background: #e6f3ff; }

/* 九宫格切图（grid） */
.grid-preview-img { max-width: 300px; }
.grid-preview-3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  max-width: 300px; margin: 0 auto 16px;
}
.info-tip-blue {
  background: #f0f7ff; border: 1px solid #d0e8ff;
  border-radius: 8px; padding: 16px; margin-bottom: 16px;
}
.info-tip-blue p { font-size: 14px; color: #1e40af; line-height: 1.8; margin: 0; }

/* 圆角结果棋盘格透明背景（rounded） */
.checkerboard-bg {
  background: repeating-conic-gradient(#f0f0f0 0% 25%, #fff 0% 50%) 50% / 20px 20px;
}

/* 通用工具页提示文字 */
.tool-muted-hint { color: #999; font-size: 12px; }
.tool-prose-hint { color: #666; font-size: 14px; line-height: 1.8; }
.tool-selection-info { font-size: 13px; color: #666; margin-top: 8px; }

/* base64 输出区 */
.tool-field-label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 6px; }
.tool-block-note { margin-top: 12px; }
.tool-warn-note { margin-top: 12px; color: #e67e22; }

/* to-ico */
.tool-local-hint { font-size: 12px; color: #4f46e5; margin-top: 8px; }
.tool-ico-meta { margin-bottom: 12px; font-size: 14px; }
.ico-preset-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ico-preset-row .preset-btn { flex: 1; min-width: auto; }
.ico-faq-card {
  margin-top: 32px; padding: 28px; background: #fff;
  border-radius: 12px; border: 1px solid #e2e8f0;
}
.ico-faq-card h2 { font-size: 20px; margin-bottom: 12px; color: #0f172a; }
.ico-faq-card .faq-item { margin-bottom: 12px; }
.ico-faq-card h3 { font-size: 15px; margin-bottom: 4px; color: #1e293b; font-weight: 600; }
.ico-faq-card p { font-size: 14px; color: #64748b; }

/* ============================================================
   工具页标准结构·批次4（取色/滤镜/渐变/反色/像素化/锐化等
   "上传提示 + 主内容面板 + 文档说明" 型页面）
   单一权威：替代这些页面的静态内联 style，视觉值取自原内联与各页 <style>
   ============================================================ */
/* 上传提示三行（.upload-hint 内）；仅复刻原内联声明，margin 未声明部分保持原状 */
.tool-hint-main { font-size: 16px; font-weight: 500; color: #334155; margin-bottom: 8px; }
.tool-hint-sub { font-size: 14px; color: #64748b; }
.tool-hint-secure { font-size: 12px; color: #94a3b8; margin-top: 8px; }
/* 功能面板分区标题：语义 H2，视觉复刻各页 .panel/.filter-panel/.setting-group h3（14/600/#0f172a/mb12） */
.tool-panel-title { font-size: 14px; font-weight: 600; color: #0f172a; margin: 0 0 12px; }
.tool-panel-title.tool-panel-gap { margin-top: 16px; }
/* 结果/工作区满宽；初始隐藏由 .tool-hidden 提供，JS 用 element.style.display 覆盖 */
.tool-result-area { width: 100%; }
/* 操作按钮行 */
.tool-btn-row { margin-top: 16px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
/* 按钮取消占满（页面 .btn 默认 width:100%） */
.btn-inline { width: auto; display: inline-block; }
.tool-mt-16 { margin-top: 16px; }
.tool-mt-12 { margin-top: 12px; }
/* 文档说明区（视觉值取自原内联） */
.tool-doc-section { margin-top: 40px; }
.tool-doc-title { font-size: 20px; color: #0f172a; margin-bottom: 16px; }
.tool-doc-card { background: #f8fafc; padding: 20px; border-radius: 12px; border: 1px solid #e2e8f0; }
.tool-doc-subtitle { font-size: 16px; color: #1e293b; margin: 16px 0 8px; }
.tool-doc-list { color: #475569; line-height: 1.8; padding-left: 20px; }
.tool-doc-text { color: #475569; line-height: 1.8; }
/* JS 触发点击的隐藏文件输入（区别于透明覆盖层 .file-input-overlay） */
.file-input-hidden { display: none; }
/* 品牌色文字链接 / 行内 label 复位 */
.tool-link-brand { color: #4f46e5; }
.tool-label-reset { margin: 0; cursor: pointer; }
/* 结果预览图容器与图片（拼接等工具页结果区） */
.tool-result-figure { text-align: center; margin-bottom: 12px; }
.tool-result-img { max-width: 100%; max-height: 300px; border-radius: 8px; }
/* 工具页通用：满宽按钮/弹性列/间距（SEO 批次5） */
.tool-btn-full { width: 100%; }
.tool-flex-1 { flex: 1; }
.tool-mt-8 { margin-top: 8px; }
.tool-mt-20 { margin-top: 20px; }

/* ============================================================
   首页内联样式抽取（单一权威）：hero 阶梯动画延迟 + 客户端推广卡片
   ============================================================ */
.hero-title.animate-fade-in-up { animation-delay: 0.1s; }
.hero-subtitle.animate-fade-in-up { animation-delay: 0.2s; }
.hero-actions.animate-fade-in-up { animation-delay: 0.3s; }
.hero-stats.animate-fade-in-up { animation-delay: 0.4s; }
.client-promo-card { padding: 48px; text-align: center; }
.client-promo-icon { font-size: 48px; margin-bottom: 16px; }
.client-promo-title { font-size: 28px; font-weight: 700; color: #ffffff; margin-bottom: 12px; }
.client-promo-desc { font-size: 16px; color: rgba(255,255,255,0.7); max-width: 600px; margin: 0 auto 24px; line-height: 1.7; }

/* ==== open-source.html .oss-* (single authority) ==== */
.oss-wrap { max-width: 960px; margin: 0 auto; padding: var(--space-6, 24px) 0 var(--space-12, 48px); }
.oss-hero { text-align: center; margin-bottom: 32px; }
.oss-hero h1 { font-size: 30px; color: #2c3e50; margin: 0 0 12px; }
.oss-hero p { color: #5a6472; font-size: 15px; line-height: 1.8; max-width: 780px; margin: 0 auto; }
.oss-updated { text-align: center; color: #9aa3af; font-size: 13px; margin-top: 12px; }
.oss-group { margin-bottom: 40px; }
.oss-group h2 { font-size: 20px; color: #2c3e50; margin: 0 0 6px; padding-left: 12px; border-left: 4px solid #667eea; }
.oss-sub { color: #8a93a0; font-size: 13px; margin: 0 0 16px; padding-left: 16px; }
.oss-table-scroll { overflow-x: auto; border: 1px solid #eef0f3; border-radius: 12px; background: #fff; }
table.oss-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.oss-table th { background: #f7f8fa; color: #2c3e50; font-size: 13px; text-align: left; padding: 12px 14px; border-bottom: 1px solid #eef0f3; white-space: nowrap; }
.oss-table td { padding: 12px 14px; border-bottom: 1px solid #f2f4f7; font-size: 14px; color: #444; vertical-align: top; line-height: 1.6; }
.oss-table tr:last-child td { border-bottom: none; }
.oss-name { font-weight: 600; color: #2c3e50; white-space: nowrap; }
.oss-name a { color: #1890ff; text-decoration: none; }
.oss-name a:hover { text-decoration: underline; }
.oss-ver { color: #8a93a0; font-size: 12px; white-space: nowrap; }
.oss-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.oss-badge.mit { background: #e6f7ec; color: #1a8a44; }
.oss-badge.isc { background: #e8f1fd; color: #1f6fd0; }
.oss-badge.apache { background: #fff4e5; color: #c77711; }
.oss-badge.lgpl { background: #fdecec; color: #d04545; }
.oss-note { background: #f0f7ff; border-left: 4px solid #1890ff; border-radius: 8px; padding: 16px 20px; margin: 16px 0 0; color: #3d4b5c; font-size: 14px; line-height: 1.8; }
.oss-warn { background: #fff8e6; border-left: 4px solid #f5a623; border-radius: 8px; padding: 16px 20px; margin: 16px 0 0; color: #5c4a1f; font-size: 14px; line-height: 1.8; }
.oss-model { background: linear-gradient(135deg, #f5f7ff, #eef4ff); border: 1px solid #e2e9ff; border-radius: 12px; padding: 20px 24px; margin-top: 12px; color: #33415c; font-size: 14px; line-height: 1.9; }
.oss-legal { color: #6b7480; font-size: 13px; line-height: 1.9; margin: 8px 0; }
.oss-legal a { color: #1890ff; }
@media (max-width: 768px) {
  .oss-wrap { padding: 16px 0 40px; }
  .oss-hero h1 { font-size: 24px; }
  .oss-group h2 { font-size: 18px; }
  .oss-table th, .oss-table td { padding: 10px 12px; font-size: 13px; }
}
