﻿:root {
  --bg-top: #fff6eb;
  --bg-mid: #ffe7d2;
  --bg-bottom: #ffd6be;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-border: rgba(255, 255, 255, 0.9);
  --text: #3f261b;
  --muted: #7a5545;
  --accent: #f26c3d;
  --accent-strong: #d95126;
  --cool: #2f7e8a;
  --tag-bg: rgba(255, 255, 255, 0.75);
  --tag-border: rgba(161, 98, 70, 0.2);
  --success: #1a7f45;
  --error: #b52a2a;
  --shadow: 0 18px 40px rgba(123, 68, 42, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 22px;
  color: var(--text);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 8% 14%, rgba(255, 255, 255, 0.8), transparent 34%),
    radial-gradient(circle at 90% 8%, rgba(242, 108, 61, 0.18), transparent 28%),
    radial-gradient(circle at 82% 84%, rgba(47, 126, 138, 0.18), transparent 30%),
    linear-gradient(155deg, var(--bg-top), var(--bg-mid) 44%, var(--bg-bottom));
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 280px;
  height: 280px;
  top: -80px;
  right: -40px;
  background: radial-gradient(circle, rgba(242, 108, 61, 0.38), rgba(242, 108, 61, 0));
  animation: floatA 9s ease-in-out infinite;
}

body::after {
  width: 240px;
  height: 240px;
  bottom: -70px;
  left: -70px;
  background: radial-gradient(circle, rgba(47, 126, 138, 0.28), rgba(47, 126, 138, 0));
  animation: floatB 11s ease-in-out infinite;
}

.page {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.hero,
.panel,
.list-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.hero {
  padding: 26px 22px;
}

.hero-badge {
  margin: 0;
  width: fit-content;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(120deg, var(--accent), #f28a4b);
}

h1 {
  margin: 10px 0 8px;
  font-family: "STKaiti", "KaiTi", "Kaiti SC", serif;
  font-size: clamp(2rem, 4.2vw, 2.9rem);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.06em;
}

.title-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.05em;
  line-height: 1;
}

.title-icon {
  width: 0.98em;
  height: 0.98em;
  object-fit: contain;
  border-radius: 0.14em;
  vertical-align: middle;
}

.title-text {
  line-height: 1;
}

.hero-desc {
  margin: 0;
  color: var(--muted);
  max-width: 52ch;
  line-height: 1.6;
}

.quick-row {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.quick-pill {
  border: 1px solid var(--tag-border);
  background: var(--tag-bg);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.93rem;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.quick-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(242, 108, 61, 0.5);
}

.panel {
  padding: 18px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #593a2e;
}

input,
select,
.btn {
  border-radius: 12px;
  font-size: 1rem;
}

input,
select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(143, 99, 79, 0.26);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
}

input:focus,
select:focus {
  outline: 2px solid rgba(242, 108, 61, 0.35);
  border-color: rgba(242, 108, 61, 0.65);
}

.action-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.btn {
  border: none;
  padding: 11px 10px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover {
  transform: none;
  filter: brightness(1.02);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(125deg, var(--accent), var(--accent-strong));
}

.btn-secondary {
  color: var(--cool);
  background: rgba(47, 126, 138, 0.12);
  border: 1px solid rgba(47, 126, 138, 0.25);
}

.preview-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-right: 42px;
}

.preview-btn .preview-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.preview-wave {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 34px;
  height: 18px;
  transition: opacity 0.2s ease;
}

.preview-wave .sound-pill {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5a4a;
  box-shadow: 0 0 0 0 rgba(255, 90, 74, 0.35);
}

.preview-wave .sound-bars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 14px;
}

.preview-wave .bar {
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff7a67, #ff4c3b);
  transform-origin: center;
  opacity: 0.85;
}

.preview-wave .b1 {
  height: 5px;
}

.preview-wave .b2 {
  height: 8px;
}

.preview-wave .b3 {
  height: 11px;
}

.preview-wave .b4 {
  height: 7px;
}

.preview-btn.is-playing {
  background: rgba(47, 126, 138, 0.2);
  border-color: rgba(47, 126, 138, 0.35);
}

.preview-btn.is-playing .preview-wave {
  opacity: 1;
}

.preview-btn.is-playing .sound-pill {
  animation: pillGlow 1s ease-in-out infinite;
}

.preview-btn.is-playing .b1 {
  animation: barPulse1 0.8s ease-in-out infinite;
}

.preview-btn.is-playing .b2 {
  animation: barPulse2 0.7s ease-in-out infinite;
}

.preview-btn.is-playing .b3 {
  animation: barPulse3 0.9s ease-in-out infinite;
}

.preview-btn.is-playing .b4 {
  animation: barPulse4 0.75s ease-in-out infinite;
}

.btn-fav {
  color: #8a481d;
  background: rgba(242, 108, 61, 0.14);
  border: 1px solid rgba(242, 108, 61, 0.3);
}

.btn-fav.active {
  color: #fff;
  background: linear-gradient(135deg, #f27d47, #c44723);
}

.translation-card {
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid rgba(143, 99, 79, 0.2);
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
  min-height: 188px;
}

.translation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.translation-head strong {
  font-size: 0.94rem;
  color: #5a3a2e;
}

.translate-btn {
  border: 1px solid rgba(47, 126, 138, 0.28);
  background: rgba(47, 126, 138, 0.12);
  color: var(--cool);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}

.translation-body {
  min-height: 118px;
  max-height: 118px;
  overflow-y: auto;
  padding-right: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.translation-item + .translation-item {
  margin-top: 4px;
}

.translation-body.loading {
  color: #8a6a5d;
}

.translation-body.success {
  color: #533427;
}

.translation-body.error {
  color: var(--error);
}

.status {
  min-height: 24px;
  margin: 12px 2px 2px;
  color: var(--muted);
  font-weight: 600;
}

.status.success {
  color: var(--success);
}

.status.error {
  color: var(--error);
}

.list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.list-card {
  padding: 14px;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.list-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.list-clear-btn {
  border: 1px solid rgba(143, 99, 79, 0.25);
  background: rgba(255, 255, 255, 0.7);
  color: #7a5545;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}

.list-clear-btn:hover {
  border-color: rgba(242, 108, 61, 0.45);
  color: #d95126;
}

.list-clear-btn.active {
  color: #fff;
  background: linear-gradient(135deg, #f27d47, #c44723);
  border-color: transparent;
}

h2 {
  margin: 0;
  font-size: 1rem;
  color: #5e3b2e;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  min-height: 78px;
  max-height: 78px;
  overflow-y: auto;
  padding-right: 4px;
}

.tag-btn,
.tag-empty {
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.88rem;
}

.tag-btn {
  border: 1px solid var(--tag-border);
  background: var(--tag-bg);
  color: var(--text);
  cursor: pointer;
}

.tag-btn:hover {
  border-color: rgba(242, 108, 61, 0.5);
}

.fav-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.fav-word-btn {
  padding-right: 8px;
}

.fav-remove-btn {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(143, 99, 79, 0.22);
  background: rgba(255, 255, 255, 0.85);
  color: #b14e2e;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: none;
}

.tag-list.delete-mode .fav-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fav-remove-btn:hover {
  border-color: rgba(242, 108, 61, 0.55);
  background: rgba(242, 108, 61, 0.12);
}

.tag-empty {
  border: 1px dashed rgba(143, 99, 79, 0.25);
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: reveal 0.65s ease forwards;
}

.delay-1 {
  animation-delay: 0.08s;
}

.delay-2 {
  animation-delay: 0.16s;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatA {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-14px, 14px);
  }
}

@keyframes floatB {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(14px, -12px);
  }
}

@keyframes pillGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 90, 74, 0.3);
    transform: scale(0.95);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(255, 90, 74, 0.08);
    transform: scale(1.05);
  }
}

@keyframes barPulse1 {
  0%,
  100% { transform: scaleY(0.65); }
  50% { transform: scaleY(1.2); }
}

@keyframes barPulse2 {
  0%,
  100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1.35); }
}

@keyframes barPulse3 {
  0%,
  100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1.5); }
}

@keyframes barPulse4 {
  0%,
  100% { transform: scaleY(0.6); }
  50% { transform: scaleY(1.25); }
}

@media (max-width: 920px) {
  .action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .list-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body {
    padding: 14px;
  }

  .hero,
  .panel,
  .list-card {
    border-radius: 16px;
  }

  .hero {
    padding: 20px 16px;
  }

  .panel {
    padding: 14px;
  }

  h1 {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }
}



.translation-body::-webkit-scrollbar,
.tag-list::-webkit-scrollbar {
  width: 6px;
}

.translation-body::-webkit-scrollbar-thumb,
.tag-list::-webkit-scrollbar-thumb {
  background: rgba(143, 99, 79, 0.35);
  border-radius: 999px;
}
