/* Eastudy V4 — 组件样式唯一入口。原始色板和语义颜色位于 themes-12.css，几何与字体位于 tokens.css。组件按功能组织，响应式集中在末尾。 */

/* ============================================================ 基础 */

*{
  box-sizing: border-box;
}

*::before{
  box-sizing: border-box;
}

*::after{
  box-sizing: border-box;
}

html{
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body{
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1{
  margin: 0;
  font-weight: 600;
  line-height: var(--leading-tight);
}

h2{
  margin: 0;
  font-weight: 600;
  line-height: var(--leading-tight);
}

h3{
  margin: 0;
  font-weight: 600;
  line-height: var(--leading-tight);
}

h4{
  margin: 0;
  font-weight: 600;
  line-height: var(--leading-tight);
}

p{
  margin: 0;
}

ul{
  margin: 0;
  padding: 0;
  list-style: none;
}

ol{
  margin: 0;
  padding: 0;
  list-style: none;
}

a{
  color: var(--link);
  text-decoration: none;
}

a:hover{
  text-decoration: underline;
}

code{
  font-family: var(--font-mono);
  font-size: 0.92em;
}

kbd{
  font-family: var(--font-mono);
  font-size: 0.92em;
}

:focus-visible{
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.visually-hidden{
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.boot{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 60vh;
  color: var(--fg-muted);
}

.boot__logo{
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: var(--brand-accent);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
}

.boot__text{
  font-size: var(--text-sm);
}

.fatal{
  max-width: 480px;
  margin: 18vh auto;
  padding: var(--space-6);
  text-align: center;
}

.fatal h1{
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.fatal p{
  color: var(--fg-muted);
  margin-bottom: var(--space-4);
}

.code{
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 2px 6px;
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
}

.dashboard{
  gap: var(--space-5);
}

.toolbar{
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}

.row-actions{
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.stat-row{
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.stat{
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 110px;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.stat__value{
  font-size: var(--text-xl);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stat__label{
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

.stat.is-danger .stat__value{
  color: var(--danger);
}

.word-token{
  border-radius: var(--radius-sm);
  padding: 0 1px;
  cursor: default;
}

.word-token.is-key{
  color: var(--teach-key-fg);
  background: var(--teach-key-bg);
  cursor: pointer;
}

.word-token.level-1{
  color: var(--teach-level1-fg);
}

.word-token.level-2{
  color: var(--teach-level2-fg);
}

.word-token.is-active{
  color: var(--teach-word-active-fg);
  background: var(--teach-word-active-bg);
  box-shadow: inset 0 -2px 0 var(--teach-word-active-underline);
}

.invite-row{
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
}

/* ============================================================ 表单 */

.input{
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease);
}

.input:hover{
  border-color: var(--border-hover);
}

.input:focus{
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.input:disabled{
  background: var(--surface-sunken);
  color: var(--fg-subtle);
  cursor: not-allowed;
}

.input--search{
  padding-left: 34px;
  background: var(--search-bg);
}

.input--compact{
  width: auto;
  min-width: 120px;
}

.input--time{
  width: 92px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.input--sentence{
  font-family: var(--font-sans);
  resize: vertical;
}

.field{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-3);
}

.field__label{
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--fg);
}

.field__req{
  color: var(--danger);
  margin-left: 2px;
}

.field__hint{
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

.field__error{
  font-size: var(--text-xs);
  color: var(--danger);
}

.field--inline{
  flex-direction: row;
  align-items: center;
}

.field__check{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  cursor: pointer;
}

.checkbox{
  width: 16px;
  height: 16px;
  flex: none;
  margin: 0;
  accent-color: var(--brand-accent);
  cursor: pointer;
}

.checkbox:disabled{
  cursor: not-allowed;
}

.form-row{
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.form-grid{
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.form-grid .field{
  margin-bottom: 0;
}

.field-row{
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.field-row .field{
  margin-bottom: var(--space-3);
}

.toolbar .input--search{
  flex: 1;
  min-width: 200px;
  max-width: 420px;
}

.invite-row .field{
  flex: 1;
  margin-bottom: 0;
}

/* ============================================================ 配色面板 */

.theme-panel{
  display: block;
}

.theme-panel__hint{
  margin: 0 0 var(--space-4);
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.theme-grid{
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.theme-card{
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.theme-card.is-current{
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 1px var(--brand-accent);
}

.theme-card__head{
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.theme-card__name{
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--fg);
}

.theme-card__note{
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

.theme-card__pair{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.theme-chip{
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  font: inherit;
  background: none;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.theme-chip:hover{
  background: var(--surface-hover);
}

.theme-chip:focus-visible{
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.theme-chip.is-active{
  border-color: var(--brand-accent);
  background: var(--brand-soft);
}

.theme-chip__swatch{
  position: relative;
  display: block;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.theme-chip__card{
  position: absolute;
  left: 6px;
  top: 6px;
  width: 46%;
  height: calc(100% - 12px);
  border-radius: 4px;
}

.theme-chip__dot{
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.theme-chip__dot--alt{
  right: 25px;
}

.theme-chip__label{
  font-size: var(--text-xs);
  color: var(--fg-muted);
  text-align: center;
}

.theme-chip.is-active .theme-chip__label{
  color: var(--fg);
  font-weight: 600;
}

/* ============================================================ 按钮／标签／徽章 */

.chip{
  display: inline-flex;
  align-items: center;
  color: var(--fg-muted);
  background: var(--surface-sunken);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 12px;
}

.chip--ok{
  color: var(--success-fg);
  background: var(--success-bg);
}

.chip--muted{
  color: var(--fg-subtle);
}

.chip--level{
  color: var(--level-fg);
  background: var(--level-bg);
  font-weight: 600;
}

.chip--tag{
  color: var(--tag-fg);
  background: var(--tag-bg);
}

.badge{
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.badge--neutral{
  color: var(--fg-muted);
  background: var(--surface-sunken);
}

.badge--ok{
  color: var(--success-fg);
  background: var(--success-bg);
}

.badge--warn{
  color: var(--warn-fg);
  background: var(--warn-bg);
}

.badge--danger{
  color: var(--danger-fg);
  background: var(--danger-bg);
}

.badge--busy{
  color: var(--info-fg);
  background: var(--info-bg);
}

.badge--muted{
  color: var(--fg-subtle);
  background: var(--surface-sunken);
}

.page--notfound .btn{
  margin-top: var(--space-3);
}

/* ============================================================ 卡片 */

.card{
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.card__title{
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--text-lg);
}

.card__hint{
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.card__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.card-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.card--video{
  padding: 0;
  overflow: hidden;
  border-color: var(--border-subtle);
  position: relative;
  border-radius: 18px;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand-accent) 9%, transparent);
  transition: box-shadow var(--motion) var(--ease);
}

.card--video:hover{
  box-shadow: 0 12px 28px rgb(33 68 102 / 11%);
}

.card__link{
  display: block;
  color: inherit;
}

.card__link:hover{
  text-decoration: none;
}

.card__cover{
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-sunken);
  border-radius: 0;
}

.card__cover--empty{
  display: grid;
  place-items: center;
  font-size: var(--text-xs);
  color: var(--fg-subtle);
}

.card__body{
  display: flex;
  flex-direction: column;
  padding: 14px 46px 18px 14px;
  gap: 8px;
}

.card__subtitle{
  color: var(--fg-muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
}

.card__meta{
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 24px;
}


.card__progress{
  height: 3px;
  background: var(--surface-sunken);
  overflow: hidden;
  margin: 2px calc(var(--space-3) * -1) calc(var(--space-4) * -1);
  border-radius: 0;
}

.card__progress-fill{
  height: 100%;
  background: var(--primary);
}

.card--skeleton{
  height: 210px;
  background: linear-gradient(100deg, var(--surface-sunken) 30%, var(--surface-hover) 50%, var(--surface-sunken) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-color: transparent;
}

.skeleton{
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
  animation: pulse 1.6s ease-in-out infinite;
}

.skeleton--player{
  aspect-ratio: 16 / 9;
}

.skeleton--rows{
  height: 320px;
}

.skeleton--cards{
  height: 180px;
}

.card__media{
  position: relative;
  overflow: hidden;
  background: var(--surface-sunken);
  border-radius: 0;
}

.card__media .card__cover{
}

.card--video:hover .card__media .card__cover{
}

.card__play{
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgb(255 255 255 / 68%);
  border-radius: 50%;
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 6px 16px rgb(15 38 64 / 18%);
  opacity: .94;
  transition: transform var(--motion-fast) var(--ease), opacity var(--motion-fast) var(--ease);
  width: 48px;
  height: 48px;
}

.card__play::after{
  content: '';
  position: absolute;
  inset: 0;
  width: 0;
  height: 0;
  margin: auto;
  transform: translateX(2px);
  border-style: solid;
  border-width: 8px 0 8px 12px;
  border-color: transparent transparent transparent var(--brand-accent);
}

.card--video:hover .card__play{
  opacity: 1;
  transform: translate(-50%, -50%);
}

.card__duration-badge{
  position: absolute;
  color: #fff;
  background: rgb(15 31 48 / 72%);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  right: 12px;
  bottom: 12px;
  padding: 5px 10px;
  font-size: 13px;
}

.card__eyebrow{
  color: var(--brand-accent);
  font-size: var(--text-xs);
  font-weight: 600;
}

.card__tags{
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}


/* ============================================================ 共享外壳 */

.topbar__icon-btn{
  display: grid;
  place-items: center;
  width: var(--tap-min);
  height: var(--tap-min);
  font-size: 18px;
  line-height: 1;
  color: var(--fg-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
}

.topbar__icon-btn:hover{
  background: var(--surface-hover);
  color: var(--fg);
}

.outlet{
  flex: 1;
  width: 100%;
  margin: 0 auto;
  padding: 30px 24px 58px;
  max-width: 1560px;
}

/* ============================================================ 页面骨架 */

.page{
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.page__head{
  flex-direction: column;
  gap: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.page__title{
  font-size: var(--text-2xl);
  letter-spacing: -0.01em;
  grid-column: 1;
}

.page__subtitle{
  font-size: var(--text-sm);
  color: var(--fg-muted);
  grid-column: 1;
}

.page__actions{
  display: flex;
  gap: var(--space-2);
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-content: flex-end;
  align-self: start;
  margin-top: 0;
  flex-wrap: wrap;
}

.section__title{
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}

.page--notfound{
  align-items: center;
  text-align: center;
  padding: var(--space-8) var(--space-4);
  gap: var(--space-3);
}

.page--notfound .page__title{
  font-size: var(--text-2xl);
}

.empty__action{
  margin-top: var(--space-3);
}

.empty--error .empty__icon{
  color: var(--danger);
}

.empty--error .empty__title{
  color: var(--danger-fg);
}

.pager{
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  padding: var(--space-4) 0 0;
}

.pager__btn{
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  font: inherit;
  font-size: var(--text-xs);
  color: var(--fg-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.pager__btn:hover:not(:disabled){
  background: var(--surface-hover);
  color: var(--fg);
}

.pager__btn:disabled{
  opacity: 0.45;
  cursor: not-allowed;
}

.pager__btn.is-current{
  color: #fff;
  background: var(--brand-accent);
  border-color: var(--brand-accent);
}

.pager__gap{
  padding: 0 4px;
  color: var(--fg-subtle);
}

.pager__total{
  margin-left: var(--space-3);
  font-size: var(--text-xs);
  color: var(--fg-subtle);
}

.progress{
  position: relative;
  height: 6px;
  background: var(--surface-sunken);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress__fill{
  height: 100%;
  background: var(--primary);
  transition: width var(--motion) var(--ease);
}

.progress__label{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--fg-muted);
}

/* ============================================================ 播放器 */

.player{
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  grid-template-areas: 'topbar   topbar'
    'stage    side'
    'modes    side'
    'progress side'
    'controls side'
    'footer   side';
  align-items: start;
}

.player__side{
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.player__topbar{
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap-min);
}

.player__top-title-wrap{
  flex: 1;
  min-width: 0;
}

.player__top-title{
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player__top-btn{
  display: grid;
  place-items: center;
  width: var(--tap-min);
  height: var(--tap-min);
  flex-shrink: 0;
  color: var(--fg);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.player__top-btn:hover{
  background: var(--surface-hover);
}

.player__top-btn svg{
  display: block;
}

.player__stage{
  grid-area: stage;
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 12px 26px rgb(15 25 37 / 14%);
}

.player__modes{
  grid-area: modes;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.player__learning{display:contents}

.player__subtitles{
  grid-area: subtitles;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(56vh, 560px);
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.player__progress{
  grid-area: progress;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.player__controls{
  grid-area: controls;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  gap: 2px;
  position: relative;
}

.player__footer{
  grid-area: footer;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-subtle);
}

.player__video{
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.player__stage-overlay{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.player__stage-overlay > *{
  pointer-events: auto;
}

.player__stage-times{
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, .92);
}

.player__stage-time{
  min-width: 4ch;
  font-variant-numeric: tabular-nums;
}

.player__stage-slash{
  opacity: .55;
}

.player__stage-total{
  opacity: .7;
}

.player__stage-btn{
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: rgba(0, 0, 0, .34);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.player__stage-btn:hover{
  background: rgba(0, 0, 0, .55);
}

.player__stage-btn svg{
  display: block;
}

.player__stage-empty{
  position: absolute;
  inset: auto 0 44px 0;
  padding: 0 var(--space-3);
  text-align: center;
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, .7);
}

.player__stage-empty[hidden]{
  display: none;
}

.player__modes[hidden]{
  display: none;
}

.player__mode{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 56px;
  padding: 8px 4px;
  font: inherit;
  font-size: var(--text-xs);
  color: var(--fg-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease);
}

.player__mode:hover{
  background: var(--surface-hover);
  color: var(--fg);
}

.player__mode.is-on{
  color: var(--brand-fg);
  background: var(--brand-soft);
  border-color: var(--brand-accent);
  box-shadow: inset 0 0 0 1px var(--brand-accent);
}

.player__mode svg{
  display: block;
}

.player__time{
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  min-width: 42px;
}

.player__progress .player__time:last-child{
  text-align: right;
}

.player__bar{
  position: relative;
  flex: 1;
  height: 6px;
  background: var(--surface-sunken);
  border-radius: var(--radius-pill);
  cursor: pointer;
  touch-action: none;
}

.player__bar-buffer{
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--border-strong);
  border-radius: inherit;
}

.player__bar-fill{
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background-image: linear-gradient(180deg, var(--btn-crown), transparent 45%, var(--btn-foot)),
    linear-gradient(90deg, var(--btn-light), var(--btn-mid) 48%, var(--btn-dark) 92%);
  background-color: var(--brand-accent);
  box-shadow: inset 0 1px 1px var(--btn-rim);
}

.player__bar-handle{
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 3px solid var(--brand-accent);
  border-radius: 50%;
}

.player__control{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 4px 2px;
  font: inherit;
  font-size: 10px;
  line-height: 1.2;
  color: var(--fg-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.player__control:hover{
  background: var(--surface-hover);
  color: var(--fg);
}

.player__control.is-on{
  color: var(--brand-accent);
}

.player__control svg{
  display: block;
}

.player__control-text{
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.player__control-label{
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.player__play{
  display: grid;
  place-items: center;
  justify-self: center;
  width: 54px;
  height: 54px;
  background-color: var(--brand-accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 10px var(--brand-ring, rgba(0, 0, 0, .18));
  color: var(--on-primary);
  padding: 0;
}

.player__play:hover{
  background-color: var(--brand-accent-strong, var(--brand-accent));
}

.player__play svg{
  display: block;
}

.player__spacer{
  flex: 1;
}

.player__more{
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 120;
  display: flex;
  flex-direction: column;
  min-width: 156px;
  padding: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 28px rgba(15, 27, 45, .18);
}

.player__more[hidden]{
  display: none;
}

.player__more-item{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  font: inherit;
  font-size: var(--text-sm);
  text-align: left;
  color: var(--fg);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.player__more-item:hover{
  background: var(--surface-hover);
}

.player__more-item svg{
  display: block;
  flex-shrink: 0;
  color: var(--fg-muted);
}

.player__stat{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  padding: 4px 2px;
  font: inherit;
  font-size: 10px;
  line-height: 1.2;
  color: var(--fg-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.player__stat:hover{
  background: var(--surface-hover);
  color: var(--fg);
}

.player__stat.is-on{
  color: var(--brand-accent);
}

.player__stat-label{
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.player__stat-icon{
  position: relative;
  display: grid;
  place-items: center;
}

.player__stat-icon svg{
  display: block;
}

.player__stat-badge{
  position: absolute;
  min-width: 15px;
  padding: 0 4px;
  font-size: 9px;
  font-weight: 600;
  line-height: 15px;
  text-align: center;
  background: var(--brand-accent);
  border-radius: var(--radius-pill);
  color: var(--on-primary);
  top: -6px;
  left: 16px;
}

.player__stat-badge[hidden]{
  display: none;
}

.player__subtitles[hidden]{
  display: none;
}

.player__sentence{
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease);
  border-left: 3px solid transparent;
}

.player__sentence:hover{
  background: var(--surface-hover);
}

.player__sentence.is-active{
  background: var(--brand-soft);
  border-left-color: var(--brand-accent);
}

.player__sentence-main{
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.player__sentence-foot{
  display: flex;
  align-items: center;
  gap: 2px;
}

.player__sentence-time{
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--fg-subtle);
  font-variant-numeric: tabular-nums;
}

.player__sentence-text{
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

.player__sentence-translation{
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

.player__sentence-btn{
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--fg-subtle);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.player__sentence-btn:hover{
  color: var(--fg);
  background: var(--surface-hover);
}

.player__sentence-btn svg{
  display: block;
}

.player__sentence-btn.player__sentence-star.is-on{
  color: var(--brand-accent);
}

.player__sentence-speak[data-state="loading"]{
  color: var(--fg-muted);
  cursor: progress;
}

.player__sentence-speak[data-state="playing"]{
  color: var(--brand-accent);
}

.player__sentence-speak[data-state="playing"] svg{
  animation: word-card-pulse 900ms ease-in-out infinite;
}

.player__sentence-speak[data-state="retry"]{
  color: var(--warning, var(--brand-accent));
}

.player__spin{
  animation: word-card-spin 900ms linear infinite;
}

.player__blind{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
}

.player__blind[hidden]{
  display: none;
}

.player__blind-text{
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.player.is-blind .player__sentence-text{
  color: transparent;
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
  user-select: none;
}

.player.is-blind .player__sentence-translation{
  color: transparent;
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
  user-select: none;
}

.player.is-blind .player__sentence-text > *{
  visibility: hidden;
}

.player.is-cloze .word-token.is-key{
  color: transparent;
  background: var(--surface-sunken);
}

.player.is-starred-only .player__sentence:not(:has(.player__sentence-star.is-on)){
  display: none;
}

.player[data-font-step="1"] .player__sentence-text{
  font-size: var(--text-lg);
}

.player[data-font-step="2"] .player__sentence-text{
  font-size: var(--text-xl);
}

.player__empty{
  padding: var(--space-5);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

/* ============================================================ 筛选控件 */

.filter-bar{
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border: 1px solid var(--border);
  padding: 18px 20px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--card-bg) 94%, var(--brand-soft));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--brand-accent) 10%, transparent);
}

.filter-bar__inline{
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
}

.filter-bar__body{
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.filter-row{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.filter-row__label{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 112px;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-ink);
}

.filter-row__label svg{
  display: block;
  flex-shrink: 0;
}

.filter-row__options{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip{
  font: inherit;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  min-height: var(--tap-min);
  padding: 8px 18px;
  border-color: transparent;
  font-size: 15px;
  background-color: var(--chip-bg);
}

.filter-chip:hover{
  background-color: var(--surface-hover);
  border-color: var(--border-hover, var(--brand-accent));
}


.filter-bar__sort{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.filter-bar__sort-label{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.filter-bar__sort-select{
  padding: 6px 12px;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--fg);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  min-height: 42px;
  padding-inline: 16px;
}

.filter-bar__toggle{
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--fg);
  background-color: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.filter-bar__summary{
  color: var(--brand-accent);
  font-size: var(--text-xs);
}

.filter-bar__summary:empty{
  display: none;
}

.filter-bar.is-filtered .filter-bar__toggle{
  border-color: var(--brand-accent);
}

.filter-sheet{
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: filter-fade var(--dur-fast) var(--ease);
  margin: 0;
  padding: 0;
  border: 0;
  width: 100%;
  height: 100svh;
  max-width: none;
  max-height: none;
  background: transparent;
  overflow: hidden;
  color: var(--fg);
}

.filter-sheet:not([open]){
  display: none;
}

.filter-sheet__panel{
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 430px;
  max-height: 78svh;
  background: var(--sheet-bg);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  animation: filter-rise var(--dur-base) var(--ease);
}

.filter-sheet__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4) var(--space-3);
  flex-shrink: 0;
}

.filter-sheet__title{
  font-size: var(--text-lg);
}

.filter-sheet__close{
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--fg-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.filter-sheet__close:hover{
  background: var(--surface-hover);
  color: var(--fg);
}

.filter-sheet__body{
  overflow-y: auto;
  padding: 0 var(--space-4) var(--space-4);
  min-height: 0;
  overscroll-behavior: contain;
}

.filter-bar__body--sheet .filter-row{
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.filter-bar__body--sheet .filter-row__label{
  min-width: 0;
}

.filter-sheet__foot{
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.filter-sheet__foot .btn{
  flex: 1;
  min-height: 48px;
  border-radius: 12px;
}

/* ============================================================ Toast／Modal */

.toast-host{
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
}

.toast{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--fg-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transform: translateY(8px);
  opacity: 0;
  transition: transform var(--motion) var(--ease), opacity var(--motion) var(--ease);
}

.toast.is-visible{
  transform: translateY(0);
  opacity: 1;
}

.toast.is-leaving{
  transform: translateY(4px);
  opacity: 0;
}

.toast--success{
  border-left-color: var(--success);
}

.toast--warn{
  border-left-color: var(--warn);
}

.toast--error{
  border-left-color: var(--danger);
}

.toast--info{
  border-left-color: var(--info);
}

.toast__message{
  flex: 1;
  font-size: var(--text-sm);
}

.toast__close{
  background: transparent;
  border: none;
  color: var(--fg-subtle);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.toast__action{
  background: transparent;
  border: none;
  color: var(--brand-accent);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
}

.modal{
  width: min(100% - 32px, 560px);
  max-height: 86vh;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal--sm{
  width: min(100% - 32px, 440px);
}

.modal--lg{
  width: min(100% - 32px, 840px);
}

.modal::backdrop{
  background: rgb(12 20 30 / 0.5);
}

.modal__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.modal__title{
  font-size: var(--text-lg);
}

.modal__close{
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--fg-subtle);
  cursor: pointer;
}

.modal__body{
  padding: var(--space-4);
  overflow-y: auto;
  max-height: 60vh;
}

.modal__message{
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.modal__footer{
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-sunken);
}

/* ============================================================ 上传 */

.upload{
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.upload__head{
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.upload__title{
  font-size: var(--text-lg);
}

.upload__hint{
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

.upload__phase{
  font-size: var(--text-sm);
  font-weight: 500;
}

.upload__bar{
  height: 10px;
  background: var(--surface-sunken);
  border-radius: var(--radius-pill);
  box-shadow: inset 0 1px 2px var(--btn-contact);
  overflow: hidden;
}

.upload__bar-fill{
  height: 100%;
  width: 0;
  background-color: var(--brand-accent);
  background-image: linear-gradient(180deg, var(--btn-crown), transparent 40%, var(--btn-foot)),
    linear-gradient(90deg, var(--btn-light), var(--btn-mid) 48%, var(--btn-dark) 92%);
  box-shadow: inset 0 1px 1px var(--btn-rim);
  transition: width var(--motion) var(--ease);
}

.upload__meta{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.upload__percent{
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.upload__stats{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
}

.upload__stat{
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.upload__stat dt{
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

.upload__stat dd{
  margin: 0;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.upload__notice{
  padding: 10px 12px;
  font-size: var(--text-xs);
  border-radius: var(--radius-md);
}

.upload__notice--error{
  color: var(--danger-fg);
  background: var(--danger-bg);
}

.upload__notice--info{
  color: var(--info-fg);
  background: var(--info-bg);
}

.upload__actions{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.upload-flow{
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.upload-flow__video{
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: var(--text-sm);
}

.upload-flow__label{
  color: var(--fg-muted);
}

.upload-flow__name{
  font-weight: 500;
}

.upload__status{
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

.upload-first{
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.upload-first__title{
  font-size: var(--text-lg);
}

.upload-first__hint{
  color: var(--fg-muted);
  font-size: var(--text-sm);
  line-height: 1.65;
}

.upload__resume{
  display: contents;
}

/* ============================================================ 视频目录面板 */

.picker{
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  justify-content: flex-end;
  background: var(--sheet-scrim);
  animation: picker-fade var(--dur-fast) var(--ease);
}

.picker[hidden]{
  display: none;
}

.picker__panel{
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  height: 100%;
  background: var(--sheet-bg);
  border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  animation: picker-slide var(--dur-base) var(--ease);
}

.picker__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.picker__title{
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--fg);
  font-size: var(--text-lg);
}

.picker__title svg{
  color: var(--brand-accent);
}

.picker__close{
  display: grid;
  place-items: center;
  flex: none;
  width: var(--tap-min);
  height: var(--tap-min);
  color: var(--fg-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.picker__close:hover{
  background: var(--surface-hover);
  color: var(--fg);
}

.picker__search{
  position: relative;
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4) 0;
}

.picker__search-icon{
  position: absolute;
  left: calc(var(--space-4) + var(--space-3));
  color: var(--fg-subtle);
  pointer-events: none;
}

.picker__search-input{
  width: 100%;
  padding-left: calc(var(--space-5) + var(--space-2));
}

.picker__search-input::-webkit-search-cancel-button{
  -webkit-appearance: none;
}

.picker__count{
  margin: 0;
  padding: var(--space-3) var(--space-4) var(--space-2);
  color: var(--fg-muted);
  font-size: var(--text-xs);
}

.picker__count:empty{
  display: none;
}

.picker__list{
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.picker__item{
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2);
  min-height: var(--tap-min);
  text-align: left;
  color: var(--fg);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.picker__item:hover:not(:disabled){
  background: var(--surface-hover);
}

.picker__item:focus-visible{
  border-color: var(--brand-ring);
  outline: none;
}

.picker__item.is-current{
  background: var(--brand-soft);
  border-color: var(--brand-accent);
  cursor: default;
}

.picker__item.is-current .picker__item-title{
  color: var(--brand-fg);
}

.picker__cover{
  flex: none;
  width: 56px;
  height: 40px;
  object-fit: cover;
  background: var(--surface-sunken);
  border-radius: var(--radius-sm);
}

.picker__cover--blank{
  display: block;
  position: relative;
  color: var(--fg-subtle);
  background: var(--surface-sunken);
  overflow: hidden;
}

.picker__cover-art{
  display: block;
  width: 100%;
  height: 100%;
}

.picker__cover-band{
  fill: currentColor;
  opacity: .16;
}

.picker__cover-rim{
  fill: none;
  stroke: currentColor;
  stroke-opacity: .28;
}

.picker__cover-glyph{
  fill: currentColor;
  opacity: .55;
}

.picker__item.is-current .picker__cover--blank{
  color: var(--brand-accent);
}

.picker__item.is-current .picker__cover-glyph{
  opacity: .8;
}

.picker__body{
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.picker__item-title{
  font-size: var(--text-sm);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.picker__item-meta{
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--fg-muted);
  font-size: var(--text-xs);
}

.picker__now{
  color: var(--brand-accent);
  font-weight: 500;
}

.picker__now-icon{
  color: var(--brand-accent);
}

.picker__skeleton{
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  animation: picker-pulse 1.4s var(--ease) infinite;
}

.picker__state{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-4);
  text-align: center;
}

.picker__state-icon{
  color: var(--fg-subtle);
}

.picker__state-title{
  color: var(--fg);
  font-size: var(--text-sm);
  font-weight: 500;
}

.picker__state-hint{
  color: var(--fg-muted);
  font-size: var(--text-xs);
}

.picker__pager{
  padding: 0 var(--space-4);
}

.picker__pager-nav{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.picker__page-btn{
  display: grid;
  place-items: center;
  width: var(--tap-min);
  height: var(--tap-min);
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.picker__page-btn:hover:not(:disabled){
  background: var(--surface-hover);
  color: var(--fg);
}

.picker__page-btn:disabled{
  opacity: 0.4;
  cursor: not-allowed;
}

.picker__page-now{
  color: var(--fg-muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.picker__foot{
  padding: var(--space-3) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-subtle);
}

.picker__foot-hint{
  margin: 0;
  color: var(--fg-subtle);
  font-size: var(--text-xs);
}

/* ============================================================ 字体／动画 */

@keyframes shimmer{
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@keyframes pulse{
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

@keyframes filter-fade{
  from {
    opacity: 0;
  }
}

@keyframes filter-rise{
  from {
    transform: translateY(12%);
  }
}

@keyframes word-card-spin{
  to {
    transform: rotate(360deg);
  }
}

@keyframes word-card-pulse{
  50% {
    transform: scale(1.18);
  }
}

@keyframes word-card-rise{
  from {
    transform: translateY(14%);
  }
}

@keyframes picker-fade{
  from {
    opacity: 0;
  }
}

@keyframes picker-slide{
  from {
    transform: translateX(6%);
  }
}

@keyframes picker-pulse{
  50% {
    opacity: 0.55;
  }
}

@keyframes picker-rise{
  from {
    transform: translateY(12%);
  }
}

/* ============================================================ 响应式 */

.page__actions:empty{
  display: none;
}

.filter-sheet .filter-chip{
  background-color: var(--sheet-option-bg);
}


.filter-sheet::backdrop{ background: var(--sheet-scrim); }

.player__subtitle-title{ font-size:var(--text-lg); margin:0; }

.player__preview-note{ position:absolute; left:12px; top:12px; padding:6px 10px; border-radius:8px; background:var(--sheet-bg); color:var(--fg); font-size:12px; }

@media (max-width: 640px){
  
  .picker{
    align-items: flex-end;
    justify-content: center;
  }
  .picker__panel{
    width: 100%;
    height: auto;
    max-height: 84svh;
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    animation: picker-rise var(--dur-base) var(--ease);
  }
  .picker__head{
    padding: var(--space-4) var(--space-4) var(--space-3);
  }
}

@media (max-width: 1179px){
  .player{
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'topbar'
      'stage'
      'modes'
      'side'
      'progress'
      'controls'
      'footer';
  }
  .player__side{
    gap: var(--space-3);
  }
  .player__subtitles{
    max-height: min(50vh, 420px);
  }

  .card-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px){

  .outlet{
    padding: 20px 14px calc(88px + env(safe-area-inset-bottom));
  }
  .page__title{
    font-size: var(--text-xl);
  }
  .card-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  
  .filter-bar__inline{
    display: none;
  }
  .filter-bar__toggle{
    display: flex;
    justify-content: space-between;
    width: 100%;
  }
  .filter-sheet{
    align-items: flex-end;
  }
  .filter-sheet__panel{
    max-height: 76svh;
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -16px 40px rgb(15 35 60 / 16%);
  }
  .filter-row{
    align-items: flex-start;
  }
  .filter-row__label{
    padding-top: 8px;
  }
  .player__stage{
    border-radius: 0;
  }
  .player{
    gap: var(--space-2);
  }
  .player__subtitles{
    max-height: none;
    padding-right: 0;
  }
  .player__sentence{
    padding: 10px;
  }
  .player__sentence-text{
    font-size: 14px;
  }
  .player__controls{
    gap: 0;
  }
  .player__control{
    min-height: 48px;
  }
  .player__play{
    width: 48px;
    height: 48px;
  }
  .player__footer{
    gap: 0;
  }
  body.is-sheet-open{
    overflow: hidden;
  }
  .toast-host{
    left: var(--space-3);
    right: var(--space-3);
    bottom: calc(var(--space-3) + 56px);
    max-width: none;
  }

  .card__title{
    font-size: 17px;
  }
  .card__body{
    padding: 11px 38px 14px 12px;
    gap: 6px;
  }
  .card__progress{
    margin: 2px calc(var(--space-3) * -1) calc(var(--space-3) * -1);
  }

  .card--video{
    border-radius: 18px;
  }
  .card__subtitle{
    font-size: 13px;
  }


.card__duration-badge{
    right: 8px;
    bottom: 8px;
    font-size: 12px;
  }
  .filter-sheet__head{
    padding: 20px 20px 14px;
  }
  .filter-sheet__title{
    font-size: 22px;
  }
  .filter-sheet__body{
    padding-inline: 20px;
  }
  .filter-sheet__foot{
    padding-inline: 20px;
  }

  .player__subtitle-title{ display:none; }
}

@media (prefers-reduced-motion: reduce){
  *{
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  *::before{
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  *::after{
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .card--video:hover{
    transform: none;
  }
  .picker{
    animation: none;
  }
  .picker__panel{
    animation: none;
  }
  .picker__skeleton{
    animation: none;
  }
}

/* 桌面分档：1800／1500／1320，860px 以下仍由移动外壳接管。几何不依赖主题和模式。 */

@media (min-width: 861px) and (max-width: 1800px){

  .outlet{
    max-width: 1320px;
  }
}

@media (min-width: 861px) and (max-width: 1500px){

  .outlet{
    max-width: 1180px;
  }

  .card-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 861px) and (max-width: 1179px){

  .outlet{
    max-width: 1120px;
  }

  .player{
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'topbar' 'stage' 'modes' 'side' 'progress' 'controls' 'footer';
  }

  .player__side{
    gap: var(--space-3);
  }

  .player__subtitles{
    max-height: min(50vh, 420px);
  }
}

.auth{--auth-ink:#273b2d;--auth-muted:#526455;--auth-accent:#4d705b;position:relative;isolation:isolate;min-height:100svh;display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,460px);align-items:center;gap:48px;padding:48px max(32px,calc((100vw - 1160px)/2));color:var(--auth-ink);color-scheme:light;background:#e9e6dd;font:400 16px/1.6 var(--font-sans)}
.auth::before{content:'';position:fixed;inset:0;z-index:-1;background:linear-gradient(90deg,#17352866,#17352810),url('/assets/ui/auth/auth-reading-room.png') center/cover no-repeat;pointer-events:none}
.auth__motto{color:#fffdf4;font:600 clamp(24px,3vw,40px)/1.5 var(--font-serif);text-shadow:0 2px 16px #17352890;max-width:440px}
.auth__card{width:100%;min-width:0;min-height:680px;padding:24px 28px;display:flex;flex-direction:column;gap:16px;border:1px solid #ffffff90;border-radius:16px;background:linear-gradient(145deg,#fffffcf5,#f0f0e7f2);box-shadow:inset 0 1px 0 #fff,0 16px 48px #102a2a3b;color:var(--auth-ink)}
.auth__brand{display:flex;justify-content:center;height:90px;flex-shrink:0}.auth__brand img{height:90px;width:auto;object-fit:contain}
.auth__tabs{display:flex;gap:4px;padding:4px;border:1px solid #abb9a780;border-radius:12px;background:#dce5d6;flex-shrink:0}.auth__tab{flex:1;min-height:40px;border:0;border-radius:8px;background:transparent;color:#405644;font-weight:600}.auth__tab.is-active{background:linear-gradient(135deg,#668574,#4d705b);color:#fff;box-shadow:0 2px 6px #17352826}
.auth__form{display:flex;flex:1;flex-direction:column;gap:12px;min-height:400px}.auth__fields,.auth__extra{display:flex;flex-direction:column;gap:12px}.auth .field{gap:4px;margin:0}.auth .field__label{font-size:14px;color:#273b2d}.auth .field__control{color:#526455}.auth .input{height:44px;min-height:44px;font-size:16px;border:1px solid #a8b7a5;background:#fffff9;color:#273b2d;border-radius:8px}.auth .input::placeholder{color:#6b786b}.auth .field__reveal{color:#526455}.auth .field__reveal:hover{color:#273b2d;background:transparent}.auth .field__error{color:#913749}.auth .field__check{color:#526455;font-size:13px}.auth__row{min-height:24px}.auth__submit{margin-top:auto;min-height:44px;border:1px solid #4d705b;border-radius:8px;background:linear-gradient(135deg,#668574,#4d705b 50%,#405c4b);color:#fff;font-weight:600;box-shadow:0 3px 8px #17352826}.auth__submit:disabled{opacity:.6;cursor:wait}.auth__message{font-size:14px;margin:0;line-height:1.5}.auth__message--error{color:#913749}.auth__message--success{color:#315b37}.auth__note{font-size:13px;text-align:center;color:#526455;margin:0}.auth__switch{padding:4px;background:transparent;border:0;color:#3b624b;font:inherit;text-decoration:underline;text-underline-offset:3px}.auth :focus-visible{outline:3px solid #4d705b;outline-offset:3px}
.word-card{position:fixed;inset:0;width:min(520px,calc(100% - 32px));max-height:calc(100dvh - 32px);margin:auto;padding:0;border:1px solid var(--border-base);border-radius:var(--radius-layer);background:linear-gradient(155deg,var(--material-surface-top),var(--material-surface-bottom));color:var(--fg);box-shadow:var(--word-surface-recess),var(--word-surface-edge),var(--material-layer-shadow);overflow:hidden}
.word-card[open]{display:flex;flex-direction:column}.word-card::backdrop,.key-word-dialog::backdrop{background:#07132170}.word-card__head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:20px 20px 12px;flex-shrink:0}.word-card__ident{min-width:0}.word-card__word{font:650 22px/1.4 var(--font-sans);overflow-wrap:anywhere;margin:0}.word-card__phonetic{color:var(--fg-muted);font-size:14px}.word-card__tag{color:var(--text-secondary);font-size:12px}.word-card__tools{display:flex;align-items:center;gap:4px;flex-shrink:0}.word-card__icon-btn{width:36px;height:44px;display:grid;place-items:center;background:transparent;border:0;border-radius:8px;color:var(--fg-muted)}.word-card__icon-btn.is-on{color:var(--primary)}.word-card__speak{width:56px;height:56px;display:grid;place-items:center;background:var(--selected-bg);border:1px solid var(--primary);border-radius:50%;color:var(--selection-ink)}.word-card__speak svg{width:28px;height:28px}.word-card__speak[data-state=playing]{animation:speak-pulse 1.2s ease-in-out infinite}.word-card__spin{animation:spin 1s linear infinite}.word-card__rule{margin:0 20px;border:0;border-top:1px solid var(--border-base)}.word-card__body{padding:16px 20px 20px;display:flex;flex-direction:column;gap:16px;overflow:auto;min-height:0;overscroll-behavior:contain}.word-card__label{margin:0 0 4px;font:650 16px/1.5 var(--font-sans)}.word-card__gloss,.word-card__context{font-size:16px;line-height:1.65;margin:0}.word-card__context{color:var(--text-secondary)}.word-card__example{padding:16px;margin:0;border-radius:8px;background:var(--panel-bg)}.word-card__example-en{font-size:16px;line-height:1.65;margin:0}.word-card__example-zh{font-size:14px;color:var(--text-secondary);margin:8px 0 0}.word-card__hit{background:var(--teach-key-bg);color:var(--teaching-readable)}.word-card__actions{display:flex;gap:12px;padding:16px 20px;border-top:1px solid var(--border-base);background:var(--card-bg);flex-shrink:0}.word-card__action{display:inline-flex;flex:1;justify-content:center;align-items:center;gap:8px;min-height:44px;padding:10px 12px;border:1px solid var(--control-border);border-radius:8px;color:var(--fg);background:transparent;font:600 14px/1.4 var(--font-sans)}.word-card__action--primary{background:linear-gradient(135deg,var(--material-button-top),var(--material-button-bottom));color:var(--on-primary);border-color:var(--primary)}.word-card__handle{display:none}.key-word-dialog{width:min(520px,calc(100% - 32px));max-height:calc(100dvh - 32px);padding:24px;margin:auto;border:1px solid var(--border-base);border-radius:16px;background:var(--card-bg);color:var(--fg);box-shadow:var(--material-layer-shadow)}.key-word-list{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}.key-word-dialog>button{float:right}
.toast-host{position:fixed;top:72px;bottom:auto;left:50%;right:auto;transform:translateX(-50%);width:max-content;max-width:calc(100% - 32px);z-index:1000;pointer-events:none}.toast{background:var(--card-bg);color:var(--fg);border:1px solid var(--border-base);border-left:3px solid var(--primary);border-radius:8px;box-shadow:var(--material-contact);padding:10px 14px;pointer-events:none;font-size:14px;min-height:0}.toast__message{margin:0}.toast--success{border-left-color:var(--success)}.toast--warn{border-left-color:var(--warning)}.toast--error{border-left-color:var(--danger)}.toast__action{pointer-events:auto}
@media(max-width:640px){.auth{grid-template-columns:minmax(0,1fr);gap:0;padding:20px 16px;align-content:center}.auth__motto,.auth__brand{display:none}.auth__card{width:min(420px,100%);margin:auto;min-height:540px;padding:20px;gap:12px}.auth__form{min-height:420px}.auth__note{font-size:12px}.word-card{inset:auto 0 0;width:100%;max-height:calc(100dvh - 24px);margin:0;border-radius:16px 16px 0 0}.word-card__handle{display:block;width:100%;height:24px;background:transparent;border:0;touch-action:none;flex-shrink:0}.word-card__handle:after{content:'';display:block;width:40px;height:4px;margin:auto;border-radius:2px;background:var(--control-border)}.word-card__head{padding-top:4px}.word-card__tools{gap:0}.word-card__word{font-size:20px}.word-card__actions{padding-bottom:max(16px,env(safe-area-inset-bottom))}.toast-host{top:64px;bottom:auto;left:50%;right:auto;max-width:calc(100% - 24px)}}
@media(prefers-reduced-motion:reduce){.word-card__speak,.word-card__spin{animation:none}}

.toast{display:flex;align-items:center;gap:8px}.toast>svg{flex-shrink:0}.toast--success>svg{color:var(--success)}.toast--warn>svg{color:var(--warning)}.toast--error>svg{color:var(--danger)}

.word-card__ident{min-width:0}.word-card__word,.word-card__example-en{overflow-wrap:anywhere}
