﻿    /* ===== 提示词仓库 · 高级灰设计系统 ===== */
   :root {
  --ui-scale: 0.75;
  --card-columns: 4;
  --card-gap: 16px;
  --card-row-gap: 16px;
      --bg-primary: #121212;
      --bg-secondary: #181818;
      --bg-elevated: #1a1a1a;
      --bg-card: #1e1e1e;
      --bg-hover: #262626;
      --bg-input: #262626;
      --glass-blur: blur(20px) saturate(1.1);
      --border: #2d2d2d;
      --border-light: #3a3a3a;
      --text-primary: #ffffff;
      --text-secondary: #d4d4d4;
      --text-muted: #a3a3a3;
      --accent: #e8eaed;
      --accent-hover: #ffffff;
      --accent-muted: #9ca3af;
      --accent-bg: rgba(255, 255, 255, 0.06);
      --accent-bg-strong: rgba(255, 255, 255, 0.1);
      --accent-gradient: linear-gradient(180deg, #f0f1f3 0%, #c8ccd4 100%);
      --accent-on: #121212;
      --danger: #e57373;
      --danger-bg: rgba(229, 115, 115, 0.12);
      --radius: 8px;
      --radius-sm: 8px;
      --radius-lg: 12px;
      --gap: 16px;
      --padding-page: 16px;
      --padding-card: 16px;
      --font-xs: 12px;
      --font-sm: 13px;
      --font-base: 14px;
      --font-lg: 16px;
      --lh-title: 1.2;
      --lh-body: 1.5;
      --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
      --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
      --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
      --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.35);
      --shadow-glow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 24px rgba(0, 0, 0, 0.45);
      --shadow-glass: var(--shadow-card);
      --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
      --ease-spring: cubic-bezier(0.34, 1.2, 0.64, 1);
      --transition: all 0.22s var(--ease-out);
      --toolbar-h: 56px;
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    .mobile-only { display: none; }
   html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  zoom: 0.75;
  width: 133.333vw;
  height: 133.333vh;
  display: flex;
  overflow: hidden;
}

    .drag-layer-root {
      position: fixed;
      inset: 0;
      z-index: 10000;
      pointer-events: none;
      overflow: visible;
    }
    .ripple-grid-bg {
      position: fixed;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      overflow: hidden;
    }
    .ripple-grid-bg .ripple-grid-canvas {
      display: block;
      width: 100% !important;
      height: 100% !important;
    }
    .ui-vignette {
      position: fixed;
      inset: 0;
      z-index: 1;
      pointer-events: none;
      background:
        radial-gradient(ellipse 80% 60% at 50% 45%, transparent 0%, rgba(18, 18, 18, 0.2) 50%, rgba(18, 18, 18, 0.82) 100%),
        linear-gradient(180deg, rgba(18, 18, 18, 0.35) 0%, transparent 16%, transparent 84%, rgba(18, 18, 18, 0.55) 100%);
    }
    .ripple-grid-bg.ripple-fallback-active {
      background: #121212;
    }
    .ripple-grid-bg.ripple-fallback-active canvas.ripple-fallback-canvas {
      display: block;
      width: 100%;
      height: 100%;
    }
    .app-chrome {
      position: relative;
      z-index: 2;
      display: flex;
      flex: 1;
      min-width: 0;
      min-height: 0;
      width: 100%;
    }
    ::-webkit-scrollbar { width: 5px; height: 5px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: #3B4A5E; border-radius: 10px; transition: var(--transition); }
    ::-webkit-scrollbar-thumb:hover { background: #4a4a4a; }
    .context-menu {
      position: fixed;
      background: rgba(17, 24, 39, 0.96);
      backdrop-filter: blur(12px);
      border: 1px solid var(--border);
      border-radius: 16px;
      z-index: 200;
      min-width: 150px;
      display: none;
      box-shadow: var(--shadow-lg);
      padding: 6px;
    }
    .context-menu button {
      display: block;
      width: 100%;
      padding: 8px 14px;
      background: none;
      border: none;
      color: var(--text-secondary);
      text-align: left;
      cursor: pointer;
      font-size: var(--font-sm);
      border-radius: 10px;
      transition: var(--transition);
      font-weight: 500;
    }
    .context-menu button:hover { background: var(--accent-bg-strong); color: var(--text-primary); }

    /* 左侧主导航 */
    .app-nav {
      width: 200px;
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      background: var(--bg-secondary);
      backdrop-filter: var(--glass-blur);
      -webkit-backdrop-filter: var(--glass-blur);
      border-right: 1px solid var(--border);
      box-shadow: var(--shadow-glass);
      padding: 12px 10px 16px;
      z-index: 20;
      overflow-x: hidden;
      overflow-y: auto;
      transition: width 0.28s var(--ease-out), padding 0.28s var(--ease-out);
    }
    body.app-nav-collapsed .app-nav {
      width: 72px;
      padding-left: 8px;
      padding-right: 8px;
    }
    .app-nav-head {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 4px 4px 14px;
      margin-bottom: 6px;
      border-bottom: 1px solid var(--border);
    }
    body.app-nav-collapsed .app-nav-head {
      flex-direction: column;
      align-items: center;
      gap: 10px;
      padding-bottom: 12px;
    }
    .app-brand {
      flex: 1;
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 6px 8px;
      border: none;
      border-radius: var(--radius-sm);
      background: transparent;
      color: var(--text-primary);
      cursor: pointer;
      text-align: left;
      transition: background 0.2s var(--ease-out);
    }
    .app-brand:hover {
      background: var(--bg-hover);
    }
    .app-brand-mark {
      width: 32px;
      height: 32px;
      flex-shrink: 0;
      display: block;
      border-radius: 8px;
      object-fit: contain;
      box-shadow: var(--shadow-sm);
    }
    .app-brand-name {
      font-size: var(--font-lg);
      font-weight: 700;
      line-height: var(--lh-title);
      letter-spacing: -0.02em;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      transition: opacity 0.2s, width 0.28s;
    }
    body.app-nav-collapsed .app-brand {
      flex: none;
      padding: 4px;
      justify-content: center;
    }
    body.app-nav-collapsed .app-brand-name {
      opacity: 0;
      width: 0;
      overflow: hidden;
      pointer-events: none;
    }
    .app-nav-collapse-btn {
      width: 34px;
      height: 34px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: rgba(255, 255, 255, 0.04);
      color: var(--text-secondary);
      cursor: pointer;
      transition: var(--transition);
    }
    .app-nav-collapse-btn:hover {
      border-color: var(--border-light);
      color: var(--accent);
      background: var(--accent-bg);
    }
    .app-nav-collapse-btn svg {
      width: 18px;
      height: 18px;
      transition: transform 0.28s var(--ease-out);
    }
    body.app-nav-collapsed .app-nav-collapse-btn svg {
      transform: scaleX(-1);
    }
    .app-nav-menu {
      display: flex;
      flex-direction: column;
      gap: 4px;
      flex: 1;
    }
    .app-nav-item {
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      padding: 12px;
      border: none;
      border-radius: var(--radius-sm);
      background: transparent;
      color: var(--text-secondary);
      font-size: var(--font-sm);
      font-weight: 500;
      cursor: pointer;
      text-align: left;
      transition: var(--transition);
      position: relative;
    }
    .app-nav-item:hover:not(.active) {
      background: var(--bg-hover);
      color: var(--text-primary);
    }
    .app-nav-item.active {
      background: var(--accent-bg-strong);
      color: var(--text-primary);
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    }
    .app-nav-icon {
      width: 18px;
      height: 18px;
      flex-shrink: 0;
    }
    .app-nav-label {
      flex: 1;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      transition: opacity 0.2s, max-width 0.28s;
    }
    body.app-nav-collapsed .app-nav-item {
      justify-content: center;
      padding-left: 10px;
      padding-right: 10px;
    }
    body.app-nav-collapsed .app-nav-label,
    body.app-nav-collapsed .app-nav-soon {
      opacity: 0;
      max-width: 0;
      overflow: hidden;
      padding: 0;
      margin: 0;
      pointer-events: none;
    }
    body.app-nav-collapsed .app-nav-item {
      gap: 0;
    }
    .app-nav-soon {
      display: none;
    }
    .app-nav-footer {
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
      padding: 8px 0 4px;
      margin-top: auto;
      border-top: 1px solid var(--border);
    }
    .app-nav-util {
      font-size: var(--font-xs);
      padding: 10px 12px;
    }
    body.app-nav-collapsed .app-nav-util .app-nav-label {
      opacity: 0;
      max-width: 0;
    }
    body.app-nav-collapsed .app-nav-footer .app-nav-util {
      justify-content: center;
      padding-left: 10px;
      padding-right: 10px;
    }
    .app-nav-subscribe-wrap {
      margin-bottom: 12px;
      padding: 0 2px;
    }
    .app-nav-subscribe-btn {
      position: relative;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 12px 14px 12px 10px;
      border-radius: var(--radius-sm);
      border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
      background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--bg-card)), var(--accent-bg));
      color: var(--text-primary);
      font-size: var(--font-sm);
      font-weight: 700;
      cursor: pointer;
      transition: var(--transition);
      overflow: visible;
      box-shadow: 0 2px 12px color-mix(in srgb, var(--accent) 18%, transparent);
    }
    .app-nav-subscribe-btn:hover {
      filter: brightness(1.06);
      box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 28%, transparent);
      transform: translateY(-1px);
    }
    .app-nav-subscribe-badge {
      position: absolute;
      top: -9px;
      right: 10px;
      flex-shrink: 0;
      padding: 3px 9px;
      border-radius: 999px;
      background: linear-gradient(135deg, #ff7a45, #ffb347);
      border: 1px solid rgba(255, 255, 255, 0.35);
      color: #fff;
      font-size: 11px;
      font-weight: 800;
      line-height: 1.2;
      letter-spacing: 0.06em;
      box-shadow: 0 2px 10px rgba(255, 122, 69, 0.45);
      animation: subscribe-badge-pulse 2.4s ease-in-out infinite;
    }
    @keyframes subscribe-badge-pulse {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.06); }
    }
    .app-nav-subscribe-shine {
      position: absolute;
      inset: 0;
      border-radius: inherit;
      background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.12) 50%, transparent 60%);
      pointer-events: none;
      animation: subscribe-shine 3.5s ease-in-out infinite;
    }
    @keyframes subscribe-shine {
      0%, 100% { opacity: 0; transform: translateX(-30%); }
      50% { opacity: 1; transform: translateX(30%); }
    }
    .app-nav-subscribe-text {
      white-space: nowrap;
      position: relative;
      z-index: 1;
    }
    body.app-nav-collapsed .app-nav-subscribe-wrap {
      display: none;
    }
    .app-nav-auth {
      flex-shrink: 0;
      padding: 10px 8px 4px;
      border-top: 1px solid var(--border);
    }
    .auth-login-btn {
      width: 100%;
      padding: 10px 12px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border-light);
      background: var(--bg-card);
      color: var(--text-primary);
      font-size: var(--font-sm);
      font-weight: 600;
      cursor: pointer;
      transition: var(--transition);
    }
    .auth-login-btn:hover {
      background: var(--bg-hover);
      border-color: var(--border-light);
    }
    .auth-login-btn.hidden { display: none; }
    body.app-nav-collapsed .auth-login-btn,
    body.app-nav-collapsed .auth-user-bar,
    body.app-nav-collapsed .auth-sync-hint {
      display: none;
    }
    .auth-user-bar {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .auth-user-bar.hidden { display: none; }
    .auth-user-email {
      font-size: var(--font-xs);
      color: var(--text-muted);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .auth-sync-btn,
    .auth-logout-btn {
      width: 100%;
      padding: 8px 10px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: transparent;
      color: var(--text-secondary);
      font-size: var(--font-xs);
      cursor: pointer;
      transition: var(--transition);
    }
    .auth-sync-btn:hover,
    .auth-logout-btn:hover {
      background: var(--bg-hover);
      color: var(--text-primary);
    }
    .auth-sync-hint {
      font-size: 11px;
      color: var(--text-muted);
      margin-top: 8px;
      line-height: 1.4;
    }
    .auth-sync-hint.hidden { display: none; }
    .auth-overlay {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 500;
      background: rgba(0, 0, 0, 0.65);
      align-items: center;
      justify-content: center;
      padding: 24px;
    }
    .auth-overlay.open { display: flex; }
    .auth-box {
      position: relative;
      width: 100%;
      max-width: 420px;
      background: var(--bg-elevated);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 28px 24px 24px;
      box-shadow: var(--shadow-lg);
    }
    .auth-box h3 {
      font-size: var(--font-lg);
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 8px;
    }
    .auth-desc {
      font-size: var(--font-sm);
      color: var(--text-muted);
      margin-bottom: 16px;
      line-height: 1.5;
    }
    .auth-method-tabs {
      display: flex;
      gap: 8px;
      margin-bottom: 12px;
    }
    .auth-method-tab {
      flex: 1;
      height: 34px;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--bg-input);
      color: var(--text-muted);
      font-size: var(--font-sm);
      font-weight: 600;
      cursor: pointer;
      transition: var(--transition);
    }
    .auth-method-tab.active {
      background: var(--accent-bg-strong);
      color: var(--text-primary);
      border-color: var(--border-light);
    }
    .auth-method-tabs.hidden { display: none; }
    .auth-method-tab.hidden { display: none; }
    .auth-phone-wrap {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 12px;
    }
    .auth-phone-prefix {
      flex-shrink: 0;
      padding: 0 10px;
      height: 40px;
      line-height: 40px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--bg-input);
      color: var(--text-secondary);
      font-size: var(--font-sm);
    }
    .auth-phone-wrap input {
      flex: 1;
      height: 40px;
      padding: 0 12px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--bg-input);
      color: var(--text-primary);
      font-size: var(--font-sm);
    }
    .auth-phone-wrap input:focus {
      outline: none;
      border-color: var(--border-light);
      box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
    }
    .auth-otp-row {
      display: flex;
      gap: 8px;
      align-items: center;
    }
    .auth-otp-row input {
      flex: 1;
      min-width: 0;
      height: 40px;
      padding: 0 12px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--bg-input);
      color: var(--text-primary);
      font-size: var(--font-sm);
    }
    .auth-otp-btn {
      flex-shrink: 0;
      height: 40px;
      padding: 0 12px;
      font-size: var(--font-xs);
      white-space: nowrap;
    }
    .auth-otp-btn:disabled { opacity: 0.55; cursor: not-allowed; }
    .auth-phone-hint {
      font-size: var(--font-xs);
      color: var(--text-muted);
      margin: -4px 0 12px;
      line-height: 1.4;
    }
    #authPhonePanel.hidden { display: none; }
    .auth-social {
      margin-top: 16px;
    }
    .auth-social.hidden { display: none; }
    .auth-social-divider {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 12px;
      color: var(--text-muted);
      font-size: var(--font-xs);
    }
    .auth-social-divider::before,
    .auth-social-divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--border);
    }
    .auth-wechat-btn {
      width: 100%;
      height: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      border: none;
      border-radius: var(--radius-sm);
      background: #07c160;
      color: #fff;
      font-size: var(--font-sm);
      font-weight: 600;
      cursor: pointer;
      transition: var(--transition);
    }
    .auth-wechat-btn:hover { filter: brightness(1.06); }
    .auth-wechat-btn:disabled { opacity: 0.5; cursor: not-allowed; }
    .auth-tabs {
      display: flex;
      gap: 8px;
      margin-bottom: 18px;
      padding: 4px;
      background: var(--bg-input);
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
    }
    .auth-tab {
      flex: 1;
      height: 36px;
      border: none;
      border-radius: 6px;
      background: transparent;
      color: var(--text-muted);
      font-size: var(--font-sm);
      font-weight: 600;
      cursor: pointer;
      transition: var(--transition);
    }
    .auth-tab:hover { color: var(--text-primary); }
    .auth-tab.active {
      background: var(--bg-card);
      color: var(--text-primary);
      box-shadow: var(--shadow-sm);
    }
    .auth-tabs.hidden { display: none; }
    .auth-field { margin-bottom: 12px; }
    .auth-field.hidden { display: none; }
    .auth-box label {
      display: block;
      font-size: var(--font-xs);
      color: var(--text-muted);
      margin-bottom: 6px;
    }
    .auth-password-wrap {
      position: relative;
      display: flex;
      align-items: center;
    }
    .auth-password-wrap input {
      width: 100%;
      height: 40px;
      padding: 0 40px 0 12px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--bg-input);
      color: var(--text-primary);
      font-size: var(--font-sm);
    }
    .auth-box input[type="email"] {
      width: 100%;
      height: 40px;
      padding: 0 12px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--bg-input);
      color: var(--text-primary);
      font-size: var(--font-sm);
    }
    .auth-password-wrap input:focus,
    .auth-box input[type="email"]:focus {
      outline: none;
      border-color: var(--border-light);
      box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06);
    }
    .auth-pwd-toggle {
      position: absolute;
      right: 4px;
      width: 32px;
      height: 32px;
      border: none;
      background: transparent;
      color: var(--text-muted);
      cursor: pointer;
      border-radius: 6px;
      font-size: 14px;
      line-height: 1;
    }
    .auth-pwd-toggle:hover { color: var(--text-primary); background: var(--bg-hover); }
    .auth-remember {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 4px 0 14px;
      font-size: var(--font-xs);
      color: var(--text-muted);
      cursor: pointer;
    }
    .auth-remember.hidden { display: none; }
    .auth-remember input { width: auto; margin: 0; accent-color: var(--accent); }
    .auth-submit-btn {
      width: 100%;
      height: 44px;
      font-weight: 600;
    }
    .auth-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }
    .auth-links {
      margin-top: 12px;
      text-align: center;
      min-height: 20px;
    }
    .auth-link-btn {
      border: none;
      background: none;
      color: var(--text-muted);
      font-size: var(--font-xs);
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 2px;
    }
    .auth-link-btn:hover { color: var(--text-primary); }
    .auth-link-btn.hidden { display: none; }
    .auth-close {
      position: absolute;
      top: 14px;
      right: 14px;
      border: none;
      background: none;
      color: var(--text-muted);
      font-size: 18px;
      cursor: pointer;
    }
    .auth-status {
      min-height: 20px;
      margin-top: 12px;
      font-size: var(--font-xs);
      color: var(--text-muted);
    }
    .auth-status.error { color: var(--danger); }
    .auth-status.ok { color: #86efac; }
    .app-main {
      flex: 1;
      display: flex;
      min-width: 0;
      min-height: 0;
      overflow: hidden;
    }
    .app-page {
      display: none;
      flex: 1;
      min-width: 0;
      min-height: 0;
      overflow: hidden;
    }
    .app-page.active {
      display: flex;
    }
    .app-page-warehouse.active {
      flex: 1;
      min-width: 0;
    }
    .app-page-placeholder {
      align-items: center;
      justify-content: center;
      background: transparent;
    }
    .app-placeholder {
      text-align: center;
      max-width: 360px;
      padding: 48px 32px;
    }
    .app-placeholder-icon {
      width: 72px;
      height: 72px;
      margin: 0 auto 20px;
      border-radius: 20px;
      background: var(--bg-card);
      border: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
    }
    .app-placeholder-icon svg {
      width: 36px;
      height: 36px;
    }
    .app-placeholder h2 {
      font-size: 20px;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 10px;
    }
    .app-placeholder p {
      font-size: var(--font-sm);
      color: var(--text-muted);
      line-height: 1.6;
    }

    .sidebar {
      width: 232px;
      background: var(--bg-secondary);
      backdrop-filter: var(--glass-blur);
      -webkit-backdrop-filter: var(--glass-blur);
      border-right: 1px solid var(--border);
      box-shadow: var(--shadow-glass);
      display: flex;
      flex-direction: column;
      padding: 16px 0 20px;
      flex-shrink: 0;
      z-index: 10;
      overflow-y: auto;
    }
    .guest-limit-hint {
      margin: 8px 12px 0;
      padding: 8px 10px;
      font-size: 11px;
      line-height: 1.45;
      color: var(--text-muted);
      background: var(--accent-bg);
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
    }
    .guest-limit-hint.hidden {
      display: none;
    }
    .sidebar-new-btn {
      margin: 0 14px 16px;
      padding: 11px 14px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border-light);
      background: var(--bg-card);
      color: var(--text-primary);
      font-size: var(--font-sm);
      font-weight: 600;
      cursor: pointer;
      transition: var(--transition);
      text-align: center;
    }
    .sidebar-new-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
      background: var(--accent-bg);
    }
    .sidebar-section { padding: 0 14px; margin-bottom: 24px; }
    .sidebar-section-title {
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.5px;
      text-transform: uppercase;
      color: var(--text-muted);
      padding: 0 12px 10px 12px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .sidebar-section-title .add-btn {
      background: var(--bg-hover);
      border-radius: 8px;
      width: 24px;
      height: 24px;
      font-size: 16px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: var(--transition);
      color: var(--text-muted);
    }
    .sidebar-section-title .add-btn:hover { background: var(--accent-bg-strong); color: var(--text-primary); }
    .group-list { overflow-y: auto; }
    .group-item {
      padding: 12px 16px;
      cursor: pointer;
      transition: var(--transition);
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      border-radius: var(--radius-sm);
      margin: 2px 0;
      color: var(--text-secondary);
      font-size: var(--font-base);
      font-weight: 500;
      line-height: var(--lh-body);
    }
    .group-item:hover { background: var(--bg-hover); color: var(--text-primary); }
    .group-item.active {
      background: var(--accent-bg-strong);
      color: var(--text-primary);
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    }
    .group-item .count {
      font-size: var(--font-xs);
      background: transparent;
      color: var(--text-muted);
      border-radius: 0;
      padding: 0;
      min-width: auto;
      text-align: right;
      font-weight: 400;
      flex-shrink: 0;
    }
    .group-item.active .count { color: var(--text-muted); }
    .inline-edit-group {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 6px 10px;
      margin: 4px 0;
      background: var(--bg-card);
      border: 1px solid var(--accent);
      border-radius: 14px;
      box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
    }
    .inline-edit-group .group-name-input {
      flex: 1;
      min-width: 0;
      height: 32px;
      padding: 0 12px;
      background: var(--bg-primary);
      border: 1px solid var(--border-light);
      border-radius: 10px;
      color: var(--text-primary);
      font-size: var(--font-sm);
    }
    .inline-edit-group .group-name-input:focus {
      outline: none;
      border-color: var(--accent);
    }
    .sidebar .action-btn {
      margin: 12px 20px;
      padding: 10px;
      background: rgba(255,255,255,0.02);
      border: 1px solid var(--border);
      color: var(--text-secondary);
      border-radius: 40px;
      cursor: pointer;
      text-align: center;
      font-size: 13px;
      font-weight: 500;
      transition: var(--transition);
      backdrop-filter: blur(4px);
    }
    .sidebar .action-btn:hover { border-color: var(--border-light); color: var(--text-primary); background: var(--bg-hover); transform: translateY(-1px); }
    .main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
    .main-header {
      padding: 0 16px 0 20px;
      height: var(--toolbar-h);
      min-height: var(--toolbar-h);
      background: rgba(10, 14, 22, 0.52);
      backdrop-filter: var(--glass-blur);
      -webkit-backdrop-filter: var(--glass-blur);
      border-bottom: 1px solid var(--border);
      box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
      display: flex;
      align-items: center;
      flex-wrap: nowrap;
      gap: 12px;
      flex-shrink: 0;
      z-index: 20;
      overflow: visible;
    }
    .main-header h3 {
      font-weight: 600;
      font-size: 15px;
      color: var(--text-primary);
      letter-spacing: -0.02em;
      white-space: nowrap;
      flex-shrink: 0;
      margin-right: 4px;
    }
    .header-actions {
      display: flex;
      align-items: center;
      flex: 1;
      min-width: 0;
      justify-content: flex-end;
      overflow: visible;
      gap: 8px;
    }
    .toolbar-row {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: nowrap;
      flex: 1;
      min-width: 0;
      justify-content: flex-end;
    }
    .toolbar-cluster {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }
    .toolbar-cluster-grow {
      flex: 1;
      min-width: 0;
      justify-content: flex-end;
    }
    .batch-bar {
      display: none;
      align-items: center;
      gap: 6px;
      flex-wrap: nowrap;
    }
    .batch-bar.active { display: flex; }
    .batch-count { font-size: var(--font-xs); color: var(--text-muted); margin-left: 4px; white-space: nowrap; }
    .filter-select-hidden {
      position: absolute;
      width: 1px;
      height: 1px;
      opacity: 0;
      pointer-events: none;
    }
    .filter-menu-wrap { position: relative; z-index: 120; }
    .filter-dropdown {
      display: none;
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      min-width: 160px;
      max-height: 280px;
      overflow-y: auto;
      background: rgba(15, 20, 29, 0.98);
      border: 1px solid var(--border-light);
      border-radius: var(--radius);
      padding: 6px;
      z-index: 100;
      box-shadow: var(--shadow-lg);
      backdrop-filter: blur(16px);
    }
    .filter-dropdown.open { display: block; animation: menuIn 0.2s var(--ease-out); }
    .filter-dropdown button {
      display: block;
      width: 100%;
      text-align: left;
      padding: 8px 12px;
      border: none;
      border-radius: var(--radius-sm);
      background: transparent;
      color: var(--text-secondary);
      font-size: var(--font-sm);
      cursor: pointer;
      transition: var(--transition);
    }
    .filter-dropdown button:hover { background: var(--accent-bg); color: var(--accent); }
    .filter-dropdown button.active { background: var(--accent-bg); color: var(--accent); font-weight: 500; }
    .filter-dropdown-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 2px 8px 8px;
      margin-bottom: 4px;
      border-bottom: 1px solid var(--border);
      font-size: var(--font-xs);
      color: var(--text-muted);
    }
    .filter-clear-btn {
      background: none;
      border: none;
      color: var(--accent);
      font-size: var(--font-xs);
      cursor: pointer;
      padding: 2px 6px;
      border-radius: 4px;
    }
    .filter-clear-btn:hover { background: var(--accent-bg); }
    .filter-option {
      display: flex;
      align-items: center;
      gap: 10px;
      width: 100%;
      text-align: left;
      padding: 8px 10px;
      border: none;
      border-radius: var(--radius-sm);
      background: transparent;
      color: var(--text-secondary);
      font-size: var(--font-sm);
      cursor: pointer;
      transition: var(--transition);
    }
    .filter-option:hover { background: var(--bg-hover); color: var(--text-primary); }
    .filter-option.active { background: var(--accent-bg-strong); color: var(--text-primary); }
    .filter-check {
      width: 16px;
      height: 16px;
      flex-shrink: 0;
      border: 1px solid var(--border-light);
      border-radius: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      line-height: 1;
    }
    .filter-option.active .filter-check {
      background: var(--text-primary);
      border-color: var(--text-primary);
      color: var(--accent-on);
    }
    .filter-option.active .filter-check::after { content: '✓'; font-weight: 700; }
    .filter-empty { padding: 12px; text-align: center; color: var(--text-muted); font-size: var(--font-xs); }
    @keyframes menuIn {
      from { opacity: 0; transform: translateY(-6px) scale(0.98); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }
    .icon-btn {
      width: 34px;
      height: 34px;
      padding: 0;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--bg-card);
      color: var(--text-secondary);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: var(--transition);
      flex-shrink: 0;
    }
    .icon-btn {
      transition: transform 0.18s var(--ease-out), background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s;
    }
    .icon-btn:hover {
      border-color: var(--border-light);
      color: var(--text-primary);
      background: var(--bg-hover);
      transform: translateY(-1px);
      box-shadow: var(--shadow-sm);
    }
    .icon-btn:active {
      transform: translateY(0) scale(0.96);
    }
    .icon-btn.active, .icon-btn-accent.active {
      border-color: var(--border-light);
      color: var(--text-primary);
      background: var(--accent-bg-strong);
      box-shadow: none;
    }
    .icon-btn-accent:hover { border-color: var(--border-light); color: var(--text-primary); }
    .icon-btn-labeled {
      width: auto;
      padding: 0 12px;
      gap: 6px;
      font-size: var(--font-xs);
      font-weight: 600;
      color: var(--text-secondary);
    }
    .icon-btn-labeled span { line-height: 1; }
    .icon-btn-labeled:hover { color: var(--text-primary); }
    .toolbar-select {
      height: 34px;
      padding: 0 28px 0 10px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
      color: var(--text-secondary);
      font-size: var(--font-sm);
      cursor: pointer;
      appearance: none;
      flex-shrink: 0;
      transition: var(--transition);
    }
    .toolbar-select:hover, .toolbar-select:focus { border-color: var(--border-light); color: var(--text-primary); outline: none; }
    .search-box {
      flex: 1;
      min-width: 100px;
      max-width: 180px;
      height: 34px;
      background: rgba(18, 24, 36, 0.55);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0 12px;
      color: var(--text-primary);
      font-size: var(--font-sm);
      transition: var(--transition);
    }
    .search-box::placeholder { color: var(--text-muted); }
    .search-box:focus { border-color: var(--border-light); outline: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06); }
    .btn {
      padding: 0 16px;
      height: 34px;
      border-radius: var(--radius-sm);
      font-weight: 500;
      font-size: var(--font-sm);
      cursor: pointer;
      transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), background 0.18s var(--ease-out), border-color 0.18s var(--ease-out), color 0.18s var(--ease-out), filter 0.18s;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
      letter-spacing: -0.01em;
      border: 1px solid transparent;
      flex-shrink: 0;
    }
    .btn:active {
      transform: scale(0.98);
    }
    .btn-sm { height: 34px; padding: 0 14px; font-size: var(--font-sm); }
    .btn-primary {
      background: var(--accent-gradient);
      border: none;
      color: var(--accent-on);
      font-weight: 600;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    .btn-primary:hover {
      filter: brightness(1.04);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
      transform: translateY(-1px);
    }
    .btn-ghost {
      background: transparent;
      color: var(--text-secondary);
      border-color: var(--border);
    }
    .btn-ghost:hover { border-color: var(--border-light); color: var(--text-primary); background: var(--bg-hover); }
    .btn-ghost.active { border-color: var(--border-light); color: var(--text-primary); background: var(--accent-bg-strong); }
    .btn-secondary {
      background: var(--bg-card);
      color: var(--text-secondary);
      border: 1px solid var(--border);
    }
    .btn-secondary:hover { border-color: var(--border-light); color: var(--text-primary); background: var(--bg-hover); }
    .btn-danger {
      background: var(--danger-bg);
      color: var(--danger);
      border: 1px solid rgba(248, 113, 113, 0.2);
    }
    .btn-danger:hover { background: rgba(248, 113, 113, 0.18); }
    .view-toggle {
      display: flex;
      gap: 2px;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 3px;
    }
    .view-toggle button {
      padding: 0;
      background: transparent;
      border: none;
      color: var(--text-muted);
      border-radius: 6px;
      cursor: pointer;
      font-size: 14px;
      transition: var(--transition);
      height: 28px;
      width: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .view-toggle button.active { background: var(--accent-bg); color: var(--accent); }
    .column-toggle {
      display: flex;
      gap: 2px;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 3px;
    }
    .column-toggle .icon-btn {
      width: 28px;
      height: 28px;
      border: none;
      background: transparent;
      font-size: 10px;
    }
    .column-toggle .icon-btn:hover { background: var(--accent-bg); color: var(--accent); }
    .cards-container {
      flex: 1;
      overflow-y: auto;
      padding: var(--padding-page);
      position: relative;
      width: 100%;
      box-sizing: border-box;
      transition: padding 0.55s var(--ease-out);
    }
    .card.card-enter {
      animation: cardAppear 0.48s var(--ease-out) both;
    }
    @keyframes cardAppear {
      from { opacity: 0; filter: blur(4px); }
      to { opacity: 1; filter: blur(0); }
    }
    .cards-container:not(.list-view) .grid-sizer {
      height: 0;
      visibility: hidden;
      display: block;
    }
    .cards-container:not(.list-view) .card {
      display: flex;
      box-sizing: border-box;
      margin-bottom: var(--card-row-gap);
    }
    .card {
      background: var(--bg-card);
      border-radius: var(--radius-lg);
      border: none;
      display: flex;
      flex-direction: column;
      cursor: pointer;
      transition: transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
      box-shadow: var(--shadow-card);
      position: relative;
      overflow: hidden;
    }
    .card:hover {
      box-shadow: var(--shadow-md);
      transform: translateY(-2px);
    }
    .card.selected {
      box-shadow: var(--shadow-glow);
    }
    .card.is-pinned {
      box-shadow: 0 0 0 1px var(--accent), var(--shadow-card);
    }
    .card-pin-badge {
      position: absolute;
      top: 8px;
      left: 8px;
      z-index: 3;
      padding: 2px 7px;
      font-size: 10px;
      font-weight: 700;
      line-height: 1.3;
      color: #fff;
      background: var(--accent);
      border-radius: 4px;
      pointer-events: none;
      letter-spacing: 0.02em;
    }
    .card.card-dragging-source {
      opacity: 0.32;
      transform: scale(0.96) !important;
      box-shadow: none;
      transition: opacity 0.15s var(--ease-out), transform 0.15s var(--ease-out);
    }
    body.is-card-dragging,
    body.is-card-dragging * {
      cursor: grabbing !important;
    }
    body.is-card-dragging .group-item,
    body.is-card-dragging .group-item * {
      cursor: pointer !important;
    }
    .group-item.group-drag-over {
      background: var(--accent-bg-strong);
      color: var(--text-primary);
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    }
    .card-drag-stack {
      position: fixed;
      z-index: 10000;
      width: 148px;
      pointer-events: none;
      filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.5));
    }
    .card-drag-preview {
      position: absolute;
      left: 0;
      top: 0;
      width: 148px;
      background: var(--bg-card);
      border: 1px solid var(--border-light);
      border-radius: 12px;
      overflow: hidden;
      transform: scale(0.9) translate(calc(var(--stack-i, 0) * 5px), calc(var(--stack-i, 0) * 5px));
      transform-origin: top left;
    }
    .card-drag-preview img {
      display: block;
      width: 100%;
      height: 76px;
      object-fit: cover;
      background: var(--bg-primary);
    }
    .card-drag-preview-title {
      display: block;
      padding: 8px 10px;
      font-size: 11px;
      font-weight: 600;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .card-drag-more {
      position: absolute;
      top: -6px;
      right: -6px;
      min-width: 24px;
      height: 24px;
      padding: 0 6px;
      border-radius: 20px;
      background: var(--accent-gradient);
      color: var(--accent-on);
      font-size: 11px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
      z-index: 5;
    }
    .card .card-checkbox {
      position: absolute;
      top: 14px;
      left: 14px;
      z-index: 5;
      display: none;
      width: 24px;
      height: 24px;
      border-radius: 8px;
      background: rgba(0,0,0,0.6);
      border: 1px solid rgba(255,255,255,0.3);
      cursor: pointer;
      transition: var(--transition);
    }
    .batch-mode .card-checkbox { display: flex; align-items: center; justify-content: center; }
    .card .card-checkbox::after { content: "✓"; color: #fff; font-size: 14px; font-weight: 700; display: none; }
    .card .card-checkbox.checked { background: var(--text-primary); border-color: var(--text-primary); }
    .card .card-checkbox.checked::after { display: block; }
    .card-media {
      position: relative;
      overflow: hidden;
      background: #161616;
      flex-shrink: 0;
      line-height: 0;
    }
    .card .card-img {
      width: 100%;
      height: auto;
      max-width: 100%;
      display: block;
      cursor: pointer;
      vertical-align: top;
    }
    .card-media-placeholder {
      width: 100%;
      min-height: 120px;
      background: linear-gradient(145deg, #1a1a1a 0%, #262626 100%);
    }
    .card .card-body {
      padding: var(--padding-card);
      display: flex;
      flex-direction: column;
      gap: 8px;
      flex: 1;
    }
    .card-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 8px;
    }
    .card .card-title {
      font-weight: 600;
      font-size: var(--font-base);
      line-height: var(--lh-title);
      color: var(--text-primary);
      flex: 1;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .card-time {
      font-size: var(--font-xs);
      font-weight: 400;
      color: var(--text-muted);
      flex-shrink: 0;
      line-height: var(--lh-title);
    }
    .card-desc {
      color: var(--text-secondary);
      font-size: var(--font-base);
      font-weight: 400;
      line-height: var(--lh-body);
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .card .card-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 4px;
    }
    .tag {
      background: var(--bg-hover);
      color: var(--text-muted);
      padding: 4px 8px;
      border-radius: 4px;
      font-size: var(--font-xs);
      font-weight: 400;
      cursor: pointer;
      transition: var(--transition);
      border: none;
    }
    .tag:hover { background: #333; color: var(--text-secondary); }
    .tag.tag-more {
      cursor: default;
      background: transparent;
      padding-left: 0;
    }
    .tag.tag-more:hover { background: transparent; color: var(--text-muted); }
    .card .card-actions {
      display: none;
      margin-top: 4px;
    }
    .card-copy-btn {
      width: 32px;
      height: 32px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: rgba(10, 14, 22, 0.85);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text-secondary);
      cursor: pointer;
      transition: var(--transition);
    }
    .card-copy-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
    .cards-container.list-view {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .list-view .card {
      width: 100%;
      height: 92px;
      min-height: 92px;
      max-height: 92px;
      display: flex;
      flex-direction: row;
      align-items: stretch;
      margin: 0;
      padding: 0;
      overflow: hidden;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      background: var(--bg-card);
      box-shadow: var(--shadow-sm);
      transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), border-color 0.2s;
    }
    .list-view .card:hover {
      transform: translateY(-1px);
      border-color: var(--border-light);
      box-shadow: var(--shadow-md);
    }
    .list-view .card.selected {
      border-color: var(--text-muted);
      box-shadow: var(--shadow-glow);
    }
    .list-view .card .card-checkbox {
      top: 50%;
      left: 10px;
      transform: translateY(-50%);
      z-index: 3;
    }
    .list-view .card .card-media {
      width: 92px;
      min-width: 92px;
      height: 92px;
      max-height: none;
      flex-shrink: 0;
      border-radius: 0;
      overflow: hidden;
      background: #141414;
      display: block;
      position: relative;
    }
    .list-view .card .card-img {
      width: 100%;
      height: 100%;
      min-height: 100%;
      max-height: none;
      object-fit: cover;
      object-position: center top;
      display: block;
    }
    .list-view .card .card-media-placeholder {
      position: relative;
      width: 100%;
      height: 100%;
      min-height: 92px;
      background: linear-gradient(145deg, #1a1a1a 0%, #262626 100%);
    }
    .list-view .card .card-media-placeholder::after {
      content: '无图';
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      color: var(--text-muted);
      letter-spacing: 0.05em;
    }
    .list-view .card .card-media {
      position: relative;
    }
    .list-view .card .card-body {
      flex: 1;
      min-width: 0;
      padding: 10px 14px 10px 12px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 4px;
    }
    .list-view .card .card-head {
      align-items: center;
      gap: 10px;
      margin: 0;
    }
    .list-view .card .card-title {
      font-size: var(--font-sm);
      font-weight: 600;
      line-height: 1.3;
    }
    .list-view .card .card-time {
      font-size: 11px;
      color: var(--text-muted);
      white-space: nowrap;
    }
    .list-view .card .card-desc {
      font-size: var(--font-xs);
      line-height: 1.45;
      color: var(--text-muted);
      -webkit-line-clamp: 2;
      margin: 0;
    }
    .list-view .card .card-tags {
      display: none;
    }
    .list-view .card .card-actions {
      display: none;
    }
    .list-view.batch-mode .card .card-body {
      padding-left: 36px;
    }
    /* 编辑面板样式 + 图片预览修复 */
    .edit-panel {
      width: 340px;
      background: var(--bg-elevated);
      border-left: 1px solid var(--border);
      box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, border-color 0.3s ease;
      height: 100%;
      min-height: 0;
      align-self: stretch;
      z-index: 10;
      overflow: hidden;
    }
    .edit-panel.hidden {
      width: 0;
      min-width: 0;
      opacity: 0;
      pointer-events: none;
      border-left-width: 0;
    }
    .edit-panel .panel-header {
      flex-shrink: 0;
      padding: 10px 14px;
      min-height: 40px;
      border-bottom: 1px solid var(--border);
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      background: transparent;
    }
    .edit-panel .panel-header h4 {
      margin: 0;
      color: var(--text-secondary);
      font-weight: 500;
      font-size: var(--font-sm);
      letter-spacing: 0;
      flex: 1;
      min-width: 0;
    }
    .panel-header-actions {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }
    .panel-pin-btn.is-pinned {
      color: var(--accent);
      border-color: var(--accent);
    }
    .edit-panel .close-btn {
      flex-shrink: 0;
      width: 28px;
      height: 28px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: none;
      border: none;
      border-radius: var(--radius-sm);
      color: var(--text-muted);
      font-size: 16px;
      line-height: 1;
      cursor: pointer;
      transition: var(--transition);
    }
    .edit-panel .close-btn:hover {
      color: var(--text-primary);
      background: var(--bg-hover);
    }
    .edit-panel .panel-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
    .edit-panel .panel-body > div:last-child { flex-shrink: 0; }
    .edit-panel .panel-footer {
      padding: 12px 16px;
      border-top: 1px solid var(--border);
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .btn-footer-save {
      flex: 1 1 auto;
      min-width: 0;
      height: 44px;
      font-size: var(--font-base);
      font-weight: 600;
    }
    .btn-footer-copy {
      flex: 0 0 72px;
      height: 44px;
      padding: 0 10px;
      font-size: var(--font-sm);
    }
    .panel-form {
      padding: 14px 20px 16px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .panel-form > label {
      margin-bottom: 0;
    }
    .prompt-field {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .prompt-field-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      min-height: 32px;
    }
    .prompt-label-text {
      position: relative;
      display: inline-flex;
      align-items: center;
      font-weight: 500;
      color: var(--text-secondary);
      font-size: var(--font-sm);
      line-height: 1;
      padding-right: 8px;
      margin: 0;
      cursor: default;
    }
    .prompt-label-text .required-mark {
      position: absolute;
      top: -5px;
      right: 0;
      margin: 0;
      font-size: 10px;
      line-height: 1;
      color: var(--danger);
    }
    .prompt-field-actions {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-shrink: 0;
    }
    .prompt-field textarea,
    #cardPrompt {
      width: 100%;
      min-height: 120px;
      padding: 10px 12px;
      margin: 0;
      resize: vertical;
      font-family: inherit;
      font-size: var(--font-sm);
      line-height: 1.5;
    }
    .prompt-header-copy {
      flex-shrink: 0;
      width: 32px;
      height: 32px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text-secondary);
      cursor: pointer;
      transition: var(--transition);
    }
    .prompt-header-copy:hover {
      border-color: var(--accent);
      color: var(--accent);
      background: var(--accent-bg);
    }
    .btn-icon-danger,
    .btn-icon-muted {
      width: 40px;
      height: 40px;
      flex-shrink: 0;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: var(--radius-sm);
      cursor: pointer;
      transition: var(--transition);
    }
    .btn-icon-danger {
      background: transparent;
      border: 1px solid rgba(248, 113, 113, 0.25);
      color: var(--danger);
      opacity: 0.65;
    }
    .btn-icon-danger:hover {
      opacity: 1;
      background: var(--danger-bg);
      border-color: rgba(248, 113, 113, 0.45);
    }
    .btn-icon-muted {
      background: transparent;
      border: 1px solid var(--border);
      color: var(--text-muted);
      font-size: 16px;
    }
    .btn-icon-muted:hover { color: var(--text-primary); border-color: var(--border-light); }
    .panel-footer .status-message { flex: 1 1 100%; margin: 0; }
    .edit-panel label { font-weight: 500; color: var(--text-secondary); font-size: var(--font-sm); display: block; margin-bottom: 4px; }
    .edit-panel input[type="text"], .edit-panel textarea, .edit-panel select {
      width: 100%;
      padding: 10px 14px;
      background: var(--bg-card);
      border: 1px solid var(--border-light);
      border-radius: 16px;
      color: var(--text-primary);
      font-size: var(--font-sm);
      transition: var(--transition);
    }
    .edit-panel input:focus, .edit-panel textarea:focus, .edit-panel select:focus {
      border-color: var(--accent);
      outline: none;
      box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
    }
    /* 图片预览区域修复：限制最大高度，防止撑爆 */
    .image-drop-area {
      position: relative;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
    }
    .image-drop-area.no-image {
      border: 2px dashed var(--border-light);
      border-radius: 20px;
      padding: 24px;
      margin: 20px;
      background: rgba(0,0,0,0.2);
    }
.image-drop-area.has-image {
  width: 100%;
  height: auto;
  max-height: none;
  background: #000;
  overflow: visible;
  display: block;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

.image-drop-area.has-image img {
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  object-fit: contain;
  display: block;
}
    .image-drop-area .remove-image-btn {
      position: absolute;
      top: 12px;
      right: 12px;
      background: rgba(0,0,0,0.7);
      color: #fff;
      border: none;
      border-radius: 30px;
      width: 28px;
      height: 28px;
      font-size: 14px;
      cursor: pointer;
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 2;
    }
    .edit-panel:not(.hidden) .image-drop-area.has-image:hover .remove-image-btn { display: flex; }
    .placeholder-text { color: var(--text-muted); font-size: var(--font-sm); pointer-events: none; }
    .required-mark { color: var(--danger); }
    .status-message { font-size: var(--font-xs); color: #4ade80; margin-top: 4px; }
    .tag-input-area {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
      width: 100%;
    }
    .tag-chips-wrap {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      width: 100%;
    }
    .tag-chips-wrap:empty { display: none; }
    .tag-chip {
      background: var(--accent-bg);
      color: var(--accent);
      padding: 5px 12px;
      border-radius: 30px;
      font-size: 12px;
      font-weight: 500;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .tag-input {
      align-self: flex-start;
      width: 120px;
      max-width: 100%;
      height: 36px;
      background: var(--bg-card);
      border: 1px solid var(--border-light);
      border-radius: 40px;
      padding: 6px 12px;
      color: var(--text-primary);
      font-size: var(--font-xs);
    }
    .tag-pick-btn {
      width: 100%;
      height: 36px;
      padding: 0 14px;
      white-space: nowrap;
    }
    .tag-sheet-overlay {
      position: fixed;
      inset: 0;
      z-index: 2100;
      background: rgba(0, 0, 0, 0.5);
      display: flex;
      align-items: flex-end;
      justify-content: flex-end;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.22s var(--ease-out);
      backdrop-filter: blur(4px);
    }
    .tag-sheet-overlay.open {
      opacity: 1;
      pointer-events: auto;
    }
    .tag-sheet {
      width: 100%;
      max-width: min(340px, 100vw);
      max-height: min(58vh, 420px);
      background: var(--bg-elevated);
      border: 1px solid var(--border);
      border-radius: 20px 20px 0 0;
      display: flex;
      flex-direction: column;
      transform: translateY(100%);
      transition: transform 0.28s var(--ease-out);
      box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
    }
    .tag-sheet-overlay.open .tag-sheet { transform: translateY(0); }
    .tag-sheet-handle {
      width: 36px;
      height: 4px;
      background: var(--border-light);
      border-radius: 4px;
      margin: 10px auto 4px;
    }
    .tag-sheet-title {
      padding: 4px 16px 10px;
      font-size: var(--font-sm);
      font-weight: 700;
      color: var(--accent);
    }
    .tag-sheet-list {
      flex: 1;
      overflow-y: auto;
      padding: 0 12px 8px;
    }
    .tag-sheet-row {
      display: flex;
      align-items: stretch;
      border: 1px solid var(--border);
      border-radius: 12px;
      margin-bottom: 8px;
      overflow: hidden;
      background: var(--bg-card);
    }
    .tag-sheet-name {
      flex: 1;
      min-width: 0;
      padding: 12px 14px;
      border: none;
      background: transparent;
      color: var(--text-primary);
      font-size: var(--font-sm);
      font-weight: 500;
      text-align: left;
      cursor: pointer;
      transition: background 0.15s;
    }
    .tag-sheet-name:hover { background: var(--bg-hover); }
    .tag-sheet-check {
      flex: 0 0 50%;
      max-width: 50%;
      border: none;
      border-left: 1px solid var(--border);
      background: rgba(255, 255, 255, 0.03);
      cursor: pointer;
      position: relative;
      transition: background 0.15s;
    }
    .tag-sheet-check::after {
      content: '';
      position: absolute;
      inset: 10px 14px;
      border: 2px solid var(--border-light);
      border-radius: 8px;
      background: transparent;
      transition: background 0.15s, border-color 0.15s;
    }
    .tag-sheet-check.checked { background: rgba(74, 222, 128, 0.08); }
    .tag-sheet-check.checked::after {
      background: #4ade80;
      border-color: #4ade80;
    }
    .tag-sheet-empty {
      text-align: center;
      color: var(--text-muted);
      font-size: var(--font-sm);
      padding: 24px 16px;
    }
    .tag-sheet-footer {
      display: none;
      padding: 12px 16px 20px;
      gap: 10px;
      border-top: 1px solid var(--border);
    }
    .tag-sheet-footer .btn { flex: 1; height: 40px; }
    .tag-sheet-overlay.multi .tag-sheet-footer { display: flex; }
    .fab-new {
      position: fixed;
      bottom: 28px;
      right: 28px;
      background: var(--accent-gradient);
      color: #fff;
      border: none;
      border-radius: 50%;
      width: 48px;
      height: 48px;
      font-size: 24px;
      display: none;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      z-index: 100;
      box-shadow: var(--shadow-md);
      transition: var(--transition);
    }
    .fab-new.visible { display: flex; }
    .fab-new:hover { transform: scale(1.05); filter: brightness(1.05); }
    .toast {
      position: fixed;
      bottom: 32px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(10, 14, 22, 0.92);
      border: 1px solid var(--border-light);
      color: var(--text-primary);
      padding: 10px 20px;
      border-radius: var(--radius-sm);
      font-weight: 500;
      font-size: var(--font-sm);
      box-shadow: var(--shadow-lg);
      z-index: 1000;
      opacity: 0;
      transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
      pointer-events: none;
      backdrop-filter: blur(12px);
    }
    .toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
    .custom-modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.6);
      z-index: 500;
      display: none;
      align-items: center;
      justify-content: center;
      backdrop-filter: blur(8px);
    }
    .custom-modal-overlay.active { display: flex; }
    .custom-modal {
      background: rgba(17, 24, 39, 0.96);
      backdrop-filter: blur(16px);
      border: 1px solid var(--border);
      border-radius: 32px;
      width: 420px;
      max-width: 90vw;
      padding: 32px 36px 36px;
      color: var(--text-primary);
      box-shadow: var(--shadow-lg);
      max-height: 80vh;
      overflow-y: auto;
    }
    .custom-modal h3 { color: var(--accent); margin: 0 0 18px; font-weight: 700; font-size: 18px; }
    .custom-modal p { color: var(--text-secondary); margin: 0 0 28px; line-height: 1.6; font-size: var(--font-sm); }
    .modal-actions {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 12px;
      margin-top: 4px;
      padding-top: 4px;
    }
    .custom-modal input {
      width: 100%;
      padding: 10px 14px;
      background: var(--bg-card);
      border: 1px solid var(--border-light);
      border-radius: 16px;
      color: var(--text-primary);
      font-size: var(--font-sm);
    }
    .custom-modal .suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
    .custom-modal .suggestions span {
      background: var(--accent-bg);
      color: var(--accent);
      padding: 4px 12px;
      border-radius: 30px;
      font-size: 12px;
      cursor: pointer;
    }
    .image-lightbox {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.85);
      z-index: 600;
      display: none;
      align-items: center;
      justify-content: center;
    }
    .image-lightbox.active { display: flex; }
    .lightbox-container {
      width: auto;
      max-width: 90vw;
      max-height: 80vh;
      background: #000;
      border-radius: 28px;
      overflow: hidden;
      box-shadow: var(--shadow-lg);
      position: relative;
    }
    .image-lightbox img { display: block; width: auto; height: auto; max-width: 100%; max-height: 80vh; object-fit: contain; }
    .image-lightbox .close-lightbox {
      position: absolute;
      top: 16px;
      right: 20px;
      background: rgba(0,0,0,0.6);
      border: none;
      color: #fff;
      font-size: 18px;
      cursor: pointer;
      border-radius: 40px;
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .hidden-input { display: none !important; }
    .settings-overlay {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 400;
      align-items: center;
      justify-content: center;
      padding: 20px;
      background: rgba(0, 0, 0, 0.55);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
    }
    .settings-overlay.active { display: flex; }
    .settings-panel {
      width: 100%;
      max-width: 480px;
      max-height: min(88vh, 720px);
      display: flex;
      flex-direction: column;
      background: var(--bg-elevated);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-lg);
      overflow: hidden;
    }
    .settings-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      padding: 18px 20px 14px;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }
    .settings-title {
      margin: 0;
      font-size: var(--font-lg);
      font-weight: 700;
      color: var(--text-primary);
      letter-spacing: -0.02em;
    }
    .settings-subtitle {
      margin: 4px 0 0;
      font-size: var(--font-xs);
      color: var(--text-muted);
      line-height: 1.4;
    }
    .settings-close {
      flex-shrink: 0;
      width: 32px;
      height: 32px;
      border: none;
      border-radius: var(--radius-sm);
      background: transparent;
      color: var(--text-muted);
      font-size: 18px;
      line-height: 1;
      cursor: pointer;
      transition: var(--transition);
    }
    .settings-close:hover {
      color: var(--text-primary);
      background: var(--bg-hover);
    }
    .settings-body {
      flex: 1;
      overflow-y: auto;
      padding: 8px 20px 16px;
    }
    .settings-section {
      padding: 16px 0;
      border-bottom: 1px solid var(--border);
    }
    .settings-section:last-child {
      border-bottom: none;
      padding-bottom: 8px;
    }
    .settings-section-title {
      margin: 0 0 4px;
      font-size: var(--font-sm);
      font-weight: 600;
      color: var(--text-primary);
    }
    .settings-section-desc {
      margin: 0 0 12px;
      font-size: var(--font-xs);
      color: var(--text-muted);
      line-height: 1.45;
    }
    .settings-field {
      margin-bottom: 14px;
    }
    .settings-field label {
      display: block;
      margin-bottom: 6px;
      font-size: var(--font-xs);
      font-weight: 500;
      color: var(--text-secondary);
    }
    .settings-input {
      width: 100%;
      height: 40px;
      padding: 0 12px;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--bg-input);
      color: var(--text-primary);
      font-size: var(--font-sm);
      font-family: inherit;
      transition: var(--transition);
      appearance: none;
      -webkit-appearance: none;
    }
    select.settings-input {
      padding-right: 32px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 12px center;
      cursor: pointer;
    }
    .settings-input:focus {
      outline: none;
      border-color: var(--border-light);
      box-shadow: 0 0 0 2px var(--accent-bg-strong);
    }
    .settings-input::placeholder {
      color: var(--text-muted);
    }
    .settings-hint {
      margin: 6px 0 0;
      font-size: 11px;
      color: var(--text-muted);
      line-height: 1.4;
    }
    .settings-hint-block {
      margin: 12px 0 14px;
      padding: 10px 12px;
      border-radius: var(--radius-sm);
      background: var(--accent-bg);
      border: 1px solid var(--border);
    }
    .settings-check {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      cursor: pointer;
      margin-top: 4px;
    }
    .settings-check input {
      position: absolute;
      opacity: 0;
      width: 0;
      height: 0;
    }
    .settings-check-box {
      flex-shrink: 0;
      width: 18px;
      height: 18px;
      margin-top: 1px;
      border: 1px solid var(--border-light);
      border-radius: 5px;
      background: var(--bg-input);
      position: relative;
      transition: var(--transition);
    }
    .settings-check input:checked + .settings-check-box {
      background: var(--text-primary);
      border-color: var(--text-primary);
    }
    .settings-check input:checked + .settings-check-box::after {
      content: '';
      position: absolute;
      left: 5px;
      top: 2px;
      width: 5px;
      height: 9px;
      border: solid var(--accent-on);
      border-width: 0 2px 2px 0;
      transform: rotate(45deg);
    }
    .settings-check-label {
      font-size: var(--font-sm);
      color: var(--text-secondary);
      line-height: 1.45;
    }
    .settings-field-row {
      display: grid;
      grid-template-columns: 1fr auto auto;
      gap: 8px;
      align-items: center;
      margin-bottom: 10px;
    }
    .settings-input-narrow {
      width: 96px;
      min-width: 96px;
    }
    .settings-add-btn {
      height: 40px;
      padding: 0 14px;
      white-space: nowrap;
    }
    .settings-field-list {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .settings-field-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 12px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--bg-card);
    }
    .settings-field-item-name {
      font-size: var(--font-sm);
      color: var(--text-primary);
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .settings-field-item-type {
      font-size: var(--font-xs);
      color: var(--text-muted);
      flex-shrink: 0;
    }
    .settings-field-item-del {
      flex-shrink: 0;
      height: 28px;
      padding: 0 10px;
      font-size: var(--font-xs);
    }
    .settings-empty-hint {
      margin: 0;
      padding: 12px;
      text-align: center;
      font-size: var(--font-xs);
      color: var(--text-muted);
      border: 1px dashed var(--border);
      border-radius: var(--radius-sm);
    }
    .settings-empty-hint.hidden { display: none; }
    #ocrApiKeyWrap.hidden { display: none; }
    .settings-btn-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-bottom: 4px;
    }
    .settings-btn-grid .btn {
      height: 40px;
      font-size: var(--font-sm);
      justify-content: center;
    }
    .settings-btn-grid .btn-primary {
      grid-column: 1 / -1;
    }
    .settings-danger-btn {
      width: 100%;
      height: 40px;
      margin-top: 4px;
    }
    .settings-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 20px 16px;
      border-top: 1px solid var(--border);
      flex-shrink: 0;
      background: var(--bg-secondary);
    }
    .settings-status {
      flex: 1;
      min-width: 0;
      font-size: var(--font-xs);
      color: var(--text-muted);
      line-height: 1.4;
    }
    .settings-status:not(:empty) {
      color: #86efac;
    }
    [data-theme="light"] .settings-status:not(:empty) {
      color: #2e7d32;
    }
    @media (max-width: 520px) {
      .settings-field-row {
        grid-template-columns: 1fr;
      }
      .settings-input-narrow,
      .settings-add-btn {
        width: 100%;
        min-width: 0;
      }
      .settings-btn-grid {
        grid-template-columns: 1fr;
      }
    }
    .custom-checkbox {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      font-size: var(--font-xs);
      color: var(--text-muted);
    }
    .custom-checkbox input[type="checkbox"] {
      position: absolute;
      opacity: 0;
      width: 0;
      height: 0;
    }
    .custom-checkbox .checkmark {
      width: 16px;
      height: 16px;
      border: 1px solid var(--border-light);
      border-radius: 4px;
      background: var(--bg-input);
      flex-shrink: 0;
      position: relative;
    }
    .custom-checkbox input:checked + .checkmark {
      background: var(--text-primary);
      border-color: var(--text-primary);
    }
    .custom-checkbox input:checked + .checkmark::after {
      content: '';
      position: absolute;
      left: 4px;
      top: 1px;
      width: 4px;
      height: 8px;
      border: solid var(--accent-on);
      border-width: 0 2px 2px 0;
      transform: rotate(45deg);
    }
    .floating-prompt {
      position: fixed;
      left: 0;
      top: 0;
      width: 340px;
      max-width: calc(100vw - 32px);
      background: rgba(17, 24, 39, 0.95);
      backdrop-filter: blur(16px);
      border: 1px solid var(--border);
      border-radius: 28px;
      box-shadow: var(--shadow-lg);
      z-index: 80;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .floating-prompt.hidden { opacity: 0; pointer-events: none; }
    .floating-prompt-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 16px;
      cursor: grab;
      background: rgba(0,0,0,0.2);
      border-bottom: 1px solid var(--border);
      user-select: none;
    }
    .floating-prompt-header:active { cursor: grabbing; }
    .floating-prompt-header .fp-close-btn { cursor: pointer; }
    .floating-prompt-header span { font-size: var(--font-xs); color: var(--text-muted); }
    .fp-close-btn {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      transition: var(--transition);
    }
    .floating-prompt textarea {
      flex: 1;
      min-height: 120px;
      background: transparent;
      border: none;
      color: var(--text-primary);
      padding: 16px;
      font-size: 13px;
      line-height: 1.5;
      resize: vertical;
    }
    .floating-prompt .fp-copy-btn {
      position: absolute;
      bottom: 8px;
      right: 8px;
      background: rgba(255, 255, 255, 0.08);
      border: none;
      width: 28px;
      height: 28px;
      border-radius: 30px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .fp-toggle-btn {
      position: static;
      width: 32px;
      height: 32px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: var(--bg-elevated);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text-muted);
      cursor: pointer;
      transition: var(--transition);
      z-index: 2;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    }
    .fp-toggle-btn svg { width: 16px; height: 16px; display: block; }
    .fp-toggle-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
      background: var(--accent-bg);
    }
    .fp-toggle-btn.is-active {
      border-color: var(--accent);
      color: var(--accent);
      background: var(--accent-bg);
      box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
    }
    body.global-view .app-nav-head,
    body.global-view .app-nav,
    body.global-view #sidebarArea,
    body.global-view .main-header,
    body.global-view #editPanel,
    body.global-view #fabNewBtn,
    body.global-view #floatingPrompt { display: none !important; }
    body.global-view .main-content { flex: 1; width: 100%; max-width: 100%; }
    body.global-view .cards-container { padding: 28px 32px; }
    body.global-view .card {
      cursor: zoom-in;
      pointer-events: auto;
    }
    body.global-view .card:hover {
      transform: none;
      border-color: var(--border-light);
      box-shadow: var(--shadow-glow);
    }
    body.global-view .card .card-actions,
    body.global-view .card:hover .card-actions {
      opacity: 0 !important;
      pointer-events: none;
    }
    .appreciate-viewer {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 400;
      background: rgba(0, 0, 0, 0.88);
      backdrop-filter: blur(12px);
      align-items: center;
      justify-content: center;
      padding: 48px 24px;
    }
    .appreciate-viewer.active { display: flex; }
    .appreciate-viewer-close {
      position: fixed;
      top: 20px;
      right: 24px;
      z-index: 2;
      width: 40px;
      height: 40px;
      border: 1px solid var(--border-light);
      border-radius: var(--radius-sm);
      background: rgba(10, 14, 22, 0.8);
      color: var(--text-secondary);
      font-size: 18px;
      cursor: pointer;
      transition: var(--transition);
    }
    .appreciate-viewer-close:hover {
      border-color: var(--accent);
      color: var(--accent);
    }
    .appreciate-viewer-inner {
      max-width: min(94vw, 980px);
      max-height: 90vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      animation: appreciateZoomIn 0.32s var(--ease-out);
    }
    .appreciate-viewer-stage {
      max-width: min(94vw, 980px);
      max-height: calc(90vh - 72px);
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: var(--radius-lg);
      background: rgba(0, 0, 0, 0.35);
      box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    }
    .appreciate-viewer-stage img {
      max-width: min(94vw, 980px);
      max-height: calc(90vh - 72px);
      width: auto;
      height: auto;
      object-fit: contain;
      will-change: transform;
      user-select: none;
    }
    .appreciate-viewer-hint {
      margin: 0;
      font-size: 11px;
      color: var(--text-muted);
      letter-spacing: 0.02em;
    }
    .appreciate-viewer-caption {
      color: var(--text-secondary);
      font-size: var(--font-sm);
      text-align: center;
      max-width: 640px;
      line-height: 1.5;
    }
    @keyframes appreciateZoomIn {
      from { opacity: 0; transform: scale(0.92); }
      to { opacity: 1; transform: scale(1); }
    }
    body.global-view-entering::before {
      content: '';
      position: fixed;
      inset: 0;
      z-index: 50;
      pointer-events: none;
      background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(255, 255, 255, 0.04), transparent 65%);
      animation: globalFlash 0.7s var(--ease-out) forwards;
    }
    body.global-view-entering:not(.global-view) .app-nav,
    body.global-view-entering:not(.global-view) #sidebarArea { animation: chromeSlideOut 0.5s var(--ease-out) forwards; pointer-events: none; }
    body.global-view-entering:not(.global-view) .main-header { animation: chromeSlideOut 0.45s var(--ease-out) forwards; pointer-events: none; }
    body.global-view-entering:not(.global-view) #editPanel,
    body.global-view-entering:not(.global-view) #fabNewBtn { animation: chromeFadeOut 0.4s var(--ease-out) forwards; }
    body.global-view-entering:not(.global-view) .cards-container {
      animation: cardsImmersive 0.62s var(--ease-spring) forwards;
    }
    body.global-view .cards-container .card {
      transition: opacity 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
    }
    body.global-view-exiting #sidebarArea,
    body.global-view-exiting .main-header { animation: chromeSlideIn 0.4s var(--ease-out) forwards; }
    body.global-view-exiting .cards-container { animation: cardsSettle 0.35s var(--ease-out) forwards; }
    @keyframes globalFlash {
      0% { opacity: 0; }
      25% { opacity: 1; }
      100% { opacity: 0; }
    }
    @keyframes chromeSlideOut {
      to { opacity: 0; transform: translateX(-16px); }
    }
    @keyframes chromeFadeOut {
      to { opacity: 0; transform: scale(0.98); }
    }
    @keyframes cardsImmersive {
      from { opacity: 0.5; transform: scale(0.94); filter: blur(4px); }
      to { opacity: 1; transform: scale(1); filter: blur(0); }
    }
    @keyframes chromeSlideIn {
      from { opacity: 0; transform: translateX(-12px); }
      to { opacity: 1; transform: translateX(0); }
    }
    @keyframes cardsSettle {
      from { opacity: 0.85; transform: scale(1.01); }
      to { opacity: 1; transform: scale(1); }
    }
    .global-view-exit {
      display: none;
      position: fixed;
      bottom: 28px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 300;
      padding: 10px 20px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border-light);
      background: rgba(10, 14, 22, 0.9);
      color: var(--text-secondary);
      font-size: var(--font-sm);
      cursor: pointer;
      backdrop-filter: blur(16px);
      transition: var(--transition);
      letter-spacing: 0.02em;
    }
    .global-view-exit:hover { border-color: var(--border-light); color: var(--text-primary); }
    body.global-view .global-view-exit {
      display: block;
      animation: exitBtnIn 0.5s 0.35s var(--ease-out) both;
    }
    @keyframes exitBtnIn {
      from { opacity: 0; transform: translateX(-50%) translateY(12px); }
      to { opacity: 1; transform: translateX(-50%) translateY(0); }
    }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
      }
    }
    .ocr-progress { width: 100%; height: 4px; background: var(--border); border-radius: 2px; margin-top: 8px; overflow: hidden; display: none; }
    .ocr-progress-bar { height: 100%; background: var(--accent); width: 0%; transition: width 0.3s; }
    .modal-overlay {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.6);
      z-index: 300;
      align-items: center;
      justify-content: center;
      backdrop-filter: blur(8px);
    }
    .modal-overlay.active { display: flex; }
    /* 辅助 */
    .no-image-placeholder { display: none; }

