:root {
  --bg: #0f1b2d;
  --bg2: #13233a;
  --card: #1a2c46;
  --line: #2b4162;
  --text: #e8eef8;
  --muted: #8fa3bf;
  --accent: #8ea9db;
  --accent2: #5b7fb8;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: radial-gradient(120% 80% at 50% 0%, #16273f 0%, var(--bg) 55%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", sans-serif;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 20px
           max(22px, env(safe-area-inset-bottom));
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand { display: flex; align-items: baseline; gap: 8px; }
.logo { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.ver {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 999px;
}

select {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  max-width: 46%;
}

.card {
  flex: 1;
  background: linear-gradient(180deg, var(--card), #16263d);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 46vh;
}

.meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .5px;
}

#word {
  margin: 10px 0 2px;
  font-size: clamp(30px, 11vw, 46px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: .5px;
  word-break: break-word;
}

.ipa {
  font-size: 14px;
  color: var(--accent);
  min-height: 18px;
  font-family: "Lucida Sans Unicode", "Segoe UI", sans-serif;
}

.zh {
  margin-top: 10px;
  font-size: 18px;
  color: #cfdcf0;
}

.example {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.example .en { margin: 0 0 6px; font-size: 14px; line-height: 1.5; color: #dfe8f6; }
.example .cn { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }

.progress { display: flex; flex-direction: column; gap: 4px; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: #2c4263;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--accent);
}
input[type="range"]::-moz-range-track {
  height: 4px; border-radius: 999px; background: #2c4263;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border: none; border-radius: 50%; background: var(--accent);
}

.times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
}

button {
  font-family: inherit;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.ghost {
  width: 56px;
  height: 56px;
  font-size: 13px;
  color: var(--muted);
}

.primary {
  width: 76px;
  height: 76px;
  font-size: 24px;
  border: none;
  color: #0f1b2d;
  background: linear-gradient(180deg, #a9c0e8, #7f9fd6);
  box-shadow: 0 8px 24px rgba(90, 130, 200, .35);
}

.primary:active, .ghost:active { transform: scale(.96); }

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

.speed { display: flex; gap: 6px; }

.speed button {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--muted);
}

.speed button.on {
  color: #0f1b2d;
  background: var(--accent);
  border-color: var(--accent);
}

.loop { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.loop input { accent-color: var(--accent2); }

.settings {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-label {
  font-size: 11px;
  color: #6f84a3;
  margin-right: 2px;
}

.settings button {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--muted);
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
}

.settings button.on {
  color: #dfe8f6;
  border-color: var(--accent2);
  background: rgba(94, 129, 183, .28);
}

.hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: #6f84a3;
  text-align: center;
}

@media (min-height: 760px) {
  #word { font-size: 46px; }
  .card { min-height: 50vh; }
}
