  /* ============================================
     以太風格 — FF14 巨集生成器（極簡版）
     ============================================ */
  :root {
    /* 整體調亮 — 不那麼黑了 */
    --bg-deep: #131830;
    --bg-mid: #1c2546;
    --bg-soft: #25325b;
    --bg-card: rgba(40, 52, 88, 0.75);
    --bg-card-solid: #25325b;

    --aether-blue: #7dd6ff;
    --aether-blue-dim: #4a94c0;
    --aether-violet: #c5a6ff;
    --aether-gold: #f0d589;
    --aether-rose: #ffb0d3;
    --aether-mint: #92f0d3;

    /* 文字提亮 — 之前太暗的那些往上拉一階 */
    --text-primary: #f5f7ff;
    --text-secondary: #d8dff5;
    --text-muted: #a8b2d2;
    --text-faint: #8088ad;

    /* 邊線加強 — 從 0.12 提到 0.22 */
    --border-subtle: rgba(125, 214, 255, 0.22);
    --border-soft: rgba(125, 214, 255, 0.35);
    --border-bright: rgba(125, 214, 255, 0.65);

    --glow-blue: 0 0 22px rgba(125, 214, 255, 0.4);
    --glow-violet: 0 0 26px rgba(197, 166, 255, 0.45);
    --glow-gold: 0 0 20px rgba(240, 213, 137, 0.45);

    --font-display: 'Cinzel', 'Noto Serif TC', serif;
    --font-serif: 'Cormorant Garamond', 'Noto Serif TC', serif;
    --font-body: 'Noto Serif TC', system-ui, serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  }

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

  /* ===== UI 縮放 ===== */
  html { font-size: 16px; transition: font-size 0.2s ease; }
  html.ui-large { font-size: 18px; }
  html.ui-xlarge { font-size: 20px; }

  /* 大尺寸時主面板寬度同步調大 */
  html.ui-large .app { max-width: 1100px; }
  html.ui-xlarge .app { max-width: 1240px; }
  html.ui-large .emote-floater { width: 360px; }
  html.ui-xlarge .emote-floater { width: 400px; }
  @media (min-width: 1380px) {
    html.ui-large .app { margin-right: 420px; }
    html.ui-xlarge .app { margin-right: 460px; }
  }

  /* UI 切換器（面板頂端整行） */
  .ui-scale-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(28, 37, 70, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    margin: -4px -4px 18px;
  }
  .ui-scale-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-right: auto;
  }
  .ui-scale-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 2px;
    padding: 4px 14px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .ui-scale-btn:hover {
    color: var(--aether-blue);
    background: rgba(125, 214, 255, 0.08);
  }
  .ui-scale-btn.active {
    color: var(--aether-blue);
    border-color: var(--aether-blue);
    background: rgba(125, 214, 255, 0.15);
  }

  /* 快捷鍵說明（可摺疊） */
  .hotkey-help {
    margin-bottom: 22px;
    background: rgba(28, 37, 70, 0.45);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    overflow: hidden;
  }
  .hotkey-help summary {
    cursor: pointer;
    padding: 10px 14px;
    font-family: var(--font-display);
    font-size: 0.78rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--aether-blue);
    user-select: none;
    list-style: none;
    transition: background 0.15s ease;
  }
  .hotkey-help summary::-webkit-details-marker { display: none; }
  .hotkey-help summary:hover {
    background: rgba(125, 214, 255, 0.06);
  }
  .hotkey-help[open] summary {
    border-bottom: 1px dashed var(--border-subtle);
  }
  .hotkey-list {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .hotkey-item {
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
    padding: 4px 0;
  }
  .hotkey-keys {
    flex: 0 0 auto;
    min-width: 180px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
  }
  .hotkey-desc {
    flex: 1;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.86rem;
    line-height: 1.5;
  }
  .hotkey-list kbd {
    font-family: var(--font-mono);
    font-style: normal;
    background: rgba(125,214,255,0.12);
    color: var(--aether-blue);
    border: 1px solid rgba(125,214,255,0.25);
    padding: 1px 7px;
    border-radius: 3px;
    font-size: 0.82em;
  }
  .hotkey-list code {
    font-family: var(--font-mono);
    font-style: normal;
    background: rgba(240,213,137,0.1);
    color: var(--aether-gold);
    padding: 1px 5px;
    border-radius: 2px;
    font-size: 0.85em;
  }

  html, body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
  }

  /* 以太背景 */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
      radial-gradient(ellipse 80% 60% at 15% 0%, rgba(125, 214, 255, 0.22), transparent 60%),
      radial-gradient(ellipse 70% 50% at 85% 100%, rgba(197, 166, 255, 0.18), transparent 60%),
      radial-gradient(ellipse 50% 40% at 50% 50%, rgba(240, 213, 137, 0.07), transparent 70%),
      linear-gradient(180deg, #131830 0%, #1a2042 50%, #131830 100%);
    z-index: -2;
    pointer-events: none;
  }
  body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.36, 0 0 0 0 0.78, 0 0 0 0 1, 0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
    mix-blend-mode: overlay;
  }

  /* ===== 容器 ===== */
  .app {
    max-width: 980px;
    margin: 0 auto;
    padding: 48px 32px 80px;
    /* 大螢幕時往左偏一點，騰出右側空間給浮動視窗 */
    transition: padding 0.2s ease;
  }
  @media (min-width: 1380px) {
    .app {
      margin-right: 380px;
      margin-left: max(32px, calc(50% - 700px));
    }
  }
  @media (max-width: 1379px) and (min-width: 1101px) {
    .app {
      margin-right: 320px;
      margin-left: 32px;
    }
  }

  /* ===== 標題 ===== */
  .header {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
  }
  .header-mark {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--aether-blue);
    font-family: var(--font-display);
    font-size: 0.82rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    margin-bottom: 18px;
    opacity: 0.85;
  }
  .header-mark::before, .header-mark::after {
    content: '';
    width: 64px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--aether-blue-dim), transparent);
  }
  .header h1 {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 600;
    letter-spacing: 0.04em;
    background: linear-gradient(180deg, #ffffff 0%, #c9d4ed 50%, #5dc6ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 12px;
    text-shadow: 0 0 60px rgba(125, 214, 255, 0.3);
  }
  .header .subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
  }
  .header .subtitle .accent {
    color: var(--aether-gold);
    font-weight: 500;
  }
  .crystal-deco {
    position: absolute;
    width: 24px;
    height: 24px;
    transform: rotate(45deg);
    border: 1px solid var(--aether-blue-dim);
    background: rgba(125, 214, 255, 0.1);
    box-shadow: var(--glow-blue);
  }
  .crystal-deco.left { left: -8px; top: 30%; animation: float 4s ease-in-out infinite; }
  .crystal-deco.right { right: -8px; top: 60%; animation: float 4s ease-in-out infinite reverse; }
  @keyframes float {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(-8px); }
  }

  /* ===== 卡片 ===== */
  .panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 28px;
    position: relative;
  }
  .panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--aether-blue), transparent);
    opacity: 0.6;
  }
  .panel-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--aether-blue);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .panel-title .num {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.7rem;
    color: var(--aether-gold);
    font-weight: 500;
    letter-spacing: 0;
  }
  .panel-desc {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.98rem;
    margin-bottom: 22px;
    line-height: 1.6;
  }
  .panel-desc kbd {
    font-family: var(--font-mono);
    font-style: normal;
    background: rgba(125,214,255,0.1);
    color: var(--aether-blue);
    padding: 1px 6px;
    border-radius: 2px;
    font-size: 0.85em;
  }
  .panel-desc code {
    font-family: var(--font-mono);
    font-style: normal;
    background: rgba(240,213,137,0.1);
    color: var(--aether-gold);
    padding: 1px 5px;
    border-radius: 2px;
    font-size: 0.85em;
  }

  /* ===== 小工具區 ===== */
  .mini-tools {
    margin-bottom: 12px;
    background: rgba(28, 37, 70, 0.45);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    padding: 12px 14px;
  }
  .mini-tools-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
  }
  .mini-tools-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  .mini-tools-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .mini-tool-btn {
    background: rgba(28, 37, 70, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    padding: 6px 14px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
  }
  .mini-tool-btn:hover {
    border-color: var(--aether-mint);
    color: var(--aether-mint);
    background: rgba(146, 240, 211, 0.08);
  }
  .mini-tool-btn.active {
    border-color: var(--aether-mint);
    color: var(--aether-mint);
    background: rgba(146, 240, 211, 0.18);
    box-shadow: 0 0 16px rgba(146, 240, 211, 0.25);
  }
  .mini-tool-form {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-subtle);
  }
  .mini-tool-form.active {
    display: block;
  }
  .mini-tool-form-title {
    font-family: var(--font-display);
    font-size: 0.74rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--aether-mint);
    margin-bottom: 8px;
  }
  .mini-tool-form-desc {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
  }
  .mini-tool-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
  }
  .mini-tool-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
    flex: 1;
  }
  .mini-tool-field-label {
    font-family: var(--font-body);
    font-size: 0.78rem;
    color: var(--text-secondary);
  }
  .mini-tool-field-label .required {
    color: var(--aether-rose);
    margin-left: 2px;
  }
  .mini-tool-field input,
  .mini-tool-field select {
    background: rgba(28, 37, 70, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    padding: 7px 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    transition: all 0.15s ease;
  }
  .mini-tool-field input:focus,
  .mini-tool-field select:focus {
    border-color: var(--aether-mint);
    box-shadow: 0 0 0 1px rgba(146, 240, 211, 0.25);
  }
  .mini-tool-submit {
    background: rgba(146, 240, 211, 0.15);
    border: 1px solid var(--aether-mint);
    color: var(--aether-mint);
    border-radius: 2px;
    padding: 8px 18px;
    font-family: var(--font-display);
    font-size: 0.78rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
  }
  .mini-tool-submit:hover {
    background: rgba(146, 240, 211, 0.25);
    box-shadow: 0 0 12px rgba(146, 240, 211, 0.35);
  }
  .mini-tool-preview {
    margin-top: 10px;
    padding: 6px 10px;
    background: rgba(28, 37, 70, 0.5);
    border-left: 2px solid var(--aether-mint);
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
  }
  .mini-tool-preview-empty {
    color: var(--text-faint);
    font-style: italic;
    font-family: var(--font-serif);
  }

  /* ===== 自訂圖標區 ===== */
  .micon-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: rgba(28, 37, 70, 0.55);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    flex-wrap: wrap;
  }
  .micon-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text-secondary);
    user-select: none;
    flex-shrink: 0;
  }
  .micon-toggle input {
    width: 15px;
    height: 15px;
    accent-color: var(--aether-gold);
    cursor: pointer;
  }
  .micon-toggle.checked {
    color: var(--aether-gold);
  }
  .micon-name {
    flex: 1;
    min-width: 180px;
    background: rgba(28, 37, 70, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    padding: 7px 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    transition: all 0.15s ease;
  }
  .micon-name:focus:not(:disabled) {
    border-color: var(--aether-gold);
    box-shadow: 0 0 0 1px rgba(240,213,137,0.25);
  }
  .micon-name:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
  .micon-type {
    background: rgba(28, 37, 70, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    padding: 7px 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    min-width: 180px;
    transition: all 0.15s ease;
  }
  .micon-type:focus:not(:disabled) {
    border-color: var(--aether-gold);
    box-shadow: 0 0 0 1px rgba(240,213,137,0.25);
  }
  .micon-type:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
  .micon-type option {
    background: var(--bg-card-solid);
    color: var(--text-primary);
  }

  /* ===== 主編輯文字框 ===== */
  .macro-editor {
    width: 100%;
    background: linear-gradient(135deg, rgba(28, 37, 70, 0.95), rgba(37, 50, 91, 0.95));
    border: 1px solid var(--border-soft);
    border-radius: 3px;
    padding: 18px 20px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1rem;
    line-height: 1.7;
    outline: none;
    resize: vertical;
    min-height: 280px;
    transition: border-color 0.15s ease;
  }
  .macro-editor:focus {
    border-color: var(--aether-blue);
    box-shadow: 0 0 0 1px rgba(125, 214, 255, 0.3), 0 0 24px rgba(125, 214, 255, 0.2);
  }
  .macro-editor::placeholder {
    color: var(--text-muted);
    font-family: var(--font-serif);
    font-style: italic;
    opacity: 0.85;
  }
  .macro-editor::-webkit-scrollbar { width: 8px; }
  .macro-editor::-webkit-scrollbar-track { background: transparent; }
  .macro-editor::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 3px; }
  .macro-editor::-webkit-scrollbar-thumb:hover { background: var(--aether-blue-dim); }

  /* 編輯器底部資訊 + 按鈕 */
  .editor-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
  }
  .line-count {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-right: auto;
  }
  .line-count.warn { color: var(--aether-gold); }
  .line-count.danger { color: #ff7a9c; }

  /* ===== 按鈕 (chip) ===== */
  .chip {
    background: rgba(28, 37, 70, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    padding: 8px 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    white-space: nowrap;
  }
  .chip:hover {
    border-color: var(--border-bright);
    color: var(--aether-blue);
    background: rgba(125, 214, 255, 0.08);
  }
  .chip.gold:hover {
    border-color: var(--aether-gold);
    color: var(--aether-gold);
    background: rgba(240, 213, 137, 0.08);
  }
  .chip.violet:hover {
    border-color: var(--aether-violet);
    color: var(--aether-violet);
    background: rgba(197, 166, 255, 0.08);
  }
  .chip.danger {
    color: rgba(255, 122, 156, 0.85);
    border-color: rgba(255, 100, 130, 0.3);
  }
  .chip.danger:hover {
    color: #ff7a9c;
    border-color: #ff7a9c;
    background: rgba(255, 100, 130, 0.08);
  }
  .chip.primary {
    background: rgba(125, 214, 255, 0.12);
    color: var(--aether-blue);
    border-color: var(--aether-blue);
    font-family: var(--font-display);
    font-size: 0.78rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 9px 18px;
  }
  .chip.primary:hover {
    background: rgba(125, 214, 255, 0.22);
    box-shadow: var(--glow-blue);
  }

  /* ===== 工具區段 ===== */
  .sub-section {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px dashed var(--border-subtle);
  }
  /* 第一個 pre-editor 不要上方分隔線（緊接著 panel-desc） */
  .panel-desc + .sub-section.pre-editor {
    margin-top: 8px;
    padding-top: 0;
    border-top: none;
  }
  .sub-section-title {
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--aether-blue);
    margin-bottom: 6px;
    opacity: 1;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .sub-desc {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 14px;
    line-height: 1.55;
  }
  .sub-desc kbd {
    font-family: var(--font-mono);
    font-style: normal;
    background: rgba(125,214,255,0.1);
    color: var(--aether-blue);
    padding: 1px 6px;
    border-radius: 2px;
    font-size: 0.85em;
  }
  .sub-desc code {
    font-family: var(--font-mono);
    font-style: normal;
    background: rgba(240,213,137,0.1);
    color: var(--aether-gold);
    padding: 1px 5px;
    border-radius: 2px;
    font-size: 0.88em;
  }

  /* ===== 統一頻道按鈕網格 ===== */
  .channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }
  .chan-btn {
    background: rgba(28, 37, 70, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    padding: 10px 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-primary);
    font-family: var(--font-body);
    text-align: center;
  }
  .chan-btn:hover {
    border-color: var(--aether-blue);
    background: rgba(125, 214, 255, 0.15);
    color: var(--aether-blue);
    transform: translateY(-1px);
    box-shadow: var(--glow-blue);
  }
  .chan-btn .name {
    font-size: 0.86rem;
    font-weight: 500;
    margin-bottom: 2px;
  }
  .chan-btn .cmd {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text-secondary);
    opacity: 0.85;
  }
  .chan-btn:hover .cmd {
    color: var(--aether-blue);
    opacity: 1;
  }

  /* 選擇範圍提示 */
  .scope-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: rgba(240, 213, 137, 0.08);
    border: 1px solid rgba(240, 213, 137, 0.3);
    border-radius: 3px;
    color: var(--aether-gold);
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.88rem;
    line-height: 1.4;
  }
  .scope-indicator .scope-icon {
    font-style: normal;
  }
  .scope-indicator.global {
    background: rgba(125, 214, 255, 0.08);
    border-color: rgba(125, 214, 255, 0.25);
    color: var(--text-secondary);
  }

  /* ===== 等待 wait 區 ===== */
  .wait-num-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 12px;
  }
  .wait-num {
    background: rgba(28, 37, 70, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    padding: 6px 12px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 38px;
  }
  .wait-num:hover {
    border-color: var(--aether-violet);
    color: var(--aether-violet);
    background: rgba(197, 166, 255, 0.08);
  }
  .wait-num.active {
    border-color: var(--aether-violet);
    color: var(--aether-violet);
    background: rgba(197, 166, 255, 0.18);
    box-shadow: var(--glow-violet);
  }
  .wait-input {
    background: rgba(28, 37, 70, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    padding: 6px 10px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    width: 64px;
    outline: none;
    transition: all 0.15s ease;
  }
  .wait-input:focus {
    border-color: var(--aether-violet);
    box-shadow: 0 0 0 1px rgba(197, 166, 255, 0.2);
  }
  .wait-input::placeholder {
    color: var(--text-muted);
    opacity: 0.85;
  }

  .wait-actions, .channel-unify-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  /* ===== 情感動作浮動視窗（右側） ===== */
  .emote-floater {
    position: fixed;
    top: 80px;
    right: 24px;
    width: 320px;
    height: calc(100vh - 120px);
    min-width: 240px;
    min-height: 200px;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 48px);
    background: var(--bg-card-solid);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 24px rgba(125, 214, 255, 0.12);
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* 原生 resize handle（左下角，因為視窗 anchor 在右上） */
    resize: both;
    /* 注意：resize:both 會讓視窗右下角拉動才能 resize，
       但因為我們的視窗釘在右上角（用 right），實際拖右下會跑掉。
       我們改用自訂 resize handle。 */
    resize: none;
  }
  .emote-floater::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--aether-blue), transparent);
    opacity: 0.7;
    pointer-events: none;
  }
  .emote-floater:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.65), 0 0 28px rgba(125, 214, 255, 0.2);
  }

  /* 自訂 resize handle */
  .emote-resize-handle {
    position: absolute;
    background: transparent;
    z-index: 5;
  }
  .emote-resize-handle.left {
    left: 0;
    top: 0;
    bottom: 12px;
    width: 6px;
    cursor: ew-resize;
  }
  .emote-resize-handle.bottom {
    left: 12px;
    right: 0;
    bottom: 0;
    height: 6px;
    cursor: ns-resize;
  }
  .emote-resize-handle.corner {
    left: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: nesw-resize;
    background: linear-gradient(45deg, transparent 0%, transparent 40%, var(--aether-blue-dim) 40%, var(--aether-blue-dim) 50%, transparent 50%, transparent 70%, var(--aether-blue-dim) 70%, var(--aether-blue-dim) 80%, transparent 80%);
    opacity: 0.5;
    transition: opacity 0.15s ease;
  }
  .emote-resize-handle.corner:hover {
    opacity: 1;
  }
  .emote-resize-handle.left:hover,
  .emote-resize-handle.bottom:hover {
    background: rgba(125, 214, 255, 0.15);
  }
  /* 拖曳中游標保持 */
  body.emote-resizing {
    user-select: none;
    cursor: nesw-resize;
  }
  body.emote-resizing .emote-floater {
    transition: none;
  }

  .emote-floater-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(28, 37, 70, 0.75);
    transition: background 0.15s ease;
    flex-shrink: 0;
  }
  .emote-floater-header:hover {
    background: rgba(125, 214, 255, 0.05);
  }
  .emote-floater-title {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--aether-blue);
    flex: 1;
  }
  .emote-floater-hint {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: none;
    color: var(--text-muted);
    margin-left: 4px;
  }
  .emote-floater-toggle {
    background: transparent;
    border: 1px solid var(--border-soft);
    border-radius: 2px;
    width: 26px;
    height: 26px;
    color: var(--aether-blue);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
  }
  .emote-floater-toggle:hover {
    border-color: var(--aether-blue);
    background: rgba(125, 214, 255, 0.12);
  }
  .emote-floater.collapsed {
    height: auto !important;
    min-height: 0;
  }
  .emote-floater.collapsed .emote-floater-toggle {
    transform: rotate(-90deg);
  }
  .emote-floater-body {
    padding: 14px 16px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .emote-floater-body::-webkit-scrollbar { width: 6px; }
  .emote-floater-body::-webkit-scrollbar-track { background: transparent; }
  .emote-floater-body::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 3px; }
  .emote-floater.collapsed .emote-floater-body,
  .emote-floater.collapsed .emote-resize-handle {
    display: none;
  }
  .emote-floater-desc {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.86rem;
    margin-bottom: 12px;
    line-height: 1.4;
    flex-shrink: 0;
  }
  .emote-floater .emote-grid {
    flex: 1;
    min-height: 100px;
    max-height: none;
  }

  /* 視窗太窄就改為下方固定條 */
  @media (max-width: 1100px) {
    .emote-floater {
      position: relative;
      top: auto;
      right: auto;
      width: 100% !important;
      height: auto !important;
      max-width: 980px;
      margin: 24px auto 0;
      max-height: 480px;
    }
    .emote-resize-handle { display: none; }
  }

  .emote-search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
  }
  .emote-search {
    flex: 1;
    min-width: 200px;
    background: rgba(28, 37, 70, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    padding: 9px 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.15s ease;
  }
  .emote-search::placeholder {
    color: var(--text-muted);
    font-style: italic;
    font-family: var(--font-serif);
    opacity: 0.85;
  }
  .emote-search:focus {
    border-color: var(--aether-blue);
    box-shadow: 0 0 0 1px rgba(125, 214, 255, 0.2);
  }
  .motion-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-primary);
    user-select: none;
    padding: 5px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    background: rgba(28, 37, 70, 0.75);
    transition: all 0.15s ease;
  }
  .motion-toggle:hover { border-color: var(--border-bright); }
  .motion-toggle input {
    width: 14px;
    height: 14px;
    accent-color: var(--aether-violet);
    cursor: pointer;
  }
  .motion-toggle.checked {
    color: var(--aether-violet);
    border-color: var(--aether-violet);
    background: rgba(197, 166, 255, 0.08);
  }

  .cat-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    flex-wrap: wrap;
  }
  .cat-tab {
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    padding: 5px 11px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .cat-tab:hover { color: var(--text-primary); border-color: var(--border-bright); }
  .cat-tab.active {
    color: var(--aether-blue);
    border-color: var(--aether-blue);
    background: rgba(125, 214, 255, 0.12);
  }
  .emote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
  }
  .emote-grid::-webkit-scrollbar { width: 6px; }
  .emote-grid::-webkit-scrollbar-track { background: transparent; }
  .emote-grid::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 3px; }
  .emote-grid::-webkit-scrollbar-thumb:hover { background: var(--aether-blue-dim); }
  .emote-btn {
    background: rgba(28, 37, 70, 0.65);
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    padding: 7px 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.84rem;
    text-align: center;
    line-height: 1.3;
  }
  .emote-btn:hover {
    border-color: var(--aether-violet);
    background: rgba(197, 166, 255, 0.15);
    color: var(--aether-violet);
    box-shadow: var(--glow-violet);
  }
  .emote-btn .en {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
  }
  .emote-btn:hover .en { color: var(--aether-violet); opacity: 0.85; }
  .emote-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-faint);
    font-family: var(--font-serif);
    font-style: italic;
    padding: 32px;
  }

  /* ===== 自動完成 popup ===== */
  .autocomplete-popup {
    position: fixed;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-bright);
    border-radius: 3px;
    padding: 4px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6), 0 0 16px rgba(125, 214, 255, 0.25);
    z-index: 60;
    max-height: 280px;
    overflow-y: auto;
    min-width: 240px;
    max-width: 360px;
  }
  .autocomplete-popup::-webkit-scrollbar { width: 6px; }
  .autocomplete-popup::-webkit-scrollbar-track { background: transparent; }
  .autocomplete-popup::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 3px; }

  .ac-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 2px;
    cursor: pointer;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: background 0.1s ease;
    line-height: 1.3;
  }
  .ac-item:hover, .ac-item.selected {
    background: rgba(125, 214, 255, 0.15);
    color: var(--text-primary);
  }
  .ac-item.selected {
    background: rgba(125, 214, 255, 0.22);
    box-shadow: inset 2px 0 0 var(--aether-blue);
  }
  .ac-item .ac-cn {
    color: var(--aether-blue);
    font-weight: 500;
    flex-shrink: 0;
  }
  .ac-item.selected .ac-cn { color: #fff; }
  .ac-item .ac-en {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-faint);
    margin-left: auto;
    flex-shrink: 0;
  }
  .ac-item.selected .ac-en { color: var(--aether-mint); }
  .ac-item .ac-match {
    color: var(--aether-gold);
    font-weight: 600;
  }
  .ac-hint {
    padding: 6px 12px;
    border-top: 1px dashed var(--border-subtle);
    margin-top: 4px;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.75rem;
    color: var(--text-faint);
    line-height: 1.5;
  }
  .ac-hint kbd {
    font-family: var(--font-mono);
    font-style: normal;
    background: rgba(125,214,255,0.1);
    color: var(--aether-blue);
    padding: 1px 5px;
    border-radius: 2px;
    font-size: 0.92em;
  }

  /* Toast */
  .toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-card-solid);
    border: 1px solid var(--aether-blue);
    color: var(--aether-blue);
    padding: 12px 24px;
    border-radius: 3px;
    font-family: var(--font-display);
    font-size: 0.78rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: var(--glow-blue);
    z-index: 100;
  }
  .toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  /* Footer */
  .footer {
    text-align: center;
    margin-top: 56px;
    padding-top: 28px;
    border-top: 1px solid var(--border-subtle);
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text-faint);
    font-size: 0.85rem;
  }
  .footer .glyph {
    color: var(--aether-blue-dim);
    margin: 0 8px;
  }

  .helper {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
  }
  .helper code {
    font-family: var(--font-mono);
    font-style: normal;
    background: rgba(125, 214, 255, 0.08);
    color: var(--aether-blue);
    padding: 1px 5px;
    border-radius: 2px;
    font-size: 0.88em;
  }
  .helper kbd {
    font-family: var(--font-mono);
    font-style: normal;
    background: rgba(125,214,255,0.1);
    color: var(--aether-blue);
    padding: 1px 5px;
    border-radius: 2px;
    font-size: 0.92em;
  }

  /* ═══ Info button (ℹ) — header 右上角 ═══ */
  .header { position: relative; }
  .info-btn {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 32px;
    height: 32px;
    background: rgba(40, 52, 88, 0.6);
    border: 1px solid var(--border-soft);
    color: var(--aether-blue);
    font-family: var(--font-mono);
    font-size: 14px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
  }
  .info-btn:hover {
    border-color: var(--aether-blue);
    color: var(--text-primary);
    box-shadow: var(--glow-blue);
    background: rgba(125, 214, 255, 0.12);
  }

  /* ═══ Site footer — 低調列 ═══ */
  .site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-top: 1px solid var(--border-subtle);
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
    background: rgba(19, 24, 48, 0.65);
  }
  .footer-tool-name {
    font-family: var(--font-display);
    color: var(--aether-gold);
    letter-spacing: 0.08em;
    font-weight: 500;
  }
  .footer-author { color: var(--text-secondary); }
  .footer-divider { color: var(--text-faint); opacity: 0.6; }
  .site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 2px 5px;
    border-radius: 2px;
    transition: color 0.15s, background 0.15s;
  }
  .site-footer a:hover {
    color: var(--aether-blue);
    background: rgba(125, 214, 255, 0.08);
  }

  /* ═══ About dialog ═══ */
  .about-dialog {
    background: linear-gradient(180deg, var(--bg-mid), var(--bg-deep));
    border: 1px solid var(--border-soft);
    color: var(--text-primary);
    border-radius: 6px;
    max-width: 480px;
    width: calc(100% - 32px);
    padding: 0;
    box-shadow:
      0 0 0 1px rgba(125, 214, 255, 0.15),
      0 30px 80px -10px rgba(0, 0, 0, 0.7),
      var(--glow-blue);
    font-family: var(--font-body);
  }
  .about-dialog::backdrop {
    background: rgba(10, 12, 24, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .about-form {
    position: relative;
    padding: 28px 30px 24px;
  }
  .about-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    padding: 0;
    line-height: 1;
  }
  .about-close:hover {
    color: var(--aether-rose);
    background: rgba(255, 176, 211, 0.12);
  }
  .about-title {
    font-family: var(--font-display);
    font-size: 14px;
    letter-spacing: 0.18em;
    color: var(--aether-gold);
    margin: 0 0 12px;
    font-weight: 500;
    text-transform: uppercase;
  }
  .about-name {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: 0.04em;
  }
  .about-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
  }
  .about-link,
  .about-tool {
    display: grid;
    grid-template-columns: 76px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(40, 52, 88, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.18s ease;
  }
  .about-link:hover,
  .about-tool:not(.about-tool-current):hover {
    background: rgba(125, 214, 255, 0.08);
    border-color: var(--border-bright);
    color: var(--text-primary);
    transform: translateX(2px);
  }
  /* 作者連結首欄需容納「Threads (FFXIV 創作)」標籤 */
  .about-link { grid-template-columns: minmax(140px, max-content) 1fr auto; }
  .about-link:focus-visible,
  .site-footer a:focus-visible {
    outline: 2px solid var(--aether-blue);
    outline-offset: 2px;
  }
  .about-platform {
    color: var(--aether-blue);
    font-weight: 500;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }
  .about-handle {
    font-family: var(--font-mono);
    font-size: 12px;
    color: inherit;
  }
  .about-arrow {
    color: var(--text-faint);
    transition: color 0.18s, transform 0.18s;
  }
  .about-link:hover .about-arrow,
  .about-tool:hover .about-tool-arrow {
    color: var(--aether-blue);
    transform: translateX(2px);
  }
  .about-msg {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 2;
    text-align: center;
    font-style: italic;
    padding: 10px 4px 2px;
    letter-spacing: 0.03em;
  }
  .about-sep {
    margin: 20px 0;
    border: none;
    border-top: 1px dashed var(--border-subtle);
  }
  .about-tools {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .about-tool {
    grid-template-columns: 28px 1fr auto;
  }
  .about-tool-icon {
    font-size: 18px;
    text-align: center;
    user-select: none;
  }
  .about-tool-name {
    color: inherit;
    font-weight: 500;
    letter-spacing: 0.03em;
  }
  .about-tool-arrow {
    color: var(--text-faint);
    font-size: 14px;
  }
  .about-tool-current {
    cursor: default;
    border-color: var(--aether-gold);
    background: rgba(240, 213, 137, 0.08);
    color: var(--text-primary);
  }
  .about-tool-badge {
    font-size: 10px;
    color: var(--aether-gold);
    border: 1px solid var(--aether-gold);
    padding: 1px 6px;
    border-radius: 999px;
    letter-spacing: 0.08em;
  }

  /* ═══ Mobile block — 僅支援桌面 (≥1024px) ═══ */
  #mobile-block {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--bg-deep);
    color: var(--text-primary);
    text-align: center;
    padding: 32px;
    text-decoration: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    cursor: pointer;
  }
  #mobile-block.show { display: flex; }
  #mobile-block .block-icon {
    font-size: 56px;
    margin-bottom: 22px;
    line-height: 1;
  }
  #mobile-block h1 {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--aether-gold);
    margin-bottom: 14px;
    letter-spacing: 0.08em;
    font-weight: 500;
    text-transform: uppercase;
  }
  #mobile-block p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.9;
    margin: 0;
  }
  #mobile-block .block-hint {
    color: var(--text-faint);
    font-size: 12px;
    margin-top: 24px;
    letter-spacing: 0.05em;
  }