﻿:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #e5e9f2;
  --text: #1e2430;
  --sub: #6d7585;
  --brand: #c8102e;
  --brand-soft: #ffe9ec;
  --ok: #0e9f6e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "HarmonyOS Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 20% 30%, rgba(139, 0, 0, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(200, 16, 46, 0.3) 0%, transparent 50%),
    linear-gradient(135deg, #0f172a 0%, #8b0000 50%, #c8102e 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(255, 255, 255, 0.82), transparent),
    radial-gradient(1px 1px at 60px 70px, rgba(255, 215, 0, 0.72), transparent),
    radial-gradient(1px 1px at 50px 50px, rgba(255, 255, 255, 0.68), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255, 215, 0, 0.58), transparent);
  background-repeat: repeat;
  background-size: 220px 220px;
  opacity: 0.72;
  animation: topbarStarTwinkleFar 8.5s ease-in-out infinite, topbarStarDriftFar 110s linear infinite;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: -30% -10%;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(200, 16, 46, 0.2) 0%, transparent 65%),
    radial-gradient(2px 2px at 42px 68px, rgba(255, 255, 255, 0.95), transparent),
    radial-gradient(2px 2px at 128px 154px, rgba(255, 215, 0, 0.9), transparent),
    radial-gradient(1px 1px at 210px 76px, rgba(255, 255, 255, 0.88), transparent);
  background-repeat: no-repeat, repeat, repeat, repeat;
  background-size: 100% 100%, 360px 360px, 360px 360px, 360px 360px;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.42));
  animation:
    topbarStarTwinkleNear 3.2s ease-in-out infinite,
    topbarStarDriftNear 60s linear infinite,
    topbarGlowPulse 9s ease-in-out infinite;
}

.topbar > .top-inner,
.topbar > .quick-nav {
  position: relative;
  z-index: 1;
}

@keyframes topbarStarTwinkleFar {
  0%, 100% { opacity: 0.48; filter: brightness(0.95); }
  45% { opacity: 0.72; filter: brightness(1.08); }
  50% { opacity: 0.8; filter: brightness(1.18); }
  82% { opacity: 0.56; filter: brightness(0.98); }
}

@keyframes topbarStarTwinkleNear {
  0%, 100% {
    opacity: 0.54;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.42)) brightness(1);
  }
  28% {
    opacity: 0.92;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.86)) brightness(1.9);
  }
  68% {
    opacity: 0.84;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.72)) brightness(1.55);
  }
}

@keyframes topbarStarDriftFar {
  0% { background-position: 0 0, 0 0, 0 0, 0 0; }
  100% { background-position: -170px 120px, -130px 96px, -110px 84px, -72px 60px; }
}

@keyframes topbarStarDriftNear {
  0% { background-position: center, 0 0, 0 0, 0 0; }
  100% { background-position: center, -240px 170px, -210px 150px, -170px 120px; }
}

@keyframes topbarGlowPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.top-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 20px 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.platform-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.workspace-title {
  margin-top: 4px;
  font-size: 14px;
  opacity: 0.95;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 13px;
}

.meta-item {
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.14);
  white-space: nowrap;
}

.logout-btn {
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0 12px;
  font-size: 13px;
  cursor: pointer;
}

.quick-nav {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.quick-nav a {
  text-decoration: none;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.12);
}

.wrap {
  max-width: 1320px;
  margin: 16px auto 36px;
  padding: 0 20px;
  display: grid;
  gap: 14px;
}

.section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.section-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
  color: #30384a;
}

.section-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--sub);
}

.content {
  padding: 14px 16px;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  height: 34px;
  border-radius: 8px;
  border: 1px solid #d4daea;
  background: #fff;
  color: #334055;
  font-size: 13px;
  padding: 0 12px;
  cursor: pointer;
}

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

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

.kpi {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.kpi .label { font-size: 12px; color: var(--sub); }
.kpi .value { margin-top: 8px; font-size: 26px; font-weight: 700; color: #273248; }
.kpi .delta { margin-top: 6px; font-size: 12px; color: #75839d; }

.kpi:nth-child(1) { background: linear-gradient(180deg, #f3f8ff 0%, #ffffff 78%); border-color: #d9e7ff; }
.kpi:nth-child(2) { background: linear-gradient(180deg, #f0fcfb 0%, #ffffff 78%); border-color: #cff2ee; }
.kpi:nth-child(3) { background: linear-gradient(180deg, #fff7ef 0%, #ffffff 78%); border-color: #ffe5cb; }
.kpi:nth-child(4) { background: linear-gradient(180deg, #f6f2ff 0%, #ffffff 78%); border-color: #e2d7ff; }
.kpi:nth-child(5) { background: linear-gradient(180deg, #fff1f3 0%, #ffffff 78%); border-color: #ffd7dd; }

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

.mini-card {
  border: 1px solid #e4e8f3;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.mini-head {
  padding: 10px;
  border-bottom: 1px solid #edf0f7;
  font-size: 13px;
  font-weight: 700;
  color: #34435e;
}

.mini-body {
  padding: 10px;
  display: grid;
  gap: 8px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #5f6b81;
}

.tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dfe4ef;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  color: #5b6881;
  background: #f8faff;
}

/* AI */
.ai-section {
  border-color: #cfe0ff;
  background: linear-gradient(135deg, #f3f7ff 0%, #eef4ff 48%, #f8f3ff 100%);
  position: relative;
  isolation: isolate;
}

.ai-head {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.35) 100%);
  border-bottom-color: #d7e5ff;
}

.ai-section .content {
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(120deg, rgba(236, 244, 255, 0.56) 0%, rgba(224, 238, 255, 0.5) 52%, rgba(238, 246, 255, 0.58) 100%),
    url("https://images.unsplash.com/photo-1518773553398-650c184e0bb3?auto=format&fit=crop&w=1800&q=60");
  background-size: cover;
  background-position: center;
}

.ai-section .content::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(43, 92, 182, 0.14) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(0deg, rgba(43, 92, 182, 0.10) 0 1px, transparent 1px 30px),
    radial-gradient(36% 30% at 16% 74%, rgba(81, 212, 255, 0.28) 0%, transparent 72%),
    radial-gradient(38% 32% at 84% 24%, rgba(128, 140, 255, 0.24) 0%, transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.2) 100%);
  animation: aiContentGridMove 8s linear infinite, aiContentGlow 7s ease-in-out infinite;
}

.ai-section .content::after {
  content: "";
  position: absolute;
  inset: -12% -28%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, 0.62) 49%, transparent 60%);
  transform: translateX(-65%);
  animation: aiContentScan 4.8s ease-in-out infinite;
  mix-blend-mode: screen;
}

.ai-section .content > * { position: relative; z-index: 1; }

.ai-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #45d7e4;
  background: radial-gradient(circle at 30% 30%, #fefefe 0%, #dce8ff 72%);
  font-size: 24px;
}

.ai-title-wrap h2 {
  margin: 0;
  color: #2750c9;
  font-size: 22px;
  font-weight: 700;
}

.ai-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 320px));
  justify-content: center;
  gap: 12px;
}

.ai-entry {
  --flow-a: #53d7ff;
  --flow-b: #6f83ff;
  --flow-c: #cc9bff;
  border-radius: 999px;
  min-height: 112px;
  padding: 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, #efdff5 0%, #edd9f2 100%);
}

.ai-entry.is-green {
  --flow-a: #65d8b0;
  --flow-b: #5ab7ff;
  --flow-c: #ccf28e;
  background: linear-gradient(90deg, #dcefd7 0%, #d2eac1 100%);
}

.ai-entry::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.6px;
  background: linear-gradient(110deg, var(--flow-a), var(--flow-b), var(--flow-c), var(--flow-a));
  background-size: 240% 100%;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: aiBorderFlow 3.2s linear infinite;
}

.ai-entry-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(255,255,255,0.5);
}

.ai-entry-title {
  margin: 0;
  font-size: 28px;
  line-height: 1;
  color: #2a2f46;
  font-weight: 700;
}

@keyframes aiBorderFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 240% 50%; }
}

@keyframes aiContentGridMove {
  0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
  100% { background-position: 60px 0, 0 60px, 14px -10px, -16px 12px, 0 0; }
}

@keyframes aiContentGlow {
  0% { opacity: 0.72; filter: saturate(100%); }
  50% { opacity: 1; filter: saturate(125%); }
  100% { opacity: 0.72; filter: saturate(100%); }
}

@keyframes aiContentScan {
  0% { transform: translateX(-72%); opacity: 0; }
  12% { opacity: 0.35; }
  45% { opacity: 0.95; }
  100% { transform: translateX(72%); opacity: 0; }
}

/* Course */
.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.course-item { display: flex; flex-direction: column; gap: 4px; }

.course-card {
  background: transparent;
  border-radius: 8px;
  border: 1px solid #e8ecf1;
  overflow: hidden;
  position: relative;
}

.course-published-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #8fddb2;
  background: #e9fbf0;
  color: #14864b;
  font-size: 12px;
  line-height: 20px;
  font-weight: 600;
}

.course-card-main {
  display: flex;
  align-items: stretch;
}

.course-thumbnail {
  width: 34%;
  min-width: 92px;
  max-width: 124px;
  min-height: 116px;
  border-right: 1px solid #e7ebf0;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.course-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.course-thumbnail-icon { font-size: 38px; color: #c8102e; }

.course-content {
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.course-title {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  margin-bottom: 5px;
  min-height: 28px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.course-info-list { display: flex; flex-direction: column; gap: 2px; }
.course-info-row { display: flex; align-items: center; font-size: 11px; color: #8b929b; min-height: 15px; }
.course-info-label { width: 62px; flex-shrink: 0; color: #979ea8; }
.course-info-value { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.course-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  padding: 0 9px 8px;
}

.action-link,
.course-action-divider {
  font-size: 12px;
  color: #c8102e;
}

.action-link {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

/* Switch cards */
.switch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.switch-card {
  border: 1px solid #dfe5f3;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.switch-card.active {
  border-color: #c13b52;
  background: linear-gradient(180deg, #fff6f8 0%, #ffffff 75%);
  box-shadow: 0 6px 14px rgba(174, 55, 78, 0.14);
}

.switch-card .name { font-size: 16px; font-weight: 600; color: #2f3a52; }
.switch-card .meta { font-size: 12px; color: #6e7890; margin-top: 4px; }

/* Resource type cards */
.resource-type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.resource-type-card {
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
  min-height: 94px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: grid;
  gap: 6px;
  align-content: start;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(33, 50, 90, 0.12);
}

.resource-type-card:hover {
  box-shadow: 0 10px 22px rgba(33, 50, 90, 0.18);
  transform: translateY(-1px);
}

.resource-type-card.active { box-shadow: 0 12px 24px rgba(33, 50, 90, 0.2); }

.resource-type-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 1;
  z-index: 0;
  pointer-events: none;
}

.resource-type-name {
  font-size: 16px;
  color: #ffffff;
  font-weight: 700;
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.resource-type-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.3;
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.resource-type-card.type-image::before {
  background-image:
    linear-gradient(180deg, rgba(11, 20, 40, 0.16) 0%, rgba(11, 20, 40, 0.68) 100%),
    url("https://images.unsplash.com/photo-1492691527719-9d1e07e534b4?auto=format&fit=crop&w=1200&q=60");
  background-size: cover;
  background-position: center;
}

.resource-type-card.type-audio::before {
  background-image:
    linear-gradient(180deg, rgba(8, 26, 26, 0.18) 0%, rgba(8, 26, 26, 0.7) 100%),
    url("https://images.unsplash.com/photo-1511379938547-c1f69419868d?auto=format&fit=crop&w=1200&q=60");
  background-size: cover;
  background-position: center;
}

.resource-type-card.type-video::before {
  background-image:
    linear-gradient(180deg, rgba(28, 19, 10, 0.18) 0%, rgba(28, 19, 10, 0.72) 100%),
    url("https://images.unsplash.com/photo-1485846234645-a62644f84728?auto=format&fit=crop&w=1200&q=60");
  background-size: cover;
  background-position: center;
}

.resource-type-card.type-vr::before {
  background-image:
    linear-gradient(180deg, rgba(22, 15, 43, 0.18) 0%, rgba(22, 15, 43, 0.74) 100%),
    url("https://images.unsplash.com/photo-1593508512255-86ab42a8e620?auto=format&fit=crop&w=1200&q=60");
  background-size: cover;
  background-position: center;
}

.resource-type-card.type-video::after {
  content: "▶";
  position: absolute;
  right: 10px;
  top: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.92);
  z-index: 2;
}

.resource-type-card.type-audio::after {
  content: "♪";
  position: absolute;
  right: 10px;
  top: 8px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.92);
  z-index: 2;
}

/* Practice */
.practice-switch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.practice-switch-card {
  border: 1px solid #dfe5f3;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 12px;
  min-height: 84px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  display: grid;
  gap: 6px;
  align-content: start;
  position: relative;
  overflow: hidden;
}

.practice-switch-card:hover {
  border-color: #cf8a96;
  box-shadow: 0 6px 14px rgba(174, 55, 78, 0.12);
  transform: translateY(-1px);
}

.practice-switch-card.active {
  border-color: #c13b52;
  background: linear-gradient(180deg, #fff6f8 0%, #ffffff 75%);
  box-shadow: 0 6px 14px rgba(174, 55, 78, 0.14);
}

.practice-switch-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.34;
  z-index: 0;
  pointer-events: none;
}

.practice-switch-card.type-category::before {
  background:
    radial-gradient(circle at 78% 22%, rgba(113, 146, 255, 0.42) 0 26%, transparent 28%),
    linear-gradient(135deg, rgba(173, 192, 255, 0.56) 0%, rgba(225, 233, 255, 0.64) 100%);
}

.practice-switch-card.type-team::before {
  background:
    radial-gradient(circle at 78% 22%, rgba(102, 201, 157, 0.42) 0 26%, transparent 28%),
    linear-gradient(135deg, rgba(184, 242, 210, 0.56) 0%, rgba(230, 249, 239, 0.64) 100%);
}

.practice-switch-card.type-task::before {
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 173, 104, 0.4) 0 26%, transparent 28%),
    linear-gradient(135deg, rgba(255, 216, 171, 0.56) 0%, rgba(255, 241, 219, 0.64) 100%);
}

.practice-switch-name {
  font-size: 16px;
  color: #2f3a52;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.practice-switch-meta {
  font-size: 12px;
  color: #6e7890;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

.practice-workspace-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.practice-workspace-card {
  border: 1px solid #e3e8f4;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 198px;
}

.practice-workspace-cover {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #324059;
  border-bottom: 1px solid #e7ecf7;
  font-weight: 600;
  background: linear-gradient(135deg, #f4f7ff 0%, #e1e9ff 100%);
}

.practice-workspace-body {
  padding: 10px;
  display: grid;
  gap: 6px;
  flex: 1;
}

.practice-workspace-name {
  font-size: 14px;
  color: #2e3b55;
  font-weight: 600;
  line-height: 1.35;
  min-height: 38px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.practice-workspace-meta {
  font-size: 12px;
  color: #6f7990;
  display: grid;
  gap: 3px;
}

.practice-workspace-actions {
  padding: 0 10px 10px;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  font-size: 12px;
  color: #c8102e;
}

.practice-workspace-actions .link {
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.practice-workspace-card.is-category {
  min-height: 212px;
  border: 0;
  box-shadow: 0 10px 22px rgba(33, 50, 90, 0.14);
  position: relative;
}

.practice-workspace-card.is-category::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  pointer-events: none;
  z-index: 2;
}

.practice-category-cover {
  position: absolute;
  inset: 0;
  border-bottom: 0;
  overflow: hidden;
  z-index: 0;
}

.practice-category-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9, 16, 33, 0.12) 0%, rgba(9, 16, 33, 0.54) 72%, rgba(9, 16, 33, 0.76) 100%),
    radial-gradient(circle at 75% 18%, rgba(255, 255, 255, 0.22) 0 20%, transparent 22%);
  pointer-events: none;
}

.practice-category-cover.type-social {
  background-image:
    linear-gradient(135deg, rgba(56, 127, 228, 0.4) 0%, rgba(134, 184, 255, 0.42) 100%),
    url("https://images.unsplash.com/photo-1469571486292-b53601020f90?auto=format&fit=crop&w=1200&q=60");
  background-size: cover;
  background-position: center;
}

.practice-category-cover.type-classroom {
  background-image:
    linear-gradient(135deg, rgba(56, 170, 136, 0.4) 0%, rgba(119, 216, 188, 0.42) 100%),
    url("https://images.unsplash.com/photo-1523050854058-8df90110c9f1?auto=format&fit=crop&w=1200&q=60");
  background-size: cover;
  background-position: center;
}

.practice-category-cover.type-campus {
  background-image:
    linear-gradient(135deg, rgba(228, 142, 56, 0.4) 0%, rgba(255, 197, 133, 0.42) 100%),
    url("https://images.unsplash.com/photo-1498243691581-b145c3f54a5a?auto=format&fit=crop&w=1200&q=60");
  background-size: cover;
  background-position: center;
}

.practice-category-cover.type-online {
  background-image:
    linear-gradient(135deg, rgba(122, 92, 214, 0.42) 0%, rgba(183, 157, 255, 0.44) 100%),
    url("https://images.unsplash.com/photo-1516321497487-e288fb19713f?auto=format&fit=crop&w=1200&q=60");
  background-size: cover;
  background-position: center;
}

.practice-category-cover.type-custom {
  background-image:
    linear-gradient(135deg, rgba(210, 93, 125, 0.42) 0%, rgba(255, 170, 196, 0.46) 100%),
    url("https://images.unsplash.com/photo-1498050108023-c5249f4df085?auto=format&fit=crop&w=1200&q=60");
  background-size: cover;
  background-position: center;
}

.practice-category-overlay {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 12px 12px 10px;
  display: grid;
  gap: 6px;
  color: #ffffff;
}

.practice-category-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.38);
}

.practice-category-meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
  display: grid;
  gap: 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.38);
}

.practice-category-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  font-size: 12px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
}

.practice-category-actions .link {
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.practice-workspace-card.add-card {
  border: 1px dashed #d4dced;
  background: linear-gradient(180deg, #fafcff 0%, #ffffff 100%);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.practice-workspace-card.add-card:hover {
  border-color: #c13b52;
  box-shadow: 0 6px 14px rgba(174, 55, 78, 0.12);
  transform: translateY(-1px);
}

.practice-add-inner {
  display: grid;
  gap: 8px;
  text-align: center;
}

.practice-add-plus {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border-radius: 50%;
  background: #ffeef2;
  color: #c13b52;
  border: 1px solid #ffd4de;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
}

.practice-add-text {
  font-size: 14px;
  color: #3a4760;
  font-weight: 600;
}

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

.asset-card {
  border: 1px solid #e3e8f4;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 206px;
}

.asset-cover {
  height: 84px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  font-size: 13px;
  color: #fff;
  border-bottom: 1px solid #e7ecf7;
  font-weight: 700;
  padding: 10px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
  background-size: cover;
  background-position: center;
}

.asset-cover.image { background-image: linear-gradient(180deg, rgba(11,20,40,.12), rgba(11,20,40,.64)), url("https://images.unsplash.com/photo-1504203700686-0f2c1b28e7fd?auto=format&fit=crop&w=1200&q=60"); }
.asset-cover.audio { background-image: linear-gradient(180deg, rgba(8,26,26,.14), rgba(8,26,26,.68)), url("https://images.unsplash.com/photo-1493225457124-a3eb161ffa5f?auto=format&fit=crop&w=1200&q=60"); }
.asset-cover.video { background-image: linear-gradient(180deg, rgba(28,19,10,.14), rgba(28,19,10,.68)), url("https://images.unsplash.com/photo-1478720568477-152d9b164e26?auto=format&fit=crop&w=1200&q=60"); }
.asset-cover.vr { background-image: linear-gradient(180deg, rgba(22,15,43,.14), rgba(22,15,43,.7)), url("https://images.unsplash.com/photo-1535223289827-42f1e9919769?auto=format&fit=crop&w=1200&q=60"); }

.asset-body { padding: 10px; display: grid; gap: 6px; flex: 1; }
.asset-name { font-size: 14px; color: #2e3b55; font-weight: 600; line-height: 1.35; }
.asset-meta { font-size: 12px; color: #6f7990; display: grid; gap: 3px; }
.asset-actions { padding: 0 10px 10px; display: flex; justify-content: flex-end; gap: 6px; font-size: 12px; color: #c8102e; }
.asset-actions button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; }

.table-wrap {
  border: 1px solid #e2e7f2;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th, .table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #edf0f6;
  color: #39465d;
}

.table th {
  color: #667188;
  font-weight: 600;
  background: #fafbff;
}

.table-actions {
  display: flex;
  gap: 6px;
}

.table-actions button {
  border: 1px solid #d4daea;
  border-radius: 8px;
  background: #fff;
  color: #334055;
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
}

.pager {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #667188;
}

.pager-left,
.pager-right { display: flex; align-items: center; gap: 8px; }

.pager select {
  height: 30px;
  border: 1px solid #d6ddec;
  border-radius: 8px;
  padding: 0 8px;
  background: #fff;
}

.pager button {
  height: 30px;
  border: 1px solid #d6ddec;
  border-radius: 8px;
  background: #fff;
  color: #334055;
  padding: 0 10px;
  cursor: pointer;
}

.pager button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(22, 30, 44, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 120;
  padding: 20px;
}

.modal.show { display: flex; }

.modal-card {
  width: min(940px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border: 1px solid #e0e7f5;
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(32, 44, 68, 0.2);
}

.modal-card.small { width: min(420px, 100%); }

.modal-head {
  padding: 14px 16px;
  border-bottom: 1px solid #ecf0f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.modal-head h3 { margin: 0; font-size: 18px; color: #2c3952; }

.modal-body { padding: 14px 16px; }
.modal-foot {
  padding: 12px 16px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

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

.form-group { display: grid; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

.form-group label {
  font-size: 13px;
  color: #556176;
}

.required-mark {
  color: #d7263d;
  font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea {
  height: 36px;
  border: 1px solid #d4ddec;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  color: #283248;
  background: #fff;
}

.form-group textarea {
  min-height: 86px;
  padding: 8px 10px;
  resize: vertical;
}

.cover-upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cover-preview {
  width: 140px;
  height: 92px;
  border: 1px solid #dce4f2;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6f9ff;
  color: #607090;
  font-size: 12px;
}

.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.toast-wrap {
  position: fixed;
  right: 16px;
  top: 16px;
  z-index: 160;
  display: grid;
  gap: 8px;
}

.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d9e1ef;
  background: #fff;
  color: #334055;
  box-shadow: 0 10px 20px rgba(32, 44, 68, 0.15);
  transform: translateY(-8px);
  opacity: 0;
  transition: all .2s ease;
  font-size: 13px;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { border-color: #b9ebd8; background: #f1fdf7; color: #0e7a52; }
.toast-error { border-color: #ffd0d6; background: #fff4f6; color: #c1273f; }
.toast-info { border-color: #d9e6ff; background: #f3f7ff; color: #3759a6; }

.site-footer {
  max-width: 1320px;
  margin: 0 auto 20px;
  padding: 0 20px;
  text-align: center;
  font-size: 12px;
  color: #7b8498;
}

.role-only { display: none; }
html[data-role="school_admin"] .role-only.role-school-admin { display: block; }

.hidden { display: none !important; }

@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .switch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .practice-switch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .practice-workspace-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .platform-title { font-size: 20px; }
  .meta-row { justify-content: flex-start; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: 1fr; }
  .course-grid { grid-template-columns: 1fr; }
  .switch-grid { grid-template-columns: 1fr; }
  .resource-type-grid { grid-template-columns: 1fr; }
  .practice-switch-grid { grid-template-columns: 1fr; }
  .practice-workspace-grid { grid-template-columns: 1fr; }
  .asset-grid { grid-template-columns: 1fr; }
  .ai-quick-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .topbar::before,
  .topbar::after,
  .ai-section .content::before,
  .ai-section .content::after,
  .ai-entry::before {
    animation: none !important;
  }
}
