/* ==========================================================================
   抖音口播脚本拆解与提词器工作台 - 核心样式表
   零外部依赖 · 纯原生 CSS · 现代暗黑视效 · 响应式适配
   ========================================================================== */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #121826;
  --bg-tertiary: #1b2336;
  --bg-card: #161e2e;
  --bg-card-hover: #1e283d;
  --bg-input: #0f1523;

  --border-color: #232d42;
  --border-focus: #3b82f6;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --color-cyan: #00f2fe;
  --color-douyin-red: #fe2c55;
  --color-accent: #38bdf8;
  --color-accent-hover: #0ea5e9;
  --color-warning: #f59e0b;
  --color-success: #10b981;
  --color-danger: #ef4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 15px rgba(0, 242, 254, 0.25);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   顶部导航栏
   ========================================================================== */
.app-header {
  background: rgba(18, 24, 38, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand-text .sub-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==========================================================================
   主工作区布局
   ========================================================================== */
.workbench-layout {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  flex: 1;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 面板小标题与编号 */
.panel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-cyan), var(--color-accent));
  color: #000;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-title h2,
.section-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==========================================================================
   按钮与交互控件
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

.btn-primary {
  background: linear-gradient(135deg, #00c6ff, #0072ff);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 198, 255, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1ad0ff, #1980ff);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 198, 255, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-accent {
  background: linear-gradient(135deg, #fe2c55, #ff5e7e);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(254, 44, 85, 0.3);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #ff4167, #ff718e);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(254, 44, 85, 0.45);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: #ef4444;
}

.btn-play {
  min-width: 125px;
}

.btn-active {
  background: #f59e0b !important;
  color: #000 !important;
  border-color: #d97706 !important;
}

.btn-icon {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--color-accent);
}

.select-input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  max-width: 240px;
}

.select-input:focus {
  border-color: var(--color-accent);
}

.sample-loader {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   脚本输入区与大文本框
   ========================================================================== */
.textarea-wrapper {
  position: relative;
  width: 100%;
}

.script-textarea {
  width: 100%;
  height: 250px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  padding: 16px 18px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.script-textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.script-textarea::placeholder {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ==========================================================================
   黄金钩子展示卡片
   ========================================================================== */
.hook-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  position: relative;
  overflow: hidden;
}

.hook-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--color-cyan), var(--color-douyin-red));
}

.hook-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.hook-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hook-icon {
  font-size: 1.15rem;
}

.hook-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-cyan);
}

.hook-badge {
  background: rgba(0, 242, 254, 0.12);
  color: var(--color-cyan);
  border: 1px solid rgba(0, 242, 254, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.hook-card-content {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.6;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-warning);
}

.hook-card-content.empty-hook {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 400;
  border-left-color: var(--text-muted);
}

.hook-card-tip {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   结构化分镜拆解区
   ========================================================================== */
.storyboard-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.storyboard-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.storyboard-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sb-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.empty-state {
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: 0.7;
}

.empty-state p {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-state span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.storyboard-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.storyboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.storyboard-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.sb-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.sb-badge {
  background: rgba(56, 189, 248, 0.15);
  color: var(--color-accent);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

.sb-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sb-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.sb-tag.sb-time {
  color: var(--color-warning);
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.1);
}

.sb-card-body {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==========================================================================
   右栏：数据看板
   ========================================================================== */
.dashboard-stats-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.stat-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.stat-box.stat-highlight {
  border-color: rgba(0, 242, 254, 0.4);
  background: linear-gradient(145deg, rgba(0, 242, 254, 0.1), rgba(18, 24, 38, 0.6));
}

.stat-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value-group {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.stat-num {
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
  letter-spacing: -0.03em;
}

.stat-highlight .stat-num {
  color: var(--color-cyan);
}

.stat-unit {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   语速切换选择器
   ========================================================================== */
.speed-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.label-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.speed-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.speed-radio-label {
  cursor: pointer;
  position: relative;
}

.speed-radio-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-custom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s;
  height: 100%;
}

.speed-val {
  font-size: 0.92rem;
  color: var(--text-primary);
  font-weight: 700;
}

.speed-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.speed-radio-label input:checked + .radio-custom {
  border-color: var(--color-accent);
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.speed-radio-label input:checked + .radio-custom .speed-val {
  color: var(--color-accent);
}

.speed-radio-label input:focus-visible + .radio-custom {
  outline: 3px solid var(--color-cyan);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.4);
}

/* ==========================================================================
   提词器播放控制器卡片
   ========================================================================== */
.teleprompter-controls-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.controls-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sliders-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.slider-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.slider-value-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--color-accent);
}

.custom-slider {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.custom-slider:focus-visible,
.fs-slider:focus-visible {
  outline: 3px solid var(--color-cyan);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.4);
}

.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
  cursor: pointer;
  transition: transform 0.15s;
}

.custom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.18);
}

/* 翻转开关与主控集群 */
.controls-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.toggle-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.switch-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-ui {
  width: 40px;
  height: 22px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}

.switch-ui::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch-checkbox:checked + .switch-ui {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.switch-checkbox:checked + .switch-ui::after {
  transform: translateX(18px);
}

.switch-checkbox:focus-visible + .switch-ui,
.fs-mirror-label input:focus-visible {
  outline: 3px solid var(--color-cyan);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.4);
}

.switch-text {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.teleprompter-btn-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   提词器预览视窗
   ========================================================================== */
.teleprompter-box {
  background: #000000;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  height: 480px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

/* 视线瞄准参考线 */
.focus-guideline {
  position: absolute;
  top: 36%;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 10;
  opacity: 0.85;
}

.guideline-line {
  flex: 1;
  border-top: 1px dashed rgba(245, 158, 11, 0.65);
}

.guideline-marker {
  color: var(--color-warning);
  font-size: 0.85rem;
  padding: 0 6px;
}

/* 滚动容器 */
.teleprompter-scroll-container {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: auto;
  padding: 0 32px;
}

/* 隐藏默认滚动条但允许滚动 */
.teleprompter-scroll-container::-webkit-scrollbar {
  width: 6px;
}
.teleprompter-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.scroll-padding-top {
  height: 160px;
}

.scroll-padding-bottom {
  height: 380px;
}

.teleprompter-text-content {
  color: #ffffff;
  font-weight: 600;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: center;
  transition: transform 0.2s ease-out;
}

/* 镜像水平翻转 */
.teleprompter-text-content.mirrored {
  transform: scaleX(-1);
}

.teleprompter-empty {
  color: #4b5563;
  font-size: 1.1rem;
  font-weight: normal;
  padding-top: 60px;
}

/* 黄金钩子高亮字样 */
.hook-highlight-word {
  color: #fef08a;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.5);
  border-bottom: 2px solid #facc15;
  padding-bottom: 2px;
}

/* ==========================================================================
   全屏提词器模式
   ========================================================================== */
.fs-floating-bar {
  display: none;
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  z-index: 100;
  background: rgba(18, 24, 38, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 10px 18px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  opacity: 0.95;
  transition: opacity 0.3s;
}

.fs-floating-bar:hover {
  opacity: 1;
}

.fs-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fs-tag {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.fs-status-pill {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.btn-active + .fs-status-pill,
.fs-status-pill.active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--color-success);
}

.fs-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.fs-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fs-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.fs-slider {
  width: 90px;
  height: 4px;
}

.fs-mirror-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* 全屏激活态样式 */
.teleprompter-box.fullscreen-mode {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  border-radius: 0 !important;
  border: none !important;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.teleprompter-box.fullscreen-mode .fs-floating-bar {
  display: flex !important;
}

.teleprompter-box.fullscreen-mode .scroll-padding-top {
  height: 25vh;
}

.teleprompter-box.fullscreen-mode .scroll-padding-bottom {
  height: 70vh;
}

.teleprompter-box.fullscreen-mode .focus-guideline {
  top: 40%;
}

/* ==========================================================================
   Toast 浮动提示组件
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100000;
  pointer-events: none;
}

.toast-item {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s, transform 0.3s;
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
  border-left: 4px solid var(--color-success);
}

.toast-info {
  border-color: rgba(56, 189, 248, 0.4);
  border-left: 4px solid var(--color-accent);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
  border-left: 4px solid var(--color-danger);
}

.toast-item.fade-out {
  opacity: 0;
  transform: translateY(10px);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   响应式适配（手机与平板）
   ========================================================================== */
@media (max-width: 1024px) {
  .workbench-layout {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 20px;
  }

  .dashboard-stats-card {
    grid-template-columns: repeat(2, 1fr);
  }

  .teleprompter-box {
    height: 400px;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 12px 16px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 6px;
    font-size: 0.75rem;
  }

  .speed-selector {
    grid-template-columns: 1fr;
  }

  .sliders-grid {
    grid-template-columns: 1fr;
  }

  .controls-action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .teleprompter-btn-cluster {
    width: 100%;
  }

  .teleprompter-btn-cluster .btn {
    flex: 1;
  }

  /* 移动端全屏控制区：仅隐藏字号/速度/镜像调节项，保留播放/暂停、回到顶部、退出全屏按钮并适配安全区 */
  .fs-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .fs-controls .fs-slider-wrap,
  .fs-controls .fs-mirror-label {
    display: none;
  }

  .fs-floating-bar {
    top: 10px;
    left: 10px;
    right: 10px;
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
    flex-wrap: wrap;
  }

  .teleprompter-box.fullscreen-mode {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .teleprompter-box.fullscreen-mode .fs-floating-bar {
    justify-content: space-between;
  }
}

/* ==========================================================================
   减弱动画模式适配 (prefers-reduced-motion)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .teleprompter-text-content {
    transition: none !important;
  }

  .toast-item {
    animation: none !important;
    transition: none !important;
  }

  .btn-primary:hover,
  .btn-accent:hover,
  .custom-slider::-webkit-slider-thumb:hover {
    transform: none !important;
  }
}
