/* S-Class 触屏教学标注 / 白板 — 全屏书写层 */
:root {
  --sclass-draw-fab-size: 52px;
  --sclass-draw-toolbar-h: 56px;
  --sclass-draw-accent: #e53935;
  --sclass-draw-accent-dark: #c62828;
}

/* ── 入口按钮（两个 FAB） ── */
.sclass-draw-fabs {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 99970;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.sclass-draw-fabs.is-hidden {
  display: none;
}

.sclass-draw-fab {
  pointer-events: auto;
  width: var(--sclass-draw-fab-size);
  height: var(--sclass-draw-fab-size);
  border: none;
  border-radius: 50%;
  background: var(--sclass-draw-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: transform 0.15s, background 0.15s;
}

.sclass-draw-fab:hover,
.sclass-draw-fab:focus-visible {
  background: var(--sclass-draw-accent-dark);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.sclass-draw-fab:active {
  transform: scale(0.94);
}

.sclass-draw-fab--whiteboard {
  background: #455a64;
}

.sclass-draw-fab--whiteboard:hover,
.sclass-draw-fab--whiteboard:focus-visible {
  background: #37474f;
}

/* ── 全屏书写层 ── */
.sclass-draw-root {
  position: fixed;
  inset: 0;
  z-index: 99980;
  display: none;
  touch-action: none;
}

.sclass-draw-root.is-active {
  display: block;
}

.sclass-draw-root.is-annotate {
  pointer-events: none;
}

.sclass-draw-root.is-annotate .sclass-draw-canvas {
  pointer-events: auto;
}

.sclass-draw-whiteboard-bg {
  position: absolute;
  inset: 0;
  background: #ffffff;
  display: none;
}

.sclass-draw-root.is-whiteboard .sclass-draw-whiteboard-bg {
  display: block;
}

.sclass-draw-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

/* ── 工具栏 ── */
.sclass-draw-toolbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99990;
  display: none;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(33, 33, 33, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
}

.sclass-draw-root.is-active .sclass-draw-toolbar {
  display: flex;
}

.sclass-draw-toolbar button {
  min-width: 64px;
  min-height: 44px;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background 0.12s;
}

.sclass-draw-toolbar button:hover,
.sclass-draw-toolbar button:focus-visible {
  background: rgba(255, 255, 255, 0.26);
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 1px;
}

.sclass-draw-toolbar button:active {
  background: rgba(255, 255, 255, 0.36);
}

.sclass-draw-toolbar button.is-primary {
  background: var(--sclass-draw-accent);
}

.sclass-draw-toolbar button.is-primary:hover,
.sclass-draw-toolbar button.is-primary:focus-visible {
  background: var(--sclass-draw-accent-dark);
}

.sclass-draw-toolbar button.is-exit {
  background: #546e7a;
}

.sclass-draw-toolbar button.is-exit:hover,
.sclass-draw-toolbar button.is-exit:focus-visible {
  background: #455a64;
}

.sclass-draw-toolbar .sclass-draw-sep {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.25);
  margin: 0 2px;
}

/* ── 文字提示（隐藏句 → 点词揭开） ── */
.sclass-draw-hint {
  position: fixed;
  left: 50%;
  top: max(12px, env(safe-area-inset-top, 0px));
  transform: translateX(-50%);
  z-index: 99985;
  width: min(920px, calc(100vw - 24px));
  max-height: min(48vh, 320px);
  overflow: auto;
  pointer-events: auto;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(229, 57, 53, 0.35);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  padding: 10px 12px 12px;
  color: #1a237e;
  font-family: system-ui, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.sclass-draw-root.is-annotate .sclass-draw-hint {
  background: rgba(18, 24, 38, 0.92);
  color: #eceff1;
  border-color: rgba(255, 213, 79, 0.45);
}

.sclass-draw-hint__unlock {
  display: block;
  width: 100%;
  border: 2px dashed rgba(229, 57, 53, 0.45);
  border-radius: 10px;
  background: rgba(229, 57, 53, 0.06);
  padding: 16px 12px;
  cursor: pointer;
  position: relative;
  min-height: 64px;
  touch-action: manipulation;
}

.sclass-draw-root.is-annotate .sclass-draw-hint__unlock {
  border-color: rgba(255, 213, 79, 0.4);
  background: rgba(0, 0, 0, 0.25);
}

.sclass-draw-hint__unlock-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #c62828;
  text-align: center;
  position: relative;
  z-index: 1;
}

.sclass-draw-root.is-annotate .sclass-draw-hint__unlock-label {
  color: #ffd54f;
}

.sclass-draw-hint__unlock-preview {
  display: block;
  margin-top: 6px;
  font-size: 1.05rem;
  line-height: 1.45;
  filter: blur(11px);
  opacity: 0.22;
  user-select: none;
  pointer-events: none;
  text-align: center;
}

.sclass-draw-hint__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.sclass-draw-hint__title {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.85;
  margin-right: auto;
}

.sclass-draw-hint__all,
.sclass-draw-hint__reset {
  border: none;
  border-radius: 8px;
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  background: #e53935;
  color: #fff;
}

.sclass-draw-hint__reset {
  background: #607d8b;
}

.sclass-draw-hint__words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.sclass-draw-hint__word {
  border: 2px solid rgba(26, 35, 126, 0.22);
  border-radius: 10px;
  background: #f5f7ff;
  min-height: 42px;
  padding: 6px 12px;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 700;
  color: #1a237e;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.sclass-draw-root.is-annotate .sclass-draw-hint__word {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 213, 79, 0.35);
  color: #fff8e1;
}

.sclass-draw-hint__word:not(.is-shown):hover,
.sclass-draw-hint__word:not(.is-shown):focus-visible {
  border-color: #e53935;
  outline: none;
}

.sclass-draw-hint__word.is-shown {
  cursor: default;
  background: #e8f5e9;
  border-color: #66bb6a;
  color: #1b5e20;
}

.sclass-draw-root.is-annotate .sclass-draw-hint__word.is-shown {
  background: rgba(105, 240, 174, 0.18);
  border-color: rgba(105, 240, 174, 0.55);
  color: #b9f6ca;
}

.sclass-draw-hint__word-mask {
  letter-spacing: 0.08em;
  opacity: 0.55;
  font-weight: 600;
}

.sclass-draw-hint__word-text {
  font-family: "Patrick Hand", "Segoe UI", cursive, sans-serif;
}

/* 书写时禁止页面滚动 */
html.sclass-draw-active,
html.sclass-draw-active body {
  overflow: hidden !important;
}
