:root {
  --bg: #0f1117;
  --card: #171a23;
  --card-2: #1e2230;
  --text: #eef1f7;
  --muted: #8a93a6;
  --accent: #5b8cff;
  --accent-2: #7c5cff;
  --green: #3ecf8e;
  --yellow: #f5c451;
  --border: #262b3a;
  --radius: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1b2340 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 60px;
}

/* ---------- Header ---------- */
header {
  width: 100%;
  max-width: 760px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .3px;
}

.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px var(--accent);
}

.stats {
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--muted);
}
.stats b { color: var(--text); font-weight: 600; }

/* ---------- Filters ---------- */
.filters {
  width: 100%;
  max-width: 760px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all .18s ease;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

/* ---------- Card ---------- */
.card {
  width: 100%;
  max-width: 760px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px 36px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.04);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -80px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(91,140,255,.18), transparent 70%);
  pointer-events: none;
}

/* ---------- Content ---------- */
.content-area {
  position: relative;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.word-wrap {
  text-align: center;
  animation: fadeUp .35s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.word {
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.05;
  background: linear-gradient(135deg, #fff 30%, #9db4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  word-break: break-word;
}
.word.sentence {
  font-size: clamp(24px, 6vw, 42px);
  letter-spacing: -0.4px;
  line-height: 1.3;
}

.ipa {
  margin-top: 10px;
  font-size: 18px;
  color: var(--muted);
  font-family: "SF Mono", "Consolas", monospace;
}

.meaning {
  margin-top: 18px;
  font-size: 17px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.translation {
  margin-top: 14px;
  font-size: 22px;
  font-weight: 600;
  color: #b7c9ff;
  line-height: 1.5;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  transition: filter .25s ease, opacity .25s ease;
  word-break: break-word;
}
.word.sentence ~ .translation {
  font-size: 20px;
}

.translation.blurred {
  filter: blur(10px);
  opacity: .6;
  user-select: none;
  pointer-events: none;
}

.example {
  margin-top: 18px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  font-style: italic;
  word-break: break-word;
}
.example::before {
  content: "e.g. ";
  color: #5b6377;
  font-style: normal;
}

/* ---------- 名言展示 ---------- */
.quote-display {
  display: none;
  text-align: center;
  padding: 0 10px;
  animation: fadeUp .35s ease;
}
.quote-display.show {
  display: block;
}
.quote-text {
  font-size: clamp(20px, 3.2vw, 28px);
  font-weight: 600;
  line-height: 1.55;
  color: #d0d8f0;
  font-style: italic;
  margin-bottom: 18px;
  word-break: break-word;
}
.quote-author {
  font-size: 15px;
  color: var(--muted);
  letter-spacing: .5px;
}

/* ---------- 盲听遮盖 ---------- */
.blind-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 17, 23, .93);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
  z-index: 5;
  pointer-events: none;
}
.blind-cover.show {
  opacity: 1;
  visibility: visible;
}

.blind-cover-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: .5px;
  user-select: none;
  text-align: center;
  padding: 0 20px;
}
.blind-icon {
  font-size: 38px;
  opacity: .85;
}
.blind-sub {
  font-size: 12px;
  color: #5b6377;
  margin-top: 4px;
}

/* ---------- Actions ---------- */
.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 36px;
  flex-wrap: wrap;
}

button.btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 24px;
  border-radius: 14px;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
button.btn:active { transform: scale(.97); }

button.btn:disabled,
button.btn.is-loading {
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 10px 24px rgba(91,140,255,.35);
}
.btn-primary:hover { box-shadow: 0 12px 30px rgba(91,140,255,.5); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); }

/* ---------- Modes ---------- */
.modes {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}
.mode-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all .18s ease;
}
.mode-btn:hover { border-color: var(--accent); color: var(--text); }
.mode-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}

/* ---------- Rate Menu ---------- */
.rate-menu {
  position: fixed;
  background: #1f2433;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px 12px;
  width: 230px;
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
  z-index: 1000;
}
.rate-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.rate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.rate-header span:last-child {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

#rateSlider {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.rate-marks {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #5b6377;
  margin-top: 6px;
}

/* ---------- Hint ---------- */
.hint {
  margin-top: 26px;
  text-align: center;
  font-size: 12.5px;
  color: #5b6377;
  line-height: 2;
  padding: 0 4px;
}
kbd {
  background: #222738;
  border: 1px solid #2e3548;
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 2px 7px;
  font-family: inherit;
  font-size: 11.5px;
  color: #aeb7cc;
  white-space: nowrap;
}

/* ---------- Bottom Beam ---------- */
.scroll-track {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,.05);
  overflow: hidden;
}

.scroll-beam {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 28%;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(91,140,255,.2) 15%,
    rgba(124,92,255,.9) 50%,
    rgba(91,140,255,.2) 85%,
    transparent 100%
  );
  opacity: 0;
  transform: translateX(-120%);
  will-change: transform, opacity;
}
.scroll-beam.run {
  animation: beamSweep .65s cubic-bezier(.33,.1,.28,.95);
}
@keyframes beamSweep {
  0%   { transform: translateX(-120%); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateX(460%); opacity: 0; }
}

/* ---------- Loading Mask ---------- */
.loading-mask {
  position: fixed;
  inset: 0;
  background: #0b0d12;           /* 完全不透明，彻底遮住正文和广告 */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
  z-index: 2147483647;           /* 最大 z-index，压住任何广告 iframe */
  padding: 20px;
  overscroll-behavior: contain;
}
.loading-mask.show {
  opacity: 1;
  visibility: visible;
}

.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 32px;
  border-radius: 18px;
  background: rgba(30, 34, 48, .85);
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  transform: translateY(6px);
  transition: transform .2s ease;
  max-width: 360px;
  width: 100%;
  text-align: center;
}
.loading-mask.show .loading-box {
  transform: translateY(0);
}

.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.1);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: spin .8s linear infinite;
}

.loading-text {
  font-size: 13.5px;
  color: var(--muted);
  letter-spacing: .3px;
  line-height: 1.5;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- 语音包缺失引导 ---------- */
.voice-guide-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 2px;
}

.voice-guide-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .3px;
}

.voice-guide-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

.voice-guide-warn {
  color: #ff6b6b;
  font-weight: 600;
}

.voice-guide-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
  margin-top: 4px;
}

.voice-guide-btn {
  display: block;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: opacity .15s ease;
}
.voice-guide-btn:hover { opacity: .85; }
.voice-guide-btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.voice-guide-btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.voice-guide-dismiss {
  background: transparent;
  border: none;
  color: #5b6377;
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  padding: 6px;
  margin-top: 2px;
}
.voice-guide-dismiss:hover { color: var(--muted); }

/* ---------- 移动端适配 ---------- */
@media (max-width: 640px) {
  body {
    padding: 20px 14px 40px;
  }

  header {
    margin-bottom: 20px;
  }

  .logo {
    font-size: 16px;
  }

  .stats {
    font-size: 12px;
  }

  .filters {
    gap: 6px;
    margin-bottom: 16px;
  }

  .chip {
    padding: 6px 12px;
    font-size: 12.5px;
  }

  .card {
    padding: 32px 18px 28px;
    border-radius: 16px;
  }

  .content-area {
    min-height: 160px;
  }

  .word {
    font-size: clamp(34px, 9vw, 52px);
  }

  .word.sentence {
    font-size: clamp(22px, 6.5vw, 32px);
  }

  .ipa {
    font-size: 16px;
  }

  .meaning {
    margin-top: 14px;
    font-size: 15px;
    padding: 0 4px;
  }

  .translation {
    margin-top: 12px;
    font-size: 19px;
    padding: 0 4px;
  }
  .word.sentence ~ .translation {
    font-size: 17px;
  }

  .example {
    margin-top: 14px;
    font-size: 13.5px;
    padding: 0 4px;
  }

  .quote-text {
    font-size: clamp(18px, 5vw, 24px);
  }
  .quote-author {
    font-size: 14px;
  }

  .blind-cover-inner {
    font-size: 13px;
  }
  .blind-icon {
    font-size: 32px;
  }

  .actions {
    gap: 8px;
    margin-top: 26px;
  }

  button.btn {
    font-size: 14px;
    padding: 11px 16px;
    border-radius: 12px;
  }

  .modes {
    gap: 6px;
    margin-top: 16px;
  }
  .mode-btn {
    font-size: 12.5px;
    padding: 7px 13px;
  }

  .hint {
    margin-top: 20px;
    font-size: 12px;
    line-height: 1.7;
    color: #4d5568;
    padding: 0 6px;
  }
  .hint-keys {
    display: none;
  }

  .rate-menu {
    width: 210px;
    padding: 12px 14px 10px;
  }

  .loading-box {
    padding: 24px 20px;
    max-width: 320px;
  }

  .voice-guide-text {
    font-size: 12.5px;
  }

  .voice-guide-btn {
    padding: 10px 14px;
    font-size: 13px;
  }
}

@media (max-width: 380px) {
  .card {
    padding: 26px 14px 24px;
  }

  .word.sentence {
    font-size: 21px;
  }

  button.btn {
    padding: 10px 14px;
    font-size: 13.5px;
  }

  .mode-btn {
    font-size: 12px;
    padding: 6px 11px;
  }

  .hint {
    font-size: 11.5px;
  }
}
.quote-translation {
  margin-top: 16px;
  font-size: 18px;
  font-weight: 600;
  color: #b7c9ff;
  line-height: 1.55;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  transition: filter .25s ease, opacity .25s ease;
  word-break: break-word;
}
.quote-translation.blurred {
  filter: blur(10px);
  opacity: .6;
  user-select: none;
  pointer-events: none;
}

@media (max-width: 640px) {
  .quote-translation {
    margin-top: 12px;
    font-size: 16px;
    padding: 0 4px;
  }
}
/* ---------- 品牌区 ---------- */
.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.brand-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .3px;
}

.brand-en {
  color: var(--muted);
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: .5px;
  margin-left: 2px;
}

.tagline {
  font-size: 12.5px;
  color: #5b6377;
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .brand-name { font-size: 17px; }
  .brand-en { font-size: 12px; }
  .tagline {
    font-size: 11.5px;
    white-space: normal;
    line-height: 1.4;
  }
}
.loading-tagline {
  margin-top: 10px;
  font-size: 12.5px;
  font-style: italic;
  letter-spacing: 1.2px;
  color: #4d5568;
  font-weight: 400;
}

@media (max-width: 640px) {
  .loading-tagline {
    font-size: 11.5px;
    letter-spacing: 1px;
  }
}

/* ---------- 赞助链接 ---------- */
.support-wrap {
  display: flex;
  justify-content: center;
  margin-top: 22px;
  padding: 0 4px;
}

.support-link {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  width: fit-content;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .02);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-decoration: none;
  transition: border-color .2s ease, background .2s ease;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.support-link:hover {
  border-color: #333a4d;
  background: rgba(255, 255, 255, .04);
}

.support-link:active {
  transform: scale(.99);
}

.support-icon {
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
}

.support-text {
  flex: 1;
  min-width: 0;
}

.support-text b {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 640px) {
  .support-wrap {
    margin-top: 18px;
  }
  .support-link {
    padding: 11px 13px;
    font-size: 12.5px;
    gap: 8px;
    border-radius: 12px;
  }
  .support-icon {
    font-size: 15px;
  }
}
/* ---------- 商务合作 ---------- */
.biz-contact {
  margin-top: 14px;
  text-align: center;
  font-size: 12.5px;
  color: #4d5568;
  line-height: 1.6;
}

.biz-contact a {
  color: #6b7488;
  text-decoration: none;
  border-bottom: 1px dashed rgba(107, 116, 136, .4);
  transition: color .18s ease, border-color .18s ease;
}

.biz-contact a:hover {
  color: var(--muted);
  border-bottom-color: var(--muted);
}


@media (max-width: 640px) {
  .biz-contact {
    margin-top: 12px;
    font-size: 11.5px;
  }
}
.biz-contact .biz-item {
  display: inline-block;
  white-space: nowrap;
}

.biz-contact .biz-sep {
  margin: 0 8px;
  color: #3a4154;
  user-select: none;
}

@media (max-width: 640px) {
  .biz-contact .biz-sep {
    margin: 0 5px;
  }
  .biz-contact .biz-item {
    display: block;
    margin-top: 4px;
  }
  .biz-contact .biz-sep {
    display: none;
  }
}

.side-ad {
  display: none; /* 默认隐藏，移动端不占位 */
}

@media (min-width: 1180px) {
  body {
    position: relative;
  }

  .side-ad {
    display: block;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    z-index: 10;
  }

  .side-ad-left {
    left: calc(50% - 380px - 160px - 24px);
  }

  .side-ad-right {
    right: calc(50% - 380px - 160px - 24px);
  }
}

/* 视口不够高时，放弃居中，贴顶显示，保证曝光 */
@media (min-width: 1180px) and (max-height: 680px) {
  .side-ad {
    top: 1px;
    transform: none;
  }
}
/* ---------- Native Banner ---------- */
.native-ad-slot {
  margin: 28px auto 0;
  width: 100%;
  max-width: 700px;
}
@media (max-width: 640px) {
  .native-ad-slot {
    margin-top: 22px;
  }
}