   BOTTOM SHEET / POPOVER CARD
══════════════════════════════════ */
    #sheet-overlay {
      position: fixed;
      inset: 0;
      z-index: 80;
      display: none;
      /* Subtle dark overlay for both mobile and desktop */
      background: rgba(15, 18, 30, 0.45);
      opacity: 0;
      will-change: opacity;
      transition: opacity .3s;
    }

    #sheet-overlay.on {
      display: block;
      opacity: 1;
    }

    #bottom-sheet {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 90;
      will-change: transform, opacity;
      transform: translateY(110%);
      transition: transform .4s cubic-bezier(.32, .72, 0, 1), opacity .3s;
      padding-bottom: env(safe-area-inset-bottom, 0);
    }
    

    

    

    #bottom-sheet.open {
      transform: translateY(0);
    }

    #bs-inner {
      background: rgba(15, 18, 30, 0.70); /* 🌟 加强透光率，让底噪能透上来滋养玻璃面 */
      border: 1px solid rgba(255, 255, 255, 0.15); /* 🌟 回归原生切割工艺的白玻璃边框 */
      border-bottom: none;
      border-radius: var(--radius-xl) var(--radius-xl) 0 0;
      overflow: hidden;
      backdrop-filter: blur(40px) saturate(200%); /* 🌟 核心魔法：色彩萃取提纯 */
      -webkit-backdrop-filter: blur(40px) saturate(200%);
      box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5); /* 🌟 移除环境光，保留纯结构深度黑影 */
      display: flex;
      flex-direction: column;
      max-height: calc(100vh - 60px - env(safe-area-inset-bottom, 0px));
      min-height: 55vh; /* 🌟 核心魔法：Apple HIG 的 Medium Detent 底线，确保不同单词间高度不剧烈跳跃 */
      position: relative;
    }

    #bs-drag {
      width: 36px;
      height: 4px;
      border-radius: 2px;
      background: rgba(255, 255, 255, .4);
      position: absolute;
      top: 6px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 10;
      cursor: pointer;
    }

    /* 增加大拇指的点击热区 */
    #bs-drag::before {
      content: '';
      position: absolute;
      top: -16px;
      bottom: -16px;
      left: -24px;
      right: -24px;
    }

    /* ─── DESKTOP POPOVER MODE (>600px) ─── */
    @media (min-width: 601px) {
      #bottom-sheet {
        /* 摒弃跟随节点的绝对定位，改为固定在屏幕右侧的优雅侧边栏 */
        position: fixed;
        top: 24px;
        right: 12px;
        bottom: 24px;
        left: auto;
        width: 340px;
        
        /* 初始状态：靠右隐藏并稍微透明 */
        transform: translateX(120%);
        opacity: 0;
        pointer-events: none;
        
        /* 丝滑的滑出动画 */
        transition: transform .4s cubic-bezier(0.16, 1, 0.3, 1), opacity .3s ease;
        padding-bottom: 0;
        z-index: 100;
      }

      #bottom-sheet.open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
      }

      #bs-inner {
        height: 100%; /* 撑满侧边栏高度 */
        border-radius: var(--radius-lg);
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: -10px 0 50px rgba(0, 0, 0, 0.5), inset 1px 0 0 rgba(255, 255, 255, 0.05);
        display: flex;
        flex-direction: column;
      }
      
      #bs-drag {
        display: none; /* 电脑端不需要顶部拖拽条 */
      }

      #bs-img-zone {
        height: 220px;
      }
    }

    /* Card image */
    #bs-img-zone {
      position: relative;
      height: 200px; /* 🌟 提升高度，更贴切 640x427 (3:2) 原生比例 */
      background: #0a0d1a;
      overflow: hidden;
      flex-shrink: 0;
      /* 双向蒙版：顶部柔和融入圆角，底部紧贴内容区才消散 */
      -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 8%, #000 65%, transparent 100%);
      mask-image: linear-gradient(to bottom, transparent 0%, #000 8%, #000 65%, transparent 100%);
    }

    #bs-img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center 30%; /* 🌟 核心魔法：视觉重心上移至黄金分割点 */
      display: block;
      opacity: 0;
      transition: opacity 0.5s ease;
    }

    #bs-img.loaded {
      opacity: 0.9;
      filter: brightness(0.9) saturate(0.85);
    }

    #bs-img-placeholder {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 54px;
      opacity: .08;
      transition: opacity 0.4s ease;
      animation: placeholderBreathe 2.5s infinite ease-in-out;
    }
    @keyframes placeholderBreathe {
      0%, 100% { transform: scale(1); filter: brightness(1); }
      50% { transform: scale(1.08); filter: brightness(1.5); }
    }
    
    #bs-img-placeholder.fade-out {
      opacity: 0;
      animation: none;
    }

    

    /* ─── Header: word + pos (line 1), logic tag (line 2) ─── */
    #bs-header {
      padding: 0 20px 12px;
      flex-shrink: 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    #bs-header-row {
      position: relative;
      display: flex;
      align-items: baseline;
      gap: 10px;
      margin-top: -88px; /* 🌟 再次微调，对消胶囊增大的体积，保持重心高悬 */
      z-index: 2;
    }

    #bs-word-big {
      font-family: var(--serif);
      font-size: 30px;
      font-weight: 700;
      color: var(--text-primary);
      letter-spacing: -0.03em; /* 🌟 核心魔法：大字号缩减字间距，呈现海报级雕塑感 */
    }

    #bs-pos-tag {
      font-family: var(--mono);
      font-size: 11px;
      font-weight: 600;
      letter-spacing: .05em;
      flex-shrink: 0;
    }

    #bs-learned-badge {
      font-family: var(--mono);
      font-size: 9px;
      font-weight: 500;
      letter-spacing: .08em;
      padding: 2px 8px;
      border-radius: var(--radius-pill); /* 统一胶囊化 */
      border: 1px solid;
      display: none;
      flex-shrink: 0;
      transition: opacity 0.5s ease;
    }

    /* ── 学完特效：星辉绽放 ── */
    .learned-burst {
      position: absolute;
      pointer-events: none;
      z-index: 100;
    }
    .learned-pulse {
      position: absolute;
      width: 20px; height: 20px;
      border-radius: 50%;
      transform: translate(-50%, -50%);
      animation: learnedPulse 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    @keyframes learnedPulse {
      0%   { width: 20px; height: 20px; opacity: 0.6; }
      100% { width: 120px; height: 120px; opacity: 0; }
    }
    .learned-spark {
      position: absolute;
      width: 4px; height: 4px;
      border-radius: 50%;
      transform: translate(-50%, -50%);
      animation: learnedSpark 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }
    @keyframes learnedSpark {
      0%   { opacity: 1; transform: translate(-50%, -50%) translate(0, 0) scale(1); }
      100% { opacity: 0; transform: translate(-50%, -50%) translate(var(--sx), var(--sy)) scale(0); }
    }

    #bs-logic-tag {
      font-family: var(--mono);
      font-size: 10px;
      letter-spacing: .06em;
      padding: 4px 10px;
      border-radius: var(--radius-pill); /* 统一胶囊化 */
      font-weight: 600;
      line-height: 1.2;
      margin-top: 8px;
      display: inline-block;
    }

    /* ─── Card body ─── */
    #bs-body {
      padding: 16px 20px calc(24px + env(safe-area-inset-bottom));
      display: flex;
      flex-direction: column;
      gap: 14px;
      overflow-y: auto;
      overscroll-behavior: contain;
    }
    #bs-body::-webkit-scrollbar { width: 3px; }
    #bs-body::-webkit-scrollbar-track { background: transparent; }
    #bs-body::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
    #bs-body::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

    #bs-meaning-row {
      position: relative;
      z-index: 2;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 12px;
      margin-top: 8px; /* 🌟 缩紧单词和音标行之间的缝隙，让它们看上去更像一个整体 */
    }

    #bs-meaning {
      font-family: var(--serif);
      font-size: 13px;
      font-style: italic;
      line-height: 1.5;
      color: rgba(255, 255, 255, 0.55);
      letter-spacing: 0.01em;
      flex: 1;
      min-width: 0;
    }

    #bs-definition {
      width: 100%;
      font-family: var(--serif);
      font-size: 15px;
      line-height: 1.65; /* 🌟 提升至完美英文阅读行高 */
      font-weight: 500;
      color: rgba(255, 255, 255, 0.75); /* 🌟 收敛刺眼的纯白，使用克制内敛的阅读色 */
      letter-spacing: 0.02em;
      padding-left: 12px;
      border-left: 3px solid var(--accent, #c6a84b);
      border-radius: 0;
    }
    #bs-definition:empty { display: none; }

    #bs-phon-row {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 14px; /* 稍微加宽一点内边距让胶囊感更好 */
      border-radius: 9999px; /* 🌟 完美胶囊形态 */
      cursor: pointer;
      /* 回弹动画：松手时使用丝滑的 ease-out 曲线缓慢归位 */
      transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, background 0.2s ease;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
      flex-shrink: 0;
    }
    #bs-phon-row:active { 
      /* 按下动画：手指触摸瞬间立刻极速响应并压缩 */
      transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.1s ease;
      transform: scale(0.92); 
      opacity: 0.7;
    }

    @keyframes sonarWave {
      0% { box-shadow: 0 0 0 0 var(--wave-color, rgba(255,255,255,0.4)); }
      100% { box-shadow: 0 0 0 16px rgba(0,0,0,0); }
    }
    #bs-phon-row.playing-audio {
      animation: sonarWave 1s cubic-bezier(0.25, 1, 0.5, 1) infinite;
    }

    #bs-phonetic { font-family: var(--mono); font-size: 12px; font-weight: 500; line-height: 1; }
    #bs-speak-icon { font-size: 13px; display: flex; align-items: center; justify-content: center; opacity: 0.8; }

    /* ─── 标签小标题 ─── */
    #bs-rel-label {
      font-family: var(--mono);
      font-size: 11px;
      letter-spacing: .2em; /* 🌟 拉开字距，更有极客设计感 */
      text-transform: uppercase;
      color: rgba(255, 255, 255, 0.4);
      /*margin-top: 4px;      和上面的释义拉开一点呼吸空间 */
      margin-bottom: -4px; /* 和下面的笔记卡片紧凑贴合 */
    }


    /* ─── 详细笔记卡片 (Notes) - Inset Grouped 风格 ─── */
    .notes-card {
      font-family: var(--serif);
      font-size: 14px;
      line-height: 1.8; 
      letter-spacing: 0.03em;
      color: rgba(255, 255, 255, 0.85); 
      padding: 16px 15px; /* 🌟 将水平内边距改为 15px，完美对齐上方 def 文本的起始线 (3px 边框 + 12px 内边距) */
      background: rgba(255, 255, 255, 0.05); /* 🌟 从黑色镂空改为白色凸出的玻璃悬浮态 */
      border: 1px solid rgba(255, 255, 255, 0.08); /* 更纤细顺滑的边框 */
      border-radius: var(--radius-md); /* 🌟 更符合新标准的 16px 大圆角 */
      width: 100%;
      white-space: pre-wrap; 
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
    }

