/* ============================================================
   Scribble — base tokens & reset
   主題色：明亮藍綠 teal #22d3b8（取代原本的橘色）
============================================================ */
:root {
  --bg-0: #0a0b0e;
  --bg-1: #121419;
  --bg-2: #1a1d24;
  --bg-3: #232730;
  --line: #2a2e38;
  --line-2: #353a47;
  --text-0: #e8ebf0;
  --text-1: #9ca3af;
  --text-2: #5b6271;

  /* 主題色：明亮藍綠 */
  --accent: #22d3b8;
  --accent-soft: rgba(34, 211, 184, 0.12);
  --accent-glow: rgba(34, 211, 184, 0.5);
  --accent-hover: #4ee0c8;
  --accent-deep: #0f3d36;       /* primary 按鈕上的文字色 */

  /* 副色：保留 cyan 作為輔助強調 */
  --accent-2: #38bdf8;

  --ok: #4ade80;
  --warn: #f59e0b;
  --err: #f87171;

  --font: 'Inter', 'Noto Sans TC', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: var(--bg-0);
  color: var(--text-0);
  font: 13px/1.4 var(--font);
  overflow: hidden;
  user-select: none;
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font: inherit; }

/* 共用元件 */
.icon-btn {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 3px; color: var(--text-1);
  transition: background 0.12s, color 0.12s;
}
.icon-btn:hover { background: var(--bg-3); color: var(--text-0); }

.btn { padding: 7px 14px; border-radius: 3px; font-size: 12px; transition: all 0.12s; }
.btn.sec { background: var(--bg-3); color: var(--text-1); }
.btn.sec:hover { background: var(--line-2); color: var(--text-0); }
.btn.pri { background: var(--accent); color: var(--accent-deep); font-weight: 600; }
.btn.pri:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 自動儲存狀態 */
.save-status {
  font-size: 10px; font-family: var(--mono); color: var(--text-2);
  padding: 3px 8px; border-radius: 10px; background: var(--bg-2);
  border: 1px solid var(--line);
}
.save-status .dot {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-2); margin-right: 5px; vertical-align: middle;
}
.save-status.saving .dot { background: var(--warn); animation: pulse 0.8s infinite; }
.save-status.saved .dot { background: var(--ok); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Hint toast */
.hint {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  background: var(--bg-2); border: 1px solid var(--line-2);
  padding: 8px 14px; border-radius: 18px;
  font-size: 11px; color: var(--text-1);
  z-index: 300; opacity: 0; pointer-events: none; transition: opacity 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4); max-width: 80vw;
}
.hint.on { opacity: 1; }
.hint kbd { font-family: var(--mono); background: var(--bg-3); padding: 1px 5px; border-radius: 2px; font-size: 10px; color: var(--accent); }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-2); }

/* Auto-keyframe 模式指示器（紅色錄製感，AE 同款） */
.rec-indicator {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10px;
  padding: 3px 9px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
}
.rec-indicator:hover { border-color: var(--line-2); color: var(--text-1); }
.rec-indicator .rec-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-2);
}
.rec-indicator.on {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--err);
}
.rec-indicator.on .rec-dot {
  background: var(--err);
  box-shadow: 0 0 6px var(--err);
  animation: pulse 1.4s infinite;
}
