:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-alt: #eef4ff;
  --text: #111827;
  --text-secondary: #4b5563;
  --muted: #64748b;
  --line: #dbe5f1;
  --primary: rgb(50, 85, 164);
  --primary-dark: rgb(33, 58, 120);
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 25px 60px rgba(15, 23, 42, 0.15);
  --radius: 20px;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-alt: #334155;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --muted: #94a3b8;
  --line: #334155;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
}

[data-theme="dark"] body {
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 18px 20px;
  backdrop-filter: blur(12px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

[data-theme="dark"] .site-header {
  background: rgba(15, 23, 42, 0.92);
}

.header-shell,
.footer-shell {
  width: calc(100% - 48px);
  margin: 0 auto;
}

.page-shell {
  width: calc(100% - 48px);
  margin: 0 auto;
  padding: 16px 0;
}

.header-shell {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-group {
  min-width: 180px;
}

.logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
}

.brand-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.nav-panel {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.site-nav a:hover,
.site-nav a.is-active {
  background: var(--surface);
  color: var(--primary);
}

.header-search {
  flex: 1;
  display: flex;
  gap: 10px;
}

.header-search .form-control {
  min-width: 160px;
  max-width: 260px;
}

.header-search .btn {
  min-width: 70px;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: var(--muted);
  font-size: 0.88rem;
}

.user-summary strong {
  color: var(--text);
}

.user-summary .user-name-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.user-summary .user-name-link:hover {
  text-decoration: underline;
}

.header-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s;
}

.header-icon-btn:hover {
  background: rgba(50, 85, 164, 0.08);
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s;
}

.theme-toggle:hover {
  background: rgba(50, 85, 164, 0.08);
}

[data-theme="dark"] .theme-icon-dark {
  display: inline !important;
}

[data-theme="dark"] .theme-icon-light {
  display: none !important;
}

.nav-toggle {
  display: none;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
}

.page-shell {
  padding: 28px 0 40px;
}

.site-footer {
  padding: 26px 0 40px;
}

.footer-shell {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-stats {
  width: 60%;
  margin: 18px auto 0;
}

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

@media (max-width: 768px) {
  .footer-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.footer-stat {
  padding: 12px;
  font-size: 12px;
  line-height: 1.4;
  border-radius: 12px;
  box-shadow: none;
}

.footer-stat span {
  color: var(--muted);
}

.footer-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  color: var(--text);
}

.footer-title {
  font-weight: 700;
  color: var(--text);
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.flash {
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: 16px;
  font-weight: 600;
}

.flash-success {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
}

.flash-error {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 30px;
  margin-bottom: 24px;
}

.hero h1,
.auth-card h1,
.page-title h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.1;
  margin: 10px 0 12px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(50, 85, 164, 0.12);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero-copy,
.helper-text,
.page-title p,
.list-item p,
.board-card p,
.section-copy,
.footer-copy {
  color: var(--muted);
}

.hero-actions,
.toolbar,
.meta-row,
.list-item-top,
.panel-head,
.action-row,
.tag-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-head--compact {
  margin-bottom: 14px;
}

.panel-head h2,
.panel-head h3,
.section-card h3,
.section-card h4,
.auth-card h2 {
  font-size: 1.2rem;
}

.text-link {
  color: var(--primary);
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.btn-danger {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}

.btn-block {
  width: 100%;
}

.publish-dropdown {
  position: relative;
  display: inline-block;
}

.publish-dropdown-menu {
  visibility: hidden;
  opacity: 1;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 120px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  margin-top: 0.25rem;
  transition: opacity 0.15s ease 0.5s, visibility 0.15s ease 0.5s;
}

.publish-dropdown:hover .publish-dropdown-menu,
.publish-dropdown:focus-within .publish-dropdown-menu,
.publish-dropdown-menu:hover {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.publish-dropdown-item {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  white-space: nowrap;
}

.publish-dropdown-item:hover {
  background: var(--surface-hover);
}

.stats-grid,
.split-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 22px;
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

.home-layout {
  display: grid;
  grid-template-columns: 1fr 480px 280px;
  gap: 20px;
  align-items: start;
}

.cj-panel {
  width: 100%;
  height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.cj-panel-body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}

.cj-panel-body::-webkit-scrollbar {
  display: none;
}

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

.cj-date-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  margin-bottom: 12px;
  background: var(--surface);
  border-radius: 6px;
  border: 1px solid var(--line);
}

.date-nav-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.date-nav-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 300;
  border-radius: 50%;
  transition: all 0.2s;
}

.date-nav-btn:not(.disabled):hover {
  background: var(--primary);
  color: white;
}

.date-nav-btn.disabled,
.date-nav-btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.date-nav-current {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  min-width: 80px;
  text-align: center;
}

.cj-date-selector input[type="date"] {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--background);
  color: var(--text);
  font-size: 0.875rem;
}

.cj-date-selector .btn-sm {
  padding: 4px 12px;
  font-size: 0.75rem;
}

.date-selector-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.date-selector-row label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-notice {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--surface-hover);
  border-radius: 4px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.cj-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--line);
}

.cj-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cj-card-copy {
  color: var(--muted);
  font-size: 0.9rem;
}

.cj-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.cj-card-meta div {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
}

.cj-card-meta span:first-child {
  color: var(--primary);
  font-weight: 800;
}

.article-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-card {
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.article-link {
  display: block;
}

.article-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-alt);
  overflow: hidden;
}

.article-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-media.is-loading::after {
  display: none;
}

.article-media-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(50, 85, 164, 0.12), var(--surface-alt));
}

.article-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.article-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.article-title {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.article-excerpt {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.article-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.right-column {
  width: 100%;
}

.right-stack {
  height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.right-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px;
  overflow: hidden;
  min-height: 0;
}

.chat-card .chat-stream {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  min-height: 0;
}

.chat-card .chat-stream::-webkit-scrollbar {
  display: none;
}

.chat-card .chat-form {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.resource-card {
  overflow: hidden;
}

.resource-accordion {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  min-height: 0;
}

.resource-accordion::-webkit-scrollbar {
  display: none;
}

.chat-form {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-form textarea {
  height: 60px;
  min-height: 60px;
  flex-shrink: 0;
}

.chat-hint {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
  flex-shrink: 0;
}

.chat-error {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
  font-weight: 700;
  font-size: 12px;
}

.chat-pending {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(50, 85, 164, 0.12);
  color: var(--primary);
  font-weight: 700;
  font-size: 12px;
}

.chat-cooldown {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(217, 119, 6, 0.12);
  color: var(--warning);
  font-weight: 700;
  font-size: 12px;
}

.chat-audit-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(50, 85, 164, 0.08);
  border-radius: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.chat-audit-notice .chat-audit-icon {
  font-size: 1rem;
}

.resource-accordion {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}

.resource-accordion::-webkit-scrollbar {
  display: none;
}

.resource-item {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.resource-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.resource-item-body {
  margin-top: 10px;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.resource-footer {
  margin-top: auto;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.dashboard-panel {
  padding: 24px;
}

.stack-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.list-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

.list-item strong {
  font-size: 1rem;
}

.meta-row {
  color: var(--muted);
  font-size: 0.9rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(50, 85, 164, 0.12);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
}

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

.board-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.board-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.board-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.mini-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
}

.mini-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  font-size: 0.92rem;
}

.mini-list li span:first-child {
  color: var(--primary);
  font-weight: 800;
}

.chat-section,
.resource-preview {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
}

.chat-bubble {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface-alt);
}

.chat-bubble-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.chat-report-btn {
  padding: 2px 6px;
  font-size: 0.75rem;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.chat-bubble:hover .chat-report-btn {
  opacity: 1;
}

.inline-form,
.form-grid,
.filter-form {
  display: grid;
  gap: 14px;
}

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

.form-label {
  font-weight: 700;
}

.form-control {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

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

.status-warn {
  color: var(--warning);
  font-weight: 700;
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  background: rgba(50, 85, 164, 0.08);
  color: var(--muted);
}

.auth-shell {
  display: flex;
  justify-content: center;
  padding: 28px 0;
}

.auth-card {
  width: min(560px, 100%);
  padding: 28px;
}

.auth-footer {
  margin-top: 8px;
  color: var(--muted);
}

.page-title {
  margin-bottom: 24px;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 32px;
}

.cj-content {
  max-width: 100%;
  padding: 0 8px;
}

.content-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-card,
.forum-card,
.resource-card,
.exam-card,
.homework-card,
.detail-card {
  padding: 22px;
}

.section-markdown,
.markdown-body {
  color: var(--text);
}

.section-markdown h1,
.section-markdown h2,
.section-markdown h3,
.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 14px 0 10px;
}

.section-markdown p,
.section-markdown ul,
.section-markdown ol,
.markdown-body p,
.markdown-body ul,
.markdown-body ol {
  margin: 10px 0;
}

.filters-shell {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.filter-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.forum-list,
.resource-list,
.exam-list,
.homework-list,
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.forum-card h3,
.resource-card h3,
.exam-card h3,
.homework-card h3,
.detail-card h3 {
  margin-bottom: 10px;
}

.forum-content,
.comment-content {
  color: var(--muted);
}

.comment-list .list-item {
  background: var(--surface);
}

.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 120px;
  align-self: start;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

.key-value-list {
  display: grid;
  gap: 12px;
}

.key-value-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.error-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.resource-actions,
.forum-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-approved {
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
}

.status-pending {
  background: rgba(217, 119, 6, 0.12);
  color: var(--warning);
}

.table-like {
  display: grid;
  gap: 14px;
}

.split-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1080px) {
  .header-shell {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .nav-panel {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-grid,
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .board-grid,
  .stats-grid,
  .split-grid,
  .filter-form {
    grid-template-columns: 1fr 1fr;
  }

  .home-layout {
    grid-template-columns: 1fr 1fr;
  }

  .cj-panel,
  .right-column {
    width: 100%;
    max-width: none;
    height: auto;
  }

  .cj-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .right-stack {
    height: auto;
  }

  .article-link {
    display: block;
  }
}

.notifications-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 0;
}

.favorites-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 0;
}

.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.favorite-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.favorite-type h3 {
  font-size: 15px;
  margin: 6px 0;
}

.favorite-type p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.favorite-note {
  font-size: 13px;
  padding: 8px;
  background: var(--surface-alt);
  border-radius: 8px;
}

.favorite-actions {
  margin-top: auto;
}

.schedule-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 0;
}

.grade-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.schedule-grid {
  overflow-x: auto;
}

.schedule-header,
.schedule-row {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  gap: 4px;
}

.schedule-header {
  margin-bottom: 8px;
}

.schedule-cell {
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-header {
  font-weight: 600;
  background: var(--surface-alt);
}

.period-label {
  font-weight: 600;
  background: var(--surface-alt);
}

.schedule-item {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.schedule-item strong {
  font-size: 13px;
}

.schedule-item span {
  opacity: 0.9;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-tabs .tab {
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.filter-tabs .tab:hover {
  background: rgba(50, 85, 164, 0.08);
}

.filter-tabs .tab.is-active {
  background: var(--primary);
  color: #fff;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: box-shadow 0.2s;
}

.notification-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.notification-item.is-unread {
  border-left: 3px solid var(--primary);
  background: rgba(50, 85, 164, 0.04);
}

.notification-icon {
  font-size: 20px;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}

.notification-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-time {
  color: var(--muted);
  font-size: 0.85rem;
}

.notification-body p {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
}

.notification-actions {
  flex-shrink: 0;
}

.messages-page {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  height: calc(100vh - 160px);
}

.messages-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.conversations-list {
  flex: 1;
  overflow-y: auto;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s;
}

.conversation-item:hover {
  background: rgba(50, 85, 164, 0.04);
}

.conversation-item.is-active {
  background: rgba(50, 85, 164, 0.08);
}

.conversation-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

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

.conversation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.conversation-preview {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-time {
  font-size: 0.8rem;
  color: var(--muted);
  flex-shrink: 0;
}

.unread-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.messages-main {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.messages-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.message-thread {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.thread-header {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.thread-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 75%;
}

.message.is-mine {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.message-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message.is-mine .message-body {
  align-items: flex-end;
}

.message-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.message-body p {
  margin: 0;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--surface-alt);
  font-size: 0.95rem;
  line-height: 1.5;
}

.message.is-mine .message-body p {
  background: var(--primary);
  color: #fff;
}

.message-form {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

.message-form textarea {
  flex: 1;
  resize: none;
}

.message-form button {
  align-self: flex-end;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.modal-hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.modal-content {
  position: relative;
  width: min(480px, 90vw);
  max-height: 80vh;
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

@media (max-width: 720px) {
  .site-header {
    padding: 14px 0;
  }

  .header-shell,
  .page-shell,
  .footer-shell {
    width: calc(100% - 28px);
  }

  .home-layout {
    grid-template-columns: 1fr;
  }

  .cj-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .article-link {
    display: block;
  }

  .right-column {
    width: 100%;
  }

  .right-stack {
    height: auto;
    flex-direction: row;
  }

  .right-card {
    flex: 1;
    min-height: 300px;
  }

  .messages-page {
    grid-template-columns: 1fr;
    height: auto;
  }

@media (max-width: 720px) {

  .messages-sidebar {
    height: 300px;
  }

  .notifications-page {
    padding: 16px 0;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .nav-panel {
    display: none;
    width: 100%;
    padding-top: 12px;
  }

  .nav-panel.is-open {
    display: flex;
  }

  .site-nav,
  .header-actions,
  .header-search {
    flex-direction: column;
    align-items: stretch;
  }

  .hero,
  .footer-shell {
    flex-direction: column;
    align-items: flex-start;
  }

  .board-grid,
  .stats-grid,
  .split-grid,
  .filter-form {
    grid-template-columns: 1fr;
  }

  .footer-stats {
    width: 100%;
  }

  .footer-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-summary {
    align-items: flex-start;
  }

  .page-shell {
    padding-top: 20px;
  }
}

.review-layout {
  max-width: 900px;
  margin: 0 auto;
}

.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}

.review-item-icon {
  font-size: 24px;
  width: 40px;
  text-align: center;
}

.review-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.review-item-preview {
  font-size: 14px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 400px;
}

.review-item-actions {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.9rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.page-info {
  color: var(--muted);
}

.review-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.drawer-content {
  position: relative;
  width: min(480px, 90vw);
  height: 100%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

[data-theme="dark"] .btn-ghost {
  background: var(--surface-alt);
  border-color: var(--line);
  color: var(--text);
}

[data-theme="dark"] .btn-ghost:hover {
  background: rgba(50, 85, 164, 0.2);
}

[data-theme="dark"] .empty-state {
  background: rgba(50, 85, 164, 0.1);
  color: var(--muted);
}

[data-theme="dark"] .hero {
  background: var(--surface-alt);
}

[data-theme="dark"] .nav-toggle {
  background: var(--surface-alt);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .eyebrow {
  background: rgba(50, 85, 164, 0.2);
}

[data-theme="dark"] .flash-success {
  background: rgba(22, 163, 74, 0.15);
}

[data-theme="dark"] .flash-error {
  background: rgba(220, 38, 38, 0.15);
}

[data-theme="dark"] .schedule-item {
  opacity: 1;
}

[data-theme="dark"] .chat-bubble {
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

[data-theme="dark"] .message-body p {
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

[data-theme="dark"] .message.is-mine .message-body p {
  background: var(--primary);
  border-color: var(--primary);
}

[data-theme="dark"] .form-control:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(50, 85, 164, 0.25);
}

[data-theme="dark"] .modal-backdrop {
  background: rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] ::selection {
  background: rgba(50, 85, 164, 0.4);
  color: #fff;
}

[data-theme="dark"] textarea.form-control,
[data-theme="dark"] input.form-control {
  background: var(--surface);
  color: var(--text);
}

[data-theme="dark"] .tag {
  background: rgba(50, 85, 164, 0.2);
}

[data-theme="dark"] .status-approved {
  background: rgba(22, 163, 74, 0.15);
}

[data-theme="dark"] .status-pending {
  background: rgba(217, 119, 6, 0.15);
}

[data-theme="dark"] .btn-danger {
  background: rgba(220, 38, 38, 0.15);
}

[data-theme="dark"] .status-warn {
  color: #fbbf24;
}

[data-theme="dark"] .favorite-note {
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

[data-theme="dark"] .notification-item.is-unread {
  border-left-color: var(--primary);
  background: rgba(50, 85, 164, 0.06);
}

[data-theme="dark"] .header-icon-btn:hover {
  background: rgba(50, 85, 164, 0.15);
}

[data-theme="dark"] .filter-tabs .tab:hover {
  background: rgba(50, 85, 164, 0.12);
}

[data-theme="dark"] .resource-item summary:hover {
  background: rgba(50, 85, 164, 0.05);
}

[data-theme="dark"] .conversation-item:hover {
  background: rgba(50, 85, 164, 0.08);
}

[data-theme="dark"] .conversation-item.is-active {
  background: rgba(50, 85, 164, 0.12);
}

[data-theme="dark"] .day-header,
[data-theme="dark"] .period-label {
  background: var(--surface-alt);
  color: var(--text);
}

[data-theme="dark"] .schedule-cell {
  border-color: var(--line);
}

[data-theme="dark"] code,
[data-theme="dark"] pre {
  background: var(--surface-alt);
  color: var(--text);
}

[data-theme="dark"] blockquote {
  border-left-color: var(--primary);
  color: var(--muted);
}

[data-theme="dark"] table {
  border-color: var(--line);
}

[data-theme="dark"] th,
[data-theme="dark"] td {
  border-color: var(--line);
}

[data-theme="dark"] th {
  background: var(--surface-alt);
}

[data-theme="dark"] hr {
  border-color: var(--line);
}

.dashboard-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 0;
}

.dashboard-header {
  margin-bottom: 28px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.dashboard-header h1 {
  font-size: 1.5rem;
  color: var(--text);
  margin: 0 0 8px 0;
}

.dashboard-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.lv-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.lv-badge.lv-0 { background: #94a3b8; color: #fff; }
.lv-badge.lv-1 { background: #64748b; color: #fff; }
.lv-badge.lv-2 { background: #3255a4; color: #fff; }
.lv-badge.lv-3 { background: #0ea5e9; color: #fff; }
.lv-badge.lv-4 { background: #16a34a; color: #fff; }
.lv-badge.lv-5 { background: #f59e0b; color: #fff; }
.lv-badge.lv-55 { background: #8b5cf6; color: #fff; }
.lv-badge.lv-6 { background: #dc2626; color: #fff; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dashboard-card h3 {
  font-size: 1rem;
  color: var(--text);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-card > p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0 0 12px 0;
}

.stat-card {
  text-align: center;
}

.stat-card .stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 8px 0;
  line-height: 1;
}

.stat-card small {
  color: var(--muted);
  font-size: 0.8rem;
}

.info-card ul,
.admin-card ul,
.tip-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 4px 0;
  flex-grow: 1;
}

.info-card ul li,
.admin-card ul li,
.tip-card ul li {
  padding: 12px 0;
  color: var(--text-secondary);
  font-size: 0.93rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}

.info-card ul li:last-child,
.admin-card ul li:last-child,
.tip-card ul li:last-child {
  border-bottom: none;
}

.admin-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 16px;
}

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

.page-header {
  margin-bottom: 28px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.welcome-section h1 {
  font-size: 1.75rem;
  color: var(--text);
  margin: 0 0 8px 0;
}

.welcome-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.welcome-subtitle .lv-badge {
  font-size: 0.85rem;
}

.stats-section {
  margin-bottom: 28px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.content-section {
  margin-bottom: 28px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}

.content-grid .card {
  padding: 32px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-alt) 100%);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.page-container .card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: var(--surface) !important;
}

.page-container .card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg) !important;
}

.stat-card .stat-icon {
  font-size: 2rem;
  line-height: 1;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  border-radius: 12px;
  flex-shrink: 0;
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-info .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.stat-info .stat-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.stat-card.highlight .stat-info .stat-value {
  color: var(--success);
}

.info-card,
.tip-card {
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.info-card {
  border-left: 3px solid var(--primary);
}

.tip-card {
  border-left: 3px solid var(--warning);
}

.admin-card {
  border-left: 3px solid var(--danger);
  min-height: 320px;
}

.teacher-card {
  border-left: 3px solid #9333ea;
  min-height: 300px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  padding-left: 4px;
  border-bottom: 1px solid var(--line);
}

.card-icon {
  font-size: 1.6rem;
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.card-body {
  flex-grow: 1;
  padding: 4px 0;
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 24px 0;
  line-height: 1.6;
}

.card-description strong {
  color: var(--primary);
}

.feature-list,
.reward-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li,
.reward-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  color: var(--text-secondary);
  font-size: 0.93rem;
  border-bottom: 1px solid var(--line);
}

.feature-list li:last-child,
.reward-list li:last-child {
  border-bottom: none;
}

.check-icon {
  color: var(--success);
  font-weight: 700;
  font-size: 1rem;
}

.warning-icon {
  color: var(--warning);
  font-size: 1rem;
}

.danger-icon {
  color: var(--danger);
  font-size: 1rem;
}

.reward-icon {
  font-size: 1.2rem;
}

.card-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.card-footer.action-group {
  display: flex;
  gap: 10px;
}

.btn-block {
  width: 100%;
  text-align: center;
}

.standards-details {
  background: var(--surface-alt);
  border-radius: 10px;
  padding: 16px 20px;
}

.standards-details summary {
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.standards-content {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.standard-item {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
}

.standard-badge {
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 600;
}

.standard-badge.danger {
  background: rgba(220, 38, 38, 0.15);
  color: var(--danger);
}

.standard-badge.warning {
  background: rgba(217, 119, 6, 0.15);
  color: var(--warning);
}

.standard-badge.success {
  background: rgba(22, 163, 74, 0.15);
  color: var(--success);
}

.tip-card {
  margin: 8px 0;
}

.review-standards {
  margin-top: 12px;
}

.review-standards details {
  background: var(--surface-alt);
  border-radius: 8px;
  padding: 10px 14px;
}

.review-standards summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
}

.review-standards ul {
  margin: 8px 0 0 0;
  padding-left: 16px;
}

.review-standards ul li {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 2px 0;
}

[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.75rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
  line-height: 1.4;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

.locale-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(50, 85, 164, 0.08);
  border: 1.5px solid rgba(50, 85, 164, 0.2);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}

.locale-btn {
  position: relative;
  padding: 5px 14px;
  border: none;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  color: var(--muted);
  letter-spacing: 0.3px;
  z-index: 1;
}

.locale-btn:hover:not(.active) {
  color: var(--text);
  background: rgba(50, 85, 164, 0.06);
}

.locale-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(50, 85, 164, 0.35);
}

.locale-btn.active::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
}

[data-theme="dark"] .locale-toggle {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .locale-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

[data-theme="dark"] .locale-btn.active {
  background: linear-gradient(135deg, #3255a4 0%, #0ea5e9 100%);
  box-shadow: 0 2px 12px rgba(50, 85, 164, 0.5);
}
