:root {
  --ink: #282047;
  --muted: #6f6890;
  --line: #ded9ef;
  --bg: #f5f1ff;
  --panel: #ffffff;
  --primary: #1f73f1;
  --good: #258a55;
  --bad: #c73f4a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html,
body {
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: auto;
  touch-action: pan-y;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--primary); }
button, .button-link {
  border: 1px solid #bdb7d2;
  background: #eeeaf7;
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button:hover, .button-link:hover { border-color: var(--primary); }
button:disabled {
  cursor: not-allowed;
  opacity: .62;
}
input, select, textarea {
  min-height: 40px;
  border: 1px solid #bdb7d2;
  border-radius: 6px;
  padding: 8px 10px;
  background: white;
  font: inherit;
}
textarea {
  resize: vertical;
  line-height: 1.6;
}

.page { width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.auth-panel {
  max-width: 430px;
  margin: 64px auto;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.auth-panel h1 { margin-top: 0; }
.login-announcements {
  display: grid;
  gap: 8px;
  margin: 16px 0 20px;
  padding: 14px;
  border: 1px solid #e8d998;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff8d8, #edf7ff);
}
.login-announcement-item {
  display: grid;
  gap: 3px;
  padding-top: 8px;
  border-top: 1px solid rgba(138, 106, 18, .16);
}
.login-announcement-item:first-of-type { border-top: 0; padding-top: 0; }
.login-announcement-item strong { color: var(--ink); }
.login-announcement-item span { color: var(--muted); line-height: 1.45; }
.more-link { font-weight: 800; text-decoration: none; }
.stack { display: grid; gap: 16px; }
.stack label { display: grid; gap: 8px; font-weight: 700; }
.muted { color: var(--muted); }
.error { color: var(--bad); font-weight: 700; }
.ok { color: var(--good); font-weight: 700; }
.ghost { background: white; }
.danger, .bad { color: var(--bad); border-color: #e4b5bc; background: #fff3f5; }
.good { color: var(--good); border-color: #add7bf; background: #effaf4; }
.secondary { background: white; margin-top: 12px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.topbar h1 { margin: 0; }
.topbar p { margin: 6px 0 0; color: var(--muted); }

.student-app {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: calc(100vh - 48px);
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 0%, rgba(108, 92, 231, .1), transparent 28%),
    #f8f7ff;
  border: 1px solid #ebe8f8;
  border-radius: 26px;
  box-shadow: 0 22px 60px rgba(49, 38, 91, .1);
}
.student-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px 18px;
  background: rgba(255, 255, 255, .9);
  border-right: 1px solid #ece9f8;
}
.student-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 24px;
  font-size: 18px;
}
.student-brand > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: white;
  border-radius: 10px;
  background: linear-gradient(145deg, #806df2, #5540ce);
  box-shadow: 0 7px 18px rgba(108, 92, 231, .28);
}
.side-nav {
  display: grid;
  gap: 8px;
}
.side-nav button {
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  color: #4e4965;
  border: 0;
  background: transparent;
}
.side-nav button > span,
.bottom-nav button > span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #6d62a0;
  font-size: 12px;
  border: 1px solid #d9d4f2;
  border-radius: 8px;
}
.side-nav button.active {
  color: var(--primary);
  background: #efecff;
}
.side-nav button.active > span {
  color: white;
  border-color: var(--primary);
  background: var(--primary);
}
.sidebar-streak {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(145deg, #f6f3ff, #fff);
  border: 1px solid #ece7ff;
}
.sidebar-streak span,
.sidebar-streak p {
  color: var(--muted);
  font-size: 12px;
}
.sidebar-streak strong {
  color: var(--primary);
  font-size: 26px;
}
.sidebar-streak strong::after {
  content: " 天";
  font-size: 13px;
}
.sidebar-streak p {
  margin: 0;
  line-height: 1.6;
}
.sidebar-user {
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  border: 0;
  background: transparent;
}
.sidebar-user > span:last-child {
  display: grid;
  gap: 3px;
  justify-items: start;
  min-width: 0;
}
.sidebar-user small {
  color: var(--muted);
}
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  color: white;
  font-size: 18px;
  font-weight: 900;
  border-radius: 50%;
  background: linear-gradient(145deg, #745de4, #9b8cf4);
}
.avatar.large {
  width: 70px;
  height: 70px;
  font-size: 28px;
}
.student-workspace {
  position: relative;
  min-width: 0;
  padding: 28px 36px calc(104px + env(safe-area-inset-bottom));
}
.student-workspace .mobile-panel {
  max-width: 980px;
  margin: 0 auto;
}
.student-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.student-header h1 {
  margin: 0;
  font-size: 28px;
}
.student-header p {
  margin: 6px 0 0;
  color: var(--muted);
}
.student-header .wave {
  color: #a27600;
  font-size: 14px;
  font-weight: 800;
}
.section-header {
  min-height: 58px;
}
.round-action {
  min-width: 52px;
  padding: 10px 12px;
  color: #4f476c;
  border-color: #e2def2;
  border-radius: 12px;
  background: white;
}
.primary-button {
  color: white;
  border-color: #5b49bc;
  background: linear-gradient(135deg, #7a64e8, #5b43d0);
}
.student-workspace .today-grid {
  gap: 16px;
  margin-bottom: 16px;
}
.student-workspace .mini-stat {
  position: relative;
  min-height: 104px;
  padding: 18px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(52, 43, 86, .04);
}
.student-workspace .mini-stat::after {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #f0edff;
  content: "学";
  color: var(--primary);
  font-weight: 900;
}
.student-workspace .stat-red::after {
  content: "错";
  color: #ef476f;
  background: #fff0f4;
}
.student-workspace .stat-yellow::after {
  content: "勤";
  color: #d18b00;
  background: #fff7dc;
}
.student-workspace .mini-stat strong {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 8px;
}
.student-workspace .mini-stat strong b {
  color: var(--primary);
  font-size: 34px;
}
.student-workspace .stat-red strong b { color: #ef476f; }
.student-workspace .stat-yellow strong b { color: #e49a00; }
.student-workspace .mini-stat strong small {
  color: #615a78;
  font-size: 13px;
}
.student-workspace .range-card {
  position: relative;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 14px;
}
.student-workspace .range-card span,
.student-workspace .range-card strong {
  grid-column: 1;
}
.student-workspace .range-card button {
  grid-column: 2;
  grid-row: 1 / 3;
  color: var(--primary);
  border-color: #ddd7fa;
  background: #f4f1ff;
}
.student-workspace .compact-study {
  min-height: 430px;
  padding: 26px;
  border-radius: 16px;
  box-shadow: 0 12px 34px rgba(54, 43, 93, .05);
}
.student-workspace .compact-study h2 {
  font-size: clamp(34px, 4vw, 48px);
}
.word-answer-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.word-answer-line .answer {
  font-size: 28px;
}
.word-sound {
  min-width: auto;
  padding: 6px 10px;
  color: var(--primary);
  border: 0;
  background: transparent;
}
.student-workspace .answer-row {
  grid-template-columns: minmax(0, 1fr) 110px;
  margin-top: 8px;
}
.student-workspace .answer-row input {
  min-height: 50px;
}
.student-workspace .explain-button {
  min-height: 46px;
}
.student-workspace .mobile-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.student-workspace .mobile-actions .action-wide {
  grid-column: span 2;
}
.student-workspace .bottom-nav {
  position: absolute;
  left: 36px;
  right: 36px;
  bottom: 0;
  width: auto;
  transform: none;
  border: 1px solid #ebe8f8;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
}
.student-workspace .bottom-nav button {
  display: flex;
  gap: 7px;
}
.student-workspace .bottom-nav button.active {
  color: var(--primary);
  background: transparent;
  box-shadow: inset 0 -3px 0 var(--primary);
}
.student-workspace .bottom-nav button.active > span {
  color: white;
  border-color: var(--primary);
  background: var(--primary);
}
.article-search-card {
  grid-template-columns: 2fr 1fr 1fr auto;
  align-items: end;
  padding: 18px;
  border-radius: 14px;
}
.article-search-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.article-date-row { display: contents; }
.article-card,
.profile-card,
.menu-card,
.trend-card,
.list-card {
  border-radius: 14px;
}
.student-workspace .record-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.student-workspace .record-grid .mini-stat {
  min-height: 94px;
}
.student-workspace .record-grid .mini-stat::after {
  display: none;
}
.student-workspace .record-grid .mini-stat strong {
  color: var(--primary);
  font-size: 28px;
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title-row span {
  color: var(--muted);
  font-size: 13px;
}
.export-link {
  padding: 10px 14px;
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
  border: 1px solid #ded8fb;
  border-radius: 10px;
  background: white;
}
.member-only-tag,
.my-post-tag {
  padding: 7px 10px;
  color: #9a6800;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid #f0d88d;
  border-radius: 999px;
  background: #fff8d9;
}
.community-compose {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
  padding: 20px;
}
.community-compose h2,
.community-list-head h2 {
  margin: 0;
}
.community-compose label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.community-compose textarea {
  min-height: 108px;
  resize: vertical;
}
.community-compose-actions,
.community-list-head,
.community-post-head,
.community-reply-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.community-compose-actions .primary-button {
  flex: 0 0 auto;
}
.community-list-head {
  margin: 0 0 12px;
}
.community-list {
  display: grid;
  gap: 14px;
}
.community-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: 0 8px 24px rgba(52, 43, 86, .04);
}
.community-post-head > div {
  display: grid;
  gap: 5px;
}
.community-post-head strong {
  color: var(--ink);
  font-size: 18px;
}
.community-post-head span,
.community-reply small {
  color: var(--muted);
  font-size: 12px;
}
.community-content {
  margin: 16px 0;
  color: #3f3957;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.content-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.content-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}
.content-actions button {
  min-width: auto;
  padding: 8px 12px;
  color: var(--primary);
  border-color: #ded8fb;
  border-radius: 999px;
  background: #f8f6ff;
}
.content-actions button.active {
  color: white;
  border-color: var(--primary);
  background: var(--primary);
}
.content-actions button span {
  margin-left: 4px;
}
.content-view-count {
  color: var(--muted);
  font-size: 13px;
}
.community-actions {
  margin-top: -4px;
}
.inline-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.inline-select select {
  min-height: 34px;
  padding: 6px 10px;
}
.article-comments {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.article-comments h3 {
  margin: 0;
}
.article-comment {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid #ece8f6;
  border-radius: 12px;
  background: #fbfaff;
}
.article-comment > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--primary);
}
.article-comment p {
  margin: 0;
  line-height: 1.65;
}
.comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.comment-actions button {
  min-width: auto;
  padding: 6px 10px;
}
.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 10px;
}
.community-replies {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: #f8f7fd;
}
.community-reply {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid #ebe8f5;
}
.community-reply:last-child {
  border-bottom: 0;
}
.community-reply strong {
  color: var(--primary);
}
.community-reply span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.community-reply-form {
  margin-top: 12px;
}
.community-reply-form input {
  min-width: 0;
  flex: 1;
}
.community-reply-result {
  margin-bottom: 0;
}
.community-empty {
  padding: 28px;
  text-align: center;
}
.ai-chat-sheet {
  display: grid;
  gap: 12px;
}
.ai-chat-sheet .sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 8px;
  background: white;
}
.ai-chat-note {
  padding: 10px 12px;
  color: #7a5b00;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid #ead98c;
  border-radius: 12px;
  background: #fff9dd;
}
.ai-chat-list {
  display: grid;
  gap: 10px;
  max-height: min(48vh, 460px);
  overflow-y: auto;
  padding: 4px 2px;
}
.ai-chat-message {
  display: grid;
  gap: 6px;
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.ai-chat-message > strong {
  font-size: 13px;
}
.ai-chat-message p {
  margin: 0;
}
.ai-chat-body {
  display: grid;
  gap: 8px;
}
.ai-chat-body p,
.ai-chat-body ul,
.ai-chat-body ol,
.ai-chat-body blockquote {
  margin: 0;
}
.ai-chat-body ul,
.ai-chat-body ol {
  padding-left: 20px;
}
.ai-chat-body li {
  margin: 3px 0;
}
.ai-chat-body code {
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(103, 83, 200, 0.12);
}
.ai-chat-body blockquote {
  padding-left: 10px;
  color: #5d537f;
  border-left: 3px solid #d8cff7;
}
.ai-chat-message.assistant {
  justify-self: start;
  color: #352d55;
  background: #f5f2ff;
  border: 1px solid #e5defb;
}
.ai-chat-message.user {
  justify-self: end;
  color: white;
  background: linear-gradient(135deg, #7a64e8, #5b43d0);
}
.ai-chat-message.user .ai-chat-body code {
  color: white;
  background: rgba(255, 255, 255, 0.2);
}
.ai-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 10px;
  align-items: stretch;
}
.ai-chat-form textarea {
  min-height: 72px;
  resize: vertical;
}
.ai-chat-close-bottom {
  width: 100%;
  min-height: 42px;
  color: var(--primary);
  border: 1px solid #ded8fb;
  background: #f8f6ff;
}
.profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
}
.profile-hero > div {
  display: grid;
  gap: 6px;
}
.profile-menu {
  padding: 0;
  overflow: hidden;
}
.profile-menu button,
.profile-menu .menu-link {
  min-height: 58px;
  margin: 0;
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid #eeeaf7;
  border-radius: 0;
}
.profile-menu button:last-child { border-bottom: 0; }
.profile-menu button > span,
.profile-menu .menu-link > span {
  color: var(--ink);
  font-size: 15px;
}
.profile-menu em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.empty-study-card {
  position: relative;
  display: grid;
  min-height: 430px;
}
.study-progress {
  justify-self: start;
  padding: 6px 12px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  background: #f1edff;
}
.empty-study-content {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  min-height: 230px;
  text-align: center;
}
.empty-study-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  color: white;
  font-size: 24px;
  font-weight: 900;
  border-radius: 20px;
  background: linear-gradient(145deg, #806df2, #5540ce);
  box-shadow: 0 12px 24px rgba(103, 83, 200, .2);
}
.empty-study-content h2 {
  margin: 4px 0 0;
  font-size: 24px !important;
}
.empty-study-content p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.empty-study-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.profile-membership {
  justify-self: start;
  padding: 4px 9px;
  color: #6748d7;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  background: #f0ecff;
}
.profile-login-link {
  margin-left: auto;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid #7661e8;
  border-radius: 999px;
}
.profile-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 12px 0;
  padding: 18px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}
.profile-overview > div {
  display: grid;
  justify-items: center;
  gap: 7px;
  border-right: 1px solid #eeeaf7;
}
.profile-overview > div:last-child {
  border-right: 0;
}
.profile-overview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.profile-overview strong {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--primary);
  font-size: 25px;
}
.profile-overview strong b {
  font: inherit;
}
.profile-overview small {
  color: var(--muted);
  font-size: 12px;
}
.record-type-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid #e7e2f7;
  border-radius: 12px;
  background: white;
}
.record-type-tabs button {
  min-height: 38px;
  padding: 8px;
  border: 0;
  background: transparent;
}
.record-type-tabs button.active {
  color: white;
  background: linear-gradient(135deg, #7a64e8, #5b43d0);
}
.record-type-tabs button:not(.active):active {
  background: #f3f0ff;
}
.phrase-study-card {
  position: relative;
  text-align: center;
  background:
    radial-gradient(circle at 88% 4%, rgba(114, 82, 231, .08), transparent 30%),
    white;
}
.study-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.phrase-study-card > h2 {
  margin: 34px 0 14px;
  color: #17123f;
  font-size: clamp(34px, 5vw, 54px);
}
.phrase-answer {
  min-height: 34px;
  margin: 0 0 18px;
  color: #6d58d9;
  font-size: 24px;
  font-weight: 800;
}
.phrase-study-card .answer-row,
.phrase-study-card .phrase-actions {
  text-align: left;
}
.phrase-study-card .explain-button {
  margin: 12px 0;
}
.phrase-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
.phrase-actions .action-wide {
  grid-column: span 2;
}
.sentence-study-card > h2 {
  max-width: 820px;
  margin-right: auto;
  margin-left: auto;
  font-size: clamp(25px, 3.2vw, 40px);
  line-height: 1.35;
}
.sentence-answer {
  max-width: 820px;
  margin-right: auto;
  margin-left: auto;
  font-size: 20px;
  line-height: 1.55;
}

.structure-hero {
  position: relative;
  align-items: center;
  min-height: 178px;
  padding: 26px;
  color: white;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(31, 115, 241, .96), rgba(45, 138, 255, .9)), #1f73f1;
  box-shadow: 0 18px 42px rgba(31, 115, 241, .2);
}
.structure-hero::after {
  position: absolute;
  right: 24px;
  bottom: -18px;
  width: 148px;
  height: 148px;
  border-radius: 42px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .08));
  transform: rotate(8deg);
  content: "";
}
.structure-hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  max-width: 620px;
}
.student-header.structure-hero h1 {
  color: white;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
}
.student-header.structure-hero p {
  max-width: 560px;
  color: rgba(255, 255, 255, .88);
  line-height: 1.7;
}
.system-kicker {
  justify-self: start;
  margin: 0 !important;
  padding: 6px 10px;
  color: #0f5fd4 !important;
  font-size: 12px;
  font-weight: 900;
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
}
.structure-hero .header-actions {
  position: relative;
  z-index: 2;
}
.structure-hero .round-action {
  color: white;
  border-color: rgba(255, 255, 255, .32);
  background: rgba(255, 255, 255, .16);
}
.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.section-title-row span,
.continue-card span,
.growth-tree article span,
.wordtree-preview-card span,
.training-grid span {
  color: #65758b;
  font-size: 13px;
  font-weight: 900;
}
.section-title-row h2,
.practice-title-row h2 {
  margin: 3px 0 0;
  color: #11243d;
  font-size: 20px;
}
.section-title-row > strong {
  color: #1f73f1;
  font-size: 26px;
}
.daily-task-card,
.continue-card,
.growth-tree-card,
.wordtree-preview-card {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid #dbe8fb;
  border-radius: 16px;
  background: white;
  box-shadow: 0 12px 32px rgba(22, 81, 150, .06);
}
.task-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 14px;
}
.task-grid article {
  display: grid;
  gap: 7px;
  padding: 14px;
  border-radius: 14px;
  background: #f4f8ff;
}
.task-grid article:nth-child(2) { background: #f0fbf5; }
.task-grid article:nth-child(3) { background: #fff7ec; }
.task-grid strong {
  color: #10233f;
  font-size: 24px;
}
.task-grid em {
  color: #7890aa;
  font-style: normal;
}
.task-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9f1fb;
}
.task-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f73f1, #2fbf71, #f2a724);
  transition: width .25s ease;
}
.continue-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}
.continue-card strong {
  display: block;
  margin-top: 4px;
  color: #10233f;
  font-size: 22px;
}
.continue-card p {
  margin: 6px 0 0;
  color: #65758b;
}
.continue-card button,
.practice-title-row button {
  color: #1f73f1;
  border-color: #cfe0fa;
  border-radius: 12px;
  background: #f4f8ff;
}
.growth-tree {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.growth-tree::before {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 32px;
  height: 3px;
  background: #d9e8fb;
  content: "";
}
.growth-tree article {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 11px;
  border: 1px solid #dce9fb;
  border-radius: 14px;
  background: #fbfdff;
}
.growth-tree i {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: white;
  font-style: normal;
  font-weight: 900;
  border-radius: 14px;
  background: linear-gradient(135deg, #1f73f1, #56a2ff);
  box-shadow: 0 8px 18px rgba(31, 115, 241, .2);
}
.growth-tree article:nth-child(3n + 2) i {
  background: linear-gradient(135deg, #22a867, #6edb9e);
  box-shadow: 0 8px 18px rgba(34, 168, 103, .18);
}
.growth-tree article:nth-child(3n) i {
  background: linear-gradient(135deg, #f0a01f, #ffd16a);
  box-shadow: 0 8px 18px rgba(240, 160, 31, .18);
}
.growth-tree strong {
  display: block;
  overflow: hidden;
  color: #10233f;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.growth-tree div span {
  display: block;
  margin-top: 2px;
  color: #1f73f1;
}
.growth-tree em {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8f1fb;
}
.growth-tree u {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #1f73f1;
}
.growth-tree article.is-complete {
  border-color: #bae7cf;
  background: #f5fff9;
}
.home-practice-card {
  margin-top: 0;
}
.home-practice-card .practice-title-row {
  margin-bottom: 8px;
}
.student-workspace .home-practice-card .practice-title-row h2 {
  font-size: 20px;
  line-height: 1.2;
}
.wordtree-preview-card {
  display: grid;
  gap: 22px;
}
.structure-tree-card {
  position: relative;
  overflow: hidden;
  min-height: 620px;
}
.wordtree-root {
  justify-self: center;
  display: grid;
  justify-items: center;
  min-width: min(260px, 100%);
  padding: 20px;
  color: white;
  border-radius: 24px;
  background: linear-gradient(135deg, #1f73f1, #2d8aff);
  cursor: pointer;
  box-shadow: 0 16px 36px rgba(31, 115, 241, .22);
}
.wordtree-root span,
.wordtree-root small {
  color: rgba(255, 255, 255, .88);
}
.wordtree-root strong {
  margin: 6px 0;
  font-size: 36px;
}
.wordtree-preview-grid,
.training-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.structure-node-grid {
  position: relative;
  z-index: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 720px;
  margin: 0 auto;
}
.wordtree-preview-grid article,
.training-grid button {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 8px;
  padding: 16px;
  text-align: left;
  border: 1px solid #dce9fb;
  border-radius: 16px;
  background: white;
  box-shadow: 0 10px 26px rgba(22, 81, 150, .05);
}
.wordtree-preview-grid article {
  min-height: 132px;
}
.wordtree-preview-grid article[data-tab-jump],
.wordtree-preview-grid article[data-structure-field],
.training-grid button {
  cursor: pointer;
}
.structure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.structure-status {
  margin: -6px 0 12px;
  padding: 10px 12px;
  color: #55708f;
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid #dbe8fb;
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
}
.wordtree-preview-grid article.needs-query {
  border-color: #ffd9a8;
  background: #fffaf2;
}
.wordtree-preview-grid article.needs-query strong {
  color: #9a5b00;
}
.wordtree-preview-grid article.needs-query small::after {
  content: " · 点击查询";
  color: #1f73f1;
  font-weight: 900;
}
.wordtree-preview-grid article small {
  display: -webkit-box;
  overflow: hidden;
  color: #65758b;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.wordtree-preview-grid strong,
.training-grid strong {
  display: -webkit-box;
  overflow: hidden;
  color: #10233f;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.training-grid button {
  min-height: 118px;
}
.training-grid em {
  justify-self: start;
  color: #1f73f1;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}
.word-detail-topbar {
  align-items: center;
}
.word-detail-topbar > div {
  flex: 1;
  text-align: center;
}
.word-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  padding: 24px;
  color: white;
  border-radius: 18px;
  background: linear-gradient(135deg, #1f73f1, #2d8aff);
  box-shadow: 0 18px 42px rgba(31, 115, 241, .18);
}
.word-detail-hero span,
.word-detail-hero p {
  color: rgba(255, 255, 255, .86);
}
.word-detail-hero h2 {
  margin: 6px 0;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1;
}
.word-detail-hero strong {
  display: block;
  margin-top: 10px;
  font-size: 18px;
}
.word-detail-hero em {
  display: inline-flex;
  margin-top: 12px;
  padding: 6px 10px;
  color: #0f5fd4;
  font-style: normal;
  font-weight: 900;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
}
.word-detail-actions {
  display: grid;
  gap: 10px;
  min-width: 150px;
}
.word-detail-actions button {
  color: #0f5fd4;
  border-color: rgba(255, 255, 255, .68);
  background: rgba(255, 255, 255, .94);
}
.word-detail-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.word-detail-tabs article {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid #dbe8fb;
  border-radius: 16px;
  background: white;
  box-shadow: 0 12px 32px rgba(22, 81, 150, .06);
}
.word-detail-tabs article > span {
  color: #1f73f1;
  font-weight: 900;
}
.word-detail-tabs p {
  margin: 0;
  color: #31445d;
  line-height: 1.75;
}
.detail-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.detail-chip-list span {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  color: #10233f;
  font-weight: 900;
  border-radius: 12px;
  background: #f4f8ff;
}
.detail-chip-list small {
  color: #65758b;
  font-weight: 700;
}
.detail-sentence-list,
.detail-tense-list {
  display: grid;
  gap: 10px;
}
.detail-sentence-list p,
.detail-tense-list p {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fbff;
}
.detail-sentence-list span,
.detail-tense-list span {
  color: #65758b;
}
.detail-tense-list strong {
  color: #10233f;
}

.mobile-app-shell {
  max-width: 520px;
  min-height: calc(100vh - 48px);
  margin: 0 auto;
  padding-bottom: 84px;
}

@supports (min-height: 100dvh) {
  .student-app,
  .mobile-app-shell {
    min-height: calc(100dvh - 48px);
  }
}
.mobile-panel {
  display: none;
}
.mobile-panel.active {
  display: block;
}
.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.learn-header {
  justify-content: flex-end;
  min-height: 42px;
  margin-bottom: 10px;
}
.mobile-header.plain {
  display: block;
}
.mobile-header h1 {
  margin: 0;
  font-size: 26px;
}
.mobile-header p {
  margin: 4px 0 0;
  color: var(--muted);
}
.header-actions {
  display: flex;
  gap: 8px;
}
.learn-header .header-actions {
  margin-left: auto;
}
.icon-button {
  min-width: auto;
  padding: 9px 11px;
  border-radius: 999px;
  background: white;
}
.today-grid,
.record-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.record-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.mini-stat,
.summary-card,
.range-card,
.profile-card,
.menu-card,
.trend-card,
.list-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.mini-stat {
  display: grid;
  gap: 4px;
  min-height: 72px;
}
.mini-stat span,
.summary-card span,
.range-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.mini-stat strong,
.summary-card strong,
.range-card strong {
  color: var(--primary);
  font-size: 24px;
  line-height: 1.1;
}
.range-card {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #fbf8ff 100%);
}
.range-card strong {
  font-size: 17px;
  color: var(--ink);
}
.compact-study {
  align-content: start;
  gap: 9px;
  margin-bottom: 0;
  padding: 16px;
}
.compact-study h2 {
  font-size: 34px;
  line-height: 1.12;
}
.compact-study .tag {
  display: none;
}
.compact-study .answer-row {
  margin-top: 2px;
}
.compact-study .guide:empty,
.compact-study .result:empty {
  display: none;
}
.compact-study .result {
  min-height: 0;
  margin: 0;
}
.explain-button {
  width: 100%;
  margin-top: 2px;
  background: #fff8d8;
  border-color: #e8d998;
  color: #6d4c00;
}
.premium-entry.course-not-allowed {
  color: #8b3a3a;
  border-color: #efb3b3;
  background: #fff0f0;
}
.premium-entry.course-not-allowed span {
  color: #8b3a3a;
  background: #ffdede;
}
.mobile-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.mobile-actions button {
  min-width: 0;
  min-height: 48px;
}
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(520px, 100%);
  transform: translateX(-50%);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(44, 36, 76, .08);
}
.bottom-nav button {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 4px;
  border-radius: 8px;
}
.bottom-nav button.active {
  color: white;
  background: var(--primary);
}
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(22, 18, 40, .38);
}
.sheet-mask[hidden] {
  display: none;
}
.bottom-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 31;
  width: min(520px, 100%);
  max-height: min(78vh, 720px);
  overflow: auto;
  transform: translateX(-50%);
  padding: 16px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  background: white;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -18px 40px rgba(22, 18, 40, .18);
}
.bottom-sheet[hidden] {
  display: none;
}
.loop-player-sheet {
  width: min(560px, 100%);
  height: min(100dvh, 920px);
  max-height: 100dvh;
  padding: 0 14px 315px;
  color: #211b49;
  background: #f7f6ff;
  border-radius: 18px 18px 0 0;
}
.loop-player-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 2px 12px;
  background: rgba(247, 246, 255, .96);
  backdrop-filter: blur(12px);
}
.loop-player-header .student-brand {
  flex-direction: row;
  gap: 8px;
  margin: 0;
}
.loop-player-header .student-brand span {
  display: inline;
  width: auto;
  height: auto;
  color: inherit;
  background: transparent;
}
.loop-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
  background: white;
  border: 1px solid #ebe8ff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(81, 63, 170, .06);
}
.loop-panel-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.loop-panel-title > span {
  color: #6548e7;
  font-size: 22px;
  line-height: 1;
}
.loop-panel-title div {
  display: grid;
  gap: 5px;
}
.loop-panel-title strong {
  font-size: 17px;
}
.loop-panel-title small {
  color: var(--muted);
}
.loop-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.loop-mode-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  border: 0;
}
.loop-mode-control legend {
  margin-bottom: 7px;
  color: #413962;
  font-size: 13px;
  font-weight: 800;
}
.loop-mode-control label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}
.loop-mode-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.loop-mode-control span {
  display: grid;
  gap: 3px;
  height: 100%;
  padding: 11px 12px;
  color: #4b436d;
  background: #fbfaff;
  border: 1px solid #e4e0fb;
  border-radius: 8px;
}
.loop-mode-control small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}
.loop-mode-control input:checked + span {
  color: #563bd5;
  background: #f1edff;
  border-color: #7455e8;
  box-shadow: inset 0 0 0 1px #7455e8;
}
.loop-mode-control input:focus-visible + span {
  outline: 2px solid #7455e8;
  outline-offset: 2px;
}
.loop-filter-grid label {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: #413962;
  font-size: 13px;
  font-weight: 800;
}
.loop-filter-grid select {
  width: 100%;
  min-width: 0;
  padding: 10px 8px;
  border-color: #e4e0fb;
  background: #fbfaff;
}
.loop-start-actions {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
}
.loop-start-actions button {
  min-width: 0;
}
.loop-queue-panel {
  padding: 0;
  overflow: hidden;
}
.loop-queue-head {
  padding: 15px 16px 10px;
}
.loop-queue-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.loop-queue {
  display: grid;
  max-height: 390px;
  overflow: auto;
}
.loop-queue-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px 14px;
  text-align: left;
  border: 0;
  border-top: 1px solid #f0eef9;
  border-radius: 0;
  background: white;
}
.loop-queue-item b {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  color: #5f4bd2;
  border-radius: 50%;
  background: #f0edff;
}
.loop-queue-item > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.loop-queue-item strong,
.loop-queue-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.loop-queue-item small {
  color: var(--muted);
}
.loop-queue-item em {
  color: #6548e7;
  font-style: normal;
}
.loop-queue-item.active {
  background: #f7f4ff;
}
.loop-queue-item.active b {
  color: white;
  background: #6753c8;
}
.loop-now-playing {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 33;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  width: min(560px, 100%);
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
  color: white;
  transform: translateX(-50%);
  background: linear-gradient(145deg, #7455e8, #563bd5);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 30px rgba(70, 45, 180, .28);
}
.loop-now-meta {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.loop-now-meta span,
.loop-now-meta small {
  color: rgba(255, 255, 255, .82);
}
.loop-now-meta strong {
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.loop-now-count {
  display: grid;
  justify-items: end;
  gap: 3px;
}
.loop-now-count strong {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
}
.loop-now-count span {
  color: rgba(255, 255, 255, .82);
  font-size: 12px;
}
.loop-subtitle {
  grid-column: 1 / -1;
  min-height: 54px;
  max-height: 88px;
  padding: 10px 12px;
  overflow-y: auto;
  color: white;
  font-size: 15px;
  line-height: 1.55;
  text-align: center;
  white-space: pre-wrap;
  background: rgba(31, 17, 104, .28);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
}
.loop-player-controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  justify-items: center;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}
.loop-player-controls button {
  min-width: 0;
  color: white;
  border: 0;
  background: transparent;
}
.loop-player-controls .loop-pause {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 3px solid white;
  border-radius: 50%;
}
.loop-progress-track {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .28);
}
.loop-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: white;
  transition: width .25s ease;
}
.loop-volume {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.loop-volume input {
  width: 100%;
  accent-color: white;
}
.sheet-head,
.sheet-actions,
.list-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.sheet-head strong {
  font-size: 20px;
}
.sheet-close {
  min-width: auto;
  padding: 8px 10px;
  background: #f8f6ff;
}
.sheet-toolbar {
  border: 0;
  margin: 0;
  padding: 0;
  grid-template-columns: 1fr;
}
.announcement-list {
  display: grid;
  gap: 10px;
}
.announcement-item.full {
  padding: 12px;
  border: 1px solid #efe6bd;
  border-radius: 8px;
  background: #fffdf4;
}
.profile-card,
.menu-card {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.profile-card strong {
  font-size: 22px;
}
.profile-card span {
  color: var(--muted);
}
.menu-card button {
  justify-content: space-between;
  width: 100%;
  background: white;
}
.menu-card span {
  color: var(--muted);
  font-size: 13px;
}
.logout-button {
  width: 100%;
  color: var(--bad);
  border-color: #e4b5bc;
  background: #fff3f5;
}
.trend-card,
.list-card {
  margin-bottom: 12px;
}
.trend-card h2,
.list-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
}
.trend-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 112px;
}
.trend-chart > .muted {
  grid-column: 1 / -1;
  align-self: center;
  width: 100%;
}
.trend-bar {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.trend-bar span {
  display: block;
  width: 100%;
  max-width: 28px;
  border-radius: 999px 999px 4px 4px;
  background: var(--primary);
}
.wrong-list {
  display: grid;
  gap: 10px;
}
.photo-ai-card,
.photo-explain-card,
.photo-history-item {
  display: grid;
  gap: 12px;
}
.photo-ai-card {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.photo-picker {
  display: grid;
  gap: 8px;
  padding: 14px;
  color: var(--primary);
  font-weight: 900;
  text-align: center;
  background: #f4f1ff;
  border: 1px dashed #b7aaf0;
  border-radius: 8px;
}
.photo-picker input {
  width: 100%;
}
.photo-tip {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.photo-preview {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
  background: #f9fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.photo-preview img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}
.ocr-result-list,
.photo-history-list,
.history-line-list {
  display: grid;
  gap: 10px;
}
.ocr-line-card,
.history-line-list button {
  justify-content: flex-start;
  width: 100%;
  text-align: left;
  line-height: 1.5;
  background: #fbfdff;
}
.photo-explain-card {
  line-height: 1.7;
}
.photo-explain-card p {
  margin: 0;
}
.photo-explain-card ul {
  margin: 6px 0 0;
  padding-left: 20px;
}
.photo-explain-card span {
  color: var(--muted);
}
.photo-history-item {
  padding: 12px;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.article-search-card {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.article-date-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.list-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.list-card-head h2 {
  margin: 0;
}
.article-list {
  display: grid;
  gap: 10px;
}
.article-card {
  display: grid;
  justify-items: start;
  width: 100%;
  min-height: 86px;
  gap: 6px;
  text-align: left;
  background: #fbfdff;
  border-color: #d8e1f2;
}
.article-card strong {
  font-size: 18px;
  color: var(--ink);
}
.article-card em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.5;
}
.article-card-meta {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}
.article-detail-card {
  margin-top: 12px;
}
.article-detail-content {
  display: grid;
  gap: 10px;
  color: #332b52;
  line-height: 1.8;
}
.article-detail-content h2,
.article-detail-content h3,
.article-detail-content h4,
.article-detail-content p,
.article-detail-content ul,
.article-detail-content ol,
.article-detail-content blockquote {
  margin: 0;
}
.article-detail-content h2,
.article-detail-content h3,
.article-detail-content h4 {
  color: #1f1a3d;
  line-height: 1.35;
}
.article-detail-content h2 {
  font-size: 22px;
}
.article-detail-content h3 {
  font-size: 18px;
}
.article-detail-content h4 {
  font-size: 16px;
}
.article-detail-content ul,
.article-detail-content ol {
  padding-left: 22px;
}
.article-detail-content li + li {
  margin-top: 4px;
}
.article-detail-content blockquote {
  border-left: 4px solid #8d7cff;
  color: #51476f;
  padding: 4px 0 4px 12px;
}
.article-detail-content code {
  background: #f3f0ff;
  border-radius: 4px;
  color: #493a85;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  padding: 2px 5px;
}
.article-detail-content a {
  color: #4f46e5;
  font-weight: 800;
  text-decoration: none;
}
.article-detail-content a:hover {
  text-decoration: underline;
}
.compact-pager {
  margin-top: 12px;
}
.explain-content dl {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 10px;
  margin: 0;
}
.explain-content dt {
  color: var(--muted);
  font-weight: 900;
}
.explain-content dd {
  margin: 0;
  line-height: 1.6;
}
.explain-content dd span {
  color: var(--muted);
}
.word-explain-sheet {
  width: min(1024px, calc(100% - 16px));
  max-height: min(92vh, 920px);
  padding: 0;
  overflow: auto;
  color: #17133c;
  background: #f8f9fc;
  border: 1px solid rgba(108, 92, 231, .14);
  border-radius: 18px 18px 0 0;
}
.word-explain-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(248, 249, 252, .94);
  border-bottom: 1px solid rgba(108, 92, 231, .12);
  backdrop-filter: blur(12px);
}
.word-explain-back,
.word-explain-refresh,
.vip-card-head button {
  min-width: auto;
  color: #5b45d6;
  border: 1px solid rgba(108, 92, 231, .2);
  background: white;
  border-radius: 999px;
}
.word-explain-refresh {
  color: #8a5a00;
  background: #fff3cf;
  border-color: #ffd47c;
}
.vip-explain-page {
  display: grid;
  gap: 18px;
  padding: 20px 24px 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(162, 155, 254, .34), transparent 28%),
    radial-gradient(circle at 95% 8%, rgba(108, 92, 231, .16), transparent 26%),
    #f8f9fc;
}
.vip-explain-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: center;
}
.vip-explain-hero > div {
  flex: 1;
}
.vip-kicker {
  margin: 0;
  color: #6c5ce7;
  font-size: 30px;
  font-weight: 950;
}
.vip-kicker span {
  display: inline-flex;
  margin-left: 10px;
  padding: 5px 13px;
  color: #8a5a00;
  font-size: 14px;
  vertical-align: middle;
  border: 1px solid #f8c568;
  border-radius: 999px;
  background: #ffe7a8;
}
.vip-explain-hero h2 {
  margin: 8px 0 4px;
  font-size: 18px;
}
.vip-explain-hero p:last-child {
  margin: 0;
  color: #5e5a7d;
}
.vip-explain-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.8fr);
  gap: 18px;
}
.vip-card {
  padding: 22px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(108, 92, 231, .18);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}
.vip-card h3 {
  margin: 0 0 14px;
  color: #1d1760;
  font-size: 24px;
}
.vip-word-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  min-height: 250px;
  overflow: hidden;
}
.vip-word-card h3 {
  display: inline-flex;
  margin: 0;
  color: #6c5ce7;
  font-size: clamp(52px, 9vw, 78px);
  line-height: .95;
}
.vip-sound {
  width: 48px;
  height: 48px;
  margin-left: 10px;
  vertical-align: top;
  background: #eeeaff;
}
.vip-phonetic {
  margin: 12px 0;
  color: #2b254a;
  font-size: 28px;
}
.vip-part {
  display: inline-flex;
  padding: 7px 12px;
  color: white;
  font-weight: 900;
  border-radius: 9px;
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
}
.vip-stars {
  margin: 18px 0 0;
  color: #fdcb6e;
  font-size: 22px;
}
.vip-stars span {
  margin-left: 10px;
  padding: 6px 10px;
  color: #e17000;
  font-size: 14px;
  border: 1px solid #ffd79a;
  border-radius: 10px;
  background: #fff3da;
}
.vip-teacher {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  margin: -22px -22px -22px 0;
  overflow: hidden;
}
.vip-bubble {
  position: absolute;
  left: 0;
  top: 38px;
  max-width: 145px;
  padding: 14px;
  color: white;
  font-weight: 900;
  border-radius: 24px 24px 24px 8px;
  background: linear-gradient(135deg, #a29bfe, #6c5ce7);
  box-shadow: 0 14px 26px rgba(108, 92, 231, .22);
}
.vip-teacher-image {
  width: 100%;
  height: 100%;
  min-height: 250px;
  object-fit: cover;
  object-position: 52% 22%;
}
.meaning-list {
  display: grid;
  gap: 12px;
}
.meaning-list p {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 15px;
  font-size: 18px;
  border-radius: 12px;
  background: #f5f6fb;
}
.meaning-list span {
  font-size: 28px;
}
.vip-ai-card {
  line-height: 1.85;
}
.vip-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.vip-card-head h3 {
  margin: 0;
}
.vip-ai-text p,
.vip-ai-text ul,
.vip-ai-text ol {
  margin: 0 0 10px;
}
.vip-ai-text li::marker {
  color: #6c5ce7;
}
.vip-cache {
  margin: 10px 0 0;
  color: #8a86a6;
  font-size: 12px;
}
.example-list {
  display: grid;
  gap: 10px;
}
.example-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f7f7fd;
}
.example-row b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: white;
  border-radius: 50%;
  background: #6c5ce7;
}
.example-row p {
  display: grid;
  gap: 3px;
  margin: 0;
}
.example-row span {
  color: #5f5b7b;
}
.example-row button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
  background: #eeeaff;
}
.vip-pronunciation-card {
  margin-bottom: 92px;
}
.pronunciation-vip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.pronunciation-vip-grid > div {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 150px;
  padding: 18px;
  text-align: center;
  border: 1px solid #e4e0f5;
  border-radius: 14px;
  background: #fbfbff;
}
.pronunciation-vip-grid span {
  font-weight: 950;
}
.pronunciation-vip-grid button {
  min-height: 46px;
  color: #5b45d6;
  border-color: #d9d0ff;
  background: #f1edff;
  border-radius: 999px;
}
.pronunciation-vip-grid strong {
  color: #00b894;
  font-size: 48px;
}
.pronunciation-vip-grid em {
  font-size: 18px;
  font-style: normal;
}
.pronunciation-vip-grid small,
.pronunciation-vip-grid p {
  margin: 0;
  color: #5f5b7b;
  line-height: 1.7;
}
.vip-reward-bar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -24px;
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid rgba(108, 92, 231, .14);
  box-shadow: 0 -12px 30px rgba(29, 23, 96, .08);
  backdrop-filter: blur(12px);
}
.vip-reward-bar div {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
}
.vip-reward-bar span {
  color: #4f486d;
}
.vip-reward-bar button {
  color: white;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #6c5ce7, #5a43d6);
  box-shadow: 0 10px 18px rgba(108, 92, 231, .22);
}

.toolbar, .stats, .study-card, .history, .admin-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
}
.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  align-items: end;
}
.toolbar label { display: grid; gap: 6px; font-weight: 700; color: var(--muted); }
.toolbar .check { display: flex; align-items: center; gap: 8px; }
.voice-status {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.study-card { display: grid; gap: 12px; }
.review-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #b9c7ea;
  border-radius: 8px;
  background: #edf4ff;
  color: #3b4c72;
  font-weight: 800;
}
.review-banner[hidden] { display: none; }
.announcement-board {
  min-height: 118px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff8d8 0%, #edf7ff 100%);
  padding: 14px;
  border: 1px solid #e8d998;
}
.announcement-card {
  display: grid;
  gap: 10px;
}
.announcement-card.quiet {
  color: #4c5574;
}
.announcement-kicker {
  margin: 0;
  color: #8a6a12;
  font-size: 13px;
  font-weight: 900;
}
.announcement-item {
  display: grid;
  gap: 4px;
  padding: 8px 0;
  border-top: 1px solid rgba(138, 106, 18, 0.18);
}
.announcement-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.announcement-card strong {
  color: #241d48;
  font-size: 18px;
}
.announcement-card span {
  color: #4f5570;
  line-height: 1.55;
}
.tag { color: var(--muted); margin: 0; }
.study-card h2 { margin: 0; font-size: 36px; }
.answer { margin: 0; color: var(--primary); font-size: 22px; font-weight: 800; }
.guide { margin: 0; line-height: 1.7; color: #3b335a; }
.answer-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.result { min-height: 28px; font-weight: 800; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions button { min-width: 110px; }
.premium-entry span {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  color: #795400;
  font-size: 11px;
  border-radius: 999px;
  background: #fff0bd;
}
.nav-prev {
  color: #3b4c72;
  border-color: #b9c7ea;
  background: #edf4ff;
}
.reveal-answer {
  color: #2f4f7a;
  border-color: #bfd2ef;
  background: #f1f7ff;
}
.speak-main {
  color: white;
  border-color: #5b49bc;
  background: #6753c8;
}
.auto-play,
.pronunciation-practice {
  color: #4d3100;
  border-color: #e5ba55;
  background: #fff0bd;
}
.loop-play-entry {
  color: white;
  border-color: #5b49bc;
  background: #6753c8;
}
.auto-play.is-running,
.pronunciation-practice.is-running {
  color: white;
  border-color: #bf3543;
  background: #c73f4a;
}
.pronunciation-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.purchase-sheet {
  max-width: 520px;
}
.purchase-content {
  display: grid;
  gap: 14px;
  padding: 4px 0 12px;
}
.purchase-content > p {
  margin: 0;
  line-height: 1.7;
}
.purchase-price {
  color: var(--primary);
  font-size: 20px;
  font-weight: 900;
}
.purchase-qr {
  width: min(240px, 72vw);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.contact-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf9ff;
}
.contact-row span {
  color: var(--muted);
}
.purchase-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 0;
  color: inherit;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.menu-link span {
  color: var(--muted);
}
.login-main-link {
  display: block;
  margin-top: 16px;
  text-align: center;
}
.pronunciation-head,
.pronunciation-actions,
.score-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.pronunciation-head {
  justify-content: space-between;
}
.pronunciation-head span {
  color: var(--primary);
  font-weight: 900;
}
.score-card {
  display: grid;
  place-items: center;
  width: 96px;
  min-height: 82px;
  color: white;
  background: #6753c8;
  border-radius: 8px;
}
.score-card strong {
  font-size: 32px;
}
.score-grid span {
  padding: 8px 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.nav-next {
  color: white;
  border-color: #23754a;
  background: #258a55;
}

.history h2, .admin-section h2 { margin-top: 0; }
.day-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.history-actions button {
  min-width: 86px;
  padding: 8px 10px;
  background: #ffffff;
}
.history-actions button[data-status="correct"] {
  color: var(--good);
  border-color: #add7bf;
}
.history-actions button[data-status="wrong"] {
  color: var(--bad);
  border-color: #e4b5bc;
}
.history-actions span {
  min-width: 86px;
  padding: 8px 10px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.history-actions span.correct {
  color: var(--good);
  border-color: #add7bf;
}
.history-actions span.wrong {
  color: var(--bad);
  border-color: #e4b5bc;
}
.favorite-record {
  display: grid;
  width: 100%;
  margin-bottom: 10px;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.favorite-record > span {
  width: fit-content;
  margin-bottom: 6px;
  padding: 3px 8px;
  color: #654bd6;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  background: #f1edff;
}
.favorite-record strong {
  color: var(--text);
}
.favorite-record p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 14px;
}
.pager span {
  color: var(--muted);
  font-weight: 800;
}
.admin-pager {
  flex-wrap: wrap;
}
.pager-total {
  margin-right: 4px;
}
.page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.page-number {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  min-height: 38px;
  padding: 6px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}
.page-number.active {
  color: white;
  border-color: var(--primary);
  background: var(--primary);
}
.page-ellipsis {
  min-width: 24px;
  text-align: center;
}
.button-link.is-disabled {
  cursor: not-allowed;
  opacity: .5;
}
.bulk-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}
.bulk-select-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
}
.bulk-select-label input,
.code-select-cell input {
  width: 18px;
  min-height: 18px;
}
.bulk-action-bar button {
  margin-left: auto;
}
.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}
.admin-form .wide {
  grid-column: 1 / -1;
}
.admin-form label { display: grid; gap: 6px; font-weight: 700; color: var(--muted); }
.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  padding: 12px;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.filter-bar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}
.course-picker {
  grid-column: 1 / -1;
  padding: 14px;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.course-picker-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.course-picker-head strong {
  color: var(--text);
}
.course-picker-head span {
  color: var(--muted);
  font-size: 13px;
}
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
}
.course-group {
  display: grid;
  gap: 7px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #ebe6f6;
  border-radius: 8px;
}
.course-group strong {
  color: var(--primary);
  font-weight: 800;
}
.course-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 700;
}
.course-group input {
  width: auto;
}
.course-picker.compact {
  margin-top: 10px;
}
.course-picker.compact .course-grid {
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
}
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; min-width: 840px; table-layout: fixed; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #faf8ff; }
td {
  overflow-wrap: anywhere;
}
.admin-table th,
.admin-table td {
  white-space: normal;
}
.codes-table {
  min-width: 1170px;
}
.codes-table th:nth-child(1) { width: 58px; }
.codes-table th:nth-child(2) { width: 150px; }
.codes-table th:nth-child(3) { width: 220px; }
.codes-table th:nth-child(4) { width: 100px; }
.codes-table th:nth-child(5) { width: 120px; }
.codes-table th:nth-child(6) { width: 185px; }
.codes-table th:nth-child(7) { width: 95px; }
.codes-table th:nth-child(8) { width: 95px; }
.codes-table th:nth-child(9) { width: 96px; }
.code-select-cell {
  text-align: center;
}
.course-cell {
  color: #3d365f;
  line-height: 1.5;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  background: #eef1f7;
  color: #516079;
}
.status-pill.ok {
  background: #e9f8ef;
  color: var(--good);
}
.status-pill.warn {
  background: #fff2d5;
  color: #9a6400;
}
.status-pill.idle {
  background: #eef1f7;
  color: #536071;
}
.row-details summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 900;
}
.row-actions-cell {
  white-space: nowrap;
}
.compact-button {
  min-width: 68px;
  padding: 8px 12px;
}
.admin-dialog {
  width: min(900px, calc(100vw - 32px));
  max-width: 900px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  margin: auto;
  padding: 0;
  color: var(--ink);
  border: 0;
  border-radius: 12px;
  background: white;
  box-shadow: 0 24px 70px rgba(31, 24, 61, .28);
}
.admin-dialog::backdrop {
  background: rgba(31, 24, 61, .52);
  backdrop-filter: blur(2px);
}
.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.dialog-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.dialog-head strong {
  font-size: 20px;
}
.dialog-head code {
  overflow: hidden;
  text-overflow: ellipsis;
}
.dialog-close {
  flex: 0 0 auto;
  background: white;
}
.dialog-form {
  width: 100%;
  margin: 0;
  padding: 18px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.dialog-form .edit-actions {
  gap: 10px;
}
.dialog-delete-form {
  padding: 0 18px 18px;
}
.edit-panel {
  display: grid;
  gap: 12px;
  width: min(820px, 78vw);
  margin-top: 10px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(44, 36, 76, .12);
}
.edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.edit-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}
.edit-actions {
  display: flex;
  justify-content: flex-end;
}
.inline-admin-form {
  display: grid;
  gap: 8px;
  min-width: 220px;
  margin: 10px 0;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.row-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.announcement-form {
  margin-bottom: 16px;
}
.announcement-row-form {
  grid-template-columns: minmax(140px, 1fr) minmax(260px, 2fr) 90px minmax(170px, 1fr) minmax(170px, 1fr) auto;
}
.announcement-table {
  min-width: 980px;
}
.announcement-table textarea {
  min-height: 58px;
}
.article-create-form {
  margin-bottom: 18px;
}
.articles-table {
  min-width: 980px;
}
.articles-table th:nth-child(1) { width: 42%; }
.articles-table th:nth-child(2) { width: 120px; }
.articles-table th:nth-child(3) { width: 96px; }
.articles-table th:nth-child(4) { width: 110px; }
.articles-table th:nth-child(5) { width: 120px; }
.articles-table p {
  margin: 6px 0 0;
  line-height: 1.5;
}
.article-edit-panel {
  width: min(920px, 78vw);
}
.article-edit-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}
.article-edit-panel textarea[name="content"] {
  min-height: 220px;
}
.article-row-actions {
  justify-content: flex-start;
  gap: 10px;
}
.admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  width: 100%;
  min-width: 0;
}
.admin-menu {
  position: sticky;
  top: 16px;
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.admin-menu a {
  padding: 10px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 800;
}
.admin-menu a:hover {
  background: #eeeaf7;
}
.admin-menu a.active {
  color: white;
  background: var(--primary);
}
.admin-main {
  width: 100%;
  min-width: 0;
}
.admin-section {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}
.list-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.list-toolbar h2,
.list-toolbar h3 {
  margin: 0;
}
.page-size-form {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.page-size-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}
.section-title-row,
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.section-title-row h2,
.detail-header h3 {
  margin: 0;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.compact-metrics {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.metric-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  color: var(--text);
  text-decoration: none;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.metric-card:hover,
.metric-card.is-active {
  border-color: var(--primary);
  background: #f2efff;
}
.metric-value {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}
.metric-label {
  font-weight: 900;
}
.metric-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.row-form.wide {
  grid-template-columns: repeat(10, minmax(95px, 1fr));
}
.row-form.word-form {
  grid-template-columns: minmax(130px, 1.3fr) minmax(150px, 1.4fr) minmax(90px, .8fr) minmax(90px, .8fr) minmax(90px, .9fr) minmax(70px, .6fr) auto;
}

@media (max-width: 680px) {
  .page { padding: 14px 12px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .answer-row { grid-template-columns: 1fr; }
  .study-card h2 { font-size: 30px; }
  .compact-study {
    gap: 11px;
    padding: 16px;
  }
  .compact-study h2 {
    font-size: 34px;
  }
  .compact-study .answer {
    line-height: 1.25;
  }
  .compact-study input,
  .compact-study button {
    min-height: 48px;
  }
  .compact-study .explain-button {
    margin-top: 4px;
  }
  .compact-study .mobile-actions {
    margin-top: 2px;
  }
  .auth-panel {
    margin: 16px auto;
    padding: 20px;
  }
  .toolbar, .stats, .study-card, .history, .admin-section {
    padding: 14px;
  }
  .today-grid {
    gap: 8px;
  }
  .mini-stat {
    padding: 11px;
  }
  .mini-stat strong {
    font-size: 21px;
  }
  .answer {
    font-size: 20px;
  }
  .review-banner,
  .day-row {
    align-items: stretch;
    flex-direction: column;
  }
  .history-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .history-actions button {
    min-width: 0;
    padding: 9px 6px;
  }
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .admin-menu {
    position: static;
    display: flex;
    gap: 6px;
    max-width: 100%;
    overflow-x: auto;
    padding: 10px;
    white-space: nowrap;
    overscroll-behavior-inline: contain;
  }
  .admin-menu a {
    flex: 0 0 auto;
  }
  .section-title-row,
  .detail-header,
  .list-toolbar {
    flex-direction: column;
  }
  .page-size-form,
  .page-size-form label {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }
  .row-form { grid-template-columns: 1fr; }
  .row-form.wide,
  .row-form.announcement-row-form,
  .row-form.word-form { grid-template-columns: 1fr; }
  .filter-bar,
  .admin-form,
  .edit-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .filter-bar > *,
  .admin-form > *,
  .edit-grid > * {
    min-width: 0;
    width: 100%;
  }
  .filter-bar .button-link,
  .filter-bar button {
    margin-top: 0;
  }
  .codes-table {
    min-width: 0;
    table-layout: auto;
  }
  .codes-table thead {
    display: none;
  }
  .codes-table,
  .codes-table tbody,
  .codes-table tr,
  .codes-table td {
    display: block;
    width: 100%;
  }
  .codes-table tbody {
    display: grid;
    gap: 12px;
  }
  .codes-table tr {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
  }
  .codes-table td {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    min-height: 42px;
    padding: 8px 0;
    border-bottom: 1px solid #eeeaf7;
  }
  .codes-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 800;
  }
  .codes-table td:last-child {
    border-bottom: 0;
  }
  .codes-table .row-actions-cell {
    white-space: normal;
  }
  .codes-table .compact-button {
    width: 100%;
  }
  .codes-table .code-select-cell {
    text-align: left;
  }
  .bulk-action-bar {
    align-items: stretch;
    flex-direction: column;
  }
  .bulk-action-bar button {
    width: 100%;
    margin-left: 0;
  }
  .admin-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }
  .dialog-head {
    padding: 13px 14px;
  }
  .dialog-form {
    padding: 14px;
  }
  .dialog-delete-form {
    padding: 0 14px 14px;
  }
  .dialog-form .course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-pager {
    gap: 8px;
  }
  .page-numbers {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 820px) {
  .page {
    padding: 0;
  }
  .student-app {
    display: block;
    min-height: 100vh;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .student-sidebar {
    display: none;
  }
  .student-workspace {
    min-height: 100vh;
    padding: 18px 14px calc(112px + env(safe-area-inset-bottom));
  }
  .student-workspace .mobile-panel {
    max-width: 520px;
  }
  .student-header {
    align-items: center;
    margin-bottom: 16px;
  }
  .student-header h1 {
    font-size: 22px;
  }
  .student-header p {
    font-size: 13px;
  }
  .student-header .header-actions {
    gap: 6px;
  }
  .round-action {
    min-width: auto;
    padding: 8px 9px;
    font-size: 12px;
  }
  .student-workspace .today-grid {
    gap: 8px;
    margin-bottom: 12px;
  }
  .student-workspace .mini-stat {
    min-height: 80px;
    padding: 12px;
  }
  .student-workspace .mini-stat::after {
    display: none;
  }
  .student-workspace .mini-stat strong {
    gap: 3px;
    margin-top: 4px;
  }
  .student-workspace .mini-stat strong b {
    font-size: 25px;
  }
  .student-workspace .range-card {
    padding: 14px;
  }
  .student-workspace .range-card button {
    min-width: auto;
    padding: 8px 10px;
    font-size: 12px;
  }
  .student-workspace .compact-study {
    min-height: 0;
    padding: 18px;
  }
  .student-workspace .compact-study h2 {
    font-size: 34px;
  }
  .word-answer-line .answer {
    font-size: 24px;
  }
  .student-workspace .answer-row {
    grid-template-columns: minmax(0, 1fr) 76px;
  }
  .student-workspace .mobile-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .student-workspace .mobile-actions .action-wide {
    grid-column: 1 / -1;
  }
  .student-workspace .bottom-nav {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: 0;
    width: min(520px, 100%);
    transform: translateX(-50%);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 16px 16px 0 0;
  }
  .student-workspace .bottom-nav button {
    display: grid;
    justify-items: center;
    gap: 3px;
    font-size: 11px;
  }
  .student-workspace .bottom-nav button.active {
    box-shadow: inset 0 -3px 0 var(--primary);
  }
  .article-search-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .student-workspace .record-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .student-workspace .record-grid .mini-stat {
    min-height: 82px;
  }
  .community-compose,
  .community-card {
    padding: 16px;
  }
  .community-compose-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .community-compose-actions .primary-button {
    width: 100%;
  }
  .community-post-head {
    align-items: flex-start;
  }
  .community-reply {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .community-reply-form {
    align-items: stretch;
  }
  .community-reply-form button {
    min-width: 64px;
  }
  .comment-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .ai-chat-message {
    max-width: 94%;
  }
  .ai-chat-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .word-explain-sheet {
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }
  .vip-explain-page {
    gap: 14px;
    padding: 14px 12px 0;
  }
  .vip-explain-hero {
    align-items: flex-start;
    text-align: left;
  }
  .vip-kicker {
    font-size: 22px;
  }
  .vip-kicker span {
    margin-left: 4px;
    padding: 4px 9px;
    font-size: 12px;
  }
  .vip-explain-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .vip-word-card {
    grid-template-columns: minmax(0, 1fr) 300px;
    min-height: 0;
  }
  .vip-word-card h3 {
    font-size: 58px;
  }
  .vip-phonetic {
    font-size: 24px;
  }
  .vip-teacher {
    min-height: 230px;
    margin: -16px -16px -16px 0;
  }
  .vip-bubble {
    left: -8px;
    right: auto;
    top: 44px;
    max-width: 120px;
    font-size: 13px;
  }
  .vip-teacher-image {
    min-height: 260px;
    max-height: 320px;
    object-position: 50% 18%;
  }
  .vip-card {
    padding: 16px;
  }
  .vip-card h3 {
    font-size: 20px;
  }
  .vip-card-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .pronunciation-vip-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .vip-pronunciation-card {
    margin-bottom: 128px;
  }
  .vip-reward-bar {
    align-items: stretch;
    flex-direction: column;
    margin: 0 -12px;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  }
  .vip-reward-bar div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
  .vip-reward-bar button {
    width: 100%;
  }
  @supports (min-height: 100dvh) {
    .student-app,
    .student-workspace {
      min-height: 100dvh;
    }
  }
  .profile-hero {
    padding: 18px;
  }
}

@media (display-mode: standalone) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  .page,
  .student-app,
  .student-workspace {
    height: auto;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 680px) {
  .loop-player-sheet {
    padding-right: 10px;
    padding-bottom: calc(250px + env(safe-area-inset-bottom));
    padding-left: 10px;
    border-radius: 0;
  }
  .loop-player-header {
    padding: 9px 2px 7px;
  }
  .loop-player-header .student-brand {
    font-size: 15px;
  }
  .loop-player-header .student-brand {
    padding-bottom: 0;
  }
  .loop-player-header .sheet-close {
    padding: 6px 8px;
    font-size: 12px;
  }
  .loop-panel {
    gap: 8px;
    margin-bottom: 8px;
    padding: 10px;
  }
  .loop-panel-title {
    gap: 6px;
  }
  .loop-panel-title > span {
    font-size: 16px;
  }
  .loop-panel-title div {
    gap: 2px;
  }
  .loop-panel-title strong {
    font-size: 14px;
  }
  .loop-panel-title small {
    font-size: 11px;
  }
  .loop-filter-grid label,
  .loop-mode-control legend {
    font-size: 11px;
  }
  .loop-filter-grid label {
    gap: 4px;
  }
  .loop-filter-grid select {
    min-height: 34px;
    padding: 5px 6px;
    font-size: 12px;
  }
  .loop-mode-control {
    gap: 6px;
  }
  .loop-mode-control legend {
    margin-bottom: 3px;
  }
  .loop-mode-control span {
    gap: 1px;
    padding: 7px 8px;
  }
  .loop-mode-control span strong {
    font-size: 14px;
  }
  .loop-mode-control small {
    font-size: 10px;
  }
  .loop-start-actions {
    gap: 7px;
  }
  .loop-start-actions button {
    min-height: 40px;
    padding: 7px 8px;
    font-size: 13px;
  }
  .loop-now-playing {
    gap: 8px 10px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    border-radius: 12px 12px 0 0;
  }
  .loop-now-meta {
    gap: 1px;
  }
  .loop-now-meta > span {
    display: none;
  }
  .loop-now-meta strong {
    font-size: 21px;
  }
  .loop-now-meta small {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .loop-now-count {
    gap: 1px;
  }
  .loop-now-count strong {
    padding: 3px 7px;
    font-size: 13px;
  }
  .loop-subtitle {
    min-height: 58px;
    max-height: 82px;
    padding: 9px 11px;
    font-size: 15px;
    line-height: 1.5;
    text-align: left;
  }
  .loop-player-controls {
    padding: 3px 12px;
  }
  .loop-player-controls .loop-pause {
    width: 46px;
    height: 46px;
    border-width: 2px;
  }
  .loop-progress-track,
  .loop-volume {
    display: none;
  }
  .vip-word-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .vip-teacher {
    min-height: 190px;
    margin: 10px -16px -16px;
  }
  .vip-teacher-image {
    min-height: 220px;
    max-height: 260px;
  }
  .vip-bubble {
    left: auto;
    right: 18px;
    top: 22px;
  }
}

@media (max-width: 820px) {
  body {
    background:
      radial-gradient(circle at 92% 0%, rgba(111, 83, 226, .1), transparent 30%),
      #faf9ff;
  }
  .student-workspace {
    padding-top: 20px;
    padding-right: 10px;
    padding-left: 10px;
  }
  .student-header {
    padding: 0 6px;
  }
  .student-header h1 {
    color: #17123f;
    font-size: 20px;
  }
  .student-header .wave {
    display: inline-block;
    margin-left: 4px;
    padding: 3px 7px;
    color: #6548d8;
    font-size: 11px;
    border-radius: 999px;
    background: #f0ecff;
  }
  .round-action {
    min-width: 44px;
    min-height: 44px;
    padding: 7px;
    border-color: #ece8f7;
    border-radius: 13px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 6px 18px rgba(56, 43, 105, .05);
  }
  .student-workspace .mini-stat,
  .student-workspace .range-card,
  .student-workspace .compact-study,
  .profile-card,
  .menu-card,
  .trend-card,
  .list-card {
    border-color: #eeeaf9;
    box-shadow: 0 8px 24px rgba(54, 43, 93, .045);
  }
  .student-workspace .mini-stat,
  .student-workspace .range-card {
    border-radius: 13px;
  }
  .student-workspace .compact-study {
    border-radius: 16px;
  }
  .empty-study-card {
    min-height: 430px !important;
  }
  .empty-study-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .phrase-study-card > h2 {
    margin-top: 28px;
    font-size: 38px;
  }
  .phrase-answer {
    font-size: 22px;
  }
  .phrase-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .phrase-actions .action-wide {
    grid-column: 1 / -1;
  }
  .sentence-study-card > h2 {
    margin-top: 24px;
    font-size: 27px;
    line-height: 1.42;
  }
  .sentence-answer {
    font-size: 18px;
    line-height: 1.55;
  }
  .profile-hero {
    position: relative;
    min-height: 124px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f4f0ff, #fff);
  }
  .profile-hero .avatar.large {
    width: 58px;
    height: 58px;
    font-size: 22px;
  }
  .profile-hero > div strong {
    font-size: 19px;
  }
  .profile-overview {
    border-color: #eeeaf9;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(54, 43, 93, .04);
  }
  .profile-menu {
    border-radius: 16px;
  }
  .profile-menu button,
  .profile-menu .menu-link {
    min-height: 54px;
  }
  .record-type-tabs {
    position: sticky;
    top: 0;
    z-index: 3;
  }
  .student-workspace .bottom-nav {
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -10px 30px rgba(52, 43, 86, .08);
    backdrop-filter: blur(16px);
  }
  .student-workspace .bottom-nav button {
    min-height: 56px;
    padding: 6px 2px;
    color: #777094;
    border-radius: 10px;
  }
  .student-workspace .bottom-nav button > span {
    width: 25px;
    height: 25px;
    border: 0;
    background: transparent;
  }
  .student-workspace .bottom-nav button.active {
    color: #6248dc;
    background: #f7f4ff;
    box-shadow: inset 0 -3px 0 #7155ec;
  }
  .student-workspace .bottom-nav button.active > span {
    color: white;
    background: linear-gradient(135deg, #8068ef, #5b42d4);
  }
}

@media (max-width: 900px) {
  .growth-tree {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .growth-tree::before {
    display: none;
  }
  .wordtree-preview-grid,
  .training-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .student-header.structure-hero {
    display: grid;
    min-height: 0;
    padding: 20px;
  }
  .student-header.structure-hero h1 {
    color: white;
    font-size: 34px;
  }
  .student-header.structure-hero p {
    color: rgba(255, 255, 255, .9);
    font-size: 14px;
  }
  .structure-hero::after {
    width: 106px;
    height: 106px;
  }
  .task-grid,
  .growth-tree,
  .wordtree-preview-grid,
  .training-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .structure-tree-card {
    min-height: 0;
  }
  .structure-node-grid {
    max-width: none;
  }
  .word-detail-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .word-detail-topbar > div {
    min-width: 0;
  }
  .word-detail-hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px;
  }
  .word-detail-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }
  .word-detail-actions button {
    min-width: 0;
    padding: 10px 8px;
  }
  .word-detail-tabs {
    grid-template-columns: minmax(0, 1fr);
  }
  .continue-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .continue-card button,
  .practice-title-row button {
    width: 100%;
  }
  .daily-task-card,
  .continue-card,
  .growth-tree-card,
  .wordtree-preview-card {
    border-radius: 16px;
  }
  .section-title-row {
    align-items: flex-start;
  }
  .practice-title-row {
    display: grid;
  }
  .home-practice-card .answer-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
