:root {
  --bg: #f4f2fb;
  --bg-glow-a: rgba(123, 97, 255, 0.18);
  --bg-glow-b: rgba(168, 139, 255, 0.12);
  --panel: rgba(255, 255, 255, 0.72);
  --panel-solid: #ffffff;
  --text: #16141f;
  --muted: #6b6680;
  --accent: #7b61ff;
  --accent-deep: #5f46e8;
  --accent-soft: rgba(123, 97, 255, 0.12);
  --active-bg: rgba(123, 97, 255, 0.14);
  --active-border: #7b61ff;
  --border: rgba(123, 97, 255, 0.14);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.65);
  --shadow-sm: 0 8px 24px rgba(55, 40, 120, 0.06);
  --shadow-md: 0 18px 48px rgba(55, 40, 120, 0.1);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font: "SF Pro Display", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 12% -10%, var(--bg-glow-a), transparent 55%),
    radial-gradient(ellipse 70% 45% at 92% 8%, var(--bg-glow-b), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(123, 97, 255, 0.06), transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

.app-header {
  padding: 10px 24px;
  padding-top: max(10px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.header-title-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.app-header h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #4b3fd6 0%, var(--accent) 55%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.25;
}

.header-sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.nav-links a,
.nav-item {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.nav-links a:hover,
.nav-item:hover {
  color: var(--accent-deep);
  background: var(--accent-soft);
  text-decoration: none;
}

@media (pointer: coarse) {
  .nav-links a,
  .nav-item,
  .btn-primary,
  .btn-secondary,
  .voice-chip,
  .btn-speak {
    min-height: 44px;
  }
}

button,
a,
.sentence,
.word-token,
.article-card,
.folder-card,
.pack-card,
.voice-chip {
  -webkit-tap-highlight-color: rgba(123, 97, 255, 0.28);
  touch-action: manipulation;
}

.nav-links a:active,
.nav-item:active,
.voice-chip:active,
.sentence:active,
.article-card:active,
.folder-card:active,
.pack-card:active,
.pay-method:active,
.text-link:active {
  transform: scale(0.97);
  filter: brightness(0.94);
  transition-duration: 0.05s;
}

.sentence:active,
.word-token:active {
  background: var(--accent-soft);
}

@media (hover: none) {
  button:hover:not(:disabled),
  a.btn-primary:hover,
  a.btn-secondary:hover,
  a.btn-ghost:hover,
  .voice-chip:hover,
  .nav-links a:hover,
  .nav-item:hover,
  .article-card:hover,
  .folder-card:hover,
  .pack-card:hover,
  .btn-speak:hover:not(:disabled) {
    transform: none;
  }
}

.nav-item.is-active,
.nav-links a.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(123, 97, 255, 0.35);
}

.nav-item.nav-context {
  font-weight: 500;
  color: var(--muted);
}

.input-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar-secondary {
  margin-bottom: 2px;
}

.toolbar-primary {
  margin-top: 2px;
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
}

.layout {
  display: flex;
  gap: 22px;
  padding: 14px 24px 24px;
  min-height: calc(100vh - 56px);
}

.left-panel,
.right-panel {
  background: var(--panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
}

.left-panel {
  flex: 0 0 60%;
  max-width: 60%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 20px;
  padding-top: 28px;
}

.avatar {
  width: min(168px, 72%);
  align-self: center;
  flex: 0 0 auto;
  position: relative;
  margin-bottom: 4px;
}

.avatar-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.55), transparent 45%),
    linear-gradient(160deg, rgba(123, 97, 255, 0.22), rgba(255, 255, 255, 0.35) 55%, rgba(167, 139, 250, 0.2));
  border: 1px solid var(--glass-border);
  box-shadow:
    0 18px 36px rgba(75, 50, 160, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

#input-text {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  line-height: 1.55;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#input-text:focus {
  outline: none;
  border-color: rgba(123, 97, 255, 0.45);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.left-panel:has(.sentence) #input-text {
  min-height: 56px;
  max-height: 88px;
}

.left-panel:has(.sentence) .result-area {
  max-height: calc(100vh - 220px);
}

button,
a.btn-primary,
a.btn-secondary,
a.btn-ghost {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

button:hover:not(:disabled),
a.btn-primary:hover,
a.btn-secondary:hover,
a.btn-ghost:hover {
  border-color: rgba(123, 97, 255, 0.35);
  color: var(--accent-deep);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(123, 97, 255, 0.12);
}

button:active:not(:disabled),
a.btn-primary:active,
a.btn-secondary:active,
a.btn-ghost:active {
  transform: scale(0.96);
  filter: brightness(0.93);
  transition-duration: 0.05s;
}

button:disabled,
a.btn-primary.is-disabled,
a.btn-secondary.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  pointer-events: none;
}

.btn-primary,
#btn-generate {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  border-color: transparent;
  font-weight: 650;
  box-shadow: 0 12px 28px rgba(123, 97, 255, 0.35);
}

.btn-primary:hover:not(:disabled),
a.btn-primary:hover,
#btn-generate:hover:not(:disabled) {
  background: linear-gradient(135deg, #8b74ff 0%, var(--accent) 100%);
  border-color: transparent;
  color: #fff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
}

#btn-save-conversion.is-attention {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.18);
  animation: save-attention-pulse 1.6s ease-in-out infinite;
}

@keyframes save-attention-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.12); }
  50% { box-shadow: 0 0 0 5px rgba(123, 97, 255, 0.22); }
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 6px 10px;
  box-shadow: none;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-color: transparent;
  box-shadow: none;
}

.result-area {
  flex: 1;
  min-height: 280px;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.sentence {
  padding: 14px 16px;
  border-left: 3px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
  cursor: pointer;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.sentence .en {
  font-size: 1.12rem;
  margin-bottom: 4px;
  line-height: 1.65;
  font-weight: 600;
}

.word-token {
  cursor: pointer;
  border-radius: 4px;
  padding: 0 1px;
}

.word-token:hover,
.word-token:focus {
  background: var(--accent-soft);
  outline: none;
}

.word-action-menu {
  position: absolute;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.word-action-label {
  font-weight: 600;
  margin-right: 4px;
}

.sentence .zh {
  color: var(--muted);
  margin-bottom: 6px;
  font-size: 0.95rem;
  line-height: 1.55;
}

.sentence .words {
  font-size: 0.88rem;
  color: #5a4f8a;
  line-height: 1.55;
  margin-top: 2px;
  max-width: 100%;
}

.sentence .vocab-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35em 0.55em;
  padding: 2px 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sentence .vocab-w {
  font-weight: 650;
  color: #3d3560;
}

.sentence .vocab-ipa {
  color: #8b83a8;
  font-weight: 500;
}

.sentence .vocab-m {
  color: #5a4f8a;
}

.sentence.active {
  background: var(--active-bg);
  border-left: 3px solid var(--active-border);
  box-shadow: 0 10px 28px rgba(123, 97, 255, 0.16);
  transform: translateY(-1px);
}

.avatar-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.voice-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.voice-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px 10px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.voice-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(123, 97, 255, 0.28);
  box-shadow: 0 12px 24px rgba(123, 97, 255, 0.14);
}

.voice-chip.is-selected {
  background: var(--accent-soft);
  border-color: rgba(123, 97, 255, 0.45);
  box-shadow: 0 12px 28px rgba(123, 97, 255, 0.2);
}

.voice-chip img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 14px rgba(55, 40, 120, 0.18);
  transition: transform 0.08s ease, filter 0.08s ease;
}

.voice-chip.is-flat img {
  border-radius: 14px;
}

.voice-chip span {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

.voice-chip.is-selected span {
  color: var(--accent-deep);
}

#voice-profile.voice-profile-native,
#reader-voice.voice-profile-native,
.voice-profile-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.control-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.control-group {
  position: relative;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.control-group-title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-secondary.is-selected {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-weight: 600;
}

.controls-play .btn-primary {
  min-width: 6.5rem;
}

.btn-play-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-play-toggle .play-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent currentColor;
  margin-left: 2px;
}

.btn-play-toggle.is-playing .play-icon {
  width: 10px;
  height: 12px;
  border: none;
  margin-left: 0;
  background:
    linear-gradient(currentColor, currentColor) left / 3px 100% no-repeat,
    linear-gradient(currentColor, currentColor) right / 3px 100% no-repeat;
}

.btn-play-toggle.is-paused .play-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent currentColor;
  background: none;
  margin-left: 2px;
}

.voice-row select,
#voice-profile:not(.voice-profile-native) {
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
}

.rate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.rate-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}

.status,
.status-bar {
  margin: 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
  text-align: left;
  min-height: 1.5em;
}

.status:empty,
.status-bar:empty {
  display: none;
}

.voice-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.rate-row label {
  color: var(--muted);
  font-size: 0.9rem;
}

.rate-row input[type="range"] {
  flex: 1;
  min-width: 100px;
  accent-color: var(--accent);
}

#speech-rate-label,
#reader-rate-label,
#sentence-gap-label,
#reader-gap-label {
  min-width: 2.5em;
  font-weight: 600;
}

.status-bar {
  margin-top: auto;
}

@media (max-width: 1100px) {
  .layout {
    flex-direction: column;
  }

  .left-panel,
  .right-panel {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
  }

  .avatar {
    width: min(120px, 40%);
  }

  .right-panel {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding-top: 18px;
    gap: 14px;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.error-banner {
  color: #8b1e1e;
  background: rgba(253, 236, 236, 0.92);
  border: 1px solid #f0c2c2;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}

.library-layout {
  display: flex;
  gap: 22px;
  padding: 18px 28px 28px;
  align-items: flex-start;
}

.library-form-panel,
.library-list-panel {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
}

.library-form-panel h2,
.library-list-panel h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.library-form-panel label {
  display: block;
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.library-form-panel input,
.library-form-panel textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.library-form-panel input:focus,
.library-form-panel textarea:focus {
  outline: none;
  border-color: rgba(123, 97, 255, 0.45);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.library-form-panel textarea {
  min-height: 220px;
  resize: vertical;
}

.library-compose {
  margin: 0 0 18px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow-sm);
}

.library-compose[hidden] {
  display: none !important;
}

.library-compose .compose-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.library-compose label {
  display: block;
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.library-compose input,
.library-compose textarea,
.library-compose select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.library-compose textarea {
  min-height: 160px;
  resize: vertical;
}

.library-compose select {
  max-width: 320px;
}

.library-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.article-card:hover {
  transform: translateY(-2px);
  border-color: rgba(123, 97, 255, 0.28);
  box-shadow: 0 14px 32px rgba(123, 97, 255, 0.12);
}

.word-card {
  position: relative;
  padding-right: 44px;
}

.btn-icon-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #8b1e1e;
  cursor: pointer;
}

.btn-icon-delete:hover {
  background: #fdf2f2;
  border-color: #f0c2c2;
}


.library-layout.known-only {
  grid-template-columns: 1fr;
}

.library-layout.known-only .library-list-panel {
  max-width: 960px;
}

.known-chip-wrap {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  align-items: flex-start;
}

.known-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-sm);
  line-height: 1.2;
}

.known-chip-word {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
}

.known-chip-del {
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0 !important;
  border: none;
  background: transparent;
  color: #8b1e1e;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 4px;
  cursor: pointer;
}

.known-chip-del:hover {
  background: #fdf2f2;
}

.wb-list-head {
  margin-bottom: 10px;
}

.wb-list-hint {
  margin: 4px 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
}

.wb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 12px;
}

.wb-toolbar[hidden] {
  display: none !important;
}

.wb-toolbar input[type="search"] {
  flex: 1 1 220px;
  min-width: 160px;
  max-width: 360px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font: inherit;
  background: rgba(255, 255, 255, 0.92);
}

.wb-toolbar input[type="search"]:focus {
  outline: none;
  border-color: rgba(123, 97, 255, 0.45);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.wb-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 0 0 12px;
}

.wb-pager[hidden] {
  display: none !important;
}

.wb-row-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wb-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 44px 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
}

.wb-row-main {
  flex: 1;
  min-width: 0;
}

.wb-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

.wb-row-word {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.wb-row-ipa {
  color: var(--muted);
  font-size: 0.92rem;
}

.wb-row-meaning {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 0.95rem;
}

.wb-row-example {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wb-row-del {
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
}

.word-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.article-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.article-preview {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.btn-danger {
  color: #8b1e1e;
  border-color: #f0c2c2;
}

.folder-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.folder-panel {
  margin-bottom: 8px;
}

/* 电脑端课程包：多列卡片（约原尺寸 2/3，宽屏约 5～6 列） */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  border: none;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.folder-grid > .empty-hint {
  grid-column: 1 / -1;
}

.empty-hint {
  width: 100%;
  padding: 18px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.45);
  text-align: left;
}

.empty-hint-title {
  margin: 0 0 6px;
  font-size: 0.98rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}

.empty-hint-desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 36em;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.folder-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  text-align: left;
  min-height: 0;
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.folder-card:hover,
.folder-card:focus {
  border-color: var(--accent);
  outline: none;
  background: rgba(255, 255, 255, 0.72);
  transform: none;
  box-shadow: 0 3px 10px rgba(80, 60, 140, 0.08);
}

.folder-card.drop-hover {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.folder-card.drop-reject {
  border-style: solid;
  border-color: #e11d48;
  background: rgba(225, 29, 72, 0.08);
  box-shadow: inset 0 0 0 1px rgba(225, 29, 72, 0.35);
}

.folder-card.folder-dragging {
  opacity: 0.55;
}

.folder-card.folder-sort-hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.28);
}

.folder-card-sortable {
  cursor: grab;
}

.folder-card-sortable:active {
  cursor: grabbing;
}

.conversion-file.file-card-sortable {
  cursor: grab;
}

.conversion-file.file-card-sortable:active {
  cursor: grabbing;
}

.conversion-file.file-sort-hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.28);
}

.conversion-file.dragging {
  opacity: 0.55;
}

.folder-cover-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.folder-level-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 18px;
  text-align: center;
  color: #fff;
  box-shadow: 0 1px 2px rgba(30, 20, 40, 0.22);
  pointer-events: none;
}

.folder-level-badge.is-easy { background: #2f9e6b; }
.folder-level-badge.is-medium { background: #c4841d; }
.folder-level-badge.is-hard { background: #d45a4a; }

.folder-level-badge.is-inline {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  vertical-align: middle;
}

.folder-card-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--accent-soft);
  display: block;
}

.folder-auto-cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 8px;
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--auto-bg, #5eb89a);
  box-sizing: border-box;
}

.folder-auto-cover-title {
  position: absolute;
  left: 8%;
  top: 9%;
  right: 32%;
  z-index: 1;
  color: #fff;
  font-weight: 750;
  font-size: clamp(0.78rem, 2.4vw, 1rem);
  line-height: 1.28;
  letter-spacing: 0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  text-shadow: 0 1px 1px rgba(20, 30, 40, 0.18);
}

.folder-auto-cover-glyph {
  position: absolute;
  right: -6%;
  bottom: -14%;
  z-index: 0;
  font-size: 4.4em;
  font-weight: 800;
  line-height: 1;
  color: var(--auto-glyph, rgba(255, 196, 77, 0.9));
  letter-spacing: -0.05em;
  user-select: none;
  pointer-events: none;
  text-shadow:
    -0.08em 0.05em 0 var(--auto-glyph2, rgba(30, 70, 55, 0.35)),
    0.05em -0.03em 0 rgba(255, 255, 255, 0.14);
}

.article-convert-status {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 650;
}

.article-convert-status.is-pending {
  color: #c4841d;
}

.article-convert-status.is-failed {
  color: #d45a4a;
}

.folder-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.folder-card-meta strong,
.folder-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-card-count {
  font-size: 0.78rem;
}

.folder-card-desc {
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.folder-pack-desc {
  margin: 0 0 12px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 52rem;
}

.folder-pack-desc[hidden] {
  display: none !important;
}

.folder-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.folder-access-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.folder-access-badge.is-free {
  color: #4a5568;
  background: rgba(80, 90, 110, 0.1);
}

.folder-access-badge.is-member {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.folder-access-badge.is-mine {
  color: #4a5568;
  background: rgba(80, 90, 110, 0.1);
}

.folder-card-locked {
  opacity: 0.92;
}

.folder-card-del {
  flex: 0 0 auto;
  padding: 4px 8px;
  font-size: 0.85rem;
}

.folder-card-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  padding: 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 5px rgba(40, 30, 70, 0.12);
}

.folder-grid .btn-icon-action {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.folder-grid .btn-icon-action svg {
  width: 13px;
  height: 13px;
}

@media (max-width: 560px) {
  .folder-grid {
    grid-template-columns: 1fr;
  }

  .folder-card {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
  }

  .folder-cover-wrap {
    width: 56px;
    flex: 0 0 auto;
  }

  .folder-card-cover {
    width: 56px;
    height: 56px;
    aspect-ratio: auto;
    border-radius: 10px;
  }

  .folder-card-meta strong,
  .folder-card-title {
    font-size: 1.02rem;
  }

  .folder-card-count {
    font-size: 0.86rem;
  }

  .folder-access-badge {
    padding: 2px 8px;
    font-size: 0.72rem;
  }

  .folder-card-actions {
    position: static;
    background: transparent;
    box-shadow: none;
    padding: 0;
    gap: 4px;
  }

  .folder-grid .btn-icon-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: inherit;
  }

  .folder-grid .btn-icon-action svg {
    width: 16px;
    height: 16px;
  }
}

.btn-icon-action {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.btn-icon-action[hidden],
.btn-ghost[hidden],
.btn-secondary[hidden],
#btn-back-root[hidden],
#btn-new-folder[hidden] {
  display: none !important;
}

.btn-icon-action:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-icon-action.btn-icon-danger {
  color: #8b1e1e;
}

.btn-icon-action.btn-icon-danger:hover:not(:disabled) {
  color: #8b1e1e;
  border-color: #f0c2c2;
  background: #fdf2f2;
}

.conversions-panel {
  flex: 1;
}

.conversions-toolbar {
  margin-bottom: 12px;
  gap: 12px;
}

.conversions-toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.conv-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-weight: 600;
}

.conv-breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.conv-breadcrumb a:hover {
  text-decoration: underline;
}

.crumb-sep {
  color: var(--muted);
}

.crumb-current {
  color: var(--text);
}

.root-exit-zone {
  margin: 0 0 12px;
  padding: 14px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
  font-weight: 600;
}

.root-exit-zone.drop-hover,
.folder-box.drop-hover,
.root-drop-zone.drop-hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.folder-box {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  background: rgba(255, 255, 255, 0.5);
  min-height: 72px;
}

.folder-head {
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.folder-body {
  min-height: 40px;
}

.conversion-file.dragging {
  opacity: 0.55;
}

.count-badge {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
}


.text-link {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 4px;
}

.text-link:hover {
  text-decoration: underline;
}

.recite-layout {
  padding: 8px 24px 24px;
  display: flex;
  justify-content: center;
}

.recite-layout[hidden],
.library-layout[hidden],
.library-form-panel[hidden],
.reader-layout[hidden] {
  display: none !important;
}

.reader-layout {
  /* reuse .layout */
}

.reader-title {
  margin: 8px 0 12px;
  font-size: 1.35rem;
}

.reader-text .reader-sentence .en {
  margin-bottom: 0;
}

.reader-text .reader-sentence {
  border: 1px solid transparent;
}

.reader-text .reader-sentence:hover {
  background: rgba(123, 97, 255, 0.06);
}

.recite-card {
  width: min(520px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.recite-word-line {
  margin: 16px 0 8px;
  white-space: nowrap;
  line-height: 1.2;
}

.recite-word {
  display: inline;
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  vertical-align: middle;
}

.btn-speak {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0 !important;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
}

.btn-speak svg {
  display: block;
}

.btn-speak:hover:not(:disabled) {
  background: #eef6f0;
  border-color: var(--accent);
  color: var(--accent);
}

.btn-speak:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.recite-ipa {
  color: var(--muted);
  min-height: 1.4em;
  margin-bottom: 12px;
}

.recite-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 14px 0 8px;
}

.recite-example-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 0;
  text-align: left;
}

.recite-example-text {
  flex: 1 1 auto;
  max-width: 420px;
}

.recite-example-row[hidden] {
  display: none !important;
}

.recite-example {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}

.recite-example-zh,
.word-card-example-zh {
  margin: 4px 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted, #666);
}

.recite-example-zh[hidden] {
  display: none !important;
}

.recite-example-row .btn-speak {
  margin-left: 0;
  flex: 0 0 auto;
  margin-top: 2px;
}

.btn-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-home svg {
  flex: 0 0 auto;
}

.word-example {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.45;
}

.word-card-title {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.word-card-ipa {
  margin: 0 0 4px;
  color: var(--muted, #666);
  font-family: "Segoe UI", "Lucida Sans Unicode", sans-serif;
  font-size: 0.95rem;
}

.word-card-meaning {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.4;
}

.word-card-example {
  margin-top: 2px;
}

.recite-meaning {
  font-size: 1.2rem;
  margin: 12px 0 8px;
  color: var(--text);
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }

  .left-panel,
  .right-panel {
    max-width: 100%;
    flex: none;
  }

  .result-area {
    max-height: 50vh;
  }

  .library-layout {
    flex-direction: column;
  }
}

/* —— 登录 / 会员 —— */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 50% at 12% -10%, var(--bg-glow-a), transparent 55%),
    radial-gradient(ellipse 70% 45% at 92% 8%, var(--bg-glow-b), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(123, 97, 255, 0.08), transparent 55%),
    var(--bg);
}

.auth-card {
  width: min(420px, 92vw);
  padding: 2.25rem 1.9rem;
  background: var(--panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
}

.auth-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #4b3fd6 0%, var(--accent) 55%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-sub {
  margin: 0 0 1.35rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-form label {
  display: block;
  margin-bottom: 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.auth-form input {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.7rem 0.9rem;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form input:focus {
  outline: none;
  border-color: rgba(123, 97, 255, 0.45);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.auth-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.auth-switch {
  margin: 0.25rem 0 0;
}

.auth-switch button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent, #7b61ff);
  cursor: pointer;
  font: inherit;
}

.auth-error {
  color: #b00020;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.user-status-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.user-badge {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
}

.btn-logout {
  font-size: 0.85rem;
}

.gate-dialog,
.app-dialog {
  position: fixed;
  inset: 0;
  background: rgba(55, 40, 120, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 1rem;
  animation: app-dialog-fade 0.16s ease-out;
}

.gate-dialog[hidden],
.app-dialog[hidden] {
  display: none !important;
}

.mobile-qr {
  display: flex;
  justify-content: center;
  margin: 0.35rem 0 0.85rem;
}

.mobile-qr img {
  display: block;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px;
  box-shadow: var(--shadow-sm);
}

.mobile-entry-url {
  margin-top: 0.35rem !important;
  font-size: 0.82rem !important;
  word-break: break-all;
  color: var(--accent-deep) !important;
}

.gate-dialog-card,
.app-dialog-card {
  width: min(420px, 92vw);
  padding: 1.6rem 1.55rem 1.35rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: app-dialog-pop 0.18s ease-out;
}

.app-dialog-title,
.gate-dialog-card h2 {
  margin: 0 0 0.55rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.app-dialog-body,
.gate-dialog-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.app-dialog-body[hidden] {
  display: none !important;
}

.app-dialog-field {
  display: block;
  margin-top: 1rem;
}

.app-dialog-field[hidden] {
  display: none !important;
}

.app-dialog-field-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.app-dialog-field-label[hidden] {
  display: none !important;
}

.app-dialog-field input,
.app-dialog-field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.app-dialog-field textarea {
  min-height: 6.5rem;
  resize: vertical;
  line-height: 1.45;
}

.app-dialog-field input:focus,
.app-dialog-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.gate-actions,
.app-dialog-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 1.15rem;
}

.app-dialog-actions .btn-primary,
.app-dialog-actions .btn-secondary,
.app-dialog-actions .btn-ghost,
.app-dialog-actions .btn-danger {
  min-width: 4.5rem;
}

.app-dialog-btn-danger {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: #fff !important;
  border-color: transparent;
  font-weight: 650;
  box-shadow: 0 10px 24px rgba(190, 18, 60, 0.28);
}

.app-dialog-btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: #fff !important;
}

@keyframes app-dialog-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes app-dialog-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.member-page,
.admin-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.member-hero {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.2fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: stretch;
}

.member-summary,
.member-benefits,
.member-plans,
.member-topups,
.member-ledger {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.35rem;
  background: var(--panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.member-hero .member-summary,
.member-hero .member-benefits {
  margin-bottom: 0;
  height: 100%;
}

.member-summary h2,
.member-benefits h2,
.member-plans h2,
.member-topups h2,
.member-ledger h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.member-summary p {
  margin: 0 0 0.45rem;
  color: var(--text);
  font-size: 0.95rem;
}

.member-summary p:last-child {
  margin-bottom: 0;
}

.benefits-lead {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.55;
}

.benefits-list {
  margin: 0 0 0.85rem;
  padding-left: 1.15rem;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.65;
}

.benefits-list li {
  margin-bottom: 0.35rem;
}

.benefits-list strong {
  color: var(--accent-deep);
  font-weight: 650;
}

.benefits-note {
  margin: 0;
}

@media (max-width: 720px) {
  .member-hero {
    grid-template-columns: 1fr;
  }
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.pack-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.2rem 1.25rem 1.25rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pack-card:hover {
  transform: translateY(-2px);
  border-color: rgba(123, 97, 255, 0.3);
  box-shadow: 0 14px 32px rgba(123, 97, 255, 0.14);
}

.pack-card h3 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}

.pack-meta {
  margin: 0 0 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.pack-price {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

.pack-detail {
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
}

.pack-card .btn-order {
  margin-top: auto;
  align-self: stretch;
  text-align: center;
}

.pack-card--month {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.88), rgba(123, 97, 255, 0.08));
  border-color: rgba(123, 97, 255, 0.18);
}

.pack-card--quarter {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.88), rgba(95, 70, 232, 0.12));
  border-color: rgba(95, 70, 232, 0.22);
}

.pack-card--quarter .pack-price {
  color: var(--accent-deep);
}

.pack-card--year {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.9), rgba(167, 139, 250, 0.2));
  border-color: rgba(123, 97, 255, 0.35);
  box-shadow: 0 12px 28px rgba(123, 97, 255, 0.14);
}

.pack-card--year .pack-price {
  background: linear-gradient(120deg, #4b3fd6, #7b61ff 55%, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pack-card--topup {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.9), rgba(56, 120, 170, 0.07));
  border-color: rgba(56, 120, 170, 0.16);
}

.pack-card--topup .pack-price {
  color: #2f5f86;
}

.pack-card--topup-small {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.92), rgba(56, 120, 170, 0.05));
}

.pack-card--topup-medium {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.9), rgba(56, 120, 170, 0.1));
  border-color: rgba(56, 120, 170, 0.22);
}

.pack-card--topup-large {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.9), rgba(56, 120, 170, 0.16));
  border-color: rgba(47, 95, 134, 0.28);
  box-shadow: 0 12px 28px rgba(47, 95, 134, 0.1);
}

.pack-card--topup:hover {
  border-color: rgba(47, 95, 134, 0.35);
  box-shadow: 0 14px 32px rgba(47, 95, 134, 0.12);
}

.ledger-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.checkout-page {
  max-width: 520px;
}

.checkout-kicker {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.checkout-sub {
  margin: 1.15rem 0 0.7rem;
  font-size: 0.95rem;
}

.pay-amount {
  margin: 0.15rem 0 0.35rem;
  font-size: 2.35rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(120deg, #4b3fd6 0%, var(--accent) 55%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pay-methods {
  display: grid;
  gap: 0.75rem;
}

.pay-method {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.pay-method strong {
  display: block;
  font-size: 1.02rem;
}

.pay-method .pack-detail {
  display: block;
  margin-top: 0.12rem;
}

.pay-method:hover {
  border-color: rgba(123, 97, 255, 0.3);
  transform: translateY(-1px);
}

.pay-method.is-selected {
  border-color: rgba(123, 97, 255, 0.45);
  box-shadow: 0 12px 28px rgba(123, 97, 255, 0.14);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.92), rgba(123, 97, 255, 0.1));
}

.pay-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pay-dot-wechat { background: #07c160; }
.pay-dot-alipay { background: #1677ff; }

.checkout-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.checkout-actions .btn-primary,
.checkout-actions .btn-secondary {
  display: block;
  text-align: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 9px 16px;
  border: 1px solid transparent;
}

.checkout-result h2 {
  margin-bottom: 0.5rem;
}

.admin-user-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.admin-rates {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

@media (hover: none) {
  button:hover:not(:disabled),
  .voice-chip:hover,
  .nav-links a:hover,
  .nav-item:hover,
  .article-card:hover,
  .folder-card:hover,
  .pack-card:hover,
  .pack-card--topup:hover,
  .pay-method:hover,
  .btn-speak:hover:not(:disabled),
  .btn-icon-action:hover:not(:disabled),
  .btn-icon-delete:hover,
  .known-chip-del:hover {
    transform: none;
    filter: none;
  }

  button:active:not(:disabled),
  .nav-links a:active,
  .nav-item:active,
  .voice-chip:active,
  .article-card:active,
  .folder-card:active,
  .pack-card:active,
  .pay-method:active,
  .btn-speak:active:not(:disabled),
  .btn-icon-action:active:not(:disabled) {
    transform: scale(0.96);
    filter: brightness(0.92);
    transition-duration: 0.04s;
  }
}

.is-pressed {
  transform: scale(0.9) !important;
  filter: brightness(0.8) !important;
  transition-duration: 0.06s !important;
}

button.is-pressed,
a.is-pressed,
.voice-chip.is-pressed,
.sentence.is-pressed,
.article-card.is-pressed,
.folder-card.is-pressed,
.pack-card.is-pressed,
.pay-method.is-pressed {
  box-shadow: inset 0 4px 12px rgba(70, 40, 140, 0.28);
}

.voice-chip.is-pressed {
  background: rgba(123, 97, 255, 0.28) !important;
  border-color: rgba(123, 97, 255, 0.75) !important;
}

.voice-chip.is-pressed img {
  transform: scale(0.84);
  filter: brightness(0.86);
}

.install-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.install-intro {
  margin-bottom: 1.25rem;
}

.install-intro h2 {
  margin: 0 0 0.4rem;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.install-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  max-width: 36rem;
}

.install-scan {
  margin-bottom: 1.25rem;
  padding: 1.35rem 1.35rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
  text-align: center;
}

.install-scan h3,
.install-panel h3,
.install-panel h4 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.install-panel-preview {
  text-align: center;
}

.install-panel-preview .install-ios-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: left;
}

.install-panel-preview .install-ios-block h4 {
  margin: 0;
  font-size: 1rem;
}

.install-panel-preview .install-actions {
  margin-bottom: 0;
}

.install-qr {
  margin: 0.25rem auto 0.75rem;
}

.install-qr img {
  margin: 0 auto;
}

.install-url {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--accent-deep);
  word-break: break-all;
}

.install-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  margin-bottom: 0.65rem;
}

.install-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.install-panel {
  padding: 1.25rem 1.3rem 1.15rem;
  background: var(--panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.install-panel-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.install-panel-head h3 {
  margin: 0;
}

.install-app-mark {
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(145deg, #5f46e8, #8b7cf7);
  box-shadow: 0 6px 14px rgba(95, 70, 232, 0.28);
}

.install-app-icon {
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.55rem;
  object-fit: cover;
  box-shadow: 0 6px 14px rgba(95, 70, 232, 0.22);
}

.install-app-mark-ios {
  background: linear-gradient(145deg, #5a5a5e, #8e8e93);
  box-shadow: 0 6px 14px rgba(70, 70, 80, 0.22);
}

.install-steps {
  margin: 0.65rem 0 1rem;
  padding-left: 1.15rem;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
}

.install-steps li {
  margin-bottom: 0.45rem;
}

.install-steps li:last-child {
  margin-bottom: 0;
}

.install-panel .btn-secondary[disabled] {
  width: auto;
  min-width: 10.5rem;
}

.install-apk-block .btn-secondary {
  min-width: 10.5rem;
}

.install-apk-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin: 0.15rem 0 0.25rem;
  padding: 0.85rem 0.75rem 0.95rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(123, 97, 255, 0.28);
}

.install-apk-qr {
  width: 148px;
  height: 148px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.install-apk-qr img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.install-apk-qr.is-placeholder {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(123, 97, 255, 0.04),
      rgba(123, 97, 255, 0.04) 8px,
      rgba(255, 255, 255, 0.9) 8px,
      rgba(255, 255, 255, 0.9) 16px
    );
  border-style: dashed;
}

.install-apk-qr-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.install-apk-caption {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.install-panel .hint,
.install-scan .hint {
  margin: 0.75rem 0 0;
}

.install-foot {
  margin: 0.25rem 0 0;
  text-align: center;
}

@media (max-width: 720px) {
  .install-cols {
    grid-template-columns: 1fr;
  }
}

/* 识图框选 */
body.ocr-crop-open {
  overflow: hidden;
}

.ocr-crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(18, 16, 28, 0.72);
  backdrop-filter: blur(4px);
}

.ocr-crop-panel {
  width: min(920px, 100%);
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.1rem 1.15rem;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(18, 16, 28, 0.28);
}

.ocr-crop-hint {
  margin: 0;
  color: var(--muted, #6b6680);
  font-size: 0.92rem;
}

.ocr-crop-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 280px;
  max-height: min(62vh, 560px);
  overflow: hidden;
  border-radius: 12px;
  background: #111018;
}

.ocr-crop-img {
  position: absolute;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.ocr-crop-shade {
  position: absolute;
  background: rgba(0, 0, 0, 0.48);
  pointer-events: none;
}

.ocr-crop-shade-t {
  top: 0;
  left: 0;
  right: 0;
}

.ocr-crop-shade-b {
  left: 0;
  right: 0;
  bottom: 0;
}

.ocr-crop-shade-l {
  left: 0;
}

.ocr-crop-shade-r {
  right: 0;
}

.ocr-crop-box {
  position: absolute;
  border: 2px solid #fff;
  cursor: move;
  touch-action: none;
}

.ocr-crop-handle {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent, #7b61ff);
  touch-action: none;
}

.ocr-crop-handle-nw { left: -10px; top: -10px; cursor: nwse-resize; }
.ocr-crop-handle-ne { right: -10px; top: -10px; cursor: nesw-resize; }
.ocr-crop-handle-sw { left: -10px; bottom: -10px; cursor: nesw-resize; }
.ocr-crop-handle-se { right: -10px; bottom: -10px; cursor: nwse-resize; }

.ocr-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.ocr-crop-mobile .ocr-crop-panel {
  width: 100%;
  max-height: calc(100vh - 1rem);
  border-radius: 16px 16px 0 0;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.ocr-crop-mobile .ocr-crop-stage {
  min-height: 52vh;
  max-height: 58vh;
}

.ocr-crop-mobile .ocr-crop-handle {
  width: 22px;
  height: 22px;
}

.m-ocr-row {
  margin-bottom: 0.35rem;
}

.m-ocr-row .m-btn {
  flex: 1 1 0;
}

