.subtitle-practice-modes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding: 8px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.subtitle-practice-modes button {
  min-width: 0;
  min-height: 36px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.subtitle-practice-modes button:hover,
.subtitle-practice-modes button:focus-visible {
  border-color: var(--line-warm);
  color: var(--text);
  outline: none;
}

.subtitle-practice-modes button.active {
  border-color: rgba(255, 114, 0, 0.24);
  background: rgba(255, 114, 0, 0.12);
  color: var(--orange);
}

.follow-along-panel {
  grid-column: 1 / -1;
  grid-row: 3;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin-top: 4px;
  padding: 9px 0 0;
  border-top: 1px solid var(--line);
  overflow: visible;
  color: var(--text);
}

.follow-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.follow-card-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.follow-card-title > span {
  color: var(--orange);
  font-size: 12px;
}

.follow-help-toggle {
  position: relative;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.follow-help-toggle::before {
  position: absolute;
  inset: -10px;
  content: "";
}

.follow-help-toggle:hover,
.follow-help-toggle:focus-visible,
.follow-help-toggle[aria-expanded="true"] {
  border-color: var(--orange);
  color: var(--orange);
  outline: none;
}

.follow-help-content {
  margin: 5px 0 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.follow-help-content p {
  margin: 0;
}

.follow-help-content p + p {
  margin-top: 3px;
}

.follow-model-note,
.follow-phase-note,
.follow-save-note {
  margin: 4px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.follow-model-note-consent {
  padding: 7px 9px;
  border: 1px solid rgba(255, 114, 0, 0.2);
  border-radius: 8px;
  background: rgba(255, 114, 0, 0.07);
  color: var(--text);
}

.follow-model-progress {
  height: 2px;
  overflow: hidden;
  margin: 0 0 4px;
  border-radius: 999px;
  background: var(--line);
}

.follow-model-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--orange);
  transition: width 0.2s ease;
}

.follow-model-progress.is-loading span {
  min-width: 18%;
  animation: follow-progress 1.2s ease-in-out infinite alternate;
}

@keyframes follow-progress {
  from { transform: translateX(-15%); opacity: 0.7; }
  to { transform: translateX(420%); opacity: 1; }
}

.follow-processing-progress {
  height: 5px;
  overflow: hidden;
  margin: 7px 0 6px;
  border-radius: 999px;
  background: var(--line);
}

.follow-processing-progress span {
  display: block;
  width: 30%;
  height: 100%;
  border-radius: inherit;
  background: var(--orange);
  animation: follow-progress 1.2s ease-in-out infinite;
}

.follow-processing-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.follow-processing-spinner {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid rgba(255, 114, 0, 0.22);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: follow-spin 0.9s linear infinite;
}

.follow-processing-stages {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.follow-processing-stage.is-current {
  color: var(--orange);
  font-weight: 800;
}

.follow-processing-stage.is-complete {
  color: var(--muted);
}

.follow-unrecognized-text {
  color: var(--muted);
  font-weight: 600;
}

@keyframes follow-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .follow-processing-progress,
  .follow-processing-spinner {
    display: none;
  }
}

.follow-reference-text {
  margin: 3px 0 7px;
  font-size: calc(var(--tune-subtitle-en-size) * var(--subtitle-size-factor));
  font-weight: 650;
  line-height: var(--tune-subtitle-en-line);
  overflow-wrap: anywhere;
}

.follow-recognition-line {
  display: block;
  min-width: 0;
  color: var(--text);
  font-size: calc(var(--tune-subtitle-en-size) * var(--subtitle-size-factor));
  font-weight: 650;
  line-height: var(--tune-subtitle-en-line);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.follow-recognition-line-panel {
  margin: 2px 0 6px;
}

.follow-recognition-label {
  display: inline-flex;
  align-items: center;
  margin-right: 0.42em;
  padding: 0.12em 0.42em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.58em;
  font-weight: 800;
  line-height: 1.35;
  vertical-align: 0.14em;
  white-space: nowrap;
}

.follow-word-mismatch {
  color: #e5484d;
}

.follow-word-extra {
  text-decoration: underline;
  text-decoration-color: #e5484d;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.follow-word-omission {
  display: inline-block;
  width: 0.56em;
  height: 2px;
  margin: 0 0.12em 0.12em;
  border-radius: 999px;
  background: #e5484d;
  vertical-align: baseline;
}

.follow-phase-note {
  margin-top: 3px;
}

.follow-save-note {
  color: var(--orange);
}

.follow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
}

.follow-button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--orange);
  border-radius: 12px;
  background: var(--orange);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.follow-button-secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.follow-button-recording {
  border-color: #d9313e;
  background: #d9313e;
}

.follow-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.follow-empty-state {
  padding: 18px 4px;
  color: var(--muted);
  font-size: 14px;
}

.cloze-hidden {
  color: transparent !important;
  text-shadow: none !important;
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  cursor: pointer;
  user-select: none;
}

.cloze-revealed {
  border-radius: 3px;
  background: rgba(255, 114, 0, 0.1);
}

@media (max-width: 820px) {
  body[data-view="watch"] .subtitle-practice-modes {
    position: relative;
    z-index: 4;
    gap: 4px;
    padding: 5px clamp(4px, 1.6vw, 8px) 7px;
    background: var(--panel);
  }

  body[data-view="watch"] .subtitle-practice-modes button {
    min-height: 34px;
    padding: 0 3px;
    font-size: clamp(12px, 3.5vw, 14px);
  }

  html[data-font-platform="windows"] body[data-view="watch"] .subtitle-practice-modes button {
    font-family: inherit;
    font-size: clamp(14px, 4.1vw, 15px);
    font-weight: 400;
  }

  body[data-view="watch"] .subtitle-row.follow-active .subtitle-copy {
    row-gap: 4px;
  }

  body[data-view="watch"] .subtitle-copy .follow-recognition-line {
    font-size: clamp(18px, 5.1vw, 19px);
    font-weight: 600;
    line-height: 1.21;
  }

  body[data-view="watch"] .follow-reference-text,
  body[data-view="watch"] .follow-recognition-line-panel {
    font-size: clamp(18px, 5.1vw, 19px);
    font-weight: 600;
    line-height: 1.21;
  }

  body[data-view="watch"] .follow-actions .follow-button {
    min-height: 40px;
  }

  body[data-view="watch"] .follow-processing-stages {
    gap: 4px;
    font-size: clamp(9px, 2.7vw, 11px);
  }
}

@media (min-width: 821px) {
  body[data-view="watch"] .subtitle-practice-modes {
    position: relative;
    top: auto;
    z-index: 3;
    flex: 0 0 auto;
    padding: 6px 18px 8px;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
  }

  body[data-view="watch"] .subtitle-practice-modes button {
    min-height: 34px;
    border-radius: 12px;
    font-size: clamp(15px, 1.2vw, 19px);
  }

  html[data-font-platform="windows"] body[data-view="watch"] .subtitle-practice-modes button {
    font-family: inherit;
    font-size: clamp(15px, calc(13.5px + 0.14vw), 17px);
    font-weight: 400;
  }

  body[data-view="watch"] .subtitle-copy .follow-recognition-line {
    font-size: calc(15px * var(--subtitle-size-factor));
  }

  body[data-view="watch"] .follow-reference-text,
  body[data-view="watch"] .follow-recognition-line-panel {
    font-size: calc(15px * var(--subtitle-size-factor));
  }

  body[data-view="watch"] .learning-panel {
    position: relative;
  }

  body[data-view="watch"] .desktop-study-drawer {
    position: absolute;
    z-index: 8;
    right: 12px;
    bottom: 62px;
    left: 12px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transform-origin: bottom center;
    transition: opacity 160ms ease, transform 160ms ease, visibility 0s linear 160ms;
  }

  body[data-view="watch"] .desktop-study-drawer.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
  }

  body[data-view="watch"] .desktop-study-drawer-surface {
    position: relative;
    padding: 12px 14px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-strong);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(16px);
  }

  body[data-view="watch"] .desktop-study-drawer .tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    min-height: 48px;
    padding: 0 28px 0 0;
    border: 0;
    background: transparent;
  }

  body[data-view="watch"] .desktop-study-drawer .tab {
    min-width: 0;
    min-height: 42px;
    gap: 6px;
    padding: 5px 7px;
    border-color: var(--line);
    border-radius: 10px;
    background: var(--surface);
    font-size: 13px;
  }

  body[data-view="watch"] .desktop-study-drawer .tab.active {
    border-color: rgba(255, 114, 0, 0.34);
    background: rgba(255, 114, 0, 0.1);
  }

  body[data-view="watch"] .desktop-study-drawer .tab > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body[data-view="watch"] .desktop-study-drawer .tab em {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
  }

  body[data-view="watch"] .desktop-study-drawer .tab svg {
    width: 14px;
    flex: 0 0 14px;
  }

  body[data-view="watch"] .desktop-study-drawer .subtitle-panel-tools {
    position: absolute;
    top: 16px;
    right: 15px;
    z-index: 2;
    width: 20px;
    height: 20px;
  }

  body[data-view="watch"] .desktop-study-drawer .subtitle-panel-tools .study-marker-help {
    margin: 0;
  }

  body[data-view="watch"] .desktop-study-bottom-bar {
    z-index: 5;
    flex: 0 0 auto;
    padding: 8px 12px 9px;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  }

  body[data-view="watch"] #desktopStudyToggleBtn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    text-align: left;
    transition: border-color 160ms ease, background-color 160ms ease;
  }

  body[data-view="watch"] #desktopStudyToggleBtn:hover,
  body[data-view="watch"] #desktopStudyToggleBtn:focus-visible,
  body[data-view="watch"] #desktopStudyToggleBtn[aria-expanded="true"] {
    border-color: rgba(255, 114, 0, 0.4);
    background: rgba(255, 114, 0, 0.07);
    outline: none;
  }

  body[data-view="watch"] .desktop-study-current {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
  }

  body[data-view="watch"] .desktop-study-current::before {
    content: "学习内容";
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }

  body[data-view="watch"] .desktop-study-current > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-view="watch"] .desktop-study-current svg {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body[data-view="watch"] .desktop-study-current em {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 114, 0, 0.12);
    color: var(--orange);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
  }

  body[data-view="watch"] .desktop-study-chevron {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform: rotate(180deg);
    transition: transform 160ms ease;
  }

  body[data-view="watch"] #desktopStudyToggleBtn[aria-expanded="true"] .desktop-study-chevron {
    transform: rotate(0);
  }
}

@media (max-width: 820px) {
  body[data-view="watch"] .desktop-study-drawer {
    display: contents;
  }

  body[data-view="watch"] .desktop-study-bottom-bar {
    display: none !important;
  }
}
