:root {
  --bg: #F8FAFC;
  /* Modern cool white for simple & elegant look */
  --card: #ffffff;
  --muted: #64748b;
  --text: #0f172a;
  --line: #000000;
  --accent: #6366f1;
  /* Indigo - Fashionable */
  --accent-weak: #e0e7ff;
  --active: #eff6ff;
  --shadow: 4px 4px 0px #000000;
  --border-w: 2px;
  --radius: 8px;
  /* Slightly softer corners for elegance */
}

/* 基础 */
* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Courier New', Courier, monospace, ui-sans-serif, system-ui;
  /* Monospace for brutalism */
  -webkit-font-smoothing: antialiased;
  line-height: 1.6
}

a {
  color: inherit;
  text-decoration: none
}

small {
  color: var(--muted)
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px
}

.card {
  background: var(--card);
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow)
}

.site-footer {
  padding: 22px 16px;
  text-align: center;
  color: var(--text);
  font-weight: bold
}

/* 浮动播放器状态 */
:root {
  --player-height: 0px;
}

body.player-floating {
  padding-top: var(--player-height);
  transition: padding-top 0.1s steps(5);
}

/* ---------------- 首页 ---------------- */
.page-home .hero {
  text-align: center;
  padding: 56px 16px 20px;
  background: transparent;
}

.hero-brand {
  letter-spacing: 0.05em;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
  font-size: 16px;
  text-transform: uppercase;
  border: 2px solid #000;
  display: inline-block;
  padding: 4px 8px;
  background: #fff;
  box-shadow: 4px 4px 0 #000
}

.hero-title {
  margin: 16px 0 8px;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase
}

.hero-sub {
  margin: 0 0 20px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em
}

.hero-search {
  display: flex;
  justify-content: center;
  margin: 8px 0 14px
}

.hero-search input {
  width: min(680px, 100%);
  padding: 14px 18px;
  border-radius: var(--radius);
  border: var(--border-w) solid var(--line);
  box-shadow: var(--shadow);
  font-size: 15px;
  background: #fff;
  outline: none;
  font-weight: bold;
  line-height: 1.4;
  color: #000;
  font-family: inherit;
}

.hero-search input:focus {
  box-shadow: 6px 6px 0 #000;
  transform: translate(-2px, -2px);
}

.seg {
  display: inline-flex;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0
}

.seg .tab {
  border: var(--border-w) solid #000;
  background: #fff;
  padding: 6px 14px;
  border-radius: var(--radius);
  color: #000;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  box-shadow: 2px 2px 0 #000
}

.seg .tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 4px 4px 0 #000;
  transform: translate(-2px, -2px)
}

/* 工具栏 */
.toolbar {
  margin-top: 14px
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap
}

.chips {
  display: flex;
  gap: 10px
}

.chip {
  border: var(--border-w) solid var(--line);
  background: #fff;
  padding: 6px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  transition: all 0.1s;
  box-shadow: 2px 2px 0 #000;
  letter-spacing: 0.01em;
}

.chip:hover {
  background: #fff;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 #000;
}

.chip.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 4px 4px 0 #000;
  transform: translate(-2px, -2px);
}

.chip.active:hover {
  background: var(--accent);
  box-shadow: 6px 6px 0 #000;
  transform: translate(-4px, -4px);
}

.muted {
  color: var(--muted)
}

#stats {
  background: #FFD700;
  /* Gold */
  color: #000;
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: bold;
  border: var(--border-w) solid #000;
  display: inline-block;
  margin-right: 20px;
  box-shadow: 2px 2px 0 #000;
}

/* 最近播放卡 */
.lastplay {
  margin-top: 14px;
  padding: 0
}

.lastplay-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px
}

.lp-title {
  font-weight: 900
}

.lp-sub {
  color: var(--muted);
  font-weight: 600
}

/* 网格卡 */
.grid {
  display: grid;
  gap: 16px;
  margin: 14px auto 34px;
  padding: 0 16px;
  max-width: 980px;
  grid-template-columns: repeat(3, 1fr)
}

@media (max-width:900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media (max-width:560px) {
  .grid {
    grid-template-columns: 1fr
  }
}

.lesson-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 18px;
  background: #fff;
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all 0.1s;
  min-height: 80px;
}

.lesson-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 8px 8px 0 #000;
}

.l-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.l-no {
  color: var(--accent);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-decoration: underline;
}

.l-title {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.l-star {
  border: var(--border-w) solid transparent;
  background: transparent;
  cursor: pointer;
  color: #ccc;
  font-size: 20px;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.1s;
  flex-shrink: 0;
  margin-left: 12px;
  margin-top: 2px;
}

.l-star:hover {
  border-color: #000;
  background: #fff;
  color: #000;
  box-shadow: 2px 2px 0 #000;
}

.l-star.active {
  color: #FFD700;
  text-shadow: 1px 1px 0 #000;
}

/* ---------------- 播放页 ---------------- */
.page-lesson .hero {
  padding: 42px 16px 0;
  text-align: center;
  background: transparent;
  position: relative;
}

/* 移动端：为固定返回按钮留出空间 */
@media (max-width: 767px) {
  .page-lesson .hero {
    padding-left: 60px;
    padding-right: 20px;
    text-align: left;
  }

  .page-lesson .hero-title {
    text-align: left;
  }

  .page-lesson .lesson-date {
    text-align: left;
  }

  .page-lesson .hero-sub {
    text-align: left;
    margin-left: 0;
    margin-right: auto;
  }
}

.page-lesson .hero-title {
  margin: 8px 0 12px;
  font-size: clamp(32px, 6vw, 48px);
  line-height: 1.1;
  font-weight: 900;
  text-align: center;
  color: var(--text);
  letter-spacing: -0.03em;
  text-transform: uppercase
}

.page-lesson .lesson-date {
  margin: 0 0 20px;
  font-size: 18px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-family: monospace
}

.page-lesson .hero-sub {
  margin: 0 auto 16px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em
}

.btn-ghost.back {
  position: fixed;
  left: 16px;
  top: 18px;
  z-index: 1001;
  color: #000;
  background: #fff;
  border: var(--border-w) solid #000;
  padding: 8px 12px;
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 #000;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.1s;
  transform: translateX(0);
}

.btn-ghost.back:hover {
  background: #fff;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #000
}

.btn-ghost.back:active {
  transform: translate(0, 0);
  box-shadow: 2px 2px 0 #000
}

.btn-ghost.back.floating {
  position: fixed;
  top: 76px;
  z-index: 1001;
  transform: translateZ(0)
}

.btn-ghost.back.hidden {
  transform: translateX(-120%);
  opacity: 0;
}

.tabs {
  margin-top: 6px
}

.tabs .tab {
  border: var(--border-w) solid transparent;
  background: transparent;
  padding: 6px 14px;
  border-radius: var(--radius);
  color: #000;
  cursor: pointer;
  font-weight: bold
}

.tabs .tab.active {
  background: #fff;
  border-color: #000;
  box-shadow: 4px 4px 0 #000;
  color: #000
}

.player-wrap {
  position: relative;
  z-index: 100;
  margin: 20px auto 30px;
  max-width: 600px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--card);
  border: var(--border-w) solid var(--line);
  will-change: transform;
  contain: layout style paint;
}

.player-wrap.floating {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateZ(0);
  max-width: 600px;
  width: calc(100% - 32px);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 10px 0 rgba(0, 0, 0, 1);
  backdrop-filter: none;
  background: #fff;
  border: var(--border-w) solid var(--line);
  border-top: none;
  z-index: 1000;
  transition: transform 0.2s;
}

/* 移动端播放器布局 */
.topbar {
  padding: 12px 14px
}

/* 第一行：模式切换 */
.player-row-1 {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.player-row-1 .pill {
  font-size: 15px;
  padding: 8px 16px;
  min-width: 120px;
  text-align: center;
}

/* 第二行：播放控制 */
.player-row-2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.player-row-2 .player-time {
  font-size: 14px;
  font-weight: 700;
  color: #000;
  font-family: monospace;
  flex: 0 0 auto;
}

.player-row-2 .icon {
  border: var(--border-w) solid #000;
  background: #fff;
  cursor: pointer;
  font-size: 24px;
  padding: 12px;
  border-radius: 50%;
  transition: all 0.1s;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: 2px 2px 0 #000;
}

.player-row-2 .icon:hover {
  background: #FFD700;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 #000;
}

.player-row-2 .icon:active {
  transform: translate(0, 0);
  box-shadow: 0 0 0 #000;
}

.player-row-2 .pill {
  font-size: 13px;
  padding: 6px 10px;
  min-width: 50px;
  text-align: center;
  flex: 0 0 auto;
}


/* 桌面端布局（隐藏） */
.topbar-desktop {
  display: none;
}

/* 平板端布局（768px+） */
@media (min-width: 768px) {
  .player-row-1 {
    margin-bottom: 8px;
  }

  .player-row-2 {
    justify-content: space-between;
    gap: 30px;
  }

  .player-row-1 .pill {
    font-size: 14px;
    padding: 8px 14px;
  }

  .player-row-2 .player-time {
    font-size: 15px;
  }

  .player-row-2 .icon {
    font-size: 26px;
    padding: 14px;
    min-width: 52px;
    min-height: 52px;
  }

  .player-row-2 .pill {
    font-size: 14px;
    padding: 8px 14px;
    min-width: 60px;
  }
}

/* 大屏布局（1024px+）使用原有桌面端设计 */
@media (min-width: 1024px) {

  .player-row-1,
  .player-row-2 {
    display: none;
  }

  .topbar-desktop {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .topbar-desktop .left,
  .topbar-desktop .right {
    display: flex;
    gap: 10px;
    align-items: center
  }

  .topbar-desktop .pill {
    border: var(--border-w) solid #000;
    background: #fff;
    padding: 6px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 2px 2px 0 #000
  }

  .topbar-desktop .pill:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 #000
  }

  .topbar-desktop .pill.active {
    background: var(--accent);
    color: #fff;
    border-color: #000;
    box-shadow: 4px 4px 0 #000
  }

  .topbar-desktop .icon {
    border: var(--border-w) solid transparent;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    padding: 6px 8px;
    border-radius: 4px
  }

  .topbar-desktop .icon:hover {
    border-color: #000;
    background: #fff;
    box-shadow: 2px 2px 0 #000
  }

  .topbar-desktop .playerbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0
  }

  #seekDesktop {
    appearance: none;
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #fff;
    border: 2px solid #000;
    outline: none
  }

  #seekDesktop::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #000;
    box-shadow: 2px 2px 0 #000;
    cursor: pointer
  }

  #curDesktop,
  #durDesktop {
    font-variant-numeric: tabular-nums;
    color: #000;
    font-weight: bold;
    font-family: monospace
  }
}

/* 通用样式保持 */
.pill {
  border: var(--border-w) solid #000;
  background: #fff;
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 2px 2px 0 #000;
  transition: all 0.1s
}

.pill:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 #000
}

.pill.active {
  background: var(--accent);
  color: #fff;
  border-color: #000
}

.lines {
  padding: 20px 0 40px;
  display: flex;
  flex-direction: column;
  gap: 12px
}

.line-card {
  background: #fff;
  border: var(--border-w) solid var(--line);
  border-radius: var(--radius);
  padding: 10px 20px 10px 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all .1s;
  position: relative;
  font-size: 16px;
  line-height: 1.6
}

.line-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #000
}

.line-card.active {
  outline: none;
  border-color: #000;
  background: var(--active);
  box-shadow: 6px 6px 0 #000;
  transform: translate(-2px, -2px)
}

.line-card.playing {
  background: #FFD700;
  border-color: #000
}

.line-en {
  font-weight: 800;
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text)
}

.line-zh {
  color: #000;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 500;
  font-family: sans-serif
}

.word {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all .08s;
  position: relative;
  margin: 0 2px;
  border: 1px solid transparent
}

.word:hover {
  background: #fff;
  border-color: #000;
  box-shadow: 2px 2px 0 #000;
  transform: translate(-1px, -1px)
}

.word.live {
  background: var(--accent);
  color: #fff;
  border-color: #000;
  box-shadow: 3px 3px 0 #000;
  transform: scale(1.1) rotate(-1deg)
}

.word.playing {
  background: #FFD700;
  color: #000;
  border-color: #000
}

.sep {
  display: none
}

/* 点读模式指示器 */
.point-mode .line-card::after {
  content: 'POINT MODE';
  position: absolute;
  top: -10px;
  right: 12px;
  font-size: 12px;
  font-weight: 900;
  color: #000;
  background: #fff;
  padding: 2px 6px;
  border-radius: 0;
  border: 2px solid #000;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 2px 2px 0 #000;
}

.point-mode .line-card:hover::after {
  opacity: 1
}

.point-mode .word::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px dashed #000;
  border-radius: 4px;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
  z-index: 5
}

.point-mode .word:hover::after {
  opacity: 1
}

/* 连读模式指示器 */
.chain-mode .line-card::after {
  content: 'CHAIN MODE';
  position: absolute;
  top: -10px;
  right: 12px;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  background: #000;
  padding: 2px 6px;
  border-radius: 0;
  border: 2px solid #000;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 2px 2px 0 #fff;
}

.chain-mode .line-card:hover::after {
  opacity: 1
}