:root {
  --bg: #f7f8fc;
  --panel: #ffffff;
  --line: #e6e8f0;
  --text: #1f2430;
  --muted: #687086;
  --brand: #2f6feb;
  --brand-dark: #2458bd;
  --ok: #17803d;
  --shadow: 0 6px 20px rgba(31, 36, 48, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.hero {
  background: linear-gradient(120deg, #dae7ff, #f2f6ff 60%, #f6fbff);
  border-bottom: 1px solid var(--line);
  padding: 1rem 1rem 1.1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

h1 {
  margin: 0;
  font-size: 1.3rem;
}

.subtitle {
  margin: 0.4rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.controls label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
  font-size: 0.88rem;
}

select,
input[type="text"],
input[type="range"] {
  font: inherit;
}

.hero-actions {
  margin-top: 0.7rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.panel h2 {
  margin: 0 0 0.8rem;
  font-size: 1.12rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.6rem;
}

.card-list {
  display: grid;
  gap: 0.65rem;
}

.item-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.72rem 0.78rem;
  background: #fff;
}

.item-main {
  margin: 0;
  font-size: 1rem;
}

.item-sub {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.actions {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

button {
  border: 1px solid #ccd4e6;
  background: #fff;
  color: var(--text);
  border-radius: 9px;
  padding: 0.36rem 0.62rem;
  font-size: 0.88rem;
  cursor: pointer;
}

button:hover {
  border-color: #9eb5eb;
}

button.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

button.primary:hover {
  background: var(--brand-dark);
}

.tools-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}

.tools-row input {
  flex: 1;
  min-width: 210px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  background: #fff;
}

.hint {
  color: var(--muted);
  margin-top: -0.25rem;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
}

.sentence-en {
  margin: 0;
  font-size: 1rem;
  user-select: text;
}

.sentence-zh {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  user-select: text;
}

.tips {
  margin: 0;
  padding-left: 1.2rem;
}

.selection-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #141824;
  color: #fff;
  padding: 0.55rem 0.8rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  z-index: 50;
}

.selection-bar.hidden {
  display: none;
}

.selection-actions {
  display: flex;
  gap: 0.45rem;
}

.selection-actions button {
  border-color: #424d68;
  background: #1f2638;
  color: #fff;
}

.toast {
  position: fixed;
  top: 10px;
  right: 10px;
  background: #10253d;
  color: #fff;
  border-radius: 8px;
  padding: 0.46rem 0.66rem;
  font-size: 0.86rem;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 60;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.tag {
  color: var(--ok);
  font-size: 0.82rem;
  margin-left: 0.35rem;
}

@media (max-width: 720px) {
  .hero {
    position: static;
  }
}
