/* 日语 TTS 试听评测 —— 移动端优先 */
:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1b1f24;
  --ink-2: #5b636d;
  --line: #e3e6ea;
  --brand: #2f6f5e;
  --brand-2: #3d8a76;
  --a: #4b7bec;
  --b: #d98324;
  --c: #7b5cd6;
  --err: #c0392b;
  --radius: 14px;
}

* { box-sizing: border-box; }

/* 兜底：任何子元素都不允许把页面撑出视口宽度 */
html, body { max-width: 100%; overflow-x: hidden; }
img, table, pre { max-width: 100%; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
  line-height: 1.6;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.hd { padding: 4px 2px 14px; }
.hd h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .02em;
}
.sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}
.sub a { color: var(--brand); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 12px;
}

/* 进度 */
.progress { margin-top: 10px; }
.progress .bar {
  height: 6px;
  background: #e6e9ee;
  border-radius: 99px;
  overflow: hidden;
}
.progress .bar i {
  display: block;
  height: 100%;
  background: var(--brand-2);
  border-radius: 99px;
  transition: width .3s ease;
}
.progress .ptext {
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-2);
}
.progress .ptext b { color: var(--brand); font-size: 15px; }

/* 题目 */
.qlevel {
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: .04em;
}
.qtext {
  margin-top: 10px;
  font-size: 26px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: .01em;
  word-break: break-word;
}

/* 按钮 */
.btn {
  display: inline-flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, border-color .15s, transform .06s;
}
.btn:active { transform: scale(.99); }
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
  margin-top: 14px;
}
.btn.primary:disabled {
  background: #b9c2bd;
  border-color: #b9c2bd;
  cursor: not-allowed;
}
.btn.play { padding: 14px 10px; }
.btn.play .pk { font-weight: 600; font-size: 16px; }
.btn.play .pst { font-size: 12px; color: var(--ink-2); }
.btn.play.playing {
  border-color: var(--brand-2);
  background: #eef7f4;
}
.btn.play.playing .pst { color: var(--brand); }
.btn.play.loading { opacity: .7; }
.btn.play.failed { border-color: var(--err); background: #fdf1ef; }
.btn.play.failed .pst { color: var(--err); }
.btn.play:disabled { opacity: .45; cursor: not-allowed; }

.players {
  display: grid;
  /* 1fr 的隐含最小值是 auto，会被按钮内容撑破，窄屏下导致整页横向溢出；
     minmax(0,1fr) 强制列宽可压缩，内容再长也不会撑出容器 */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
}
.err {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--err);
}

/* 选项 */
.choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .15s;
}
.choice input:checked + span {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

/* 票数条 */
.bars { display: flex; flex-direction: column; gap: 10px; }
.barrow {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.bk {
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mychoice {
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--brand-2);
  border-radius: 99px;
  padding: 1px 6px;
  white-space: nowrap;
}
.btrack {
  height: 12px;
  background: #eef0f3;
  border-radius: 99px;
  overflow: hidden;
}
.bfill {
  display: block;
  height: 100%;
  border-radius: 99px;
  min-width: 2px;
  transition: width .4s ease;
}
.bfill.bA { background: var(--a); }
.bfill.bB { background: var(--b); }
.bfill.bC { background: var(--c); }
.bnum {
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 输入 */
.enter label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.enter input {
  width: 100%;
  padding: 14px 16px;
  font-size: 22px;
  letter-spacing: .35em;
  font-family: inherit;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
  color: var(--ink);
}
.enter input:focus {
  outline: none;
  border-color: var(--brand-2);
  background: #fff;
}

/* 表格 */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl th, .tbl td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.tbl th {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 600;
  white-space: nowrap;
}
.tbl td.lead { font-weight: 700; color: var(--brand); }
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.muted { color: var(--ink-2); }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.mylist { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 12px;
  padding: 4px 10px;
  background: #eef7f4;
  color: var(--brand);
  border-radius: 99px;
  font-variant-numeric: tabular-nums;
}

.ft {
  margin-top: 22px;
  text-align: center;
  font-size: 11px;
  color: #99a1ab;
}

@media (min-width: 520px) {
  .qtext { font-size: 30px; }
  .wrap { padding-top: 28px; }
}
