/* ============================================================
   完蛋！我被大模型包圍了！ v2.0 — 日系雜誌編輯美學 × 擬真瀏覽器
   徹底去 AI 味：實體紙感、硬邊印刷陰影、非對稱張力、透明去背立繪
   ============================================================ */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  --font-serif: 'Songti TC', 'Noto Serif TC', 'PMingLiU', Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --ink: #16161a;
  --paper: #f4efe6;
  --chrome-frame: #e3e6ec;
  --chrome-bar: #ffffff;
  --chrome-border: #d4d8e1;
  --text-main: #1d2129;
  --text-muted: #647084;
  --accent: #D97757;
  --accent-soft: rgba(217, 119, 87, 0.14);
  --surface-bg: #F8F5EE;
  --surface-card: #FFFFFF;
  --chat-bg: #FBF9F5;
  --bubble-ai-bg: #FFFFFF;
  --bubble-user-bg: #1d2129;
  --bubble-user-text: #FFFFFF;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.10);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  color: var(--text-main);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==================== 全新日系時尚雜誌開場畫面 ==================== */
.title-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--paper);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.editorial-paper-grain {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(22, 22, 26, 0.055) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
}

.editorial-bg-typo {
  position: absolute;
  bottom: -24px;
  left: -16px;
  font-family: var(--font-mono);
  font-size: clamp(90px, 14vw, 210px);
  font-weight: 900;
  letter-spacing: -0.05em;
  color: rgba(22, 22, 26, 0.038);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.editorial-layout {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1280px;
  height: 100%;
  max-height: 820px;
  padding: 36px 48px;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 36px;
  align-items: center;
}

.editorial-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.issue-strip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #52525b;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 6px;
}

.issue-pill {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
}

.issue-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hero-accent, #D97757);
}

.editorial-title {
  display: flex;
  flex-direction: column;
  font-size: clamp(40px, 5.2vw, 68px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.et-accent-block {
  display: inline-block;
  background: var(--hero-accent, #D97757);
  color: #ffffff;
  padding: 2px 14px 4px;
  margin-right: 6px;
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  transition: background 0.35s ease;
}

.editorial-lead {
  font-size: 15.5px;
  line-height: 1.75;
  color: #3f3f46;
  max-width: 540px;
}

.editorial-lead strong {
  color: var(--ink);
  font-family: var(--font-mono);
  background: #fde68a;
  padding: 1px 6px;
  border: 1.5px solid var(--ink);
}

/* 票據風統計條 */
.editorial-ticket {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2.5px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 12px 22px;
  gap: 22px;
}

.ticket-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ticket-label {
  font-size: 11px;
  font-weight: 700;
  color: #71717a;
  letter-spacing: 0.05em;
}

.ticket-val {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 900;
  color: var(--ink);
}

.ticket-divider {
  width: 1.5px;
  height: 30px;
  background: #d4d4d8;
}

/* 主按鈕組（硬邊印刷風） */
.editorial-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-ink-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 28px;
  background: var(--ink);
  color: #ffffff;
  font-size: 16.5px;
  font-weight: 900;
  border: 2.5px solid var(--ink);
  box-shadow: 5px 5px 0 var(--hero-accent, #D97757);
}

.btn-ink-primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--hero-accent, #D97757);
}

.btn-ink-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--hero-accent, #D97757);
}

.btn-ink-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: #ffffff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  border: 2.5px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.btn-ink-secondary:hover {
  background: #fef3c7;
  transform: translate(-2px, -2px);
}

.continue-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #71717a;
}

.editorial-sub-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-editorial-link {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.72);
  border: 1.5px solid var(--ink);
  color: var(--ink);
}

.btn-editorial-link:hover {
  background: var(--ink);
  color: #ffffff;
}

/* 底部 6 位 AI 娘切換頭像列 */
.hero-cast-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.hero-cast-btn {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  border: 2.5px solid var(--ink);
  background: #ffffff;
  overflow: hidden;
  padding: 2px;
  box-shadow: 3px 3px 0 rgba(22, 22, 26, 0.25);
}

.hero-cast-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 10px;
}

.hero-cast-btn.active {
  transform: translateY(-5px);
  border-color: var(--ink);
  background: var(--item-accent, #D97757);
  box-shadow: 4px 6px 0 var(--ink);
}

/* 右側巨幅透明立繪舞台 */
.editorial-right {
  position: relative;
  height: 100%;
  min-height: 540px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.showcase-backdrop-card {
  position: absolute;
  inset: 28px 18px 34px 36px;
  background: var(--hero-accent, #D97757);
  border: 3px solid var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
  overflow: hidden;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background 0.4s ease;
}

.showcase-top-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
}

.showcase-big-name {
  font-family: var(--font-mono);
  font-size: 82px;
  font-weight: 900;
  line-height: 0.9;
  color: rgba(255, 255, 255, 0.18);
  letter-spacing: -0.04em;
  user-select: none;
}

.hero-sprite-img {
  position: relative;
  z-index: 3;
  max-height: 98%;
  max-width: 96%;
  object-fit: contain;
  filter: drop-shadow(0 16px 26px rgba(22, 22, 26, 0.28));
  animation: heroFloat 4.2s ease-in-out infinite;
  transition: opacity 0.22s ease, transform 0.25s ease;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero-quote-card {
  position: absolute;
  z-index: 4;
  bottom: 12px;
  left: 0;
  right: 26px;
  background: #ffffff;
  border: 2.5px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 13px 16px;
}

.hq-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.hq-header strong {
  font-size: 16px;
  font-weight: 900;
  color: var(--ink);
}

.hq-header span {
  font-size: 12px;
  font-weight: 700;
  color: var(--hero-accent, #D97757);
}

.hero-quote-card p {
  font-size: 13.5px;
  line-height: 1.55;
  color: #3f3f46;
}

/* ==================== 擬真瀏覽器主外殼 ==================== */
.browser-shell {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-bg);
  transition: background 0.3s ease;
}

.browser-top-bar {
  height: 44px;
  background: var(--chrome-frame);
  display: flex;
  align-items: flex-end;
  padding: 0 12px;
  gap: 10px;
  user-select: none;
  flex-shrink: 0;
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  padding-right: 4px;
}

.win-dot { width: 12px; height: 12px; border-radius: 50%; cursor: pointer; }
.win-dot.red { background: #ff5f57; }
.win-dot.yellow { background: #febc2e; }
.win-dot.green { background: #28c840; }

.tab-strip {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  flex: 1;
  height: 36px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-strip::-webkit-scrollbar { display: none; }

.browser-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  min-width: 124px;
  max-width: 190px;
  flex: 1;
  border-radius: 10px 10px 0 0;
  background: rgba(255, 255, 255, 0.45);
  color: #4b5563;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.browser-tab:hover { background: rgba(255, 255, 255, 0.78); }
.browser-tab.active {
  background: var(--chrome-bar);
  color: var(--text-main);
  font-weight: 800;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.tab-avatar {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 1.5px solid var(--tab-color, #94a3b8);
  background: var(--surface-bg);
  flex-shrink: 0;
}

.tab-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; text-align: left; }

.tab-badge {
  font-size: 9.5px;
  font-family: var(--font-mono);
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}
.tab-badge.pro { background: #f59e0b; color: #fff; }
.tab-badge.free { background: rgba(100, 116, 139, 0.14); color: #64748b; }

.tab-alert-dot {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: tabPing 0.7s infinite alternate;
}
@keyframes tabPing { from { transform: scale(0.85); opacity: 0.8; } to { transform: scale(1.3); opacity: 1; } }

.browser-tab.jealous-shake {
  animation: tabShake 0.35s ease-in-out infinite;
  background: #fee2e2 !important;
  color: #b91c1c !important;
}
@keyframes tabShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }

.top-right-tools { display: flex; align-items: center; gap: 5px; height: 100%; }
.incognito-pill { padding: 4px 10px; border-radius: 999px; background: #1e293b; color: #f8fafc; font-size: 11px; font-weight: 700; }
.icon-tool-btn { height: 28px; padding: 0 8px; border-radius: 7px; font-size: 12px; font-weight: 700; color: #374151; background: rgba(255, 255, 255, 0.6); }
.icon-tool-btn:hover { background: #ffffff; }

.browser-address-bar {
  height: 48px;
  background: var(--chrome-bar);
  border-bottom: 1px solid var(--chrome-border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 12px;
  flex-shrink: 0;
}

.nav-arrows { display: flex; gap: 4px; }
.nav-btn { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #4b5563; }
.nav-btn:hover:not(.disabled) { background: rgba(0, 0, 0, 0.06); }
.nav-btn.disabled { opacity: 0.35; cursor: default; }

.omnibox {
  flex: 1;
  min-width: 210px;
  height: 32px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  font-size: 12.5px;
}

.url-text { font-family: var(--font-mono); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.tier-badge { font-family: var(--font-mono); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(100, 116, 139, 0.14); color: #475569; flex-shrink: 0; }
.tier-badge.is-pro { background: linear-gradient(135deg, #f59e0b, #ea580c); color: #ffffff; }

.hud-metrics { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hud-chip { height: 32px; padding: 0 11px; border-radius: 10px; background: rgba(15, 23, 42, 0.045); border: 1px solid rgba(15, 23, 42, 0.08); display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.time-slot-tag { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: rgba(245, 158, 11, 0.14); color: #b45309; font-weight: 700; }
.time-slot-tag.is-night { background: rgba(79, 70, 229, 0.15); color: #4338ca; }
.budget-chip { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.35); color: #065f46; }
.budget-chip:hover { background: rgba(16, 185, 129, 0.22); }
.budget-chip.overdraft { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.45); color: #b91c1c; }
.chip-action { font-size: 11px; font-weight: 700; opacity: 0.8; }
.mini-bar { width: 44px; height: 6px; border-radius: 999px; background: rgba(15, 23, 42, 0.12); overflow: hidden; }
.mini-bar-fill { height: 100%; background: linear-gradient(90deg, #10b981, #3b82f6); transition: width 0.35s ease; }
.token-chip { font-family: var(--font-mono); }
.chip-sub { font-size: 10.5px; color: var(--text-muted); }

/* ==================== 主雙欄視口 ==================== */
.viewport-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 390px 1fr;
  background: var(--surface-bg);
}

.character-stage {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
  border-right: 1px solid var(--chrome-border);
  background: var(--surface-bg);
  min-height: 0;
  overflow-y: auto;
}

.stage-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.char-identity { display: flex; align-items: center; gap: 10px; }
.char-brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); flex-shrink: 0; }
.char-identity h2 { font-size: 19px; font-weight: 900; line-height: 1.2; }
.char-identity p { font-size: 12px; color: var(--text-muted); }
.mood-pill { font-size: 11.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }

/* 無白底透明立繪專屬場景框！ */
.portrait-frame {
  position: relative;
  flex: 1;
  min-height: 300px;
  border-radius: 20px;
  border: 1.5px solid var(--chrome-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.scene-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  transition: background 0.4s ease;
}

.portrait-aura {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  transition: all 0.4s ease;
}

.stage-portrait {
  position: relative;
  z-index: 2;
  max-width: 96%;
  max-height: 98%;
  object-fit: contain;
  transform-origin: bottom center;
  filter: drop-shadow(0 12px 22px rgba(15, 23, 42, 0.22));
  animation: idleBreath 4.2s ease-in-out infinite;
  transition: filter 0.35s ease, transform 0.35s ease;
}

@keyframes idleBreath {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.012); }
}

.mood-fx-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.88);
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  padding: 4px 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  animation: popBadge 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes popBadge { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.portrait-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.overlay-badge {
  background: #111827;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 16px;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.floating-feedback-layer { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.float-delta {
  position: absolute; left: 50%; top: 42%; transform: translateX(-50%);
  font-size: 19px; font-weight: 900; padding: 6px 14px; border-radius: 999px;
  animation: floatUpFade 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  white-space: nowrap; box-shadow: 0 6px 20px rgba(0,0,0,0.16);
}
.float-delta.pos { background: #dcfce7; color: #15803d; }
.float-delta.neg { background: #fee2e2; color: #b91c1c; }
.float-delta.info { background: #e0e7ff; color: #3730a3; }
@keyframes floatUpFade {
  0% { opacity: 0; transform: translate(-50%, 16px) scale(0.85); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -56px) scale(0.95); }
}

.char-stats-card {
  background: var(--surface-card);
  border: 1px solid var(--chrome-border);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.stat-row { display: flex; flex-direction: column; gap: 4px; }
.stat-label-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }
.stat-label-row strong { color: var(--text-main); font-family: var(--font-mono); }
.progress-track { height: 7px; border-radius: 999px; background: rgba(15, 23, 42, 0.08); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.affection-fill { background: linear-gradient(90deg, #f43f5e, #ec4899); }
.quota-fill { background: linear-gradient(90deg, #10b981, #34d399); }
.context-fill { background: linear-gradient(90deg, #6366f1, #a855f7); }

.char-status-banner {
  display: flex; gap: 7px; align-items: flex-start;
  padding: 8px 10px; border-radius: 10px; background: var(--accent-soft);
  font-size: 11.5px; line-height: 1.45; color: var(--text-main);
}

.stage-quick-actions.three-cols {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr 0.95fr;
  gap: 6px;
  margin-top: 2px;
}

.btn-stage-sub { padding: 8px 6px; border-radius: 10px; font-size: 11.5px; font-weight: 800; background: var(--accent); color: #ffffff; }
.btn-stage-sub:hover { filter: brightness(1.08); }
.btn-stage-sub.is-subscribed { background: rgba(16, 185, 129, 0.14); color: #047857; border: 1px solid rgba(16, 185, 129, 0.35); }

.btn-stage-gift { padding: 8px 6px; border-radius: 10px; font-size: 11.5px; font-weight: 800; background: rgba(245, 158, 11, 0.15); color: #b45309; border: 1px solid rgba(245, 158, 11, 0.35); }
.btn-stage-gift:hover { background: rgba(245, 158, 11, 0.25); }

.btn-stage-prompt { padding: 8px 6px; border-radius: 10px; font-size: 11.5px; font-weight: 800; background: rgba(15, 23, 42, 0.07); color: var(--text-main); border: 1px solid rgba(15, 23, 42, 0.1); }
.btn-stage-prompt:hover { background: rgba(15, 23, 42, 0.14); }

/* ==================== 右側擬真 AI 聊天室 ==================== */
.chat-workspace { display: flex; flex-direction: column; min-height: 0; background: var(--chat-bg); }
.chat-topbar { height: 50px; padding: 0 20px; border-bottom: 1px solid var(--chrome-border); display: flex; align-items: center; justify-content: space-between; background: var(--surface-card); flex-shrink: 0; }
.model-selector { display: flex; align-items: center; gap: 9px; }
.model-name { font-size: 14.5px; font-weight: 800; }
.model-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.model-mode-desc { font-size: 12px; color: var(--text-muted); }
.chat-topbar-right { display: flex; align-items: center; gap: 8px; }

.btn-date-special {
  padding: 6px 13px; border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  color: #fff; font-size: 12px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}
.btn-date-special:hover { transform: translateY(-1px); filter: brightness(1.06); }

.btn-risk-mini { padding: 5px 11px; border-radius: 8px; font-size: 12px; font-weight: 700; background: rgba(244, 63, 94, 0.1); color: #e11d48; border: 1px solid rgba(244, 63, 94, 0.22); }
.btn-risk-mini:hover { background: rgba(244, 63, 94, 0.2); }

.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
.msg-row { display: flex; gap: 12px; max-width: 88%; animation: msgIn 0.24s ease-out; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.msg-row.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-row.system { align-self: center; max-width: 92%; }
.msg-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; object-position: top center; background: var(--surface-bg); border: 2px solid var(--accent); flex-shrink: 0; }
.msg-content-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.msg-sender-name { font-size: 11.5px; font-weight: 700; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.msg-bubble { padding: 13px 16px; border-radius: 16px; font-size: 14.5px; line-height: 1.68; white-space: pre-wrap; word-break: break-word; box-shadow: var(--shadow-sm); }
.msg-row.ai .msg-bubble { background: var(--bubble-ai-bg); border: 1px solid var(--chrome-border); border-top-left-radius: 4px; color: var(--text-main); }
.msg-row.user .msg-bubble { background: var(--bubble-user-bg); color: var(--bubble-user-text); border-top-right-radius: 4px; }
.msg-system-pill { padding: 7px 14px; border-radius: 999px; background: rgba(15, 23, 42, 0.06); color: var(--text-muted); font-size: 12px; font-weight: 700; text-align: center; }

.stream-cursor { display: inline-block; width: 8px; height: 16px; background: var(--accent); vertical-align: -2px; margin-left: 3px; border-radius: 2px; animation: blinkCursor 0.7s step-end infinite; }
@keyframes blinkCursor { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.think-box { background: rgba(100, 116, 139, 0.08); border: 1px solid rgba(100, 116, 139, 0.22); border-radius: 12px; overflow: hidden; font-size: 12.5px; }
.think-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; font-size: 12px; font-weight: 700; color: #475569; background: rgba(100, 116, 139, 0.06); }
.think-toggle:hover { background: rgba(100, 116, 139, 0.14); }
.think-peek-badge { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; background: rgba(77, 107, 254, 0.15); color: #3b5bdb; }
.think-body { padding: 10px 13px; color: #64748b; font-style: italic; line-height: 1.6; border-top: 1px dashed rgba(100, 116, 139, 0.2); background: rgba(255, 255, 255, 0.55); }

.msg-action-bar { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.msg-act-btn { font-size: 11.5px; padding: 4px 9px; border-radius: 7px; color: var(--text-muted); border: 1px solid transparent; display: inline-flex; align-items: center; gap: 4px; }
.msg-act-btn:hover:not(:disabled) { background: rgba(15, 23, 42, 0.06); color: var(--text-main); border-color: rgba(15, 23, 42, 0.08); }
.msg-act-btn.locked { color: #ef4444; background: rgba(239, 68, 68, 0.09); border-color: rgba(239, 68, 68, 0.25); cursor: not-allowed; }

.chat-control-dock { background: var(--surface-card); border-top: 1px solid var(--chrome-border); padding: 14px 20px 16px; display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.dock-header { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-muted); }
.clipboard-indicator { padding: 3px 9px; border-radius: 999px; background: rgba(245, 158, 11, 0.16); color: #b45309; font-weight: 700; }

.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.choice-btn { text-align: left; padding: 11px 14px; border-radius: 12px; background: var(--chat-bg); border: 1.5px solid var(--chrome-border); color: var(--text-main); font-size: 13.5px; font-weight: 600; line-height: 1.4; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.choice-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.choice-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.choice-tag { font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: rgba(15, 23, 42, 0.08); color: var(--text-muted); flex-shrink: 0; }
.choice-btn.is-pro-choice { border-color: rgba(245, 158, 11, 0.55); background: linear-gradient(135deg, rgba(245, 158, 11, 0.09), rgba(236, 72, 153, 0.06)); }

.free-prompt-bar { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); border: 1.5px solid var(--accent); }
.free-prompt-header { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.btn-text-close { font-size: 12px; color: var(--text-muted); text-decoration: underline; }
.free-prompt-input-wrap { display: flex; align-items: center; gap: 8px; background: #ffffff; border: 1.5px solid var(--chrome-border); border-radius: 12px; padding: 4px 6px 4px 12px; }
#free-prompt-input { flex: 1; border: none; outline: none; font-size: 14px; font-family: inherit; color: #111827; background: transparent; }
.char-counter { font-family: var(--font-mono); font-size: 11px; color: #64748b; }
.btn-send-prompt { padding: 8px 16px; border-radius: 9px; background: var(--accent); color: #ffffff; font-size: 13px; font-weight: 700; }
.prompt-hints { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-muted); }
.hint-chip { padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.85); border: 1px solid rgba(15, 23, 42, 0.1); color: #334155; font-size: 11px; font-weight: 600; }
.hint-chip:hover { background: #ffffff; border-color: var(--accent); color: var(--accent); }

/* 跨分頁吃瓜小劇場浮動氣泡 */
.banter-popup {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 420;
  width: 340px;
  background: #16161a;
  color: #f8fafc;
  border: 2px solid #f59e0b;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: slideUpIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes slideUpIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.banter-header { display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; background: rgba(245, 158, 11, 0.16); font-size: 12px; font-weight: 800; color: #fbbf24; }
.banter-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; line-height: 1.5; }
.banter-line { display: flex; gap: 8px; align-items: flex-start; }
.banter-line strong { color: #fbbf24; flex-shrink: 0; }

.toast-container { position: fixed; top: 102px; right: 20px; z-index: 900; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast-item { background: #111827; color: #f8fafc; padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 600; box-shadow: 0 10px 26px rgba(0,0,0,0.28); border-left: 4px solid var(--accent); animation: toastIn 0.25s ease-out; max-width: 340px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }

@media (max-width: 1020px) {
  .editorial-layout { grid-template-columns: 1fr; overflow-y: auto; padding: 24px; }
  .editorial-right { min-height: 400px; }
  .viewport-main { grid-template-columns: 310px 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
}
