/* 
  妮妮绘图 (Nini绘图) - Premium Style System
  Nini绘图 品牌配色系统
*/

:root {
  /* Light Theme Colors (default) */
  --bg-app: #f9fafb;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f9fafb;
  --bg-input: #ffffff;
  --bg-input-focus: #f9fafb;
  
  --color-primary: #2563eb;
  --color-primary-glow: rgba(37, 99, 235, 0.08);
  --color-accent: #1F2937;
  --color-accent-hover: #111827;
  --color-secondary: #10b981;
  --color-secondary-glow: rgba(16, 185, 129, 0.08);
  
  --text-main: #111827;
  --text-muted: #374151;
  --text-dim: #6b7280;
  --text-placeholder: #9ca3af;
  --text-success: #10b981;
  --text-danger: #ef4444;
  --text-warning: #f59e0b;
  
  --border-color: #e5e7eb;
  --border-color-secondary: #f3f4f6;
  --border-color-focus: #2563eb;
  --glass-effect: none;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  --sidebar-width: 250px;
  
  /* Syntax Highlight Colors */
  --syn-weight: #6366f1;
  --syn-weight-bg: rgba(99, 102, 241, 0.08);
  --syn-text: #111827;
  --syn-bracket: #8b5cf6;
  --syn-punct: #6b7280;

  /* ── 补全历史遗漏的变量 ──────────────────────────────
     下面 6 个变量此前被引用却从未定义，导致浏览器把整条声明判为无效并丢弃：
       --color-primary-rgb / --color-secondary-rgb → 元数据落区渐变、hover 光晕、
                                                     结果卡头部渐变、历史徽章渐变 全部失效
       --font-mono   → 代码块/路径 等宽字体失效
       --bg-main     → 结果卡代码块底色变透明
       --bg-body     → 风格预设弹窗 body 底色丢失
       --primary-color → 历史页「本地缓存版」徽章渐变失效
     别名类直接指向主变量，深浅色主题会自动跟随。 */
  --primary-color: var(--color-primary);
  --bg-main: var(--bg-app);
  --bg-body: var(--bg-app);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Courier New', monospace;
  --color-primary-rgb: 37, 99, 235;
  --color-secondary-rgb: 16, 185, 129;
}

/* Dark Theme */
html.dark {
  --bg-app: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-input: #0f172a;
  --bg-input-focus: #1e293b;
  
  --color-primary: #818cf8;
  --color-primary-glow: rgba(129, 140, 248, 0.12);
  --color-secondary: #34d399;
  --color-secondary-glow: rgba(52, 211, 153, 0.12);
  
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-success: #34d399;
  --text-danger: #f87171;
  --text-warning: #fbbf24;
  
  --border-color: #334155;
  --border-color-focus: #818cf8;
  
  --syn-weight: #a78bfa;
  --syn-weight-bg: rgba(167, 139, 250, 0.12);
  --syn-text: #e2e8f0;
  --syn-bracket: #c4b5fd;
  --syn-punct: #64748b;

  /* 深色主题下的主/次色 RGB 分量（供 rgba(var(--x-rgb), a) 使用） */
  --color-primary-rgb: 129, 140, 248;
  --color-secondary-rgb: 52, 211, 153;
}

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[v-cloak] {
  display: none !important;
}

body {
  font-family: 'Blueaka', 'Outfit', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

input, textarea, select, button {
  font-family: inherit;
  font-size: 14px;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* ─────────────────────────────────────────────────────
   Login Interface Styles (Aligned with Original split screen)
   ───────────────────────────────────────────────────── */
.login-wrap-outer {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* 左上角品牌标识 */
.brand-logo {
  position: fixed;
  top: 24px;
  left: 28px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo .logo-text {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  letter-spacing: 1px;
}

.login-wrap-inner {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
}

/* 左侧：随机背景图（60%） */
.login-bg {
  width: 60%;
  height: 100%;
  position: relative;
  overflow: hidden;
}
.login-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.login-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.08) 0%, transparent 100%);
}

/* 右侧：40% 容器，内容居中 */
.login-form-wrap {
  width: 40%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #ffffff;
}

.login-card {
  width: 400px;
  padding: 0 30px;
}
.login-card .brand {
  margin-bottom: 36px;
}
.login-card .brand h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 6px;
}
.login-card .brand p {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
}

.form-group-custom {
  margin-bottom: 20px;
}
.form-group-custom label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.form-group-custom input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: #1f2937;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group-custom input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.form-group-custom input::placeholder {
  color: #9ca3af;
}

.msg-box {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
}
.msg-box.success { background: #f3f4f6; color: #374151; border: 1px solid #e5e7eb; }
.msg-box.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.msg-box.loading { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }

.btn-custom {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: #1f2937;
  color: #fff;
  transition: all 0.2s;
}
.btn-custom:hover {
  background: #374151;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.btn-custom:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.remember-row-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 16px 0;
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  user-select: none;
}
.remember-row-custom input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #1f2937;
  cursor: pointer;
}

/* 登录页底部：商店图标 + 联系管理员（2026-09-24 由「邀请活动横幅」收敛而来） */
.login-extra-row {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.shop-icon-link {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #374151;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s;
}
.shop-icon-link:hover {
  background-color: #111827;
  border-color: #111827;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.18);
}
.login-extra-row .footer-link-custom {
  margin-top: 0;
}

.footer-link-custom {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
}
.footer-link-custom a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}
.footer-link-custom a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .brand-logo {
    left: 20px;
    top: 20px;
  }
  .brand-logo .logo-text {
    color: #fff;
  }
  .login-bg {
    display: none;
  }
  .login-wrap-outer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1;
  }
  .login-form-wrap {
    width: 100%;
    background: transparent;
    z-index: 2;
  }
  .login-card {
    background: #ffffff;
    padding: 30px 24px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 380px;
  }
}

.control-panel {
  width: 440px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  background-color: var(--bg-sidebar);
}
.control-panel::-webkit-scrollbar {
  display: none;
}
.tooltip-center {
  text-align: center;
}

/* ─────────────────────────────────────────────────────
   Base Layout
   ───────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Header Navigation Bar */
.app-header {
  height: 48px;
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 100;
  position: relative;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background-color var(--transition-fast);
}

.menu-toggle-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.brand-icon {
  color: var(--color-primary);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 5px var(--color-primary-glow));
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
}

.header-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.header-nav a:hover {
  background-color: var(--color-primary-glow);
  color: var(--text-main);
}

.header-nav a.active {
  background: var(--color-accent);
  color: #ffffff;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user .user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #fff;
}

.header-user .user-details {
  display: flex;
  flex-direction: column;
}

.header-user .user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-main);
}

.header-user .user-points {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-user .user-actions {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.btn-action-logout, .btn-action-checkin {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-action-logout:hover {
  background-color: rgba(235, 87, 87, 0.1);
  color: var(--text-danger);
}

.btn-action-checkin:hover {
  background-color: rgba(46, 204, 113, 0.1);
  color: var(--text-success);
}

.btn-action-checkin:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


/* ─────────────────────────────────────────────────────
   Work Area
   ───────────────────────────────────────────────────── */
.work-area {
  flex-grow: 1;
  height: calc(100vh - 48px);
  overflow: hidden;
  position: relative;
  background-color: var(--bg-app);
}

.tab-content {
  padding: 30px max(30px, calc((100vw - 1200px) / 2));
  animation: fadeIn var(--transition-normal);
  height: 100%;
  overflow-y: auto;
}

.tab-header-section {
  margin-bottom: 24px;
}

.tab-header-section h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.tab-header-section p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  user-select: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(31, 41, 55, 0.2);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(31, 41, 55, 0.3);
  background: var(--color-accent-hover);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: var(--bg-input-focus);
}

.btn-outline {
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
}

.btn-outline:hover {
  border-color: var(--border-color-focus);
  color: var(--text-main);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 8px;
}

.btn-text:hover {
  color: var(--text-main);
}

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

/* ─────────────────────────────────────────────────────
   AI Drawing Tab Layout
   ───────────────────────────────────────────────────── */
.draw-tab-layout {
  display: flex;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

/* Left Control Panel */
.control-panel {
  width: 440px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  overflow-y: auto;
  scrollbar-width: none;
  background-color: var(--bg-sidebar);
}
.control-panel::-webkit-scrollbar {
  display: none;
}

.panel-section {
  padding: 16px 20px;
  border-bottom: none;
}

.panel-section-header {
  margin-bottom: 10px;
}

.panel-section-header h3 {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: 0;
}

/* Collapsible Card */
.collapsible-card {
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px 16px 20px;
}

.collapsible-card:last-child {
  border-bottom: none;
}

.collapsible-header {
  padding: 0 0 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  background-color: var(--bg-sidebar);
  transition: background var(--transition-fast);
  height: 20px;
  margin: 0 0 4px 0;
}

.collapsible-header:hover {
  color: var(--text-main);
}

.collapsible-header h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.fold-arrow {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform var(--transition-normal);
}

.collapsible-card.expanded .fold-arrow {
  transform: rotate(180deg);
}

.collapsible-content {
  padding: 0;
  display: none;
  animation: slideDown var(--transition-normal);
}

.collapsible-card.expanded .collapsible-content {
  display: block;
}

/* Textarea Prompt Styles */
.textarea-container {
  position: relative;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
  transition: border-color var(--transition-fast);
}

.textarea-container:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}

.textarea-container textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  padding: 12px;
  resize: none;
  line-height: 1.5;
  height: 150px;
  min-height: 150px;
  max-height: 150px;
  overflow-y: auto;
}
.textarea-container textarea::placeholder {
  color: var(--text-dim);
}

.textarea-actions {
  display: flex;
  justify-content: space-between;
  background-color: #f9fafb;
  padding: 6px 12px;
  border-top: 1px solid var(--border-color);
}

/* Form Styling */
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
}

/* 生成模型：标签行 = 名称 + 计价徽章（数字来自后端计价表透传） */
.form-group label.model-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-cost-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-success);
  background: var(--color-secondary-glow);
  border: 1px solid rgba(16, 185, 129, 0.3);
  white-space: nowrap;
}

.model-cost-badge i {
  font-size: 9.5px;
  opacity: 0.85;
}

.model-cost-badge.is-v5 {
  color: var(--text-danger);
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
}

.model-cost-hint {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.65;
  color: var(--text-dim);
}

.form-group select, 
.form-group input[type="text"], 
.form-group input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: all var(--transition-fast);
  height: 44px;
}

.form-group select:focus, 
.form-group input[type="text"]:focus, 
.form-group input[type="number"]:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

/* Custom Size Dropdown */
.custom-select-wrapper {
  flex: 1;
  position: relative;
}
.custom-select-trigger {
  padding: 10px 12px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-fast);
  height: 44px;
}
.custom-select-trigger:hover {
  border-color: var(--color-primary);
}
.custom-select-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 400px;
  overflow-y: auto;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  z-index: 1000;
  margin-top: 5px;
  padding: 8px 0;
}
.custom-optgroup-label {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background-color: rgba(0,0,0,0.2);
  margin-top: 4px;
}
.custom-optgroup-label:first-child {
  margin-top: 0;
}
.custom-option {
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main);
  transition: background var(--transition-fast);
}
.custom-option:hover {
  background-color: rgba(255,255,255,0.05);
}
.custom-option.active {
  background-color: rgba(59, 130, 246, 0.2);
  color: var(--color-primary);
}
.custom-option-cost {
  font-size: 12px;
  color: var(--text-dim);
}

/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-group {
  margin-top: 12px;
}

.col-6 {
  width: 50%;
}

/* Range Sliders */
input[type="range"] {
  width: 100%;
  accent-color: var(--color-primary);
  height: 6px;
  background: var(--border-color);
  border-radius: 8px;
  outline: none;
  cursor: pointer;
}

.form-group label span {
  float: right;
  color: #2563eb;
  font-weight: 600;
  font-size: 12px;
}

/* ─────────────────────────────────────────────────────
   Size Selector (Dropdown + Custom Toggle)
   ───────────────────────────────────────────────────── */
.size-select-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.size-select {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
  height: 44px;
}
.size-select:focus {
  border-color: var(--color-primary);
}
.btn-custom-size {
  flex-shrink: 0;
  padding: 4px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.btn-custom-size:hover {
  color: var(--text-muted);
  background: rgba(0,0,0,0.04);
}
.btn-custom-size.active {
  background: var(--color-accent);
  color: #fff;
}
.custom-size-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.size-input {
  flex: 1;
  width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 13px;
  font-family: inherit;
  text-align: center;
  outline: none;
  transition: border-color var(--transition-fast);
}
.size-input:focus {
  border-color: var(--color-primary);
}
.size-x {
  color: var(--text-dim);
  font-size: 14px;
  flex-shrink: 0;
}
/* Remove old resolution presets grid */
.resolution-presets { display: none; }
.btn-res { display: none; }

/* Seed Input Group */
.seed-input-wrapper {
  display: flex;
  gap: 8px;
}

.seed-input-wrapper input {
  flex-grow: 1;
}

/* Image Upload & Reference Fields */
.reference-item-block {
  margin-top: 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background-color: rgba(0,0,0,0.1);
}

.ref-header {
  padding: 8px 12px;
  background-color: rgba(0,0,0,0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.ref-title {
  font-size: 12px;
  font-weight: 600;
}

.btn-clear-ref {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
}

.btn-clear-ref:hover {
  color: var(--text-danger);
}

.ref-upload-area {
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  background-color: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  margin: 12px 0;
  transition: all var(--transition-normal);
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.ref-upload-area:hover {
  background-color: var(--color-primary-glow);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--color-primary-glow);
}

.ref-upload-area i {
  font-size: 32px;
  margin-bottom: 4px;
}

.ref-upload-area span {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
}

.reference-item-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 12px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.ref-card-header {
  padding: 10px 14px;
  background-color: var(--bg-input);
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ref-card-header i {
  color: var(--color-primary);
  font-size: 14px;
}

.ref-preview-area {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  background: transparent;
  padding: 12px 0;
}

.ref-preview-img-wrapper {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
}

.ref-preview-img-wrapper img {
  max-width: 100%;
  max-height: 240px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 6px;
}

.btn-clear-ref-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  backdrop-filter: blur(4px);
}

.btn-clear-ref-overlay:hover {
  background: rgba(220, 38, 38, 1);
  transform: scale(1.1);
}

.ref-sliders {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.slider-item {
  margin-top: 2px;
}

.slider-item label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.text-hint {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: normal;
}

/* Generation Bar */
.generation-bar {
  padding: 6px 16px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-sidebar);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.03);
  margin-top: auto;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.btn-generate {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: var(--color-accent);
  color: #fff;
  font-family: inherit;
  transition: all var(--transition-fast);
}
.btn-generate:hover:not(:disabled) {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
}
.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.gen-left {
  justify-self: start;
  font-size: 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 3px 8px;
  color: #ffffff;
}
.gen-center {
  justify-self: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
}
.gen-right {
  justify-self: end;
  font-size: 10px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 3px 8px;
  color: #ffffff;
}

/* Pill Switch (Variety+) */
.pill-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 9999px;
  cursor: pointer;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}
.pill-switch.active {
  background: var(--color-primary);
}
.pill-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform var(--transition-fast);
}
.pill-switch.active .pill-knob {
  transform: translateX(20px);
}

/* Seed input fix */
.btn-dice {
  height: 44px;
  border-radius: 12px;
  padding: 0 12px;
}
.seed-input-wrapper input {
  height: 44px;
  border-radius: 12px;
}

/* Right View Panel */
.viewer-panel {
  flex-grow: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 40px;
}

.viewer-container {
  margin: auto;
  max-width: 720px;
  width: 100%;
  min-height: 500px;
  display: flex;
  justify-content: center;
}

.viewer-placeholder {
  margin: auto;
  text-align: center;
  max-width: 460px;
}

.placeholder-icon {
  font-size: 54px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
  animation: float 4s ease-in-out infinite;
}

.viewer-placeholder h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.viewer-placeholder p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

/* Animated Loading Spinner */
.generation-loading-spinner {
  margin: auto;
  text-align: center;
}

/* Nini Interactive Mini Game */
.generation-loading-spinner.interactive-mode {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewport='0 0 48 48' style='fill:black;font-size:32px;'><text y='50%'>🔨</text></svg>") 16 16, pointer;
}

.nini-game-area {
  position: relative;
  width: 250px;
  height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.nini-character {
  position: relative;
  width: 120px;
  height: 100px;
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
  border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
  box-shadow: 0 10px 20px rgba(255, 154, 158, 0.4), inset 0 -10px 20px rgba(0,0,0,0.05);
  transition: all 0.1s ease;
  animation: float 3s ease-in-out infinite;
  margin-bottom: 20px;
}

.nini-ear {
  position: absolute;
  width: 30px;
  height: 40px;
  background: #ff9a9e;
  border-radius: 50% 50% 20% 20%;
  top: -15px;
  z-index: -1;
}

.nini-ear.left {
  left: 10px;
  transform: rotate(-30deg);
}
.nini-ear.right {
  right: 10px;
  transform: rotate(30deg);
}

.nini-body {
  position: relative;
  width: 100%;
  height: 100%;
}

.nini-eye {
  position: absolute;
  width: 14px;
  height: 18px;
  background-color: #333;
  border-radius: 50%;
  top: 40px;
}
.nini-eye.left { left: 30px; }
.nini-eye.right { right: 30px; }

.nini-pupil {
  position: absolute;
  width: 6px;
  height: 6px;
  background-color: #fff;
  border-radius: 50%;
  top: 3px;
  right: 3px;
}

.nini-blush {
  position: absolute;
  width: 16px;
  height: 8px;
  background-color: rgba(255, 0, 0, 0.3);
  border-radius: 50%;
  top: 55px;
  transition: all 0.2s;
}
.nini-blush.left { left: 15px; }
.nini-blush.right { right: 15px; }

.nini-mouth {
  position: absolute;
  width: 12px;
  height: 6px;
  border-bottom: 3px solid #333;
  border-radius: 0 0 12px 12px;
  top: 55px;
  left: calc(50% - 6px);
  transition: all 0.2s;
}

/* Hit State */
.nini-game-area.is-hit .nini-character {
  transform: scale(1.15, 0.75) translateY(15px);
  background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
  animation: none;
}
.nini-game-area.is-hit .nini-eye {
  height: 4px;
  top: 47px;
  border-radius: 4px;
}
.nini-game-area.is-hit .nini-pupil {
  display: none;
}
.nini-game-area.is-hit .nini-blush {
  background-color: rgba(255, 0, 0, 0.6);
  transform: scale(1.5);
}
.nini-game-area.is-hit .nini-mouth {
  height: 10px;
  border-bottom: none;
  border-top: 3px solid #333;
  border-radius: 12px 12px 0 0;
  top: 58px;
}

/* Hit Particles */
.hit-particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.hit-particle {
  position: absolute;
  font-weight: 900;
  font-size: 20px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3), 0 0 2px #fff;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
}

.particle-fade-enter-active {
  animation: floatUp 0.8s cubic-bezier(0.2, 1, 0.3, 1) forwards;
}
.particle-fade-leave-active {
  transition: opacity 0.2s ease;
}
.particle-fade-leave-to {
  opacity: 0;
}

@keyframes floatUp {
  0% { transform: scale(0.5) translateY(0); opacity: 1; }
  20% { transform: scale(1.2) translateY(-20px); }
  100% { transform: scale(1) translateY(-80px); opacity: 0; }
}

.nini-hit-combo {
  position: absolute;
  top: -20px;
  font-size: 24px;
  font-weight: 900;
  color: #ff4757;
  text-shadow: 2px 2px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.loading-label {
  font-weight: bold;
  font-size: 13px;
  color: var(--text-main);
  animation: breathe 2s infinite;
}

.loading-progress-tips {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
  max-width: 380px;
  margin: 0 auto;
}

/* Generation Result Display */
.viewer-result {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: scaleIn var(--transition-normal);
}

.result-image-wrapper {
  position: relative;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.result-image-wrapper img {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  margin: auto;
  object-fit: contain;
  cursor: pointer;
  transition: transform var(--transition-slow);
}

.result-image-wrapper img:hover {
  transform: scale(1.02);
}

.result-image-actions {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 8px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.btn-circle {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.1);
  color: #fff;
  border: none;
  font-size: 14px;
}

.btn-circle:hover {
  background-color: var(--color-primary);
}

/* Parameters Info Card */
.result-params-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.params-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.params-card-header h4 {
  font-size: 15px;
  font-weight: 600;
}

.params-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.param-row-long {
  grid-column: span 2;
  font-size: 13px;
  background-color: #f4f5f7;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--color-primary);
  line-height: 1.6;
  max-height: 120px;
  overflow-y: auto;
}

.param-row-long strong {
  color: var(--text-muted);
}

.param-item {
  font-size: 12px;
  color: var(--text-muted);
}


/* ─────────────────────────────────────────────────────
   Artist Library Page Styles
   ───────────────────────────────────────────────────── */
.search-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: #fff;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--color-primary);
}

.filter-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.artist-category {
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.artist-category:hover, .artist-category.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}




/* ─────────────────────────────────────────────────────
   Style Presets Gallery
   ───────────────────────────────────────────────────── */
.presets-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.preset-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-secondary);
  box-shadow: 0 8px 25px rgba(0,0,0,0.25);
}

.preset-img-wrapper {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.preset-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform var(--transition-slow);
}

/* 优雅的高级毛玻璃遮罩，用于遮挡可能暴露的胸部区域 */
.preset-img-wrapper::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 55%;
  background: linear-gradient(to top, var(--bg-card) 5%, transparent 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to top, black 30%, transparent 100%);
  mask-image: linear-gradient(to top, black 30%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.preset-card:hover .preset-img-wrapper img {
  transform: scale(1.06);
}

.preset-overlay-btn {
  position: absolute;
  inset: 0;
  background-color: rgba(22, 28, 45, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 2;
}

.preset-card:hover .preset-overlay-btn {
  opacity: 1;
}

.preset-details {
  padding: 16px;
}

.preset-details h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.preset-meta-tags {
  margin-bottom: 8px;
}

.tag-model {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: rgba(59, 130, 246, 0.15);
  color: var(--color-primary);
}

.preset-prompt-preview {
  font-size: 11px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}


/* ─────────────────────────────────────────────────────
   Character Prompt Styles
   ───────────────────────────────────────────────────── */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-top: 24px;
}

@media (max-width: 1400px) {
  .characters-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}
@media (max-width: 1200px) {
  .characters-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 768px) {
  .characters-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 480px) {
  .characters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.character-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
}
  transition: all var(--transition-fast);
}

.character-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.character-img-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  overflow: hidden;
  background-color: #f8f9fa;
}

.dark .character-img-wrapper {
  background-color: #1a1a1a;
}

.character-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform var(--transition-slow);
}

.character-card:hover .character-img-wrapper img {
  transform: scale(1.05);
}

.character-card-body {
  padding: 12px 8px;
  text-align: center;
  flex-grow: 1;
}

.char-name-cn {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.char-name-en {
  font-size: 11px;
  color: var(--text-muted);
}

.character-card-footer {
  padding: 10px 16px;
  background-color: rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
  border-top: 1px solid var(--border-color);
  transition: color var(--transition-fast);
}

.character-card:hover .character-card-footer {
  color: var(--color-primary);
}


/* ─────────────────────────────────────────────────────
   Metadata Parser Tab Layout
   ───────────────────────────────────────────────────── */
.metadata-workflow {
  max-width: 800px;
  margin: 0 auto;
}

.metadata-workflow {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.metadata-dropzone {
  position: relative;
  border: 2px dashed var(--border-color);
  border-radius: 24px;
  padding: 60px 30px;
  text-align: center;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.02) 0%, rgba(var(--color-secondary-rgb), 0.02) 100%);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
}

.metadata-dropzone::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at center, rgba(var(--color-primary-rgb), 0.08) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.metadata-dropzone:hover, .metadata-dropzone.active {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.05) 0%, rgba(var(--color-secondary-rgb), 0.05) 100%);
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(59, 130, 246, 0.1);
}

.metadata-dropzone:hover::before, .metadata-dropzone.active::before {
  opacity: 1;
}

.metadata-dropzone i {
  position: relative;
  font-size: 56px;
  color: var(--text-muted);
  margin-bottom: 20px;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
}

.metadata-dropzone:hover i, .metadata-dropzone.active i {
  transform: scale(1.1) translateY(-8px);
  color: var(--color-primary);
  filter: drop-shadow(0 8px 16px rgba(59, 130, 246, 0.4));
}

.metadata-dropzone h3 {
  position: relative;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
  z-index: 1;
}

.metadata-dropzone p {
  position: relative;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
  z-index: 1;
}

.parsing-indicator {
  margin-top: 24px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background: rgba(59, 130, 246, 0.05);
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.1);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.2); }
  70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.parsed-result-container {
  animation: slideUp var(--transition-normal);
}

.parsed-details-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.parsed-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(90deg, rgba(var(--color-primary-rgb), 0.05) 0%, rgba(var(--color-secondary-rgb), 0.05) 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.parsed-card-header h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.parsed-card-header h3 i {
  font-size: 18px;
}

.parsed-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

@media (min-width: 768px) {
  .parsed-body {
    flex-direction: row;
  }
}

.metadata-img-preview {
  position: relative;
  width: 100%;
  max-width: 240px;
  flex-shrink: 0;
  background-color: #f4f5f7;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid var(--border-color);
}

.dark .metadata-img-preview {
  background-color: #1a1a2e;
}

.metadata-img-preview img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-bottom: 1px solid var(--border-color);
}

.meta-method-badge {
  padding: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.metadata-info-list {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.meta-row-long {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-row-long strong {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-row-long .code-box {
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 14px 18px;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-main);
  word-break: break-all;
  line-height: 1.5;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  background-color: rgba(150, 150, 150, 0.05);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
}

.meta-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-col strong {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.meta-col span {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}


/* ─────────────────────────────────────────────────────
   Artists Library Styles
   ───────────────────────────────────────────────────── */
.artists-grid-container {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-top: 24px;
}

@media (max-width: 1400px) {
  .artists-grid-container {
    grid-template-columns: repeat(5, 1fr);
  }
}
@media (max-width: 1200px) {
  .artists-grid-container {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 768px) {
  .artists-grid-container {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 480px) {
  .artists-grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

.artist-tag-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
}

.artist-tag-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.artist-img-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  position: relative;
  overflow: hidden;
  background-color: #f8f9fa;
}

.dark .artist-img-wrapper {
  background-color: #1a1a1a;
}

.artist-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform var(--transition-slow);
}

.artist-tag-card:hover .artist-img-wrapper img {
  transform: scale(1.05);
}

.artist-card-body {
  padding: 12px 8px;
  text-align: center;
  flex-grow: 1;
}

.artist-name-cn {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.artist-category {
  font-size: 11px;
  color: var(--text-muted);
}

.meta-method-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  text-align: center;
  font-size: 9px;
  padding: 4px;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.6);
  color: var(--color-secondary);
  backdrop-filter: blur(4px);
}

.metadata-info-list {
  flex-grow: 1;
}

.code-box {
  background-color: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 12px;
  color: #fff;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid rgba(255,255,255,0.05);
  max-height: 120px;
  overflow-y: auto;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.meta-col {
  font-size: 12px;
  color: var(--text-muted);
}

.meta-col span {
  color: var(--text-main);
  font-weight: 500;
}


/* ─────────────────────────────────────────────────────
   Local Generation History Library
   ───────────────────────────────────────────────────── */
.history-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-dim);
}

.history-empty i {
  font-size: 54px;
  margin-bottom: 16px;
}

/* --- 历史记录页头部设计 --- */
.history-header-box {
  background: rgba(30, 30, 30, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.history-header-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 12px;
}
.history-header-title h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.history-badge {
  font-size: 0.75rem;
  background: linear-gradient(135deg, var(--primary-color), #4dabf7);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: bold;
  margin-left: 8px;
}
.history-header-desc p {
  color: #a0a0a0;
  font-size: 0.9rem;
  margin: 4px 0;
  line-height: 1.5;
}
.history-header-desc strong {
  color: #d0d0d0;
}
.history-warning-text {
  color: #ff6b81 !important;
  font-size: 0.85rem !important;
}

.history-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.history-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.history-card-img {
  position: relative;
  height: 240px;
  background-color: var(--bg-sidebar);
  overflow: hidden;
  cursor: pointer;
}

.history-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.history-card:hover .history-card-img img {
  transform: scale(1.05);
}

.history-card-hover-actions {
  position: absolute;
  inset: 0;
  background-color: rgba(22, 28, 45, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.history-card-img:hover .history-card-hover-actions {
  opacity: 1;
}

.btn-hover-action-item {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #fff;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: all var(--transition-fast);
}

.btn-hover-action-item:hover {
  transform: scale(1.1);
  color: var(--color-primary);
}

.btn-hover-action-item.text-danger:hover {
  color: var(--text-danger);
}

.history-card-info {
  padding: 12px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.history-card-prompt {
  font-size: 11px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  margin-bottom: 8px;
}

.history-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-dim);
}


/* ─────────────────────────────────────────────────────
   Global Zoom Lightbox
   ───────────────────────────────────────────────────── */
.zoom-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.9);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.zoom-modal-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
}

.zoom-modal-content img {
  max-width: 100%;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
  animation: zoomIn var(--transition-normal);
}

.zoom-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}


/* ─────────────────────────────────────────────────────
   Animation Definitions
   ───────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0% { transform: scale(1); filter: drop-shadow(0 2px 8px var(--color-primary-glow)); }
  50% { transform: scale(1.03); filter: drop-shadow(0 2px 14px var(--color-secondary-glow)); }
  100% { transform: scale(1); filter: drop-shadow(0 2px 8px var(--color-primary-glow)); }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@keyframes breathe {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* ─────────────────────────────────────────────────────
   Theme Toggle Button
   ───────────────────────────────────────────────────── */
.theme-toggle-btn {
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}
.theme-toggle-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}
html.dark .theme-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

/* ─────────────────────────────────────────────────────
   Prompt Syntax Highlighting
   ───────────────────────────────────────────────────── */
.prompt-highlight-wrap {
  position: relative;
  width: 100%;
}
.prompt-highlight-wrap .highlight-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow: auto;
  pointer-events: none;
  color: var(--syn-text);
  background: transparent;
  border-radius: 12px;
}
.prompt-highlight-wrap textarea {
  position: relative;
  z-index: 1;
  background: transparent;
  color: transparent;
  caret-color: var(--color-primary);
}
.prompt-highlight-wrap textarea::selection {
  background: rgba(59, 130, 246, 0.25);
}
.hl-weight {
  background: var(--syn-weight-bg);
  border-radius: 3px;
  padding: 0 1px;
  color: var(--syn-weight) !important;
}
.hl-bracket {
  color: var(--syn-bracket) !important;
  font-weight: bold;
}

/* ─────────────────────────────────────────────────────
   Batch / Auto Generation Panel
   ───────────────────────────────────────────────────── */
.batch-options-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}
.batch-options-row .batch-count-input {
  width: 60px;
  padding: 6px 8px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
  text-align: center;
  font-size: 13px;
}
.toggle-switch-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.toggle-switch {
  position: relative;
  width: 38px;
  height: 20px;
  background: var(--border-color);
  border-radius: 20px;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}
.toggle-switch.active {
  background: var(--color-primary);
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}
.toggle-switch.active::after {
  transform: translateX(18px);
}

/* ─────────────────────────────────────────────────────
   Config Import/Export
   ───────────────────────────────────────────────────── */
.config-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.config-actions-row .btn-export,
.config-actions-row .btn-import {
  flex: 1;
  min-width: 0;
  font-size: 11px;
}

/* ─────────────────────────────────────────────────────
   Cute Toast Notification
   ───────────────────────────────────────────────────── */
.toast-notify {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  z-index: 2000;
  font-size: 13px;
  color: var(--text-main);
  animation: slideInRight 0.3s ease-out;
  max-width: 360px;
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ─────────────────────────────────────────────────────
   Generation counter badge
   ───────────────────────────────────────────────────── */
.badge-gen-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 2px 8px;
  background: var(--color-primary-glow);
  color: var(--color-primary);
  border-radius: 20px;
  font-weight: 600;
  animation: popIn 0.3s ease;
}
@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Utilities */
.d-none { display: none !important; }
.mb-3 { margin-bottom: 16px !important; }
.text-success { color: var(--text-success) !important; }
.text-danger { color: var(--text-danger) !important; }

/* ─────────────────────────────────────────────────────
   Original Parity Styles (Prompt Tabs & Login Banner)
   ───────────────────────────────────────────────────── */
.pro-type {
  display: flex;
  background-color: var(--border-color-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
  padding: 3px;
  gap: 2px;
}

.pro-type button {
  flex: 1;
  background: transparent;
  border: none;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 8px;
  transition: all var(--transition-fast);
  line-height: 1.4;
}

.pro-type button:hover {
  color: var(--text-main);
  background-color: rgba(0, 0, 0, 0.03);
}

.pro-type button.active {
  background: #ffffff;
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.login-original-banner {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.promo-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(255, 115, 255, 0.08) 0%, rgba(151, 115, 255, 0.08) 100%);
  border: 1px solid rgba(255, 115, 255, 0.15);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.4;
}

.promo-tag b.text-secondary {
  color: var(--color-secondary);
}

.btn-shop-login {
  border-color: rgba(255, 115, 255, 0.25);
  color: var(--color-primary);
  background-color: rgba(255, 115, 255, 0.02);
}

.btn-shop-login:hover {
  background-color: rgba(255, 115, 255, 0.05);
  border-color: rgba(255, 115, 255, 0.4);
  color: var(--color-primary);
}

/* --- Style Modal --- */
.style-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.style-modal-container {
  width: 90%;
  max-width: 960px;
  max-height: 85vh;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

.style-modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-sidebar);
}

.style-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.style-modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  padding: 4px;
}

.style-modal-close:hover {
  color: var(--text-danger);
  transform: rotate(90deg);
}

.style-modal-body {
  padding: 24px;
  overflow-y: auto;
  background-color: var(--bg-body);
}

.style-modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 0;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 768px) {
  .menu-toggle-btn {
    display: block;
  }
  
  .header-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background-color: var(--bg-sidebar);
    flex-direction: column;
    padding: 12px;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.05);
    z-index: 101;
  }
  
  .header-nav.mobile-show {
    display: flex;
  }
  
  .header-nav a {
    width: 100%;
    padding: 12px 16px;
    border-left: none;
    border-radius: 8px;
  }
  
  .header-user .user-details {
    display: none;
  }
  
  .work-area {
    overflow-y: auto;
  }
  
  .draw-tab-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  
  .control-panel {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .viewer-panel {
    width: 100%;
    height: auto;
    padding: 20px;
  }
  
  .result-image-wrapper img {
    max-height: 450px;
  }
}

/* Vibe Transfer CSS Additions */
.hover-icon-gray { cursor: pointer; transition: color 0.2s; }
.hover-icon-gray:hover { color: #4b5563 !important; }
.hover-icon-red { cursor: pointer; transition: color 0.2s; }
.hover-icon-red:hover { color: #ef4444 !important; }

/* Custom Sliders for Vibe */
.range-purple {
  -webkit-appearance: none;
  background: transparent;
}
.range-purple::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  background: #e9d5ff; /* light purple */
  border-radius: 3px;
}
.range-purple::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #a855f7; /* purple */
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  margin-top: -5px;
  cursor: pointer;
}

.range-teal {
  -webkit-appearance: none;
  background: transparent;
}
.range-teal::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  background: #ccfbf1; /* light teal */
  border-radius: 3px;
}
.range-teal::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #2dd4bf; /* teal */
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  margin-top: -5px;
  cursor: pointer;
}

/* iOS Switch */
.switch-ios {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch-ios input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider-ios {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #e5e7eb;
  transition: .4s;
  border-radius: 24px;
}
.slider-ios:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
input:checked + .slider-ios {
  background-color: #3b82f6; /* blue */
}
input:checked + .slider-ios:before {
  transform: translateX(20px);
}
/* Small switch variant */
.switch-sm {
  width: 32px;
  height: 18px;
}
.switch-sm .slider-ios:before {
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
}
.switch-sm input:checked + .slider-ios:before {
  transform: translateX(14px);
}

/* Premium Monochrome Range Slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border-color, #e5e7eb);
  border-radius: 4px;
  outline: none;
  transition: background-color 0.2s;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-card, #ffffff);
  border: 4px solid var(--text-main, #111827);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(0.9);
}

/* For Firefox */
input[type="range"]::-moz-range-track {
  width: 100%;
  height: 4px;
  background: var(--border-color, #e5e7eb);
  border-radius: 4px;
}
input[type="range"]::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-card, #ffffff);
  border: 4px solid var(--text-main, #111827);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s;
}
input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Custom Info Tooltip */
.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  cursor: help;
  color: var(--text-dim);
  font-size: 0.9em;
  vertical-align: middle;
}

.info-tooltip:hover {
  color: var(--text-main);
}

/* Global JS Tooltip Box */
#global-tooltip-box {
  position: fixed;
  background: var(--bg-sidebar);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  white-space: pre-wrap;
  width: max-content;
  max-width: 260px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease-in-out;
  z-index: 2147483647;
  pointer-events: none;
  line-height: 1.6;
  text-align: left;
}
#global-tooltip-box.visible {
  opacity: 1;
  visibility: visible;
}

/* ─────────────────────────────────────────────────────
   Banana Tab Layout (Minimalist Mode)
   ───────────────────────────────────────────────────── */
.banana-tab-layout {
  display: flex;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
}

/* Left Control Panel */
.banana-control-panel {
  width: 380px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  overflow-y: auto;
  scrollbar-width: none;
  background-color: var(--bg-sidebar);
}
.banana-control-panel::-webkit-scrollbar {
  display: none;
}

.banana-textarea-container {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 4px;
}

.banana-input, .banana-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: all var(--transition-fast);
}

.banana-input:focus, .banana-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-glow);
}

/* Ratio Selector */
.banana-ratio-selector {
  display: flex;
  gap: 8px;
}
.banana-ratio-selector button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.banana-ratio-selector button:hover {
  background: var(--bg-card-hover);
}
.banana-ratio-selector button.active {
  border-color: var(--color-primary);
  background: var(--color-primary-glow);
  color: var(--color-primary);
}
.ratio-icon {
  border: 2px solid currentColor;
  border-radius: 3px;
  margin-bottom: 4px;
}
.ratio-1-1 { width: 18px; height: 18px; }
.ratio-16-9 { width: 22px; height: 14px; }
.ratio-9-16 { width: 14px; height: 22px; }
.ratio-4-3 { width: 20px; height: 16px; }
.ratio-3-4 { width: 16px; height: 20px; }

/* Bottom Generate Button */
.banana-bottom-bar {
  margin-top: auto;
  padding: 24px 20px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-color);
  position: sticky;
  bottom: 0;
}

.btn-banana-generate {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-banana-generate:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.35);
}
.btn-banana-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Right Viewer Panel */
.banana-viewer-panel {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-app);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.banana-viewer-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 40px rgba(0,0,0,0.03);
  position: relative;
  overflow: hidden;
}

/* Placeholder */
.banana-viewer-placeholder {
  text-align: center;
  color: var(--text-muted);
  animation: fadeIn var(--transition-slow);
}
.banana-placeholder-icon {
  font-size: 48px;
  color: var(--border-color);
  margin-bottom: 16px;
}
.banana-viewer-placeholder h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}
.banana-viewer-placeholder p {
  font-size: 14px;
}

/* Loading */
.banana-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-main);
  font-weight: 500;
}
.banana-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Result */
.banana-result {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000;
}
.banana-result-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  animation: fadeIn var(--transition-normal);
}

.banana-glass-actions {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 10px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0;
  transform: translate(-50%, 20px);
  transition: all var(--transition-normal);
}
.banana-result:hover .banana-glass-actions {
  opacity: 1;
  transform: translate(-50%, 0);
}

.btn-glass {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.btn-glass:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}


/* --- 历史页：自动保存紧凑工具栏 + 一键清空（2026-09-10 改版）--- */
.history-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.history-header-actions .btn {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn-danger-ghost {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.55);
  color: #ffa8a8;
}

.btn-danger-ghost:hover:not(:disabled) {
  background: rgba(255, 107, 107, 0.14);
  border-color: rgba(255, 107, 107, 0.7);
}

.history-note {
  margin: 0 0 4px;
  font-size: 0.8rem;
  color: #ffd43b;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ht-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ht-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #e6e6e6;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ht-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.ht-btn.on {
  border-color: rgba(77, 171, 247, 0.5);
  background: rgba(77, 171, 247, 0.12);
  color: #74c0fc;
}

.ht-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ht-btn.mini {
  padding: 3px 8px;
  font-size: 0.72rem;
}

.ht-path {
  font-size: 0.75rem;
  color: #ededed;
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 9px;
  border-radius: 6px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono, monospace);
}

.ht-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #eaeaea;
  cursor: pointer;
  white-space: nowrap;
}

.ht-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  accent-color: var(--primary-color, #4dabf7);
  cursor: pointer;
}

.ht-state {
  font-size: 0.72rem;
  color: #74c0fc;
  background: rgba(77, 171, 247, 0.14);
  padding: 2px 8px;
  border-radius: 10px;
}

.ht-hint {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: #ffd43b;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.ht-progress {
  position: relative;
  min-width: 140px;
  height: 18px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.ht-progress-bar {
  display: block;
  height: 100%;
  background: var(--primary-color, #4dabf7);
  transition: width 0.2s ease;
}

.ht-progress-text {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #fff;
}

@media (max-width: 720px) {
  .history-header-title {
    flex-wrap: wrap;
    gap: 10px;
  }

  .ht-path {
    max-width: 120px;
  }
}

/* ══════════════════════════════════════════════════════════════
   图片意图选择窗（把图片拖入提示词框 / Ctrl+V 粘贴后弹出）
   对齐 NovelAI 官网：Image2Image / Vibe Transfer / Precise Reference
   + 分字段导入元数据
   ══════════════════════════════════════════════════════════════ */

/* —— 提示词框拖入高亮 —— */
.textarea-container.prompt-drop-active {
  border-color: var(--color-primary);
  border-style: dashed;
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.textarea-container.prompt-drop-active::after {
  content: "松开鼠标 → 选择这张图片的用途";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-glow);
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  pointer-events: none;
  z-index: 3;
}

.prompt-drop-hint {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-dim);
}

.prompt-drop-hint b {
  color: var(--text-main);
  font-weight: 600;
}

.prompt-drop-hint i {
  margin-right: 3px;
}

/* —— 弹窗外壳 —— */
.imgintent-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.18s ease;
}

.imgintent-modal {
  position: relative;
  width: 100%;
  max-width: 470px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  padding: 20px 22px 18px;
  animation: slideUp 0.24s ease;
}

.imgintent-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.imgintent-close:hover {
  color: var(--text-danger);
  transform: rotate(90deg);
}

.imgintent-title {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  padding-right: 24px;
}

.imgintent-preview {
  width: 100%;
  height: 190px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 14px;
  color: #ffffff;
  font-size: 20px;
}

.imgintent-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* —— 三个分流按钮 —— */
.imgintent-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.imgintent-btn {
  flex: 1 1 30%;
  min-width: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.imgintent-btn i {
  font-size: 14px;
  margin-bottom: 2px;
}

.imgintent-btn .ib-sub {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-dim);
}

.imgintent-btn:hover:not(.is-disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.imgintent-btn:hover:not(.is-disabled) .ib-sub {
  color: var(--color-primary);
}

.imgintent-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* —— 元数据区 —— */
.imgintent-meta {
  margin-top: 16px;
}

.imgintent-state {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px dashed var(--border-color);
  font-size: 12.5px;
  color: var(--text-main);
}

.imgintent-state.is-muted {
  color: var(--text-dim);
}

.imgintent-state-sub {
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-dim);
}

.imgintent-meta-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.5;
  margin-bottom: 12px;
}

.imgintent-meta-head i {
  color: var(--text-warning);
  font-size: 16px;
}

.imgintent-meta-head span {
  font-weight: 500;
  font-size: 12px;
  color: var(--text-dim);
}

.imgintent-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
}

/* 角色 + 附加：跨两列，Append 紧贴 Characters 下方 */
.imgintent-check-group {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.imgintent-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.imgintent-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.imgintent-check input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.imgintent-check em {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-dim);
}

.imgintent-check.is-sub {
  padding-left: 20px;
}

.imgintent-check.is-sub span {
  color: var(--text-dim);
}

.imgintent-check.is-clean {
  font-size: 12px;
  color: var(--text-dim);
}

.imgintent-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 var(--border-color);
}

.imgintent-import {
  padding: 9px 18px;
  border-radius: 10px;
  border: none;
  background: var(--color-accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all var(--transition-fast);
}

.imgintent-import:hover {
  background: var(--color-accent-hover);
}

html.dark .imgintent-import {
  background: var(--color-primary);
  color: #0f172a;
}

html.dark .imgintent-import:hover {
  background: #a5b4fc;
}

@media (max-width: 520px) {
  .imgintent-checks {
    grid-template-columns: 1fr;
  }

  .imgintent-btn {
    flex: 1 1 100%;
    min-width: 0;
  }
}

/* ══════════════════════════════════════════════════════════════
   一、AI 绘图页空状态 → 新手引导
   ══════════════════════════════════════════════════════════════ */
.viewer-placeholder {
  max-width: 560px;
  width: 100%;
}

.viewer-placeholder h2 {
  font-size: 19px;
  margin-bottom: 6px;
}

.viewer-placeholder .placeholder-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 4px;
}

.ob-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
  text-align: left;
}

.ob-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-card);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.ob-step:hover {
  border-color: var(--color-primary);
  transform: translateX(2px);
}

.ob-num {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.ob-body {
  min-width: 0;
}

.ob-body h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 3px;
}

.ob-body p {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0;
}

.ob-body code {
  display: inline-block;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-main);
}

.ob-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--text-dim);
  font-size: 11.5px;
  white-space: nowrap;
}

.ob-or::before,
.ob-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.ob-tip {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  padding: 14px 16px;
  border: 1px dashed var(--color-primary);
  border-radius: 14px;
  background: var(--color-primary-glow);
}

.ob-tip-icon {
  font-size: 18px;
  color: var(--color-primary);
  line-height: 1.5;
}

.ob-tip-body {
  min-width: 0;
}

.ob-tip-body h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 5px;
  line-height: 1.6;
}

.ob-tip-body p {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.ob-tip-body kbd {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-main);
}

.ob-tip-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ob-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid var(--color-primary);
  background: var(--bg-card);
  color: var(--color-primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ob-btn:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ══════════════════════════════════════════════════════════════
   二、元数据解析页 → 双栏（左：解析 / 右：本地解析记录）
   ══════════════════════════════════════════════════════════════ */
.meta-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
}

.meta-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.meta-layout .metadata-dropzone {
  padding: 44px 26px;
  border-radius: 20px;
}

.meta-layout .metadata-dropzone.is-busy {
  cursor: progress;
}

.meta-layout .metadata-dropzone.is-busy i,
.meta-layout .metadata-dropzone.is-busy h3 {
  color: var(--color-primary);
}

.meta-layout .metadata-dropzone p {
  max-width: 420px;
  font-size: 12.5px;
}

.meta-layout .parsed-result-container {
  margin-top: 20px;
}

/* 解析失败提示（此前用的 .alert 类在样式表里根本不存在 → 裸文字） */
.meta-error-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.07);
}

.meta-error-box > i {
  color: var(--text-danger);
  font-size: 18px;
  line-height: 1.4;
}

.meta-error-box strong {
  display: block;
  font-size: 13.5px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.meta-error-box p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-muted);
  word-break: break-word;
}

.meta-noimg {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 26px;
}

/* 结果卡在窄栏里的适配 */
.meta-layout .parsed-details-card {
  border-radius: 20px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.meta-layout .parsed-card-header {
  flex-wrap: wrap;
  gap: 10px;
}

.meta-layout .parsed-card-header h3 {
  font-size: 14.5px;
}

.meta-layout .parsed-body {
  padding: 20px;
  gap: 20px;
}

.meta-layout .metadata-img-preview {
  max-width: 200px;
  /* ⚠️ 不加这句会被 flex 的 align-items:stretch 拉到与右侧信息列表等高，
     图片下面出现一大片空白、徽章被顶到卡片底部（实测 200×653 vs 图片仅 290 高） */
  align-self: flex-start;
}

.meta-layout .metadata-img-preview img {
  max-height: 300px;
  object-fit: contain;
  background: #0f172a;
}

.meta-layout .metadata-info-list {
  gap: 16px;
  min-width: 0;
}

.meta-layout .meta-row-long strong {
  font-size: 11.5px;
}

.meta-layout .meta-row-long .code-box {
  font-size: 12.5px;
  padding: 12px 14px;
  max-height: 150px;
}

.meta-layout .meta-grid {
  gap: 12px;
  padding: 16px;
}

/* 角色列表 */
.meta-char-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-char-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-app);
  font-size: 12.5px;
}

.mc-idx {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-txt {
  flex: 1;
  min-width: 0;
  color: var(--text-main);
  word-break: break-word;
}

.mc-pos {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* ── 右栏：本地解析记录 ── */
.meta-side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--bg-card);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.meta-side-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-side-head h3 {
  flex: 1;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 7px;
}

.meta-side-count {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 20px;
  background: var(--color-primary-glow);
  color: var(--color-primary);
}

.meta-clear-btn {
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-dim);
  font-size: 11.5px;
  border-radius: 8px;
  padding: 4px 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast);
}

.meta-clear-btn:hover {
  color: var(--text-danger);
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.06);
}

.meta-side-note {
  margin: 10px 0 12px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-muted);
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.meta-side-note i {
  color: var(--color-secondary);
  margin-right: 3px;
}

.meta-side-empty {
  text-align: center;
  padding: 28px 10px;
  color: var(--text-dim);
}

.meta-side-empty i {
  display: block;
  font-size: 26px;
  margin-bottom: 10px;
}

.meta-side-empty p {
  margin: 0 0 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.meta-side-empty span {
  font-size: 11px;
}

.meta-rec-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 2px;
}

.meta-rec-item {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-input);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.meta-rec-item:hover {
  border-color: var(--color-primary);
  transform: translateX(-2px);
}

.meta-rec-item.active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-glow);
}

.meta-rec-thumb {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}

.meta-rec-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.meta-rec-body {
  flex: 1;
  min-width: 0;
}

.meta-rec-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.meta-rec-time {
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.meta-rec-method {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--color-primary-glow);
  color: var(--color-primary);
}

.meta-rec-prompt {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-main);
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta-rec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.meta-rec-tags span {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--text-dim);
  background: var(--bg-app);
  border: 1px solid var(--border-color);
}

.meta-rec-del {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 3px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  opacity: 0.35;
  transition: all var(--transition-fast);
}

.meta-rec-item:hover .meta-rec-del {
  opacity: 1;
}

.meta-rec-del:hover {
  color: var(--text-danger);
  background: rgba(239, 68, 68, 0.1);
}

@media (max-width: 1080px) {
  .meta-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .meta-side {
    position: static;
  }

  .meta-rec-list {
    max-height: 320px;
  }
}

@media (max-width: 520px) {
  .meta-layout .parsed-body {
    padding: 16px;
  }

  .meta-layout .metadata-img-preview {
    max-width: 100%;
  }
}


