/* ── 搜尋 Modal（玩具風命令面板 · 極簡版） ── */

    /* 主面板：覆寫 06-overlay 的 .panel，寬度更寬、padding 為 0 由內部區塊控 */
    .search-panel {
      width: min(100%, 640px);
      max-height: min(80vh, 560px);
      background: var(--white-porcelain);
      border-radius: 24px;
      box-shadow: var(--shadow-lg);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      animation: searchPop 380ms cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    @keyframes searchPop {
      0%   { transform: scale(0.92) translateY(-12px); opacity: 0; }
      60%  { transform: scale(1.02) translateY(2px);   opacity: 1; }
      100% { transform: scale(1) translateY(0); }
    }

    /* 輸入框區：頂部固定,底部一條柔線分隔,icon 與按鈕統一為 SVG */
    .search-input-wrap {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 18px 22px;
      border-bottom: 1px solid var(--line);
      background: var(--white-porcelain);
    }
    .search-input-icon {
      flex-shrink: 0;
      color: var(--muted);
      opacity: 0.75;
    }
    #searchInput {
      flex: 1;
      border: 0;
      outline: 0;
      background: transparent;
      font: inherit;
      font-size: 16px;
      color: var(--text);
      padding: 0;
    }
    #searchInput::placeholder {
      color: var(--muted);
    }

    /* Topbar 搜尋 icon 鈕(沿用原本薄荷綠底) */
    .search-icon-btn {
      position: relative;
      width: 38px;
      height: 38px;
      border-radius: 14px;
      background: var(--pastel-mint);
      color: var(--stamp-approved-text);
      border: none;
      display: grid;
      place-items: center;
      cursor: pointer;
      box-shadow: var(--shadow-xs);
      transition: var(--tr);
    }
    .search-icon-btn:hover {
      transform: translateY(-2px) scale(1.05) rotate(-1deg);
      box-shadow: var(--shadow-sm);
    }
    .search-icon-btn:active {
      transform: translateY(1px) scale(0.98);
      box-shadow: var(--shadow-xs);
    }
    .search-icon-btn svg { transition: transform var(--tr); }
    .search-icon-btn:hover svg { transform: scale(1.1); }

    /* 結果列表：scroll 區 */
    .search-results {
      flex: 1;
      overflow-y: auto;
      padding: 6px 0;
    }

    /* 分組標題 */
    .search-section-title {
      padding: 14px 22px 6px;
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.1em;
      color: var(--faint);
      text-transform: uppercase;
    }

    /* 結果項目：圓點 chip + 主內容 + 右側命中欄位 chip(取代原 ::before 左色條) */
    .search-result {
      display: grid;
      grid-template-columns: 16px 1fr auto;
      align-items: center;
      gap: 14px;
      padding: 10px 22px;
      cursor: pointer;
      transition: background-color 160ms ease;
    }
    .search-result-dot {
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: var(--pastel-mint);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
      transition: transform var(--tr);
      justify-self: center;
    }
    .search-result[data-section="studio"] .search-result-dot     { background: var(--pastel-sky); }
    .search-result[data-section="flow"] .search-result-dot       { background: var(--pastel-mint); }
    .search-result[data-section="comment"] .search-result-dot    { background: var(--pastel-blush); }
    .search-result[data-section="attachment"] .search-result-dot { background: var(--pastel-butter); }

    .search-result.is-active {
      background: var(--surface-off);
    }
    .search-result.is-active .search-result-dot {
      transform: scale(1.35);
    }

    .search-result-main {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .search-result-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .search-result-sub {
      font-size: 12px;
      color: var(--muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .search-result-chip {
      flex-shrink: 0;
      padding: 3px 10px;
      background: var(--pastel-butter);
      color: var(--text);
      border-radius: 99px;
      font-size: 11px;
      font-weight: 700;
    }
    .search-result[data-section="comment"] .search-result-chip    { background: var(--pastel-blush); }
    .search-result[data-section="attachment"] .search-result-chip { background: var(--pastel-sky); }

    /* 命中關鍵字高亮（先 escapeHtml 再 replace，確保 XSS 安全） */
    mark {
      background: var(--pastel-butter);
      color: var(--text);
      padding: 0 2px;
      border-radius: 3px;
      font-weight: 700;
    }
    .search-result[data-section="comment"] mark { background: var(--pastel-blush); }

    /* 空狀態：SVG 玩具圖示 + 文案(取代原 🔍 emoji) */
    .search-empty {
      padding: 56px 32px 48px;
      text-align: center;
      color: var(--muted);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 14px;
    }
    .search-empty-icon {
      color: var(--faint);
      opacity: 0.55;
    }
    .search-empty-text {
      font-size: 13px;
      line-height: 1.7;
    }
    .search-empty-text kbd {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 22px;
      height: 20px;
      padding: 0 5px;
      margin: 0 2px;
      background: var(--surface-off);
      color: var(--text);
      border: 1px solid var(--line);
      border-radius: 5px;
      font-size: 11px;
      font-weight: 700;
      font-family: ui-monospace, "SF Mono", Menlo, monospace;
    }

    /* 底部快捷鍵提示列：素色 surface-off,不搶戲(原 lavender 太重) */
    .search-footer {
      display: flex;
      gap: 18px;
      padding: 12px 22px;
      border-top: 1px solid var(--line);
      background: #D8D6D0;
      font-size: 12px;
      color: var(--muted);
    }
    .search-footer kbd {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 22px;
      height: 22px;
      padding: 0 6px;
      margin-right: 4px;
      background: var(--white-snow);
      color: var(--text);
      border: 1px solid var(--line);
      border-radius: 6px;
      font-size: 11px;
      font-weight: 700;
      font-family: ui-monospace, "SF Mono", Menlo, monospace;
    }


