:root {
  color-scheme: dark;
  --background: #0a0a0f;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-soft: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --expanded-surface: rgba(255, 255, 255, 0.06);
  --text: rgba(255, 255, 255, 0.92);
  --text-secondary: rgba(255, 255, 255, 0.64);
  --text-muted: #a0aec0;
  --text-faint: #718096;
  --border: rgba(255, 255, 255, 0.16);
  --border-soft: rgba(255, 255, 255, 0.12);
  --table-border: gray;
  --link: #63b3ed;
  --link-hover: #90cdf4;
  --star-color: #ffd84d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.24), 0 2px 4px -1px rgba(0, 0, 0, 0.14);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.28), 0 10px 10px -5px rgba(0, 0, 0, 0.18);
}

:root[data-theme="light"] {
  color-scheme: light;
  --background: #f5f7fa;
  --surface: #fafafa;
  --surface-soft: rgba(255, 255, 255, 0.8);
  --surface-hover: #f2f6fa;
  --expanded-surface: rgba(255, 255, 255, 0.8);
  --text: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --text-faint: #a0aec0;
  --border: #e2e8f0;
  --border-soft: #edf2f7;
  --table-border: #e2e8f0;
  --link: #2b6cb0;
  --link-hover: #3182ce;
  --star-color: #d69e2e;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.page {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  isolation: isolate;
}

.ambient {
  position: absolute;
  z-index: -1;
  border-radius: 9999px;
  filter: blur(120px);
  pointer-events: none;
}

.ambient-blue {
  width: 500px;
  height: 500px;
  top: 10%;
  left: 10%;
  background: #2c5282;
  opacity: 0.15;
}

.ambient-purple {
  width: 400px;
  height: 400px;
  top: 50%;
  right: 10%;
  background: #44337a;
  opacity: 0.15;
}

.ambient-orange {
  width: 300px;
  height: 300px;
  bottom: 10%;
  left: 30%;
  background: #285e61;
  filter: blur(100px);
  opacity: 0.1;
}

:root[data-theme="light"] .page-home .ambient-blue { background: #ebf8ff; }
:root[data-theme="light"] .page-home .ambient-purple { background: #faf5ff; }
:root[data-theme="light"] .page-home .ambient-orange { background: #e6fffa; }

.page-login {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

.login-container {
  position: relative;
  z-index: 1;
  width: min(100%, 400px);
}

.login-container > .theme-toggle {
  top: 2px;
  right: 0;
}

.login-header {
  margin-bottom: 24px;
  padding: 0 40px;
  text-align: center;
}

.login-header h1 {
  margin-bottom: 2px;
  color: var(--text);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
}

.login-form {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(16px);
}

.login-form-heading {
  text-align: center;
}

.login-form-heading h2 {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.25;
}

.login-form-heading p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.login-field {
  display: grid;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.login-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 15px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.login-field input:hover {
  border-color: rgba(99, 179, 237, 0.5);
}

.login-field input:focus {
  border-color: #63b3ed;
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.16);
}

:root[data-theme="light"] .login-field input:focus {
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.13);
}

.login-error {
  padding: 9px 11px;
  border: 1px solid rgba(245, 101, 101, 0.35);
  border-radius: 6px;
  background: rgba(245, 101, 101, 0.1);
  color: #fc8181;
  font-size: 13px;
  line-height: 1.45;
}

:root[data-theme="light"] .login-error {
  border-color: #feb2b2;
  background: #fff5f5;
  color: #c53030;
}

.login-submit {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: #3182ce;
  box-shadow: var(--shadow-sm);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms ease, opacity 150ms ease;
}

.login-submit:hover:not(:disabled) {
  background: #2b6cb0;
}

.login-submit:focus-visible {
  outline: 3px solid rgba(99, 179, 237, 0.32);
  outline-offset: 2px;
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.68;
}

.page-detail .ambient-blue {
  width: 600px;
  height: 600px;
  top: 5%;
  left: 10%;
  background: #3182ce;
}

.page-detail .ambient-purple {
  width: 500px;
  height: 500px;
  top: 40%;
  right: 5%;
  background: #805ad5;
}

.page-detail .ambient-orange {
  width: 400px;
  height: 400px;
  background: #dd6b20;
}

:root[data-theme="light"] .page-detail .ambient-blue {
  background: #bee3f8;
  opacity: 0.2;
}

:root[data-theme="light"] .page-detail .ambient-purple {
  background: #d6bcfa;
  opacity: 0.2;
}

:root[data-theme="light"] .page-detail .ambient-orange {
  background: #fbd38d;
  opacity: 0.15;
}

.home-container,
.detail-container {
  position: relative;
  z-index: 1;
  width: min(100% - 32px, 1152px);
  margin: 0 auto;
  padding: 20px 0 64px;
}

.home-container {
  width: min(100% - 32px, 848px);
  padding-top: 48px;
}

.home-header {
  position: relative;
  text-align: center;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.home-header h1 {
  margin-bottom: 2px;
  color: var(--text);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.35;
}

.home-header p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.page-account-actions {
  position: absolute;
  z-index: 20;
  top: 0;
  right: 2px;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 2px;
}

.page-account-actions .theme-toggle {
  position: static;
}

.account-menu {
  position: relative;
}

.account-menu-trigger {
  display: inline-flex;
  min-height: 30px;
  max-width: 180px;
  align-items: center;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, opacity 150ms ease;
}

.home-header .page-account-actions {
  top: auto;
  bottom: 0;
}

.home-header .account-menu-trigger {
  min-height: 21px;
  line-height: 1.5;
}

.account-menu-trigger:hover,
.account-menu-trigger[aria-expanded="true"] {
  background: var(--surface-hover);
  color: var(--text);
}

.account-menu-trigger:focus-visible,
.account-menu-item:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 1px;
}

.account-menu-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  box-shadow: var(--shadow-md);
}

.account-menu-item {
  display: flex;
  width: 100%;
  min-height: 32px;
  align-items: center;
  padding: 0 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-menu-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.account-menu-item:disabled {
  cursor: wait;
  opacity: 0.5;
}

.account-toast {
  position: fixed;
  z-index: 1200;
  top: 18px;
  left: 50%;
  display: flex;
  width: min(calc(100% - 24px), 440px);
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid rgba(72, 187, 120, 0.48);
  border-radius: 7px;
  background: #22543d;
  box-shadow: var(--shadow-md);
  color: #f0fff4;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.account-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.account-toast-message {
  display: flex;
  max-width: 100%;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.account-toast-message > span {
  max-width: 100%;
  text-align: center;
}

:root[data-theme="light"] .account-toast {
  border-color: #9ae6b4;
  background: #f0fff4;
  color: #276749;
}

.password-modal {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
}

.password-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(8px);
}

.password-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  box-shadow: var(--shadow-xl);
}

.password-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.password-modal-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.password-modal-header {
  margin-bottom: 20px;
  padding-right: 32px;
}

.password-modal-header h2,
.password-modal-header p {
  margin: 0;
}

.password-modal-header h2 {
  color: var(--text);
  font-size: 21px;
  line-height: 1.3;
}

.password-modal-header p {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 13px;
}

.password-form {
  display: grid;
  gap: 16px;
}

.password-field {
  display: grid;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.password-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 15px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.password-field input:hover {
  border-color: rgba(99, 179, 237, 0.5);
}

.password-field input:focus {
  border-color: #63b3ed;
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.16);
}

.password-status {
  padding: 9px 11px;
  border: 1px solid rgba(245, 101, 101, 0.35);
  border-radius: 6px;
  background: rgba(245, 101, 101, 0.1);
  color: #fc8181;
  font-size: 13px;
  line-height: 1.45;
}

.password-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}

.password-cancel-button,
.password-submit-button {
  min-height: 38px;
  padding: 0 15px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.password-cancel-button {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-secondary);
}

.password-submit-button {
  border: 1px solid #3182ce;
  background: #3182ce;
  color: #fff;
}

.password-cancel-button:hover,
.password-modal-close:focus-visible {
  background: var(--surface-hover);
  color: var(--text);
}

.password-submit-button:hover:not(:disabled) {
  border-color: #2b6cb0;
  background: #2b6cb0;
}

.password-cancel-button:focus-visible,
.password-submit-button:focus-visible,
.password-modal-close:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.password-submit-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

:root[data-theme="light"] .password-status {
  border-color: #feb2b2;
  background: #fff5f5;
  color: #c53030;
}

.theme-toggle {
  position: absolute;
  top: 19px;
  right: 2px;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.theme-toggle:hover {
  background: var(--surface-hover);
}

.topic-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0;
}

.toolbar-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-button {
  display: inline-flex;
  min-height: 33px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.toolbar-icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: currentColor;
}

.toolbar-button-label {
  white-space: nowrap;
}

.toolbar-button:hover,
.toolbar-button.is-active {
  border-color: rgba(99, 179, 237, 0.55);
  background: var(--surface-hover);
}

.toolbar-button.is-active {
  color: var(--link);
}

.filter-active-count {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border-radius: 9999px;
  background: #3182ce;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.filtered-topic-count {
  display: inline-flex;
  min-height: 33px;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: help;
}

:root[data-theme="light"] .filtered-topic-count {
  background: #f7fafc;
  color: #2d3748;
}

.clear-filters-button {
  display: grid;
  width: 20px;
  height: 20px;
  margin-left: 4px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.clear-filters-button:hover {
  background: rgba(245, 101, 101, 0.16);
  color: #fc8181;
}

:root[data-theme="light"] .clear-filters-button:hover {
  background: #fed7d7;
  color: #c53030;
}

.search-control {
  position: relative;
  display: flex;
  width: 244px;
  min-height: 33px;
  flex: none;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  cursor: text;
}

.search-icon {
  flex: none;
  margin-left: 12px;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
}

.search-control input {
  width: 100%;
  min-width: 0;
  height: 31px;
  padding: 0 34px 0 10px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.search-control input::placeholder {
  color: var(--text-faint);
}

.search-control:focus-within {
  border-color: #4299e1;
  box-shadow: 0 0 0 1px #4299e1;
}

.search-control kbd {
  position: absolute;
  right: 10px;
  display: grid;
  min-width: 20px;
  height: 21px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
}

.filter-panel {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin: -12px 0 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.filter-panel label {
  display: grid;
  gap: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.filter-panel select {
  min-width: 150px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  background: var(--background);
  color: var(--text);
}

.toolbar-topic-count {
  margin-left: auto;
  padding-bottom: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.module-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
}

.module-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.module-modal-dialog {
  position: relative;
  width: min(100%, 1152px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  scrollbar-width: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(20px);
}

.module-modal-dialog::-webkit-scrollbar {
  display: none;
}

:root[data-theme="light"] .module-modal-dialog {
  background: rgba(255, 255, 255, 0.9);
}

.module-modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.module-modal-x:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.module-modal-header {
  padding: 20px 52px 16px 24px;
}

.module-modal-header h2 {
  display: flex;
  margin: 0 0 6px;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.2;
}

.module-modal-title-zh {
  color: var(--text-secondary);
  font-size: 20px;
  font-weight: 600;
}

.module-modal-header p {
  display: flex;
  width: 100%;
  margin: 0;
  flex-direction: column;
  gap: 2px;
  color: var(--text-secondary);
  font-size: 12px;
}

.module-modal-description-zh {
  color: var(--text-muted);
}

.module-view-all {
  display: block;
  min-height: 28px;
  margin: 8px auto 0;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--link);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.module-view-all:hover {
  background: var(--surface-hover);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 20px 32px;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.module-card {
  display: flex;
  min-width: 0;
  min-height: 154px;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
  box-shadow: var(--shadow-md);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

:root[data-theme="light"] .module-card {
  background: #f7fafc;
}

.module-card:hover {
  border-color: rgba(160, 174, 192, 0.5);
  background: var(--surface-hover);
  box-shadow: var(--shadow-xl);
}

.module-card-main,
.module-card-progress {
  display: flex;
}

.module-card-main {
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}

.module-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 7px;
  color: #4299e1;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.module-card-title-zh {
  font-size: 14px;
  font-weight: 600;
}

:root[data-theme="light"] .module-card-title {
  color: #3182ce;
}

.module-card-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.module-rating {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 14px;
}

.module-card-progress {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 14px;
}

.module-progress {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#68d391 var(--module-progress), rgba(160, 174, 192, 0.25) 0);
}

.module-progress::before {
  position: absolute;
  border-radius: 50%;
  background: #242429;
  content: "";
  inset: 4px;
}

:root[data-theme="light"] .module-progress::before {
  background: #f7fafc;
}

.module-progress > span {
  position: relative;
  z-index: 1;
  font-size: 8px;
  font-weight: 600;
}

.module-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 14px 24px;
}

.module-close-button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: #e53e3e;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.module-close-button:hover {
  background: #c53030;
}

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

.overall-progress {
  display: flex;
  min-height: 28px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding: 0 4px 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.overall-progress-item {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.overall-progress-label {
  color: var(--text-secondary);
}

.overall-progress strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.category-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  transition: background-color 150ms ease, border-color 150ms ease;
}

.category-card[open] {
  border-color: transparent;
  background: transparent;
}

.category-card summary {
  position: relative;
  display: flex;
  min-height: 42px;
  overflow: hidden;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 16px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  list-style: none;
  transition: background-color 150ms ease;
}

.category-card[data-category] summary::before,
.category-card[data-category] summary::after {
  position: absolute;
  left: 0;
  width: var(--category-progress, 0%);
  content: "";
  pointer-events: none;
  transition: width 260ms ease;
}

.category-card[data-category] summary::before {
  z-index: 0;
  top: 0;
  height: 100%;
  background: rgba(62, 232, 121, 0.2);
}

.category-card[data-category] summary::after {
  z-index: 1;
  bottom: 0;
  height: 2px;
  background: #3ee879;
  opacity: 0.78;
}

:root[data-theme="light"] .category-card[data-category] summary::before {
  background: rgba(15, 189, 88, 0.16);
}

:root[data-theme="light"] .category-card[data-category] summary::after {
  background: #0fbd58;
}

.category-card[data-category] summary > * {
  position: relative;
  z-index: 2;
}

.category-title {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.category-title-zh {
  color: var(--text-muted);
  font-size: 14px;
}

:root[data-theme="light"] .category-card summary {
  color: #4a5568;
}

.category-card summary::-webkit-details-marker {
  display: none;
}

.category-card summary:hover {
  background: var(--surface-hover);
}

.category-card[open] summary {
  background: transparent;
}

.category-summary-meta {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 12px;
}

.chevron {
  display: inline-block;
  margin-left: 5px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  transition: transform 160ms ease;
}

.category-card[open] .chevron {
  transform: rotate(180deg);
}

.category-body {
  padding: 8px 16px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--expanded-surface);
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(20px);
}

.category-description {
  max-width: 768px;
  margin: 8px 0 16px;
  color: var(--text-muted);
  font-size: 16px;
}

.description-zh {
  margin-left: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.subcategory {
  margin-bottom: 16px;
}

.subcategory:last-child {
  margin-bottom: 0;
}

.subcategory-header {
  min-height: 24px;
}

.subcategory h3 {
  display: flex;
  margin: 0;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: #edf2f7;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.subcategory-title-zh {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
}

:root[data-theme="light"] .subcategory h3 {
  color: #2d3748;
}

.subcategory-description {
  max-width: 512px;
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 16px;
}

.topic-rows {
  width: 100%;
  overflow-x: auto;
}

.topic-row {
  display: grid;
  min-width: 680px;
  min-height: 49px;
  grid-template-columns: 40px 40px minmax(150px, 1fr) 58px 40px 80px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  transition: background-color 200ms ease;
}

.topic-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="light"] .topic-row:hover {
  background: rgba(0, 0, 0, 0.04);
}

.topic-action-cell,
.topic-importance-cell,
.topic-difficulty-cell,
.topic-count-cell {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
}

.topic-title-cell {
  display: flex;
  min-width: 0;
  height: 100%;
  align-items: center;
  padding: 14px 16px;
}

.topic-title-cell a {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  color: #63b3ed;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
}

.topic-title-en,
.topic-title-zh {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.topic-title-zh {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
}

.topic-title-cell a:hover {
  color: #90cdf4;
  text-decoration: underline;
}

:root[data-theme="light"] .topic-title-cell a {
  color: #2b6cb0;
}

:root[data-theme="light"] .topic-title-cell a:hover {
  color: #3182ce;
}

.topic-state-button {
  display: grid;
  width: 18px;
  height: 18px;
  padding: 1px;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.topic-state-button:hover {
  border-color: #63b3ed;
  background: #1a365d;
  box-shadow: 0 0 0 4px rgba(66, 153, 225, 0.15);
  transform: scale(1.06);
}

.topic-state-button svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
  opacity: 0.28;
}

.topic-start-button.is-active {
  border-color: #63b3ed;
  background: #1a365d;
  color: #63b3ed;
}

.topic-start-button.is-active svg {
  fill: currentColor;
  opacity: 1;
}

.topic-complete-button.is-active {
  border-color: #68d391;
  background: #68d391;
  color: #fff;
}

.topic-complete-button.is-active svg {
  opacity: 1;
}

:root[data-theme="light"] .topic-state-button {
  border-color: #cbd5e0;
  color: #a0aec0;
}

:root[data-theme="light"] .topic-state-button:hover,
:root[data-theme="light"] .topic-start-button.is-active {
  border-color: #4299e1;
  background: #ebf8ff;
  color: #3182ce;
}

:root[data-theme="light"] .topic-complete-button.is-active {
  border-color: #48bb78;
  background: #48bb78;
  color: #fff;
}

.topic-importance {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

:root[data-theme="light"] .topic-importance {
  background: #f7fafc;
}

.topic-importance svg {
  width: 10px;
  height: 10px;
  fill: var(--text-faint);
}

.topic-importance svg.is-active {
  fill: var(--star-color);
}

.difficulty-meter {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 20px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="light"] .difficulty-meter {
  border-color: #cbd5e0;
  background: #e2e8f0;
}

.difficulty-meter > span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  background: #718096;
}

.difficulty-meter-green > span { background: #38a169; }
.difficulty-meter-yellow > span { background: #d69e2e; }
.difficulty-meter-red > span { background: #e53e3e; }
.difficulty-meter-purple > span { background: #63171b; }

.difficulty-meter:hover {
  transform: scale(1.15);
}

.topic-importance:focus-visible,
.difficulty-meter:focus-visible,
.topic-completion-count:focus-visible {
  outline: 2px solid #63b3ed;
  outline-offset: 3px;
}

.topic-tooltip {
  --tooltip-arrow-offset: 50%;
  position: fixed;
  z-index: 1000;
  width: max-content;
  max-width: min(340px, calc(100vw - 16px));
  padding: 9px 12px;
  border-radius: 6px;
  background: #2d3748;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  font-size: 13px;
  line-height: 1.45;
  pointer-events: none;
}

.topic-tooltip::after {
  position: absolute;
  left: var(--tooltip-arrow-offset);
  width: 0;
  height: 0;
  border: 6px solid transparent;
  content: "";
  transform: translateX(-50%);
}

.topic-tooltip[data-placement="top"]::after {
  top: 100%;
  border-top-color: #2d3748;
}

.topic-tooltip[data-placement="bottom"]::after {
  bottom: 100%;
  border-bottom-color: #2d3748;
}

.topic-tooltip-heading {
  font-weight: 700;
}

.topic-tooltip-heading-zh {
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 600;
}

.topic-tooltip-heading:empty,
.topic-tooltip-heading-zh:empty {
  display: none;
}

.topic-tooltip-description {
  margin-top: 7px;
}

.topic-tooltip-heading:empty ~ .topic-tooltip-description {
  margin-top: 0;
}

.topic-tooltip-description-zh {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.topic-count-cell {
  color: var(--text-muted);
  font-size: 12px;
}

.topic-completion-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: #4299e1;
  cursor: help;
  font-weight: 600;
  line-height: 1;
}

:root[data-theme="light"] .topic-completion-count {
  background: #f7fafc;
  color: #3182ce;
}

.topic-count-avatar {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 9px;
}

:root[data-theme="light"] .topic-count-avatar {
  background: #e2e8f0;
}

.badge {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-gray {
  background: rgba(226, 232, 240, 0.16);
  color: #e2e8f0;
}

.badge-green {
  background: rgba(154, 230, 180, 0.16);
  color: #9ae6b4;
}

.badge-yellow {
  background: rgba(250, 240, 137, 0.16);
  color: #faf089;
}

.badge-red {
  background: rgba(254, 178, 178, 0.16);
  color: #feb2b2;
}

.badge-purple {
  background: rgba(214, 188, 250, 0.16);
  color: #d6bcfa;
}

:root[data-theme="light"] .badge-gray { background: #edf2f7; color: #1a202c; }
:root[data-theme="light"] .badge-green { background: #c6f6d5; color: #22543d; }
:root[data-theme="light"] .badge-yellow { background: #fefcbf; color: #744210; }
:root[data-theme="light"] .badge-red { background: #fed7d7; color: #822727; }
:root[data-theme="light"] .badge-purple { background: #e9d8fd; color: #44337a; }

.importance {
  color: var(--star-color);
  font-size: 13px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.importance-muted {
  color: var(--text-faint);
}

.useful-links summary {
  height: 50px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.useful-links-body {
  padding: 0 20px 16px;
}

.useful-links-body ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.useful-links-body li {
  margin: 8px 0;
  color: var(--text-secondary);
}

.useful-links-body a {
  color: var(--link);
  font-size: 14px;
  text-underline-offset: 3px;
}

.useful-links-body a:hover {
  color: var(--link-hover);
}

.detail-container {
  padding-top: 20px;
}

.back-link {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 12px;
  border-radius: 6px;
  background: #3182ce;
  box-shadow: var(--shadow-md);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.back-link:hover {
  background: #2b6cb0;
}

.detail-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.detail-navigation .back-link {
  margin-bottom: 0;
}

.detail-navigation .page-account-actions {
  position: static;
}

.topic-header-card {
  padding: 20px;
  text-align: center;
}

.topic-header-title {
  margin-bottom: 8px;
}

.topic-header-card h1 {
  margin: 0;
  background: linear-gradient(90deg, #63b3ed, #b794f4);
  background-clip: text;
  color: transparent;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
}

:root[data-theme="light"] .topic-header-card h1 {
  background-image: linear-gradient(90deg, #2b6cb0, #6b46c1);
}

.topic-header-title-zh {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.topic-header-meta {
  display: flex;
  width: max-content;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin: 0 auto;
}

.topic-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 16px;
}

.difficulty-accent {
  width: 4px;
  height: 18px;
  margin-right: -6px;
  background: #718096;
}

.difficulty-accent-green { background: #38a169; }
.difficulty-accent-yellow { background: #d69e2e; }
.difficulty-accent-red { background: #e53e3e; }
.difficulty-accent-purple { background: #63171b; }

.problems-card {
  margin-top: 8px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(20px);
}

.problems-card h2 {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
}

.problems-card > p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.admin-container {
  position: relative;
  z-index: 1;
  width: min(100% - 32px, 1152px);
  margin: 0 auto;
  padding: 20px 0 64px;
}

.admin-page-header {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.admin-page-header h1 {
  margin-bottom: 2px;
  color: var(--text);
  font-size: 28px;
  line-height: 1.3;
}

.admin-page-header p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 15px;
}

.admin-create-section {
  display: grid;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.admin-create-section h2,
.admin-database-header h2 {
  margin-bottom: 3px;
  color: var(--text);
  font-size: 19px;
}

.admin-create-section p,
.admin-database-header p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.admin-create-section code {
  color: var(--text);
  font-size: 13px;
}

.admin-create-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  align-items: start;
  gap: 12px;
}

.admin-create-form label {
  display: grid;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.admin-create-form input,
.admin-create-form textarea,
.admin-create-form select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  background: var(--surface-soft);
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.admin-create-form input,
.admin-create-form select {
  height: 38px;
  padding: 0 11px;
}

.admin-create-form textarea {
  min-height: 112px;
  padding: 9px 11px;
  line-height: 1.45;
  resize: vertical;
}

.admin-create-form input:focus,
.admin-create-form textarea:focus,
.admin-create-form select:focus {
  border-color: #63b3ed;
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.16);
}

.admin-create-button,
.admin-refresh-button,
.admin-reset-button,
.admin-delete-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-hover);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.admin-create-button {
  height: 38px;
  margin-top: 26px;
  border-color: #3182ce;
  background: #3182ce;
  color: #fff;
}

.admin-create-button:hover:not(:disabled) {
  border-color: #2b6cb0;
  background: #2b6cb0;
}

.admin-refresh-button:hover:not(:disabled),
.admin-reset-button:hover:not(:disabled) {
  border-color: rgba(99, 179, 237, 0.55);
  background: var(--surface-soft);
}

.admin-create-button:disabled,
.admin-refresh-button:disabled,
.admin-reset-button:disabled,
.admin-delete-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.admin-status {
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
}

.admin-status[data-tone="error"] {
  border-color: rgba(245, 101, 101, 0.4);
  background: rgba(245, 101, 101, 0.1);
  color: #fc8181;
}

:root[data-theme="light"] .admin-status[data-tone="error"] { color: #c53030; }

.admin-database-section {
  margin-top: 28px;
}

.admin-database-header,
.admin-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-database-header {
  margin-bottom: 14px;
}

.admin-tables {
  display: grid;
  gap: 18px;
}

.admin-table-section {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.admin-table-header {
  min-height: 48px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}

.admin-table-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.admin-table-header > span {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.admin-table-scroll {
  overflow-x: auto;
}

.admin-data-table {
  width: max-content;
  min-width: 100%;
}

.admin-data-table th,
.admin-data-table td {
  padding: 11px 12px;
  white-space: nowrap;
}

.admin-data-table th {
  background: var(--surface-soft);
  letter-spacing: 0;
  text-transform: none;
}

.admin-data-table td {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.admin-actions-cell {
  min-width: 300px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.admin-reset-button,
.admin-delete-button {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.admin-delete-button {
  border-color: #c53030;
  background: #c53030;
  color: #fff;
}

.admin-delete-button:hover:not(:disabled) {
  border-color: #9b2c2c;
  background: #9b2c2c;
}

.admin-delete-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.admin-null {
  color: var(--text-faint);
  font-style: italic;
}

.admin-protected {
  color: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.admin-empty-row {
  height: 58px;
  color: var(--text-muted);
  text-align: center;
}

.admin-loading {
  display: flex;
  min-height: 120px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.problems-description {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.problems-description-zh {
  color: var(--text-muted);
  font-size: 13px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

th,
td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--table-border);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.table-heading-zh {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

td {
  color: var(--text-secondary);
  font-size: 14px;
}

tbody tr {
  transition: background-color 130ms ease, opacity 130ms ease;
}

tbody tr:hover {
  background: var(--surface-soft);
}

tbody tr.is-solved {
  opacity: 0.56;
}

tbody tr.is-solved .problem-cell a {
  text-decoration: line-through;
}

.checkbox-cell {
  width: 48px;
  text-align: center;
}

.checkbox-cell input {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  appearance: none;
  border: 1.5px solid #63b3ed;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
  vertical-align: middle;
}

.checkbox-cell input::before {
  position: absolute;
  top: 45%;
  left: 50%;
  width: 4px;
  height: 8px;
  border-bottom: 2px solid #fff;
  border-right: 2px solid #fff;
  content: "";
  transform: translate(-50%, -50%) rotate(45deg) scale(0);
  transform-origin: center;
  transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.checkbox-cell input:hover {
  border-color: #90cdf4;
}

.checkbox-cell input:checked {
  border-color: #3182ce;
  background: #3182ce;
}

.checkbox-cell input:checked::before {
  transform: translate(-50%, -50%) rotate(45deg) scale(1);
}

.checkbox-cell input:focus-visible {
  outline: 2px solid #63b3ed;
  outline-offset: 3px;
}

.checkbox-cell input.is-celebrating {
  animation: problem-checkbox-pop 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

:root[data-theme="light"] .checkbox-cell input {
  border-color: #2b6cb0;
}

:root[data-theme="light"] .checkbox-cell input:hover {
  border-color: #3182ce;
}

.problem-confetti {
  position: fixed;
  z-index: 1900;
  inset: 0;
  display: block;
  pointer-events: none;
}

@keyframes problem-checkbox-pop {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(66, 153, 225, 0);
    transform: scale(1);
  }

  40% {
    box-shadow: 0 0 0 7px rgba(66, 153, 225, 0.2);
    transform: scale(1.3);
  }

  70% {
    transform: scale(0.92);
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-toast,
  .checkbox-cell input,
  .checkbox-cell input::before {
    transition: none;
  }

  .checkbox-cell input.is-celebrating {
    animation: none;
  }
}

.problem-cell {
  min-width: 270px;
}

.problem-cell a,
.source-link {
  color: var(--link);
  text-decoration: none;
}

.problem-cell a:hover,
.source-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.problem-star {
  display: inline-block;
  margin-left: 5px;
  color: var(--star-color);
  cursor: help;
}

.problem-star:focus-visible {
  outline: 2px solid #63b3ed;
  outline-offset: 3px;
}

.numeric-cell {
  text-align: left;
  white-space: nowrap;
}

.tags {
  display: flex;
  max-width: 310px;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  display: inline-flex;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.2;
  text-decoration: none;
}

a.tag:hover {
  border-color: rgba(99, 179, 237, 0.55);
  color: var(--link);
}

.empty-card {
  padding: 40px 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
}

.loading-screen {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: #63b3ed;
  border-radius: 50%;
  animation: spin 450ms linear infinite;
}

.error-screen {
  flex-direction: column;
  padding: 24px;
  text-align: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .page-login {
    padding: 16px;
  }

  .login-form {
    padding: 20px;
  }

  .home-container,
  .detail-container,
  .admin-container {
    width: min(100% - 20px, 1152px);
    padding-top: 20px;
  }

  .home-container {
    padding-top: 32px;
  }

  .home-header {
    padding-top: 0;
    padding-right: 0;
    text-align: left;
  }

  .home-header p {
    padding-right: 145px;
  }

  .home-header .page-account-actions {
    top: auto;
    bottom: 0;
  }

  .account-menu-trigger {
    max-width: 130px;
  }

  .home-header h1 {
    font-size: 26px;
  }

  .theme-toggle {
    top: 5px;
  }

  .topic-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-buttons {
    flex-wrap: wrap;
  }

  .search-control {
    width: 100%;
  }

  .filter-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-panel select {
    width: 100%;
  }

  .toolbar-topic-count {
    margin-left: 0;
  }

  .module-modal {
    padding: 12px;
  }

  .module-modal-dialog {
    max-height: calc(100vh - 24px);
  }

  .module-modal-header {
    padding-left: 16px;
  }

  .module-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .category-card summary {
    padding-right: 12px;
    padding-left: 12px;
  }

  .topic-header-card,
  .problems-card {
    padding: 16px;
  }

  .admin-create-section {
    padding: 16px;
  }

  .admin-create-form {
    grid-template-columns: 1fr;
  }

  .admin-create-button {
    width: 100%;
    margin-top: 0;
  }
}

@media (min-width: 721px) and (max-width: 960px) {
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
