/* 学学：稳定的书桌与阅读面，制卡和复习不使用漂浮动画。 */

.learn-page {
  --learn-panel: #f4fbff;
  --learn-line: #b5d5e9;
  --learn-ink: #173b59;
  --learn-muted: #506d80;
  color: var(--learn-ink);
  padding-bottom: 70px;
}

.learn-page [hidden] {
  display: none !important;
}

.learn-top {
  display: flex;
  justify-content: space-between;
  margin: 10px 0 28px;
  font-size: 14px;
}

.learn-top a,
.learn-back {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.learn-heading {
  margin: 24px 0 30px;
}

.learn-heading h1 {
  font: 800 clamp(30px, 5vw, 48px)/1.3 var(--serif);
  margin: 10px 0 16px;
  letter-spacing: -0.035em;
}

.learn-heading p,
.learn-panel p {
  line-height: 1.8;
}

.learn-heading > p,
.learn-hint {
  color: var(--learn-muted);
}

.learn-hero {
  padding: 32px 0;
  max-width: 740px;
}

.learn-hero h1 {
  font-size: clamp(42px, 7vw, 70px);
}

.learn-panel {
  background: var(--learn-panel);
  border: 1px solid var(--learn-line);
  border-radius: 24px;
  padding: 28px;
  min-width: 0;
  box-shadow: 0 12px 32px #173b5908;
  overflow-wrap: anywhere;
}

.learn-panel h2 {
  margin-top: 0;
  font-size: 24px;
}

.learn-entry {
  display: block;
  max-width: 650px;
  color: inherit;
  text-decoration: none;
}

.learn-entry > span {
  color: var(--learn-muted);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.learn-entry h2 {
  margin-top: 20px;
  font-size: 32px;
}

.learn-entry strong {
  display: block;
  margin-top: 28px;
}

.learn-page button,
.learn-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #245f89;
  border-radius: 12px;
  padding: 12px 18px;
  min-height: 46px;
  background: #245f89;
  color: #fff;
  font: 600 16px/1.4 var(--sans);
  cursor: pointer;
  text-decoration: none;
}

.learn-page button.secondary,
.learn-button.secondary {
  color: var(--learn-ink);
  background: transparent;
  border-color: var(--learn-line);
}

.learn-page button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.learn-page :focus-visible {
  outline: 3px solid #e5ad28;
  outline-offset: 4px;
}

.learn-page input,
.learn-page textarea,
.learn-page select {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid var(--learn-line);
  border-radius: 10px;
  padding: 12px;
  background: var(--learn-panel);
  color: var(--learn-ink);
  font: 400 16px/1.6 var(--sans);
}

.learn-page textarea {
  resize: vertical;
  min-height: 88px;
}

.learn-form {
  display: grid;
  gap: 22px;
}

.learn-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

#learn-login {
  max-width: 470px;
}

.learn-inline {
  display: flex;
  gap: 12px;
  margin-bottom: 26px;
}

.learn-inline input {
  max-width: 470px;
}

.learn-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 0;
}

.learn-decks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.learn-deck {
  display: block;
  text-decoration: none;
  color: inherit;
}

.learn-deck strong {
  font-size: 32px;
}

.learn-deck small,
.learn-deck span {
  color: var(--learn-muted);
}

.learn-card-list {
  display: grid;
  gap: 14px;
}

.learn-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  text-decoration: none;
  color: inherit;
}

.learn-card-row h2 {
  margin: 0 0 6px;
  font-size: 23px;
}

.learn-card-row p {
  margin: 0;
}

.learn-card-row > span {
  color: var(--learn-muted);
  font-size: 14px;
  flex-shrink: 0;
}

.learn-editor {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: start;
}

.learn-preview {
  position: sticky;
  top: 100px;
  white-space: pre-wrap;
}

.learn-preview small {
  color: var(--learn-muted);
}

.learn-preview h2 {
  margin-top: 14px;
}

.learn-preview hr {
  margin: 26px 0;
  border: 0;
  border-top: 1px solid var(--learn-line);
}

.learn-message {
  min-height: 28px;
  color: #a03b24;
  line-height: 1.7;
  margin-top: 20px;
}

.learn-review-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 26px auto 18px;
  max-width: 760px;
  color: var(--learn-muted);
}

.learn-review {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(22px, 5vw, 52px);
  text-align: center;
}

.learn-question {
  font: 700 clamp(27px, 5vw, 43px)/1.5 var(--serif);
  margin: 30px 0 38px;
  white-space: pre-wrap;
}

#learn-answer {
  border-top: 1px solid var(--learn-line);
  padding-top: 28px;
}

#learn-answer h2 {
  font-size: 26px;
  white-space: pre-wrap;
}

.learn-example,
.learn-notes {
  white-space: pre-wrap;
  text-align: left;
}

.learn-example {
  padding: 20px;
  border-left: 3px solid #7ebddd;
  background: #67a9ff0d;
}

.learn-notes {
  color: var(--learn-muted);
}

.learn-ratings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.learn-ratings button {
  flex-direction: column;
}

.learn-ratings small {
  font-weight: 400;
  opacity: 0.8;
}

.learn-review .learn-actions {
  justify-content: center;
}

#refresh-review {
  margin: 20px 8px 0;
  font-size: 13px;
}

#retry-review {
  margin-top: 20px;
}

html[data-theme='night'] .learn-page {
  --learn-panel: #102d48;
  --learn-line: #456883;
  --learn-ink: #edf5ff;
  --learn-muted: #bad0e1;
}

html[data-theme='night'] .learn-message {
  color: #ffc8b6;
}

@media (max-width: 760px) {
  .learn-decks {
    grid-template-columns: 1fr;
  }
  .learn-editor {
    grid-template-columns: 1fr;
  }
  .learn-preview {
    position: static;
  }
  .learn-inline {
    flex-wrap: wrap;
  }
  .learn-inline input {
    max-width: none;
  }
  .learn-card-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .learn-panel {
    padding: 22px;
  }
  .learn-ratings {
    gap: 6px;
  }
  .learn-ratings button {
    padding: 12px 4px;
  }
  .learn-review-meta {
    font-size: 13px;
  }
}

html[data-theme='night'] body:has(.learn-page) {
  background: #071c30;
  color: #edf5ff;
}

html[data-theme='night'] body:has(.learn-page) .site-header {
  background: #102d48;
  border-color: #456883;
}

html[data-theme='night'] body:has(.learn-page) .site-footer {
  border-color: #456883;
}

html[data-theme='night'] body:has(.learn-page) .main-nav a {
  color: #c8dfed;
}

html[data-theme='night'] body:has(.learn-page) .main-nav a[aria-current='page'] {
  color: #fff;
}

/* A quiet account form on the shared pale blue shore. */

body:has(.account-scene) {
  background: #f1f7ff;
}

body:has(.account-scene) #main {
  padding: 0;
}

.learn-page:has(.account-scene) {
  width: 100%;
  padding-block: 0;
  margin: 0;
}

.learn-page:has(.account-scene) .learn-top {
  display: none;
}

.account-scene {
  min-height: calc(100svh - 210px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: 48px 24px;
  background: #f1f7ff;
}

.account-glass {
  width: 100%;
  max-width: 460px;
  justify-self: center;
  padding: 40px;
  border: 1px solid #d7e5ef;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 8px 28px #234e7010;
  color: #173b59;
  --learn-ink: #173b59;
  --learn-panel: #ffffffdb;
  --learn-line: #b1d4e8;
}

.account-heading {
  margin-bottom: 28px;
}

.account-heading > p {
  color: #256d9e;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin: 0 0 8px;
}

.account-heading h2 {
  font: 800 32px/1.3 var(--serif);
  margin: 0;
}

#learn-login {
  max-width: none;
  gap: 20px;
}

#learn-login label {
  gap: 8px;
  font-size: 14px;
  line-height: 22px;
}

.account-glass input {
  min-height: 52px;
  border-radius: 12px;
  margin: 0;
  padding: 12px 14px;
}

.account-glass input::placeholder {
  color: #647f93;
}

.account-code {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.account-code #learn-send {
  min-height: 52px;
  border-radius: 12px;
  background: #e1f3ff;
  color: #176598;
  border-color: #acd6ed;
  font-size: 14px;
  padding: 10px 14px;
}

.account-glass .account-help {
  min-height: 22px;
  margin: -12px 0 0;
  color: #506d80;
  font-size: 13px;
  line-height: 22px;
}

.account-glass .account-submit {
  min-height: 54px;
  border-radius: 27px;
  border-color: #0784c8;
  background: linear-gradient(120deg, #20b8ed, #0785dd);
  box-shadow: 0 6px 16px #158cce1c;
  font-size: 17px;
  margin-top: 4px;
}

.account-submit span {
  margin-left: 8px;
}

.account-note {
  font-size: 13px;
  line-height: 22px;
  text-align: center;
  color: #506d80;
  margin: -4px 0 0;
  text-wrap: pretty;
}

html[data-theme='night'] .account-scene {
  background: #071c30;
}

html[data-theme='night'] .account-glass {
  background: #f4f9fd;
}

@media (max-width: 900px) {
  .account-scene {
    min-height: calc(100svh - 250px);
    padding: 32px 20px;
  }
  .account-glass {
    justify-self: center;
    padding: 28px 24px;
    border-radius: 26px;
  }
  .account-heading {
    margin-bottom: 24px;
  }
  .account-code {
    gap: 8px;
  }
  .account-code #learn-send {
    padding-inline: 10px;
    font-size: 13px;
  }
  .account-heading h2 {
    font-size: 28px;
  }
}

.header-draw {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.header-draw svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Account pages stand apart from the learning channel. */

.account-page {
  padding-top: 36px;
}

.profile-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.profile-heading h1 {
  font: 700 25px/1.4 var(--sans);
  margin: 0;
}

.profile-heading > a {
  font-size: 14px;
  color: #4b6e88;
  text-decoration: none;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 36px;
  border: 1px solid #cae6ef;
  border-radius: 24px;
  background: linear-gradient(115deg, #d5f1fa, #edf8fd 65%, #d8eff7);
}

.profile-avatar {
  width: 112px;
  height: 112px;
  border: 4px solid #fff;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 16px #32668514;
  flex-shrink: 0;
}

.profile-kicker {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #55758a;
  margin: 0 0 8px;
}

.profile-hero h2 {
  font: 700 clamp(23px, 3vw, 30px)/1.4 var(--sans);
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.profile-hero p:last-child {
  color: #536f81;
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
}

.profile-menu {
  background: #fff;
  border: 1px solid #d8e6ef;
  border-radius: 20px;
  margin-top: 24px;
  padding: 0 24px;
}

.profile-menu details + details,
.profile-menu .profile-logout {
  border-top: 1px solid #e5edf4;
}

.profile-menu summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 0;
  cursor: pointer;
  list-style: none;
}

.profile-menu summary::-webkit-details-marker {
  display: none;
}

.profile-menu svg {
  width: 23px;
  height: 23px;
  flex-shrink: 0;
  stroke: #587990;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-menu summary > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 20px;
  font-size: 16px;
  font-weight: 600;
}

.profile-menu small {
  font-size: 13px;
  color: #607b8c;
  font-weight: 400;
}

.profile-menu summary > b {
  color: #7894a7;
  font-size: 24px;
  font-weight: 400;
  transition: transform var(--motion-fast) ease;
}
.profile-menu details[open] summary > b {
  transform: rotate(90deg);
}

.profile-detail {
  padding: 0 0 24px 39px;
}

.profile-email {
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 24px;
  color: #607b8c;
}

.profile-email strong {
  display: block;
  font-weight: 500;
  color: #173b59;
  overflow-wrap: anywhere;
}

#profile-form {
  max-width: 440px;
  gap: 20px;
}

#profile-form > button {
  justify-self: start;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 999px;
}

.profile-avatars {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 14px;
}

.profile-avatars legend {
  font-size: 14px;
  font-weight: 600;
  padding: 0 0 12px;
}

.profile-avatars label {
  display: block;
  position: relative;
  cursor: pointer;
}

.profile-avatars input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.profile-avatars img {
  width: 60px;
  height: 60px;
  border: 3px solid transparent;
  border-radius: 50%;
  object-fit: cover;
}

.profile-avatars input:checked + img {
  border-color: #2585b8;
}

.profile-avatars input:focus-visible + img {
  outline: 3px solid #e5ad28;
  outline-offset: 3px;
}

.profile-history > a {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid #edf2f7;
  color: #234f70;
  text-decoration: none;
  line-height: 1.6;
  font-size: 14px;
}

.profile-history time {
  font-size: 12px;
  color: #607b8c;
  white-space: nowrap;
}

.profile-history-note {
  color: #607b8c;
  font-size: 12px;
  line-height: 1.7;
}

.learn-page .profile-logout {
  display: flex;
  justify-content: start;
  width: 100%;
  gap: 16px;
  padding: 22px 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  color: #365b74;
  font-size: 16px;
  font-weight: 500;
}

html[data-theme='night'] .profile-hero {
  background: #153750;
  border-color: #456883;
}

html[data-theme='night'] .profile-hero p,
html[data-theme='night'] .profile-menu small,
html[data-theme='night'] .profile-history-note {
  color: #bad0e1;
}

html[data-theme='night'] .profile-menu {
  background: #102d48;
  border-color: #456883;
}

html[data-theme='night'] .profile-menu summary,
html[data-theme='night'] .profile-history > a,
html[data-theme='night'] .profile-email strong,
html[data-theme='night'] .profile-logout {
  color: #edf5ff;
}

@media (max-width: 600px) {
  .account-page {
    padding-block: 24px 48px;
  }
  .account-page:has(.account-scene) {
    padding-block: 0;
  }
  .profile-heading h1 {
    font-size: 21px;
  }
  .profile-heading > a {
    font-size: 12px;
  }
  .profile-hero {
    padding: 24px 20px;
    gap: 16px;
    border-radius: 20px;
  }
  .profile-avatar {
    width: 76px;
    height: 76px;
    border-width: 3px;
  }
  .profile-kicker {
    font-size: 9px;
  }
  .profile-hero h2 {
    font-size: 22px;
  }
  .profile-hero p:last-child {
    font-size: 12px;
  }
  .profile-menu {
    padding: 0 18px;
    margin-top: 20px;
  }
  .profile-menu summary > span {
    display: grid;
    gap: 4px;
  }
  .profile-menu small {
    font-size: 12px;
  }
  .profile-detail {
    padding-left: 0;
  }
  .profile-history > a {
    flex-direction: column;
    gap: 4px;
  }
}

.account-page > .learn-message {
  color: #416c84;
}

html[data-theme='night'] .account-page > .learn-message {
  color: #bad0e1;
}

.profile-avatars {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.profile-avatars label {
  display: grid;
  place-items: center;
}

.profile-avatars img {
  width: 68px;
  height: 68px;
}

.profile-name-field {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.profile-name-field input {
  min-width: 0;
}

.learn-page .profile-name-field button {
  flex-shrink: 0;
  padding: 10px 14px;
  font-size: 13px;
}

.profile-name-hint {
  font-size: 12px;
  color: #607b8c;
  font-weight: 400;
  line-height: 1.7;
}

@media (max-width: 600px) {
  .profile-avatars {
    gap: 10px;
  }
  .profile-avatars img {
    width: 100%;
    max-width: 60px;
    height: auto;
    aspect-ratio: 1;
  }
  .profile-name-field {
    gap: 8px;
  }
  .learn-page .profile-name-field button {
    padding-inline: 10px;
  }
}

.profile-name-group {
  display: grid;
  gap: 8px;
}

/* 学学首页：浅海书房，正文与入口保持真实、可访问。 */

.learn-page.learn-home {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 0 28px;
  background: #eff8ff;
  color: #173e69;
  --learn-ink: #173e69;
  --learn-muted: #567a98;
}

.learn-home-hero {
  min-height: 280px;
  display: flex;
  align-items: center;
  background: #e5f4ff url('/assets/learn-study-v1.a74406bc0625.webp') center/cover no-repeat;
  position: relative;
}

.learn-home-copy {
  margin: auto;
  position: relative;
  padding-block: 28px;
}

.learn-home-kicker {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}

.learn-home-copy h1 {
  font: 800 clamp(38px, 3.6vw, 54px)/1.24 var(--serif);
  letter-spacing: -0.04em;
  margin: 0 0 12px;
}

.learn-home-copy > p:last-child {
  color: #567a98;
  font-size: 16px;
  line-height: 1.65;
  margin: 0;
}

.learn-memory {
  margin: 0 auto;
  padding-block: 20px 0;
}

.learn-memory-heading {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 14px;
}

.learn-memory-heading h2 {
  font-size: 28px;
  margin: 0;
  flex-shrink: 0;
}

.learn-memory-heading h2 > span {
  display: inline-block;
  color: #76b6ef;
  font-size: 34px;
  vertical-align: middle;
  margin-right: 10px;
}

.learn-memory-heading > p {
  font-size: 16px;
  color: #567a98;
}

.learn-memory-note {
  margin-left: auto;
  font: 500 13px/1.8 var(--serif);
  color: #5587b6;
  transform: rotate(-6deg);
}

.learn-memory-panel {
  border: 1px solid #b9dbf1;
  border-radius: 26px;
  background: linear-gradient(110deg, #f8fcffb8, #edf8ff8f);
  display: grid;
  grid-template-columns: 28% 1fr;
  padding: 24px 28px;
  gap: 28px;
}

.learn-card-art {
  position: relative;
  min-height: 190px;
  align-self: center;
}

.learn-paper {
  position: absolute;
  width: 70%;
  height: 150px;
  border: 1px solid #a9d7fc;
  border-radius: 24px;
  left: 10%;
  top: 25px;
  background: #badafc;
}

.paper-back {
  transform: rotate(16deg) translate(24px, 20px);
  background: #d4edff;
}

.paper-mid {
  transform: rotate(9deg);
  background: linear-gradient(135deg, #d7efff, #a7caf5);
}

.paper-front {
  transform: rotate(-7deg);
  background: #fff8ec;
  border-color: #f0e3cc;
  top: 0;
  left: 8%;
  box-shadow: 0 15px 25px #5487ae15;
  padding: 22px;
}

.paper-front span {
  position: absolute;
  right: 20px;
  top: 12px;
  color: #f4c568;
  font-size: 28px;
}

.paper-front b {
  font-size: 32px;
  display: block;
  margin: 8px 0 14px;
}

.paper-front i {
  display: block;
  height: 5px;
  border-radius: 10px;
  background: #e7dfd3;
  width: 90%;
  margin: 13px 0;
}

.paper-front i:last-child {
  width: 55%;
}

.learn-memory-content {
  align-self: center;
}

.learn-memory-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.learn-memory-steps > div + div {
  border-left: 1px solid #d9eafb;
  padding-left: 24px;
}

.learn-step-icon {
  display: block;
  font-size: 32px;
  line-height: 1.1;
  color: #528ddd;
  margin-bottom: 10px;
}

.learn-memory-steps > div:last-child .learn-step-icon {
  color: #a180d5;
}

.learn-memory-steps h3 {
  font-size: 19px;
  margin: 0 0 10px;
}

.learn-memory-steps p {
  color: #567a98;
  font-size: 14px;
  line-height: 1.8;
  margin: 0;
}

.learn-memory-action {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 20px;
}

.learn-memory-action .learn-button {
  border-radius: 30px;
  padding: 14px 24px;
  background: #193f6a;
  border-color: #193f6a;
  white-space: nowrap;
}

.learn-memory-action p {
  font-size: 14px;
  color: #567a98;
  margin: 0;
}

.learn-home > .learn-message:empty {
  display: none;
}

html[data-theme='night'] .learn-home {
  background: #102b43;
  color: #edf5ff;
}

html[data-theme='night'] .learn-memory-panel {
  background: #17364f;
  border-color: #456883;
}

html[data-theme='night'] .learn-memory-heading > p,
html[data-theme='night'] .learn-memory-steps p,
html[data-theme='night'] .learn-memory-action p {
  color: #bad0e1;
}

html[data-theme='night'] .paper-front {
  color: #173e69;
}

@media (min-width: 1600px) {
  .learn-home-hero {
    min-height: 300px;
  }
}

@media (max-width: 900px) {
  .learn-home-hero {
    background-position: 58% center;
  }
  .learn-memory-note {
    display: none;
  }
  .learn-memory-heading {
    gap: 20px;
  }
  .learn-memory-panel {
    grid-template-columns: 30% 1fr;
    padding: 28px 22px;
    gap: 24px;
  }
  .learn-paper {
    width: 85%;
    left: 0;
  }
  .paper-front {
    padding: 22px;
    left: 0;
  }
  .paper-front b {
    font-size: 26px;
  }
  .learn-memory-steps {
    gap: 12px;
  }
  .learn-memory-steps > div + div {
    padding-left: 14px;
  }
}

@media (max-width: 600px) {
  .learn-home-hero {
    min-height: 260px;
    align-items: flex-start;
    background-position: 70% bottom;
    background-size: auto 260px;
    background-color: #e6f4ff;
  }
  .learn-home-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(#e6f4ff 0%, #e6f4ff 37%, transparent 65%);
  }
  .learn-home-copy {
    padding-block: 22px;
  }
  .learn-home-copy h1 {
    font-size: 34px;
  }
  .learn-home-copy > p:last-child {
    font-size: 15px;
    max-width: 210px;
  }
  .learn-home-kicker {
    font-size: 12px;
  }
  .learn-memory {
    padding-block: 16px 0;
  }
  .learn-memory-heading {
    display: block;
    margin-bottom: 12px;
  }
  .learn-memory-heading h2 {
    font-size: 27px;
  }
  .learn-memory-heading > p {
    font-size: 14px;
    margin: 8px 0;
  }
  .learn-memory-panel {
    grid-template-columns: 1fr;
    padding: 20px 16px;
    gap: 16px;
  }
  .learn-card-art {
    display: none;
  }
  .learn-paper {
    width: 75%;
    height: 166px;
  }
  .paper-front {
    left: 5%;
  }
  .learn-memory-steps {
    gap: 10px;
  }
  .learn-memory-steps > div + div {
    padding-left: 10px;
  }
  .learn-memory-steps h3 {
    font-size: 16px;
  }
  .learn-memory-steps p {
    font-size: 12px;
  }
  .learn-step-icon {
    font-size: 34px;
  }
  .learn-memory-action {
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
  }
  .learn-memory-action .learn-button {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .learn-home-copy {
    margin: 0 auto;
  }
  .learn-home-hero::before {
    background: linear-gradient(90deg, #e6f4fff2 0%, #e6f4ffd9 43%, #e6f4ff18 80%);
  }
}

/* 记忆卡片：浅海玻璃阅读面，覆盖分组、制卡、复习与空状态。 */

html[data-theme='day'] body:has(.memory-page) {
  background: #eff7ff url('/assets/memory-ocean-v1.ce530976c1a4.webp') center top/cover fixed no-repeat;
}

body:has(.memory-page) .depth-atmosphere {
  display: none;
}

.memory-page {
  min-height: calc(100svh - 100px);
  padding-block: 54px 64px;
  --learn-panel: #ffffffa6;
  --learn-line: #c9def5;
  --learn-ink: #153f61;
  --learn-muted: #597e9d;
  color: var(--learn-ink);
}

.memory-page .learn-back {
  display: inline-flex;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  margin: 0 0 12px;
  min-height: 32px;
  align-items: center;
}

.memory-page .learn-heading {
  margin: 10px 0 26px;
}

.memory-page .learn-heading h1 {
  font-size: clamp(34px, 4vw, 56px);
  margin: 6px 0 14px;
}

.memory-page .learn-heading > p,
.memory-deck-heading > div > p {
  color: var(--learn-muted);
  font-size: 18px;
  margin: 0;
}

.memory-page .memory-kicker {
  font-size: 16px;
  margin: 0 0 15px;
}

.memory-page .learn-panel {
  border-radius: 24px;
  box-shadow: 0 12px 32px #527cac06;
  background: var(--learn-panel);
  border-color: var(--learn-line);
}

.memory-page .learn-button,
.memory-page button {
  border-radius: 14px;
  background: linear-gradient(125deg, #28688d, #19547e);
  border-color: #2e729b;
  padding: 13px 24px;
}

.memory-page .secondary {
  background: transparent;
  border-color: var(--learn-line);
  color: var(--learn-ink);
}

.memory-page button:hover,
.memory-page .learn-button:hover {
  filter: brightness(1.07);
}

.memory-page button:disabled {
  cursor: default;
  opacity: 0.4;
}

.memory-page input,
.memory-page textarea,
.memory-page select {
  background: #ffffff50;
  border-color: var(--learn-line);
  border-radius: 12px;
}

.memory-page input::placeholder,
.memory-page textarea::placeholder {
  color: #7893ab;
  opacity: 1;
}

.memory-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--learn-line);
  border-radius: 22px;
  background: var(--learn-panel);
  padding: 26px 30px;
  margin: 24px 0;
}

.memory-stats > div {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 20px;
}

.memory-stats > div + div {
  border-left: 1px solid var(--learn-line);
}

.memory-stats > div > div {
  display: grid;
  gap: 7px;
}

.memory-stats strong {
  font: 700 34px/1.2 var(--sans);
}

.memory-stats > div > div > span {
  font-size: 14px;
  color: var(--learn-muted);
}

.memory-stat-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #e7f2ff;
  color: #4f9cf5;
  font-size: 36px;
}

.stat-1 {
  background: #fff0f1;
  color: #f27874;
}

.stat-2 {
  background: #e1f6f3;
  color: #39bba9;
}

.memory-toolbar {
  align-items: end;
  gap: 14px;
  margin: 24px 0;
}

.memory-toolbar input {
  max-width: 600px;
  flex: 1;
  height: 52px;
}

.memory-toolbar button {
  height: 52px;
  flex-shrink: 0;
}

.memory-sort {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  color: var(--learn-muted);
  font-size: 13px;
  white-space: nowrap;
}

.memory-sort select {
  width: 150px;
  font-size: 14px;
}

.memory-page .learn-decks {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.memory-page .learn-deck {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 26px;
  position: relative;
  transition:
    border-color var(--motion-fast),
    box-shadow var(--motion-fast);
}
.memory-page .learn-deck:hover {
  border-color: #83b8f4;
  box-shadow: 0 8px 24px #6f9ed214;
}

.memory-page .learn-deck h2 {
  font-size: 23px;
  margin: 0 0 18px;
}

.memory-deck-icon {
  width: 66px;
  height: 66px;
  border-radius: 18px;
  background: #e0edff;
  color: #4c91ed;
  display: grid;
  place-items: center;
  font-size: 34px;
  flex-shrink: 0;
}

.tone-1 {
  background: #fff0de;
  color: #dc9a4c;
}

.tone-2 {
  background: #dff5ef;
  color: #2eac9b;
}

.tone-3 {
  background: #ede8ff;
  color: #8c75dc;
}

.memory-deck-counts {
  display: flex;
  gap: 20px;
}

.memory-deck-counts > span {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--learn-muted);
}

.memory-deck-counts > span + span {
  border-left: 1px solid var(--learn-line);
  padding-left: 20px;
}

.memory-deck-counts strong {
  font-size: 23px;
  color: var(--learn-ink);
}

.memory-enter {
  font-size: 13px;
  margin-left: auto;
  align-self: end;
  white-space: nowrap;
  color: #236e9e;
}

.memory-deck-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
}

.memory-deck-heading .memory-stats {
  padding: 22px 12px;
  margin: 0;
}

.memory-deck-heading .memory-stats > div {
  padding: 0 14px;
  gap: 10px;
}

.memory-deck-heading .memory-stat-icon {
  width: 40px;
  height: 40px;
  font-size: 27px;
}

.memory-deck-heading .memory-stats strong {
  font-size: 27px;
}

.memory-deck-heading .learn-actions {
  gap: 10px;
}

.memory-deck-heading .learn-actions :is(button, a) {
  padding-inline: 18px;
}

.memory-card-toolbar {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 24px 0;
}

.memory-card-toolbar .learn-inline {
  flex: 1;
  margin: 0;
}

.memory-card-toolbar input {
  max-width: none;
}

.memory-filters {
  display: flex;
  gap: 0;
  border: 1px solid var(--learn-line);
  border-radius: 30px;
}

.memory-filters button {
  border-radius: 30px;
  padding: 10px 24px;
  border-color: transparent;
}

.memory-filters button[aria-pressed='true'] {
  background: #245f89;
  color: white;
}

.memory-empty {
  text-align: center;
  padding: 36px 24px 32px !important;
  grid-column: 1/-1;
}

.memory-empty > p {
  font-size: 18px;
  margin: 20px 0;
}

.memory-empty-art {
  position: relative;
  height: 150px;
  width: 240px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
}

.memory-empty-art::before {
  content: '';
  position: absolute;
  width: 210px;
  height: 80px;
  border-radius: 50%;
  background: #cceaff78;
  bottom: 5px;
}

.memory-empty-art > span {
  display: grid;
  place-items: center;
  position: relative;
  width: 100px;
  height: 120px;
  border: 1px solid #d8eafb;
  border-radius: 16px;
  background: #f8fcff;
  color: #65a7ed;
  font: 700 38px var(--sans);
  transform: rotate(-12deg);
  box-shadow:
    12px 8px 0 #c5e4fc,
    23px 16px 0 #dcf0ff;
}

.memory-empty-art > b {
  position: absolute;
  right: 32px;
  top: 28px;
  color: #f5cf76;
  font-size: 35px;
}

.memory-empty-art > i {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 3px solid #d3eafb;
  border-radius: 50%;
  left: 12px;
  top: 35px;
}

.memory-page .learn-card-row {
  background: #ffffffb0;
  border-color: #d5e5f5;
  padding: 24px 28px;
}

.memory-page .learn-card-row:hover {
  border-color: #84baf2;
}

.memory-page .learn-card-row p {
  color: var(--learn-muted);
}

.memory-page > .learn-actions {
  font-size: 14px;
  justify-content: center;
}

.memory-page .learn-editor {
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
}

.memory-page .learn-form {
  gap: 20px;
}

.memory-page .learn-form label {
  font-size: 16px;
}

.memory-page .learn-form textarea {
  min-height: 76px;
}

.memory-page .learn-form .learn-actions {
  margin: 0;
  border-top: 1px solid var(--learn-line);
  padding-top: 18px;
}

.memory-page .learn-preview {
  top: 40px;
  min-height: 480px;
}

.memory-page .learn-preview > h2 {
  font: 700 21px var(--sans);
  margin: 4px 0 30px;
}

.memory-preview-card {
  border: 1px solid var(--learn-line);
  border-radius: 22px;
  padding: 26px;
  min-height: 325px;
  background: linear-gradient(165deg, #ffffff75, #e3f1ff85);
}

.memory-preview-card > small:first-child {
  display: inline-block;
  padding: 5px 12px;
  background: #dfedff;
  color: #4e88c8;
  border-radius: 20px;
}

.memory-preview-card #preview-front {
  margin: 44px 0 32px;
  text-align: center;
  font: 700 32px/1.5 var(--serif);
}

.memory-preview-card > small:not(:first-child) {
  display: block;
  text-align: center;
}

.memory-preview-card #preview-answer {
  color: var(--learn-muted);
  line-height: 1.8;
}

.memory-page .learn-review {
  max-width: 900px;
  padding: 44px;
  background: linear-gradient(135deg, #ffffffb8, #edf7ffb8);
}

.memory-page .learn-review-meta {
  max-width: 900px;
  margin: 22px auto 20px;
  font-size: 16px;
}

.memory-page .learn-question {
  font-size: clamp(36px, 5vw, 64px);
  margin: 45px 0;
}

.memory-page .learn-ratings {
  gap: 12px;
  margin-top: 24px;
}

.memory-page .learn-ratings button {
  background: #e4f5f0;
  color: #258571;
  border-color: #c2e9df;
}

.memory-page .learn-ratings .rating-1 {
  background: #fff0f1;
  color: #ba4c53;
  border-color: #f4d4da;
}

.memory-page .learn-ratings .rating-2 {
  background: #fff5e4;
  color: #976c22;
  border-color: #f2dfb9;
}

.memory-page .learn-ratings .rating-4 {
  background: #e6f0ff;
  color: #3b73ad;
  border-color: #cbdef7;
}

.memory-page #refresh-review {
  font-size: 14px;
}

.memory-page .learn-hint {
  font-weight: 600;
  font-size: 17px;
}

.memory-complete {
  margin-top: 10px !important;
  max-width: 1040px !important;
}

.memory-complete .memory-empty-art > span {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b9efdf, #65d2c5);
  color: white;
  font-size: 60px;
  transform: none;
  box-shadow: none;
}

.memory-complete h1 {
  font-size: clamp(27px, 3vw, 40px);
  line-height: 1.5;
}

.memory-complete > p {
  color: var(--learn-muted);
  font-size: 18px;
}

.memory-complete .memory-stats {
  text-align: left;
  padding: 22px 10px;
}

.memory-complete .memory-stats strong {
  font-size: 28px;
}

.memory-complete .learn-actions {
  gap: 14px;
}

html[data-theme='night'] body:has(.memory-page) {
  background:
    linear-gradient(#071e32e8, #0a2540ed),
    url('/assets/memory-ocean-v1.ce530976c1a4.webp') center/cover fixed;
}

html[data-theme='night'] .memory-page {
  --learn-panel: #16364de0;
  --learn-line: #42617c;
  --learn-ink: #edf6ff;
  --learn-muted: #bad0e1;
}

html[data-theme='night'] .memory-page :is(.learn-review, .learn-card-row) {
  background: #16364de0;
}

html[data-theme='night'] .memory-page :is(input, textarea, select) {
  background: #102c43;
}

html[data-theme='night'] .memory-preview-card {
  background: #183c57;
}

html[data-theme='night'] .memory-enter {
  color: #a7d4ff;
}

@media (max-width: 1100px) {
  .memory-deck-heading {
    grid-template-columns: 1fr;
  }
  .memory-deck-heading .memory-stats {
    max-width: 600px;
  }
  .memory-page .learn-deck {
    gap: 16px;
    padding: 22px;
  }
  .memory-enter {
    display: none;
  }
  .memory-toolbar {
    flex-wrap: wrap;
  }
  .memory-sort {
    margin-left: 0;
  }
  .memory-stats > div {
    padding: 0 14px;
    gap: 14px;
  }
}

@media (max-width: 760px) {
  .memory-page {
    padding-block: 48px 40px;
  }
  .memory-page .learn-heading h1 {
    font-size: 36px;
  }
  .memory-page .learn-heading > p,
  .memory-deck-heading > div > p {
    font-size: 15px;
  }
  .memory-stats {
    padding: 18px 8px;
    border-radius: 18px;
  }
  .memory-stats > div {
    flex-direction: column;
    gap: 10px;
    padding: 0 6px;
    align-items: flex-start;
  }
  .memory-stats > div > div {
    padding-left: 6px;
  }
  .memory-stat-icon {
    width: 38px;
    height: 38px;
    font-size: 25px;
    margin-left: 6px;
  }
  .memory-stats strong {
    font-size: 27px;
  }
  .memory-stats > div > div > span {
    font-size: 12px;
  }
  .memory-page .learn-decks {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .memory-deck-counts {
    gap: 20px;
  }
  .memory-page .learn-deck h2 {
    font-size: 21px;
  }
  .memory-toolbar {
    gap: 10px;
  }
  .memory-toolbar input {
    flex-basis: 60%;
    min-width: 0;
  }
  .memory-toolbar button {
    padding-inline: 16px;
  }
  .memory-sort {
    margin-left: auto;
  }
  .memory-card-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .memory-card-toolbar .learn-inline {
    flex-wrap: nowrap;
    gap: 10px;
  }
  .memory-card-toolbar input {
    min-width: 0;
  }
  .memory-card-toolbar button {
    padding-inline: 18px;
  }
  .memory-filters {
    align-self: flex-start;
  }
  .memory-page .learn-editor {
    grid-template-columns: 1fr;
  }
  .memory-page .learn-preview {
    min-height: 0;
    position: static;
  }
  .memory-page .learn-review {
    padding: 28px 20px;
  }
  .memory-page .learn-review-meta {
    font-size: 12px;
    gap: 8px;
  }
  .memory-page .learn-question {
    margin: 35px 0;
  }
  .memory-page .learn-ratings {
    gap: 7px;
  }
  .memory-page .learn-ratings button {
    padding: 12px 6px;
    font-size: 14px;
  }
  .memory-complete .memory-stats {
    padding: 16px 8px;
  }
  .memory-complete .memory-stats > div {
    padding: 0 6px;
  }
  .memory-complete .memory-stats strong {
    font-size: 23px;
  }
  .memory-complete .learn-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .memory-page .learn-card-row {
    padding: 20px;
  }
  .memory-empty > p {
    font-size: 16px;
  }
  .memory-deck-heading .memory-stats {
    max-width: none;
  }
  .memory-page .learn-actions {
    gap: 10px;
  }
  .memory-deck-heading .learn-actions :is(button, a) {
    font-size: 14px;
    padding: 12px 14px;
  }
}

.memory-page #learn-answer.memory-answer {
  width: 100%;
  max-width: 900px;
  margin: 22px auto 0;
  padding: 28px 34px;
  border: 1px solid var(--learn-line);
  text-align: left;
}

.memory-answer > h2 {
  margin: 0 0 18px;
  font-size: 25px;
}

.memory-answer > p:not(.learn-example):not(.learn-notes) {
  text-align: center;
  color: var(--learn-muted);
  font-size: 14px;
}

@media (max-width: 760px) {
  .memory-page #learn-answer.memory-answer {
    padding: 24px 20px;
  }
}

/* 制卡：紧凑双栏填写区，与实时卡面并排。 */

.memory-page:has(.memory-card-editor) {
  padding-top: 24px;
  padding-bottom: 24px;
}

.memory-page:has(.memory-card-editor) .learn-heading {
  margin: 8px 0 18px;
}

.memory-page:has(.memory-card-editor) .learn-heading h1 {
  font-size: 32px;
  margin: 4px 0 6px;
}

.memory-page:has(.memory-card-editor) .learn-heading p {
  font-size: 14px;
}

.memory-page .memory-card-editor {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 20px;
}

.memory-page .memory-card-editor .learn-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  padding: 22px;
}

.memory-card-editor .learn-form > label {
  min-width: 0;
  gap: 6px;
}

.memory-card-editor .learn-form > label:first-child {
  grid-column: 1;
  grid-row: 1;
}

.memory-card-editor .editor-direction {
  grid-column: 2;
  grid-row: 1;
}

.memory-card-editor .learn-form > label:nth-child(2),
.memory-card-editor .learn-form > label:nth-child(3) {
  grid-column: 1/-1;
}

.memory-page .memory-card-editor :is(input, select, textarea) {
  padding: 9px 12px;
  line-height: 1.5;
}

.memory-page .memory-card-editor textarea {
  min-height: 76px;
  height: 76px;
  resize: vertical;
}

.memory-page .memory-card-editor .learn-actions {
  grid-column: 1/-1;
  padding-top: 14px;
  gap: 8px;
  flex-wrap: wrap;
}

.memory-card-editor .learn-actions button {
  padding: 11px 14px;
  font-size: 14px;
}

.memory-page .memory-card-editor .learn-preview {
  min-height: 0;
  padding: 22px;
  top: 24px;
  align-self: stretch;
  white-space: normal;
}

.memory-page .memory-card-editor .learn-preview > h2 {
  margin: 0 0 20px;
}

.memory-card-editor .memory-preview-card {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(165deg, #ffffffb0, #e3f1ff85);
}

.memory-card-editor .memory-preview-card > small:first-child {
  align-self: flex-start;
}

.memory-card-editor .memory-preview-card #preview-front {
  margin: 28px 0 20px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.memory-card-editor .memory-preview-card hr {
  width: 100%;
  margin: 8px 0 18px;
}

.memory-card-editor #preview-answer {
  text-align: center;
  white-space: pre-wrap;
}

.memory-card-editor #preview-answer p {
  margin: 8px 0;
}

@media (max-width: 760px) {
  .memory-page .memory-card-editor {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .memory-page .memory-card-editor .learn-form {
    padding: 18px;
    gap: 14px;
  }
  .memory-card-editor .learn-form > label:nth-child(4),
  .memory-card-editor .learn-form > label:nth-child(5) {
    grid-column: 1/-1;
  }
  .memory-page .memory-card-editor .learn-preview {
    position: static;
  }
  .memory-card-editor .memory-preview-card {
    min-height: 220px;
  }
}

@media (max-width: 420px) {
  .memory-card-editor .learn-form > label:first-child,
  .memory-card-editor .editor-direction {
    grid-column: 1/-1;
    grid-row: auto;
  }
}

/* 记忆卡片共享排版：标题 / 操作 / 内容采用统一节奏。 */

.memory-page {
  --memory-space: 24px;
  padding-block: 28px 40px;
}

.memory-page .learn-heading {
  margin: 8px 0 24px;
}

.memory-page .learn-heading h1 {
  font-size: 32px;
  line-height: 1.35;
  margin: 4px 0 8px;
}

.memory-page .learn-heading > p,
.memory-deck-heading > div > p {
  font-size: 16px;
  line-height: 1.7;
}

.memory-page .memory-kicker {
  font-size: 14px;
  margin: 0 0 8px;
}

.memory-page .learn-panel {
  border-radius: 18px;
  padding: 24px;
  box-shadow: none;
}

.memory-page :is(button, .learn-button) {
  min-height: 44px;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 16px;
  line-height: 1.4;
}

.memory-page :is(input, select) {
  min-height: 44px;
  padding: 9px 12px;
}

.memory-page :is(a, button, input, select, textarea):focus-visible {
  outline: 3px solid #438ac8;
  outline-offset: 3px;
}

.memory-page .memory-stats {
  margin: 0 0 24px;
  padding: 18px 12px;
  border-radius: 16px;
}

.memory-page .memory-stats > div {
  gap: 12px;
  padding: 0 20px;
}

.memory-page .memory-stat-icon {
  display: none;
}

.memory-page .memory-stats > div > div {
  gap: 6px;
}

.memory-page .memory-stats strong {
  font-size: 28px;
}

.memory-page .memory-stats > div > div > span {
  font-size: 14px;
}

.memory-page .memory-toolbar {
  margin: 0 0 24px;
  gap: 12px;
  align-items: center;
}

.memory-page .memory-toolbar :is(input, button) {
  height: 46px;
}

.memory-page .memory-sort {
  font-size: 14px;
}

.memory-page .learn-decks {
  gap: 16px;
}

.memory-page .learn-deck {
  padding: 22px;
  gap: 16px;
  align-items: flex-start;
}

.memory-page .memory-deck-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 26px;
}

.memory-page .learn-deck > div {
  min-width: 0;
  flex: 1;
}

.memory-page .learn-deck h2 {
  font-size: 21px;
  line-height: 1.4;
  margin: 0 0 16px;
}

.memory-page .memory-deck-counts {
  gap: 16px;
}

.memory-page .memory-deck-counts > span {
  font-size: 14px;
}

.memory-page .memory-deck-counts > span + span {
  padding-left: 16px;
}

.memory-page .memory-deck-counts strong {
  font-size: 22px;
}

.memory-page .memory-enter {
  display: none;
}

.memory-page .memory-deck-heading {
  grid-template-columns: 1fr;
  gap: 20px;
}

.memory-page .memory-deck-heading .memory-stats {
  max-width: none;
  margin: 0;
}

.memory-page .memory-deck-heading .learn-actions {
  margin: 16px 0 0;
  flex-direction: row;
  flex-wrap: wrap;
}

.memory-page #delete-deck,
.memory-page #delete-card {
  color: #ad4149;
}

.memory-page .memory-card-toolbar {
  margin: 0 0 16px;
  gap: 16px;
}

.memory-page .memory-filters {
  border-radius: 10px;
  padding: 3px;
}

.memory-page .memory-filters button {
  border-radius: 7px;
  min-height: 38px;
  padding: 8px 16px;
}

.memory-page .learn-card-list {
  gap: 10px;
}

.memory-page .learn-card-row {
  padding: 18px 22px;
  border-radius: 12px;
  gap: 20px;
}

.memory-page .learn-card-row > div {
  min-width: 0;
}

.memory-page .learn-card-row h2 {
  font-size: 20px;
  line-height: 1.45;
  margin: 0 0 6px;
}

.memory-page .learn-card-row p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}

.memory-page .learn-card-row > span {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--learn-muted);
}

.memory-page > .learn-actions {
  margin: 24px 0 0;
  gap: 16px;
}

.memory-page .learn-review-meta {
  max-width: 800px;
  margin: 8px auto 16px;
  font-size: 14px;
}

.memory-page .learn-review {
  max-width: 800px;
  padding: 32px;
}

.memory-page .learn-question {
  font-size: clamp(28px, 4vw, 44px);
  margin: 32px 0;
  line-height: 1.5;
}

.memory-page .learn-hint {
  font-size: 16px;
  margin: 0;
}

.memory-page #refresh-review {
  display: block;
  margin: 14px auto 0;
  background: transparent;
  color: var(--learn-muted);
  border-color: var(--learn-line);
}

.memory-page #learn-answer.memory-answer {
  max-width: 800px;
  margin: 16px auto 0;
  padding: 24px 32px;
}

.memory-page .learn-ratings {
  margin-top: 18px;
  gap: 10px;
}

.memory-page .memory-complete {
  max-width: 800px !important;
  padding: 28px !important;
}

.memory-page .memory-complete h1 {
  font-size: 28px;
  margin: 12px 0;
}

.memory-page .memory-complete > p {
  font-size: 16px;
  margin: 10px 0;
}

.memory-page .memory-empty-art {
  transform: scale(0.75);
  height: 116px;
  margin-bottom: 12px;
}

.memory-page .memory-complete .memory-stats {
  margin: 24px 0;
}

.memory-page .memory-empty {
  padding: 28px 24px !important;
}

.memory-page .memory-empty > p {
  font-size: 16px;
  margin: 16px 0;
}

.memory-page .learn-message:empty {
  margin: 0;
}

html[data-theme='night'] .memory-page :is(#delete-deck, #delete-card) {
  color: #ffacb2;
}

@media (max-width: 760px) {
  .memory-page {
    padding-block: 20px 32px;
  }
  .memory-page .learn-heading h1 {
    font-size: 28px;
  }
  .memory-page .learn-panel {
    padding: 20px;
  }
  .memory-page .memory-stats {
    padding: 16px 4px;
  }
  .memory-page .memory-stats > div {
    padding: 0 10px;
  }
  .memory-page .memory-stats > div > div {
    padding: 0;
  }
  .memory-page .memory-stats strong {
    font-size: 24px;
  }
  .memory-page .memory-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .memory-page .memory-toolbar input {
    max-width: none;
    width: 100%;
  }
  .memory-page .memory-sort {
    grid-column: 1/-1;
    margin: 0;
    justify-content: flex-end;
  }
  .memory-page .learn-decks {
    grid-template-columns: 1fr;
  }
  .memory-page .memory-card-toolbar {
    gap: 12px;
  }
  .memory-page .memory-filters {
    align-self: stretch;
  }
  .memory-page .memory-filters button {
    flex: 1;
  }
  .memory-page .learn-card-row {
    gap: 10px;
    padding: 16px;
  }
  .memory-page .learn-review {
    padding: 24px 18px;
  }
  .memory-page #learn-answer.memory-answer {
    padding: 22px 18px;
  }
  .memory-page .learn-ratings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .memory-page .learn-ratings button {
    padding: 12px;
    font-size: 16px;
  }
  .memory-page .memory-complete {
    padding: 22px 18px !important;
  }
  .memory-page .memory-complete h1 {
    font-size: 24px;
  }
  .memory-page > .learn-actions {
    flex-direction: row;
    flex-wrap: wrap;
    font-size: 14px;
    gap: 10px;
  }
}

.memory-card-editor .learn-form > label:first-child {
  grid-column: 1/-1;
}

.memory-card-editor .learn-form > label:nth-child(2) textarea {
  min-height: 76px;
}

/* Personal fish collection shares the account page's shallow-sea palette. */

.learn-page .profile-collection {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 22px 0;
  border: 0;
  border-top: 1px solid #e5edf4;
  border-radius: 0;
  background: transparent;
  color: #234f70;
  text-align: left;
}

.profile-collection > span {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 16px;
  font-weight: 600;
}

.profile-collection > b {
  color: #7894a7;
  font-size: 24px;
  font-weight: 400;
}

.fish-collection-dialog {
  box-sizing: border-box;
  width: min(840px, calc(100% - 32px));
  max-height: 85dvh;
  padding: 28px;
  border: 1px solid #d8e6ef;
  border-radius: 24px;
  background: #f5faff;
  color: #193e5b;
  overflow: auto;
  overscroll-behavior: contain;
}

.fish-collection-dialog::backdrop {
  background: rgb(13 40 65 / 45%);
}

.fish-collection-dialog > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.fish-collection-dialog h2 {
  margin: 0;
  font-size: 26px;
}

.fish-collection-dialog p {
  color: #607b8c;
  font-size: 14px;
  line-height: 1.7;
}

.fish-collection-dialog > header button {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid #d8e6ef;
  border-radius: 50%;
  background: #fff;
  color: inherit;
  font-size: 26px;
  cursor: pointer;
}

.fish-collection-group h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
  margin: 24px 0 14px;
}

.fish-collection-group h3 small {
  font-size: 14px;
  color: #607b8c;
  font-weight: 400;
}

.fish-collection-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.fish-collection-card {
  padding: 10px 6px 14px;
  background: #fff;
  border: 1px solid #e0eaf1;
  border-radius: 16px;
  text-align: center;
}

.fish-collection-art {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
}

.fish-collection-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fish-collection-art svg {
  width: 76%;
  color: #b4bfc9;
}

.fish-collection-card strong {
  display: block;
  margin-top: 8px;
  font-size: 14px;
}

.fish-collection-card > small {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #607b8c;
}

.fish-collection-card.is-locked .fish-collection-art {
  background: #f0f3f6;
}

html:has(.fish-collection-dialog[open]) {
  overflow: hidden;
}

html[data-theme='night'] .profile-collection {
  color: #edf5ff;
}

html[data-theme='night'] .fish-collection-dialog {
  background: #102d48;
  color: #edf5ff;
  border-color: #456883;
}

html[data-theme='night'] .fish-collection-card,
html[data-theme='night'] .fish-collection-dialog > header button {
  background: #173b57;
  border-color: #456883;
}

html[data-theme='night'] .fish-collection-dialog p,
html[data-theme='night'] .fish-collection-group small {
  color: #bad0e1;
}

html[data-theme='night'] .fish-collection-card.is-locked .fish-collection-art {
  background: #24445b;
}

@media (max-width: 600px) {
  .fish-collection-dialog {
    padding: 20px 16px;
  }
  .fish-collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .profile-collection > span {
    gap: 8px;
  }
}

.profile-guest-info {
  flex: 1;
  min-width: 0;
}

.profile-guest-avatar {
  display: grid;
  place-items: center;
  background: #e5eaf0;
  overflow: hidden;
}

.profile-guest-avatar svg {
  width: 88%;
  height: 88%;
  fill: #a7b2bd;
}

.learn-page #profile-login-now {
  flex-shrink: 0;
  padding: 12px 24px;
}

.profile-menu .profile-collection:first-child {
  border-top: 0;
}

html[data-theme='night'] .profile-guest-avatar {
  background: #30485d;
}

html[data-theme='night'] .profile-guest-avatar svg {
  fill: #8a9dac;
}

@media (max-width: 700px) {
  .profile-guest {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
  }
  .profile-guest-info {
    min-width: 0;
  }
  .profile-guest .profile-kicker {
    letter-spacing: 0.06em;
  }
  .learn-page #profile-login-now {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
  }
}

/* Fish field guide: painted sea cover, warm paper and collectible portraits. */

.fish-collection-dialog {
  --collection-paper: #fffcf5;
  --collection-ink: #164773;
  width: min(1120px, calc(100% - 48px));
  height: min(860px, 90dvh);
  max-height: 90dvh;
  padding: 0;
  overflow: hidden;
  border: 3px solid #daf6fc;
  border-radius: 48px 54px 40px 44px;
  background: var(--collection-paper);
  color: var(--collection-ink);
  box-shadow:
    0 30px 100px #05283d66,
    inset 0 0 0 4px #ffffff80;
}

.fish-collection-dialog[open] {
  display: flex;
  flex-direction: column;
}

.fish-collection-dialog::backdrop {
  background: #12394e99;
  backdrop-filter: blur(7px);
}

.fish-collection-dialog .collection-cover {
  position: relative;
  display: block;
  isolation: isolate;
  flex-shrink: 0;
  min-height: 188px;
  padding: 32px 36px 34px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 15% 20%, #edfeff 0, transparent 55%),
    linear-gradient(120deg, #ace8f4, #9bdfed 65%, #c0eff7);
}

.collection-cover-copy {
  position: relative;
  z-index: 2;
  width: 65%;
}

.collection-eyebrow {
  display: block;
  margin-bottom: 8px;
  color: #336f88;
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.fish-collection-dialog .collection-cover h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-family: 'Ma Shan Zheng', cursive;
  font-size: clamp(40px, 5vw, 65px);
  line-height: 1.16;
  color: #103d65;
  text-shadow:
    3px 0 #fff,
    -3px 0 #fff,
    0 3px #fff,
    0 -3px #fff,
    3px 3px #fff,
    -3px -3px #fff,
    0 6px 0 #70bdd438;
}

.collection-cover h2 svg {
  width: 46px;
  height: 36px;
  color: #2485b9;
  filter: drop-shadow(0 3px white);
}

.fish-collection-dialog .collection-cover p {
  margin: 14px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: #235a7a;
  letter-spacing: 0.1em;
}

.collection-cover p span {
  margin-left: 8px;
  font-size: 24px;
  color: #3293b6;
}

.collection-progress {
  position: absolute;
  z-index: 3;
  top: 64px;
  right: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 119px;
  height: 91px;
  transform: rotate(5deg);
  border: 3px solid #e6faff;
  border-radius: 47% 53% 42% 45%;
  background: #fffffff0;
  box-shadow: 0 4px 0 #70bed83b;
}

.collection-progress > span {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.collection-progress strong {
  margin-top: 3px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.collection-progress strong small {
  font-size: 19px;
}

.fish-collection-dialog .collection-close {
  position: absolute;
  z-index: 5;
  top: 14px;
  right: 15px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 3px solid #8bcee8;
  border-radius: 50%;
  background: #fff;
  color: #164773;
  font: 32px/1 system-ui;
  cursor: pointer;
  box-shadow: 0 3px 0 #55a5cb33;
}

.collection-close:hover {
  background: #e8f8ff;
}

.collection-wave {
  position: absolute;
  z-index: 3;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 30px;
  color: var(--collection-paper);
}

.collection-bubble {
  position: absolute;
  z-index: 1;
  width: 27px;
  height: 27px;
  border: 1px solid #93d8ef;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fff 0 12%, #d2f7ff55 17%, #58c8eb88 80%);
  box-shadow: inset -2px -3px 0 #74c9e388;
}

.collection-tabs {
  position: relative;
  display: flex;
  flex-shrink: 0;
  padding: 0 36px;
  background: var(--collection-paper);
  border-bottom: 1px solid #e3e9e7;
}

.collection-tabs::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 24px;
  right: 24px;
  height: 4px;
  border-radius: 50%;
  background: #a9dfea55;
  pointer-events: none;
}

.collection-tabs button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1;
  min-height: 64px;
  padding: 12px 8px;
  border: 0;
  background: transparent;
  color: #738797;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.collection-tabs button svg {
  width: 29px;
  height: 25px;
  flex-shrink: 0;
}

.collection-tabs button small {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.collection-tabs button[aria-selected='true'] {
  color: #195985;
}

.collection-tabs button[aria-selected='true']::after {
  content: '';
  position: absolute;
  z-index: 2;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 4px;
  border-radius: 4px;
  background: #42b2e0;
}

.collection-tabs button:last-child[aria-selected='true'] {
  color: #8b6530;
}

.collection-tabs button:last-child[aria-selected='true']::after {
  background: #d6ab62;
}

.collection-tabs button:focus-visible,
.collection-close:focus-visible {
  outline: 3px solid #216b9b;
  outline-offset: -5px;
}

.collection-pages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 22px 30px 26px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #acdce8 transparent;
  background: radial-gradient(ellipse at 0 30%, #fbefda80, transparent 55%), var(--collection-paper);
}

.fish-collection-group[hidden] {
  display: none;
}

.collection-pages .fish-collection-grid {
  gap: 13px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.collection-pages .fish-collection-card {
  min-width: 0;
  padding: 9px 9px 13px;
  border: 1px solid #eee6d9;
  border-radius: 24px;
  background: #ffffff85;
  box-shadow: 0 2px 0 #e9e2d22b;
}

.collection-pages .fish-collection-card.is-unlocked {
  border-color: #d5e9ef;
  background: #fff;
}

.collection-pages .fish-collection-art {
  border-radius: 17px;
}

.collection-pages .fish-collection-art img {
  object-fit: cover;
  border-radius: 17px;
}

.collection-pages .fish-collection-card strong {
  margin-top: 9px;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 700;
  color: #1c4a70;
  overflow-wrap: anywhere;
}

.collection-pages .fish-collection-card > small {
  display: table;
  margin: 6px auto 0;
  padding: 3px 11px;
  border-radius: 20px;
  background: #e9edef;
  color: #637989;
  font-size: 11px;
  line-height: 1.3;
}

.collection-pages .is-unlocked > small {
  background: #d3efff;
  color: #21638f;
}

.collection-unknown {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(#e4e9ee, #edf0f1);
}

.collection-unknown .collection-silhouette {
  width: 78%;
  height: 78%;
  color: #a9b6c2;
  filter: drop-shadow(0 3px 0 #95a7b21a);
}

.collection-unknown > span {
  position: absolute;
  top: 39%;
  left: 42%;
  color: #ffffffb8;
  font-size: 31px;
  font-weight: 700;
  line-height: 1;
}

.collection-unknown .collection-lock {
  position: absolute;
  top: 8%;
  right: 8%;
  width: 16px;
  height: 19px;
  color: #8da0b1;
  filter: drop-shadow(0 1px 2px #fff);
}

.collection-pages .fish-collection-count {
  top: 5px;
  right: 5px;
  padding: 4px 9px;
  background: #f0fbff;
  border: 2px solid #b8e7f6;
  box-shadow: 0 2px 4px #1d547b1a;
  color: #215578;
  font-size: 12px;
}

.collection-footer {
  flex-shrink: 0;
  padding: 12px 20px 14px;
  border-top: 1px solid #dfebe7;
  background: #e7f6f6;
  color: #497b8c;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.09em;
}

.collection-footer span {
  padding: 0 8px;
  color: #47a8cb;
}

html[data-theme='night'] .fish-collection-dialog {
  --collection-paper: #192f40;
  border-color: #4c7e92;
  color: #dfedf5;
}

html[data-theme='night'] .collection-tabs button {
  color: #b1bec8;
}

html[data-theme='night'] .collection-tabs button[aria-selected='true'] {
  color: #9edcf8;
}

html[data-theme='night'] .collection-tabs button:last-child[aria-selected='true'] {
  color: #ecd19c;
}

html[data-theme='night'] .collection-pages .fish-collection-card {
  background: #203e52;
  border-color: #3b5361;
}

html[data-theme='night'] .collection-pages .fish-collection-card strong {
  color: #e1eff8;
}

html[data-theme='night'] .collection-footer {
  background: #203e4e;
  color: #bfdce6;
  border-color: #3b5361;
}

@media (max-width: 760px) {
  .fish-collection-dialog {
    width: calc(100% - 24px);
    height: 90dvh;
    max-height: 90dvh;
    border-radius: 30px;
  }
  .fish-collection-dialog .collection-cover {
    min-height: 165px;
    padding: 30px 23px;
  }
  .collection-cover-copy {
    width: 75%;
  }
  .collection-eyebrow {
    font-size: 9px;
    letter-spacing: 0.12em;
  }
  .fish-collection-dialog .collection-cover h2 {
    font-size: 45px;
    gap: 8px;
  }
  .collection-cover h2 svg {
    width: 30px;
  }
  .fish-collection-dialog .collection-cover p {
    font-size: 12px;
    letter-spacing: 0.03em;
  }
  .collection-progress {
    top: 88px;
    right: 20px;
    width: 85px;
    height: 66px;
  }
  .collection-progress > span {
    font-size: 11px;
  }
  .collection-progress strong {
    font-size: 22px;
  }
  .collection-progress strong small {
    font-size: 14px;
  }
  .collection-tabs {
    padding: 0 12px;
  }
  .collection-tabs button {
    min-height: 58px;
    gap: 6px;
    font-size: 16px;
  }
  .collection-tabs button svg {
    width: 23px;
    height: 21px;
  }
  .collection-tabs button small {
    font-size: 12px;
  }
  .collection-pages {
    padding: 16px 13px 20px;
  }
  .collection-pages .fish-collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }
  .collection-pages .fish-collection-card {
    padding: 6px 6px 10px;
    border-radius: 18px;
  }
  .collection-pages .fish-collection-art {
    border-radius: 12px;
  }
  .collection-pages .fish-collection-card strong {
    font-size: 12px;
  }
  .collection-pages .fish-collection-card > small {
    font-size: 10px;
    padding: 3px 8px;
  }
  .collection-unknown > span {
    font-size: 24px;
  }
  .collection-footer {
    font-size: 10px;
    padding: 10px 8px;
    letter-spacing: 0;
  }
}

@media (max-width: 360px) {
  .collection-tabs button {
    gap: 4px;
    font-size: 14px;
  }
  .collection-tabs button small {
    font-size: 11px;
  }
  .collection-cover-copy {
    width: 85%;
  }
  .fish-collection-dialog .collection-cover h2 {
    font-size: 38px;
  }
}

/* Clear cover hierarchy: title field, a compact painted vignette, then paper. */

.fish-collection-dialog .collection-cover {
  min-height: 204px;
  padding: 34px 42px 38px;
  background: radial-gradient(ellipse at 30% 0, #defbff 0, transparent 60%), #aee6f1;
}

.collection-cover::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: -8px;
  right: 0;
  bottom: 0;
  width: 43%;
  background: url('/assets/fish-collection-cover-v1.1a0a359dffa1.webp') right center / auto 118% no-repeat;
  mask-image: linear-gradient(90deg, transparent, #000 16%);
}

.collection-cover-copy {
  width: 62%;
}

.collection-eyebrow {
  display: none;
}

.fish-collection-dialog .collection-cover h2 {
  gap: 16px;
  font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.22;
  color: #103b65;
  text-shadow:
    4px 0 #fff,
    -4px 0 #fff,
    0 4px #fff,
    0 -4px #fff,
    4px 4px #fff,
    -4px -4px #fff,
    4px -4px #fff,
    -4px 4px #fff,
    0 7px 0 #438eae26;
}

.collection-cover h2 svg {
  width: 42px;
  height: 35px;
  padding: 4px;
  border: 4px solid white;
  box-sizing: content-box;
  border-radius: 50%;
  color: #2587b7;
  filter: none;
}

.fish-collection-dialog .collection-cover p {
  margin: 14px 0 0 5px;
  font-size: 16px;
  letter-spacing: 0.12em;
  color: #225776;
}

.collection-progress {
  top: 77px;
  right: 32px;
  width: 116px;
  height: 86px;
  background: #fff;
  border: 3px solid #dcf6ff;
  border-radius: 45% 52% 44% 48%;
  transform: rotate(4deg);
  box-shadow: 0 5px 0 #3d9ab124;
}

.collection-progress strong {
  font-size: 29px;
}

.collection-bubble {
  opacity: 1;
}

.collection-wave {
  height: 35px;
}

@media (max-width: 760px) {
  .fish-collection-dialog .collection-cover {
    min-height: 167px;
    padding: 29px 21px 32px;
    background: radial-gradient(ellipse at 0 0, #defbff, transparent 70%), #aee6f1;
  }
  .collection-cover::before {
    width: 38%;
    top: 0;
    background-size: auto 105%;
    background-position: 80% center;
    mask-image: linear-gradient(90deg, transparent, #000 24%);
  }
  .collection-cover-copy {
    width: 85%;
  }
  .fish-collection-dialog .collection-cover h2 {
    font-size: 38px;
    gap: 9px;
    letter-spacing: 0.01em;
  }
  .collection-cover h2 svg {
    width: 23px;
    height: 20px;
    padding: 3px;
    border-width: 3px;
  }
  .fish-collection-dialog .collection-cover p {
    position: relative;
    z-index: 2;
    margin: 15px 0 0 1px;
    max-width: 190px;
    font-size: 12px;
    letter-spacing: 0.03em;
  }
  .collection-cover p span {
    display: none;
  }
  .collection-progress {
    top: 91px;
    right: 14px;
    width: 77px;
    height: 57px;
  }
  .collection-progress > span {
    font-size: 10px;
  }
  .collection-progress strong {
    font-size: 21px;
  }
  .collection-progress strong small {
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .fish-collection-dialog .collection-cover h2 {
    font-size: 33px;
  }
  .collection-cover h2 svg {
    width: 19px;
  }
}

/* 分组首页：简介与制卡入口同列，手机自然换行。 */

.memory-page .memory-groups-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.memory-groups-heading > div {
  min-width: 0;
}

.memory-page .memory-groups-heading p {
  margin: 0;
  color: var(--learn-muted);
  font-size: 16px;
  line-height: 1.7;
}

.memory-groups-heading > .learn-button {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .memory-page .memory-groups-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
  .memory-page .memory-groups-heading p {
    font-size: 14px;
  }
  .memory-groups-heading > .learn-button {
    align-self: flex-end;
  }
}

/* 学学主题封面：所有分组汇总，进入后再按分组学习。 */

.learn-memory-panel.learn-memory-overview {
  position: relative;
  isolation: isolate;
  grid-template-columns: 30% minmax(0, 1fr);
  align-items: stretch;
  padding: 24px;
  gap: 24px;
  border: 1px solid #fff;
  border-radius: 30px;
  background: linear-gradient(125deg, #ffffffb8, #f6fcffc9);
  box-shadow: 0 8px 30px #81bde30d;
}

.learn-memory-overview::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: auto 0 0;
  height: 45px;
  border-radius: 0 0 30px 30px;
  background: linear-gradient(6deg, #bce9fc55, transparent 65%);
  pointer-events: none;
}

.learn-memory-summary {
  position: relative;
  min-width: 0;
  padding: 6px 20px 12px 4px;
  border-right: 1px solid #d5e8f7;
}

.learn-memory-summary .learn-memory-slogan {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  font: 800 clamp(24px, 2.3vw, 32px)/1.4 var(--sans);
  color: var(--learn-ink);
}

.learn-memory-summary > p:not(.learn-memory-slogan) {
  position: relative;
  z-index: 1;
  margin: 0 0 20px;
  font-size: 16px;
  color: var(--learn-muted);
}

.learn-memory-summary .learn-button {
  position: relative;
  z-index: 1;
  border-radius: 28px;
  padding: 12px 22px;
  background: linear-gradient(135deg, #287cdf, #1767ba);
  border: 1px solid #438de3;
  color: #fff;
  box-shadow: 0 5px 12px #2d83ca26;
  white-space: nowrap;
}

.learn-state-art {
  display: block;
  background-image: url('/assets/learn-memory-states-v1.94768b993c4f.webp');
  background-size: 200% 200%;
  background-repeat: no-repeat;
}

.learn-summary-art {
  position: absolute;
  width: 116px;
  height: 116px;
  bottom: -3px;
  right: 8px;
  background-position: 0 0;
  pointer-events: none;
}

#learn-deck-overview {
  min-width: 0;
  align-self: center;
}

.learn-state-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.learn-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 10px 16px;
  border: 1px solid #fff;
  border-radius: 24px;
  background: #eaf7ffb8;
  text-align: center;
}

.learn-state-card.state-learning {
  background: #fff5e7c9;
}

.learn-state-card.state-review {
  background: #e9f8f1c9;
}

.learn-state-card .learn-state-art {
  width: 128px;
  max-width: 100%;
  aspect-ratio: 1;
  flex-shrink: 0;
}

.art-new {
  background-position: 100% 0;
}

.art-learning {
  background-position: 0 100%;
}

.art-review {
  background-position: 100% 100%;
}

.learn-state-card h3 {
  margin: 2px 0 5px;
  color: #173e69;
  font-size: 18px;
}

.learn-state-card strong {
  font-size: 44px;
  font-weight: 750;
  line-height: 1.15;
  color: #2383d6;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.learn-state-card.state-learning strong {
  color: #cb6655;
}

.learn-state-card.state-review strong {
  color: #249783;
}

.learn-state-unit {
  margin-top: 6px;
  font-size: 13px;
  color: #6e8da4;
}

.learn-overview-notice {
  margin: 10px 0 0;
  color: var(--learn-muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.learn-overview-notice button {
  margin-left: 8px;
  padding: 4px 10px;
}

html[data-theme='night'] .learn-home {
  --learn-ink: #edf5ff;
  --learn-muted: #bad0e1;
}

html[data-theme='night'] .learn-memory-panel.learn-memory-overview {
  border-color: #456883;
  background: linear-gradient(120deg, #193b56, #15344d);
}

html[data-theme='night'] .learn-memory-summary {
  border-color: #456883;
}

html[data-theme='night'] .learn-state-card {
  background: #214966;
  border-color: #426c8d;
}

html[data-theme='night'] .learn-state-card.state-learning {
  background: #413e3b;
}

html[data-theme='night'] .learn-state-card.state-review {
  background: #214d4e;
}

html[data-theme='night'] .learn-state-card h3 {
  color: #edf5ff;
}

html[data-theme='night'] .learn-state-card strong {
  color: #8cc9ff;
}

html[data-theme='night'] .learn-state-card.state-learning strong {
  color: #f1a798;
}

html[data-theme='night'] .learn-state-card.state-review strong {
  color: #8ad7ba;
}

html[data-theme='night'] .learn-state-unit {
  color: #bed2df;
}

@media (max-width: 900px) {
  .learn-memory-panel.learn-memory-overview {
    grid-template-columns: 28% minmax(0, 1fr);
    padding: 20px;
    gap: 18px;
  }
  .learn-memory-summary .learn-memory-slogan {
    font-size: 24px;
  }
  .learn-memory-summary > p:not(.learn-memory-slogan) {
    font-size: 14px;
  }
  .learn-summary-art {
    width: 90px;
    height: 90px;
    bottom: 0;
    right: 2px;
  }
  .learn-state-cards {
    gap: 8px;
  }
  .learn-state-card {
    padding: 10px 6px 14px;
  }
}

@media (max-width: 600px) {
  .learn-memory-panel.learn-memory-overview {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px 12px;
    border-radius: 24px;
  }
  .learn-memory-summary {
    border-right: 0;
    border-bottom: 1px solid #d5e8f7;
    padding: 0 0 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 8px;
    align-items: center;
  }
  .learn-memory-summary .learn-memory-slogan {
    font-size: 20px;
    margin: 0;
  }
  .learn-memory-summary > p:not(.learn-memory-slogan) {
    font-size: 13px;
    margin: 0;
  }
  .learn-memory-summary .learn-button {
    grid-column: 2;
    grid-row: 1/3;
    padding: 10px 14px;
    font-size: 14px;
  }
  .learn-summary-art {
    display: none;
  }
  .learn-state-card {
    border-radius: 16px;
    padding: 6px 4px 12px;
  }
  .learn-state-card .learn-state-art {
    width: 84px;
  }
  .learn-state-card h3 {
    font-size: 14px;
    margin: 2px 0 6px;
  }
  .learn-state-card strong {
    font-size: 32px;
  }
  .learn-state-unit {
    font-size: 12px;
  }
  .learn-memory-heading > p {
    margin-bottom: 0;
  }
}

/* Memory statistics share the existing ocean reading surfaces. */

.memory-stat-section {
  margin-block: 22px;
  padding: clamp(18px, 3vw, 32px);
}

.memory-stat-section h2 {
  margin-top: 0;
}

.memory-stat-controls {
  gap: 24px;
  padding: 20px;
  flex-wrap: wrap;
}

.memory-stat-controls label {
  display: grid;
  gap: 8px;
}

.memory-chart {
  margin-block: 22px;
}

.memory-chart svg {
  width: 100%;
  height: 190px;
  overflow: visible;
  border-bottom: 1px solid currentColor;
}

.memory-chart rect {
  fill: #3396b8;
}

.memory-chart polyline {
  fill: none;
  stroke: #c27c36;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.memory-chart-axis {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  font-size: 0.8rem;
}

.memory-chart-empty {
  padding: 35px 10px;
  text-align: center;
}

.memory-stat-table {
  overflow-x: auto;
}

.memory-stat-table table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.memory-stat-table th,
.memory-stat-table td {
  padding: 12px;
  border-bottom: 1px solid #729ba54d;
  white-space: nowrap;
}

.memory-calendar {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px);
  grid-auto-columns: 12px;
  gap: 4px;
  overflow-x: auto;
  padding: 12px 2px;
}

.memory-calendar span {
  border-radius: 2px;
  background: #88aeb42b;
}

.memory-calendar .heat-1 {
  background: #b4dce1;
}

.memory-calendar .heat-2 {
  background: #74bdca;
}

.memory-calendar .heat-3 {
  background: #388b9b;
}

.memory-calendar .heat-4 {
  background: #19576b;
}

.memory-page details.learn-panel {
  padding: 22px;
}

@media (max-width: 600px) {
  .memory-chart-axis {
    font-size: 0.7rem;
  }
  .memory-groups-heading .learn-actions {
    flex-wrap: wrap;
  }
}

.memory-stat-section input[type='checkbox'] {
  width: 18px;
  height: 18px;
  padding: 0;
  vertical-align: middle;
  accent-color: #277d9c;
}

/* Statistics: ocean study dashboard. */

.memory-page:has(.statistics-dashboard) {
  padding-block: 0 56px;
}

.statistics-dashboard {
  --stat-blue: #348af0;
  --stat-soft: #eaf5ff;
  font-variant-numeric: tabular-nums;
}

.stat-hero {
  position: relative;
  padding: 34px 20px 22px;
  margin-inline: -20px;
  background:
    linear-gradient(90deg, #eff8fff5 0%, #eff8ffb8 46%, #eff8ff00 76%),
    url('/assets/learn-study-v1.a74406bc0625.webp') center 44% / cover no-repeat;
  border-radius: 0 0 28px 28px;
}

.stat-hero .learn-heading {
  margin: 16px 0 22px;
  min-height: 96px;
}

.stat-hero .learn-heading h1 {
  font-family: var(--sans);
  font-size: 36px;
  letter-spacing: 0.02em;
  margin: 0 0 12px;
}

.stat-hero .learn-heading p {
  margin: 0;
  font-weight: 600;
}

.statistics-dashboard .memory-stat-controls {
  background: #ffffffc9;
  backdrop-filter: blur(8px);
  padding: 20px 24px;
  border-radius: 20px;
  gap: 26px;
}

.statistics-dashboard select {
  width: auto;
  min-width: 130px;
  padding: 8px 30px 8px 12px;
  min-height: 44px;
  font-size: 14px;
  background: var(--learn-panel);
}

.statistics-dashboard label {
  font-size: 14px;
  color: var(--learn-muted);
  font-weight: 600;
}

.stat-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 26px 0;
}

.stat-overview-card {
  border: 1px solid var(--learn-line);
  background: #ffffffb5;
  border-radius: 22px;
  padding: 22px;
  min-width: 0;
}

.stat-overview-card > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-overview-card h2 {
  font-size: 15px;
  color: var(--learn-muted);
  margin: 0;
  font-weight: 600;
}

.stat-overview-card > strong {
  display: block;
  font-size: 36px;
  line-height: 1.25;
  margin: 18px 0 8px;
  letter-spacing: -0.04em;
}

.stat-overview-card > p {
  font-size: 12px;
  color: var(--learn-muted);
  margin: 0;
  line-height: 1.6;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 16px;
  background: #e2f1ff;
  color: #328ee5;
}

.stat-icon svg {
  width: 25px;
  height: 25px;
}

.tone-coral .stat-icon,
.icon-sun,
.icon-target {
  background: #fff0e7;
  color: #df784a;
}

.tone-green .stat-icon,
.icon-layers {
  background: #e4f6f0;
  color: #25957f;
}

.tone-purple .stat-icon,
.icon-calendar {
  background: #eeebff;
  color: #8164ca;
}

.icon-clock {
  color: #309bb8;
  background: #e4f6fa;
}

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

.statistics-dashboard .memory-stat-section {
  margin: 0;
  padding: 24px;
  border-radius: 22px;
  background: var(--learn-panel);
}

.stat-panel-heading {
  display: flex;
  align-items: center;
  margin-bottom: 22px;
}

.stat-panel-heading h2 {
  margin: 0 !important;
  font-family: var(--sans);
  font-size: 22px;
  line-height: 1.4;
}

.stat-panel-heading p {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--learn-muted);
}

.statistics-dashboard .memory-stat-section > p {
  font-size: 14px;
  color: var(--learn-muted);
  margin: 10px 0;
}

.stat-today-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 20px;
}

.stat-today-counts > div {
  padding: 18px 12px;
  border-radius: 15px;
  background: #e7f3ff;
  color: #277dc4;
}

.stat-today-counts > div:nth-child(2) {
  background: #e4f5ef;
  color: #288977;
}

.stat-today-counts > div:nth-child(3) {
  background: #fff0ed;
  color: #c95e54;
}

.stat-today-counts span {
  display: block;
  font-size: 13px;
  margin-bottom: 12px;
}

.stat-today-counts strong {
  font-size: 29px;
}

.stat-today-counts small {
  font-size: 12px;
  margin-left: 5px;
}

.statistics-dashboard .memory-chart {
  position: relative;
  margin: 20px 0 10px;
}

.statistics-dashboard .memory-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  border: 0;
}

.statistics-dashboard .memory-chart rect {
  fill: #82bbfa;
}

.statistics-dashboard .memory-chart text {
  font-size: 11px;
  fill: var(--learn-muted);
  font-family: var(--sans);
}

.stat-gridline {
  stroke: #88adcd26;
  stroke-width: 1;
}

.statistics-dashboard .memory-chart .stat-trend {
  stroke: #3a95ed;
  stroke-width: 2.5;
  fill: none;
}

.stat-area {
  fill: #74b8ff1c;
}

.stat-chart-empty {
  position: absolute;
  top: 30%;
  left: 42px;
  right: 10px;
  text-align: center;
  font-size: 13px;
  color: var(--learn-muted);
}

.stat-chart-data {
  font-size: 12px;
  color: var(--learn-muted);
}

.stat-chart-data summary {
  cursor: pointer;
  padding: 8px 0;
}

.stat-chart-data > div {
  max-height: 180px;
  overflow: auto;
}

.stat-chart-data span {
  display: flex;
  justify-content: space-between;
  padding: 5px;
  border-bottom: 1px solid var(--learn-line);
}

.stat-calendar-panel {
  grid-column: 1/-1;
}

.statistics-dashboard .memory-calendar {
  grid-template-rows: repeat(7, 13px);
  grid-auto-columns: minmax(9px, 1fr);
  gap: 5px;
}

.statistics-dashboard .memory-calendar .heat-1 {
  background: #c5e2ff;
}

.statistics-dashboard .memory-calendar .heat-2 {
  background: #8dc4ff;
}

.statistics-dashboard .memory-calendar .heat-3 {
  background: #4d9bf4;
}

.statistics-dashboard .memory-calendar .heat-4 {
  background: #236ec0;
}

.statistics-dashboard .learn-actions button {
  min-width: 44px;
  min-height: 44px;
}

.stat-distribution {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-block: 24px;
}

.stat-donut {
  width: 180px;
  aspect-ratio: 1;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--donut));
}

.stat-donut > div {
  width: 68%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--learn-panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat-donut strong {
  font-size: 30px;
  line-height: 1.3;
}

.stat-donut span {
  font-size: 12px;
  color: var(--learn-muted);
}

.stat-distribution .memory-stat-table {
  flex: 1;
}

.statistics-dashboard .memory-stat-table th,
.statistics-dashboard .memory-stat-table td {
  font-size: 13px;
  padding: 12px 8px;
}

.stat-distribution .memory-stat-table th,
.stat-distribution .memory-stat-table td {
  padding: 9px 5px;
}

.statistics-dashboard .memory-stat-table thead {
  background: #e8f4ff80;
}

.stat-methods {
  margin-top: 24px;
}

.stat-methods summary {
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.stat-methods p,
.stat-methods a {
  font-size: 14px;
  line-height: 1.8;
}

html[data-theme='night'] .statistics-dashboard {
  --stat-soft: #183c58;
}

html[data-theme='night'] .stat-hero {
  background:
    linear-gradient(90deg, #102d48 0%, #102d48db 46%, #102d4860),
    url('/assets/learn-study-v1.a74406bc0625.webp') center/cover;
}

html[data-theme='night'] .statistics-dashboard .memory-stat-controls,
html[data-theme='night'] .stat-overview-card {
  background: #16364de8;
}

html[data-theme='night'] .stat-today-counts > div {
  background: #1c425e;
  color: #a4d2ff;
}

html[data-theme='night'] .stat-today-counts > div:nth-child(2) {
  background: #173e3d;
  color: #a1dbc9;
}

html[data-theme='night'] .stat-today-counts > div:nth-child(3) {
  background: #47363b;
  color: #ffc1b7;
}

html[data-theme='night'] .statistics-dashboard .memory-stat-table thead {
  background: #214861;
}

@media (max-width: 1000px) {
  .stat-overview {
    gap: 12px;
  }
  .stat-overview-card {
    padding: 16px;
  }
  .stat-overview-card h2 {
    font-size: 13px;
  }
  .stat-overview-card .stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }
  .stat-distribution {
    flex-direction: column;
  }
  .stat-distribution .memory-stat-table {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .memory-page:has(.statistics-dashboard) {
    padding-block: 0 36px;
  }
  .stat-hero {
    margin-inline: -18px;
    padding: 24px 18px 18px;
    background-position: 62% top;
  }
  .stat-hero .learn-heading {
    min-height: 115px;
  }
  .stat-hero .learn-heading h1 {
    font-size: 30px;
  }
  .stat-hero .learn-heading p {
    max-width: 190px;
    font-size: 14px;
  }
  .statistics-dashboard .memory-stat-controls {
    gap: 14px;
    padding: 16px;
  }
  .statistics-dashboard select {
    min-width: 115px;
  }
  .stat-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 18px 0;
  }
  .stat-overview-card > strong {
    font-size: 30px;
    margin: 12px 0 6px;
  }
  .stat-panels {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .statistics-dashboard .memory-stat-section {
    padding: 20px;
  }
  .stat-panel-heading h2 {
    font-size: 20px;
  }
  .stat-calendar-panel {
    grid-column: auto;
  }
  .statistics-dashboard .memory-calendar {
    grid-auto-columns: 11px;
    grid-template-rows: repeat(7, 11px);
    gap: 4px;
  }
  .stat-distribution {
    flex-direction: row;
    gap: 12px;
  }
  .stat-donut {
    width: 130px;
  }
  .stat-donut strong {
    font-size: 25px;
  }
  .stat-distribution .memory-stat-table th,
  .stat-distribution .memory-stat-table td {
    font-size: 12px;
    padding: 9px 3px;
  }
  .stat-today-counts {
    gap: 8px;
  }
  .stat-today-counts > div {
    padding: 16px 10px;
  }
}

@media (max-width: 370px) {
  .stat-distribution {
    flex-direction: column;
  }
  .stat-overview-card > div {
    gap: 6px;
  }
  .stat-overview-card {
    padding: 12px;
  }
}

/* Keep the illustration clear of the filters and the data surfaces calm. */

.stat-hero {
  margin-inline: 0;
  background: linear-gradient(110deg, #e9f7ff, #e3f4ff80);
  overflow: hidden;
}

.stat-hero::before {
  content: '';
  position: absolute;
  top: 4px;
  right: 20px;
  width: 260px;
  height: 230px;
  background: url('/assets/learn-memory-states-v1.94768b993c4f.webp') left top/200% 200% no-repeat;
  pointer-events: none;
}

.stat-hero > .learn-back,
.stat-hero > .learn-heading,
.stat-hero > .memory-stat-controls {
  position: relative;
  z-index: 1;
}

.statistics-dashboard .memory-stat-section {
  background: #fafdfff5;
}

.stat-donut > div {
  background: #fafdff;
}

html[data-theme='night'] .stat-hero {
  background: linear-gradient(110deg, #102d48, #183e58);
}

html[data-theme='night'] .statistics-dashboard .memory-stat-section,
html[data-theme='night'] .stat-donut > div {
  background: #16364d;
}

@media (max-width: 700px) {
  .stat-hero {
    margin-inline: 0;
    padding: 22px 16px 16px;
  }
  .stat-hero::before {
    width: 160px;
    height: 145px;
    top: 12px;
    right: -10px;
  }
  .stat-hero .learn-heading {
    min-height: 100px;
  }
  .stat-hero .learn-heading p {
    max-width: 165px;
  }
  .statistics-dashboard .memory-stat-controls {
    padding: 12px;
    gap: 12px;
  }
  .statistics-dashboard .memory-stat-controls label {
    min-width: 0;
    flex: 1;
  }
  .statistics-dashboard .memory-stat-controls select {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 600px) {
  .memory-page .memory-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .memory-page .memory-filters button {
    padding: 8px 4px;
    font-size: 14px;
  }
}

/* 分组与详情：标题操作区、状态条、内容列表保持一致层级。 */

.memory-page:has(.memory-group-grid, .memory-detail-heading) {
  padding-top: 32px;
}

.memory-page .memory-groups-heading {
  align-items: center;
  margin-bottom: 26px;
}

.memory-page .memory-groups-heading h1,
.memory-page .memory-detail-heading h1 {
  font-size: 36px;
  margin: 0 0 10px;
}

.memory-page .memory-groups-heading .learn-actions {
  margin: 0;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.memory-page #learn-deck-form[hidden] {
  display: none;
}

.memory-page #learn-deck-form {
  padding: 16px;
  border: 1px solid var(--learn-line);
  border-radius: 16px;
  background: #ffffff8c;
}

.memory-groups-sort {
  display: flex;
  justify-content: flex-end;
  margin: -8px 0 14px;
}

.memory-groups-sort .memory-sort {
  font-size: 13px;
  gap: 10px;
}

.memory-page:has(.memory-group-grid, .memory-detail-heading) > .memory-stats {
  padding: 24px 12px;
  margin-bottom: 24px;
  border-radius: 20px;
  background: #ffffffc7;
}

.memory-page:has(.memory-group-grid, .memory-detail-heading) > .memory-stats > div {
  align-items: center;
  flex-direction: row;
  gap: 16px;
  padding: 0 24px;
}

.memory-page:has(.memory-group-grid, .memory-detail-heading) .memory-stat-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  margin: 0;
  flex-shrink: 0;
  background: #e1f0ff;
  color: #2985c8;
}

.memory-stat-icon svg,
.memory-deck-icon svg,
.memory-row-icon svg {
  width: 26px;
  height: 26px;
}

.memory-page:has(.memory-group-grid, .memory-detail-heading) .stat-1 {
  background: #e4f5ef;
  color: #35a58e;
}

.memory-page:has(.memory-group-grid, .memory-detail-heading) .stat-2 {
  background: #fff2df;
  color: #dc9a36;
}

.memory-page .memory-group-grid {
  gap: 20px;
}

.memory-page .memory-group-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 22px;
  border-radius: 20px;
  background: #ffffffd4;
  box-shadow: 0 6px 20px #5494be08;
}

.memory-page .memory-group-card-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding-bottom: 26px;
}

.memory-page .memory-group-card .memory-deck-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}

.memory-page .memory-group-card h2 {
  margin: 0 0 5px;
  font-size: 22px;
}

.memory-group-card-heading p {
  margin: 0;
  font-size: 13px;
  color: var(--learn-muted);
}

.memory-page .memory-group-card-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--learn-line);
  padding-top: 18px;
}

.memory-page .memory-group-card .memory-deck-counts {
  flex: 1;
  gap: 0;
}

.memory-page .memory-group-card .memory-deck-counts > span {
  flex: 1;
  font-size: 12px;
}

.memory-page .memory-group-card .memory-deck-counts strong {
  font-size: 23px;
  color: #328bcd;
}

.memory-page .memory-group-card .memory-deck-counts > span:nth-child(2) strong {
  color: #d39335;
}

.memory-page .memory-group-card .memory-deck-counts > span:nth-child(3) strong {
  color: #d56871;
}

.memory-group-enter {
  padding: 8px 13px;
  border-radius: 24px;
  background: #e9f4ff;
  color: #397ba5;
  font-size: 12px;
  white-space: nowrap;
}

.memory-page .memory-detail-heading {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 580px);
  gap: 24px;
  align-items: center;
  margin: 24px 0;
}

.memory-detail-tools {
  min-width: 0;
}

.memory-page .memory-detail-tools .learn-actions {
  margin: 0 0 14px;
  justify-content: flex-end;
  gap: 8px;
}

.memory-detail-tools #learn-search {
  display: flex;
  gap: 10px;
  margin: 0;
  flex-wrap: nowrap;
}

.memory-detail-tools #learn-search input {
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: none;
}

.memory-page .memory-detail-tools #delete-deck {
  color: #b7444d;
}

.memory-page:has(.memory-detail-heading) .memory-card-toolbar {
  justify-content: flex-end;
  margin-bottom: 16px;
}

.memory-page .learn-card-row:has(.memory-row-icon) {
  padding: 20px 24px;
  border-radius: 18px;
  gap: 20px;
}

.memory-row-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #e1efff;
  color: #5084ac;
  flex-shrink: 0;
}

.memory-page .learn-card-row .memory-row-status {
  width: auto;
  max-width: 44%;
  padding: 8px 14px;
  border-radius: 24px;
  background: #eaf4ff;
  margin-left: auto;
  white-space: normal;
}

.memory-page .memory-pagination {
  justify-content: center;
  align-items: center;
}

html[data-theme='night'] .memory-page :is(.memory-group-card, #learn-deck-form),
html[data-theme='night'] .memory-page:has(.memory-group-grid, .memory-detail-heading) > .memory-stats {
  background: #193950;
}

html[data-theme='night'] :is(.memory-group-enter, .memory-row-icon),
html[data-theme='night'] .memory-page .learn-card-row .memory-row-status {
  background: #274b65;
  color: #c3e2f4;
}

@media (max-width: 900px) {
  .memory-page .memory-detail-heading {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .memory-page .memory-detail-tools .learn-actions {
    justify-content: flex-start;
  }
  .memory-page .memory-group-card-footer {
    flex-wrap: wrap;
  }
  .memory-group-enter {
    margin-left: auto;
  }
}

@media (max-width: 600px) {
  .memory-page:has(.memory-group-grid, .memory-detail-heading) {
    padding-top: 22px;
  }
  .memory-page .memory-groups-heading h1,
  .memory-page .memory-detail-heading h1 {
    font-size: 28px;
  }
  .memory-page .memory-groups-heading .learn-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }
  .memory-page .memory-groups-heading .learn-actions :is(a, button) {
    font-size: 14px;
    padding: 10px 12px;
  }
  .memory-page:has(.memory-group-grid, .memory-detail-heading) > .memory-stats {
    padding: 18px 6px;
  }
  .memory-page:has(.memory-group-grid, .memory-detail-heading) > .memory-stats > div {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 0 10px;
  }
  .memory-page:has(.memory-group-grid, .memory-detail-heading) .memory-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }
  .memory-stat-icon svg {
    width: 21px;
    height: 21px;
  }
  .memory-page .memory-group-card {
    padding: 20px;
  }
  .memory-page .memory-group-card-heading {
    padding-bottom: 20px;
  }
  .memory-page .memory-detail-tools .learn-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .memory-page .learn-card-row:has(.memory-row-icon) {
    padding: 16px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .memory-row-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }
  .memory-page .learn-card-row .memory-row-status {
    max-width: 100%;
    margin-left: 54px;
    font-size: 12px;
  }
  .memory-page .memory-pagination {
    gap: 10px;
  }
  .memory-pagination > span {
    font-size: 12px;
  }
}

@media (max-width: 600px) {
  .memory-page .learn-card-row:has(.memory-row-icon) {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
  }
  .memory-page .learn-card-row .memory-row-status {
    grid-column: 2;
    justify-self: start;
    margin-left: 0;
  }
  .memory-page .learn-card-row:has(.memory-row-icon) > div {
    width: auto;
  }
}

/* 输入即搜索，状态汇总同时承担筛选入口。 */

.memory-page .memory-detail-heading {
  grid-template-columns: minmax(150px, 0.65fr) minmax(0, 3fr);
}

.memory-detail-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.memory-detail-tools #learn-search {
  order: -1;
  flex: 1;
  min-width: 150px;
}

.memory-page .memory-detail-tools .learn-actions {
  flex-shrink: 0;
  flex-wrap: nowrap;
  margin: 0;
}

.memory-page .memory-detail-tools .learn-actions :is(a, button) {
  white-space: nowrap;
}

.memory-stats > div:has(.memory-stat-filter) {
  position: relative;
}

.memory-page .memory-stat-filter {
  position: absolute;
  inset: -12px 5px;
  width: calc(100% - 10px);
  height: calc(100% + 24px);
  padding: 0;
  border: 2px solid transparent;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  z-index: 1;
}

.memory-page .memory-stat-filter:hover {
  background: #438ac80c;
  border-color: #99c8ed;
}

.memory-page .memory-stat-filter[aria-pressed='true'] {
  background: #438ac812;
  border-color: #438ac8;
  box-shadow: inset 0 0 0 1px #438ac833;
}

.memory-page .memory-stat-filter:focus-visible {
  outline: 3px solid #438ac8;
  outline-offset: 2px;
}

.memory-page .memory-group-enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  background: #246b94;
  color: #fff;
  font-size: 16px;
  font-weight: 650;
  box-shadow: 0 3px 8px #22618a20;
}

.memory-group-card:hover .memory-group-enter,
.memory-group-card:focus-visible .memory-group-enter {
  background: #185578;
}

html[data-theme='night'] .memory-page .memory-group-enter {
  background: #307ca7;
  color: #fff;
}

@media (max-width: 1100px) {
  .memory-page .memory-detail-heading {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .memory-detail-tools {
    flex-wrap: wrap;
  }
  .memory-detail-tools #learn-search {
    flex-basis: 100%;
  }
  .memory-page .memory-detail-tools .learn-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .memory-page .memory-detail-tools .learn-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .memory-page .memory-group-enter {
    padding: 10px 14px;
    font-size: 15px;
  }
  .memory-page .memory-stat-filter {
    inset: -10px 3px;
    width: calc(100% - 6px);
    height: calc(100% + 20px);
  }
}

.memory-edit-dialog {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 26px;
  border: 1px solid var(--learn-line);
  border-radius: 22px;
  background: #f5fbff;
  color: var(--learn-ink);
  box-shadow: 0 20px 70px #173e6933;
}

.memory-edit-dialog::backdrop {
  background: #153a5c66;
  backdrop-filter: blur(4px);
}

.memory-edit-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.memory-edit-dialog h2 {
  margin: 0;
  font-size: 24px;
}

.memory-edit-dialog [data-close][aria-label] {
  font-size: 26px;
  padding: 0;
  width: 44px;
}

.memory-edit-dialog .learn-form {
  margin: 0;
}

.memory-edit-dialog .learn-actions {
  justify-content: flex-end;
  margin: 0;
}

.memory-edit-dialog input {
  width: 100%;
}

.memory-edit-danger {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--learn-line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.memory-edit-danger h3 {
  font-size: 16px;
  margin: 0 0 6px;
}

.memory-edit-danger p {
  color: var(--learn-muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.memory-edit-dialog #delete-deck {
  border-color: #e4b8bf;
}

html[data-theme='night'] .memory-edit-dialog {
  background: #193950;
}

@media (max-width: 600px) {
  .memory-edit-dialog {
    padding: 20px;
  }
}

/* 统计页紧凑标题行：控件靠右，数据区域直接跟随。 */

.statistics-dashboard .stat-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px 24px;
  padding: 24px 20px;
}

.stat-hero > .learn-back {
  grid-column: 1/-1;
  margin: 0;
}

.statistics-dashboard .stat-hero .learn-heading {
  min-height: 0;
  margin: 0;
}

.statistics-dashboard .memory-stat-controls {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  align-self: center;
}

.statistics-dashboard .memory-stat-controls label {
  display: block;
}

.statistics-dashboard .memory-stat-controls select {
  min-width: 140px;
  background: var(--learn-panel);
}

.statistics-dashboard .stat-hero::before {
  display: none;
}

.stat-panel-heading {
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.stat-panel-title {
  min-width: 0;
}

.stat-panel-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  color: var(--learn-muted);
  font-size: 13px;
}

.stat-panel-controls > .learn-inline {
  margin: 0;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stat-panel-controls label {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.statistics-dashboard .stat-panel-controls select {
  min-width: 90px;
  max-width: 130px;
  font-size: 13px;
  padding: 8px;
}

.stat-panel-controls .learn-actions {
  margin: 0;
  gap: 8px;
  align-items: center;
}

.stat-calendar-hint {
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

.stat-review-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  color: var(--learn-muted);
  font-size: 12px;
  line-height: 1.6;
  padding-top: 8px;
}

html[data-theme='night'] .statistics-dashboard .memory-stat-controls {
  background: transparent;
}

@media (max-width: 1100px) {
  .stat-panel-heading {
    gap: 10px;
  }
  .stat-panel-controls {
    flex-basis: 100%;
  }
  .stat-calendar-panel .stat-panel-controls {
    flex-basis: auto;
  }
}

@media (max-width: 700px) {
  .statistics-dashboard .stat-hero {
    grid-template-columns: 1fr;
    padding: 20px 0;
    gap: 16px;
  }
  .statistics-dashboard .stat-hero .learn-heading {
    min-height: 0;
  }
  .stat-hero .learn-heading p {
    max-width: none;
  }
  .statistics-dashboard .memory-stat-controls {
    padding: 0;
    gap: 10px;
    width: 100%;
  }
  .statistics-dashboard .memory-stat-controls label {
    flex: 1;
  }
  .statistics-dashboard .memory-stat-controls select {
    width: 100%;
    min-width: 0;
  }
  .statistics-dashboard .memory-stat-section {
    padding: 18px;
  }
  .stat-panel-controls {
    flex-basis: auto;
  }
  .stat-calendar-panel .stat-panel-controls {
    flex-basis: 100%;
    justify-content: space-between;
  }
  .stat-calendar-hint {
    text-align: left;
  }
  .stat-panel-controls > .learn-inline {
    gap: 8px;
  }
  .stat-panel-heading .stat-icon {
    width: 36px;
    height: 36px;
  }
  .stat-panel-heading h2 {
    font-size: 18px;
  }
  .stat-panel-heading p {
    font-size: 12px;
  }
}
