/* ============================================================
   学生端项目广场 - 独立样式
   ============================================================ */

/* ---- Top nav ---- */
.s-app {
  min-height: 100vh;
  background: var(--ink-25);
  display: flex;
  flex-direction: column;
}
.s-topnav {
  height: 60px;
  background: var(--ink-0);
  border-bottom: 1px solid var(--ink-150);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 32px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.s-topnav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-900);
}
.s-topnav__brand-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: white;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 8px oklch(0.48 0.17 258 / 0.25);
}
.s-topnav__menu {
  display: flex;
  gap: 4px;
  height: 100%;
  align-items: center;
}
.s-nav-item {
  height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  font-size: 14px;
  color: var(--ink-600);
  border-radius: 8px;
  cursor: pointer;
}
.s-nav-item:hover { color: var(--ink-900); background: var(--ink-50); }
.s-nav-item--active {
  color: var(--brand-700);
  background: var(--brand-50);
  font-weight: 500;
}
.s-topnav__spacer { flex: 1; }
.s-topnav__user {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  cursor: pointer;
}
.s-topnav__user:hover { background: var(--ink-50); }
.s-topnav__user-info { display: flex; flex-direction: column; line-height: 1.25; }
.s-topnav__user-name { font-size: 13px; color: var(--ink-800); font-weight: 500; }
.s-topnav__user-meta { font-size: 11.5px; color: var(--ink-500); }
.s-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.66 0.14 260), oklch(0.52 0.17 260));
  color: white;
  font-size: 13px;
  font-weight: 600;
  display: grid; place-items: center;
}

/* ---- Page area ---- */
.s-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---- List page hero ---- */
.s-hero {
  background: linear-gradient(135deg, oklch(0.97 0.025 258), oklch(0.95 0.035 220));
  padding: 32px 40px 28px;
  border-bottom: 1px solid var(--ink-150);
  position: relative;
  overflow: hidden;
}
.s-hero::before, .s-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.s-hero::before {
  top: -40px; right: 80px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, oklch(0.55 0.16 258 / 0.10), transparent 70%);
}
.s-hero::after {
  bottom: -60px; left: 200px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, oklch(0.65 0.12 200 / 0.12), transparent 70%);
}
.s-hero__inner { max-width: 1280px; margin: 0 auto; position: relative; z-index: 1; }
.s-hero__title {
  font-size: 26px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.5px;
  margin: 0;
}
.s-hero__sub {
  font-size: 14px;
  color: var(--ink-600);
  margin-top: 6px;
}

.s-search-wrap {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.s-search {
  flex: 1;
  min-width: 280px;
  max-width: 480px;
  display: inline-flex;
  align-items: center;
  height: 44px;
  background: var(--ink-0);
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  padding: 0 16px;
  gap: 10px;
  transition: all 0.15s;
}
.s-search:hover { border-color: var(--ink-300); }
.s-search:focus-within {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px oklch(0.55 0.16 258 / 0.12);
}
.s-search input {
  flex: 1;
  border: none; outline: none; background: transparent;
  font-size: 14px;
}
.s-search__icon { color: var(--ink-400); }

/* Filter chip groups */
.s-filters {
  margin-top: 16px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding: 16px 40px;
  background: var(--ink-0);
  border-bottom: 1px solid var(--ink-150);
}
.s-filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.s-filter-label {
  font-size: 13px;
  color: var(--ink-500);
  white-space: nowrap;
}
.s-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.s-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-700);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.12s;
}
.s-chip:hover { background: var(--ink-75); }
.s-chip--active {
  background: var(--brand-600);
  color: white;
  font-weight: 500;
}
.s-chip--active:hover { background: var(--brand-700); }

/* Card grid */
.s-content {
  flex: 1;
  padding: 24px 40px 40px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}
.s-toolbar-row {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
.s-result-count {
  font-size: 13.5px;
  color: var(--ink-600);
}
.s-result-count strong {
  color: var(--ink-900);
  font-weight: 600;
  font-family: var(--font-num);
}
.s-sort-select {
  margin-left: auto;
  height: 32px;
  padding: 0 28px 0 12px;
  border: 1px solid var(--ink-200);
  border-radius: 6px;
  background: var(--ink-0) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path d='M2 4l3 3 3-3' stroke='%2374809a' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") right 10px center / 10px no-repeat;
  font-size: 13px;
  color: var(--ink-700);
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
}

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

.s-card {
  background: var(--ink-0);
  border-radius: 12px;
  border: 1px solid var(--ink-150);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
  cursor: pointer;
}
.s-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(20,28,50,0.08), 0 4px 10px rgba(20,28,50,0.05);
  border-color: var(--brand-200);
}
.s-card__cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, oklch(0.92 0.04 258), oklch(0.86 0.06 258));
  overflow: hidden;
  display: grid;
  place-items: center;
  color: oklch(0.50 0.17 2608);
}
.s-card__cover--code { background: linear-gradient(135deg, oklch(0.94 0.05 230), oklch(0.86 0.10 240)); color: oklch(0.40 0.16 240); }
.s-card__cover--vm { background: linear-gradient(135deg, oklch(0.94 0.05 155), oklch(0.85 0.10 145)); color: oklch(0.36 0.14 155); }
.s-card__cover--algo { background: linear-gradient(135deg, oklch(0.94 0.05 295), oklch(0.86 0.10 305)); color: oklch(0.40 0.16 295); }
.s-card__cover svg { width: 44px; height: 44px; opacity: 0.85; }
.s-card__cover-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11.5px;
  color: var(--ink-700);
  font-weight: 500;
}
.s-card__body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.s-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.s-card__intro {
  font-size: 12.5px;
  color: var(--ink-500);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
  min-height: 38px;
}
.s-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.s-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--ink-75);
  color: var(--ink-700);
}
.s-tag--code { background: oklch(0.96 0.04 258); color: oklch(0.42 0.16 258); }
.s-tag--vm { background: oklch(0.96 0.05 155); color: oklch(0.40 0.12 155); }
.s-tag--algo { background: oklch(0.96 0.05 295); color: oklch(0.42 0.16 295); }
.s-tag--basic { background: oklch(0.95 0.04 200); color: oklch(0.38 0.13 220); }
.s-tag--mid { background: oklch(0.95 0.06 75); color: oklch(0.40 0.14 50); }
.s-tag--adv { background: oklch(0.95 0.06 25); color: oklch(0.42 0.16 25); }

.s-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  font-size: 12px;
  color: var(--ink-500);
}
.s-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.s-card__footer {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--ink-100);
  background: var(--ink-25);
}
.s-card__env-stack {
  display: inline-flex;
  gap: 4px;
}
.s-start-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--brand-600);
  color: white;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.12s;
}
.s-start-btn:hover { background: var(--brand-700); }

/* Empty state */
.s-empty {
  padding: 80px 20px;
  text-align: center;
  color: var(--ink-500);
}
.s-empty__icon {
  width: 84px; height: 84px;
  margin: 0 auto 16px;
  display: grid; place-items: center;
  background: var(--ink-75);
  border-radius: 50%;
  color: var(--ink-300);
}
.s-empty__title { font-size: 16px; color: var(--ink-700); font-weight: 500; }
.s-empty__hint { font-size: 13.5px; margin-top: 6px; color: var(--ink-500); }

/* ============================================================
   我的课程实验
   ============================================================ */

/* 新版课程卡片（同教师角色课程实验卡片风格） */
.mc-c-card {
  background: var(--ink-0);
  border-radius: var(--radius-md);
  border: 1px solid var(--ink-150);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.mc-c-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(20,28,50,0.07);
  border-color: var(--brand-200);
}
.mc-c-card__top {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mc-c-card__top--upcoming { background: linear-gradient(135deg, oklch(0.96 0.02 258), oklch(0.94 0.03 250)); }
.mc-c-card__top--ongoing { background: linear-gradient(135deg, oklch(0.96 0.05 145), oklch(0.92 0.07 155)); }
.mc-c-card__top--ended { background: linear-gradient(135deg, oklch(0.96 0.005 255), oklch(0.93 0.01 250)); }
.mc-c-card__top .mc-card__status {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.mc-c-card__teacher {
  font-size: 11.5px;
  color: var(--ink-700);
  display: inline-flex;
  align-items: center;
}

.mc-c-card__body {
  padding: 14px 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.mc-c-card__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mc-c-card__intro {
  font-size: 12.5px;
  color: var(--ink-500);
  margin-bottom: 10px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.mc-c-card__meta {
  font-size: 12px;
  color: var(--ink-500);
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
}
.mc-c-card__stats {
  display: flex;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px dashed var(--ink-150);
}
.mc-c-card__stat {
  flex: 1;
  text-align: center;
}
.mc-c-card__stat-v {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}
.mc-c-card__stat-l { font-size: 11px; color: var(--ink-500); margin-top: 2px; }
.mc-c-card__class {
  margin-top: 10px;
  padding: 6px 10px;
  background: var(--brand-50);
  border-radius: 4px;
  font-size: 12px;
  color: var(--brand-700);
}

.mc-c-card__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 14px;
  border-top: 1px solid var(--ink-100);
  background: var(--ink-25);
}

/* Status pill (used in cards & page header) */
.mc-card__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  flex: none;
}
.mc-card__status--ongoing { color: oklch(0.40 0.13 145); }
.mc-card__status--ongoing .status-badge__dot { background: var(--success-500); }
.mc-card__status--upcoming { color: oklch(0.42 0.16 258); }
.mc-card__status--upcoming .status-badge__dot { background: var(--brand-500); }
.mc-card__status--ended { color: var(--ink-600); }
.mc-card__status--ended .status-badge__dot { background: var(--ink-400); }
/* When mc-card__status not inside .mc-c-card__top, give it solid bg */
.mc-card__status:not(.mc-c-card__top .mc-card__status) {
  background: var(--ink-100);
}

/* Course exps page header */
.mc-page-head {
  background: var(--ink-0);
  border-bottom: 1px solid var(--ink-150);
  padding: 14px 40px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.mc-page-info { flex: 1; min-width: 0; }
.mc-page-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}
.mc-page-meta {
  font-size: 12.5px;
  color: var(--ink-600);
}
.mc-sep {
  color: var(--ink-300);
  margin: 0 6px;
}

/* Report side drawer (slides from RIGHT for student) */
.mc-rpt-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 640px;
  max-width: 100vw;
  background: var(--ink-0);
  z-index: 200;
  display: flex;
  flex-direction: column;
  box-shadow: -16px 0 48px rgba(20,28,50,0.14);
  animation: drawer-in 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.mc-rpt-drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--ink-150);
  gap: 12px;
  flex: none;
}
.mc-rpt-drawer__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  gap: 8px;
}
.mc-rpt-drawer__sub {
  font-size: 12.5px;
  color: var(--ink-500);
  margin-top: 4px;
}
.mc-rpt-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px 24px;
}
.mc-rpt-drawer__filebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: 8px;
  margin-bottom: 14px;
}
.mc-rpt-drawer__file-icon {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: var(--brand-100);
  color: var(--brand-700);
  display: grid; place-items: center;
  flex: none;
}
.mc-rpt-drawer__file-name {
  font-weight: 500;
  color: var(--ink-900);
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mc-rpt-drawer__file-meta {
  font-size: 11.5px;
  color: var(--ink-500);
  margin-top: 2px;
  font-family: var(--font-num);
}
.mc-rpt-drawer__score { margin-bottom: 14px; }
.mc-rpt-drawer__graded {
  background: oklch(0.97 0.03 145);
  border: 1px solid oklch(0.88 0.06 145);
  border-radius: 8px;
  padding: 14px 16px;
}
.mc-rpt-drawer__graded-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: oklch(0.40 0.13 145);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
}
.mc-rpt-drawer__graded-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.mc-rpt-drawer__graded-label {
  font-size: 11.5px;
  color: var(--ink-500);
  margin-bottom: 4px;
}
.mc-rpt-drawer__graded-text {
  font-size: 13px;
  color: var(--ink-800);
  line-height: 1.6;
  word-wrap: break-word;
}
.mc-rpt-drawer__pending {
  background: var(--ink-50);
  border: 1px solid var(--ink-150);
  border-radius: 8px;
  padding: 14px 16px;
  text-align: center;
}
.mc-rpt-drawer__preview {
  border: 1px solid var(--ink-150);
  border-radius: 8px;
  background: var(--ink-25);
  padding: 16px;
}

/* PDF preview small */
.mc-pdf__page {
  background: var(--ink-0);
  border: 1px solid var(--ink-150);
  border-radius: 4px;
  padding: 24px 28px;
  position: relative;
  min-height: 300px;
}

/* Readonly two-column layout */
.mc-readonly-summary {
  background: linear-gradient(135deg, oklch(0.97 0.01 255), oklch(0.95 0.015 255));
  border-bottom: 1px solid var(--ink-150);
  padding: 18px 40px;
  display: flex;
  align-items: center;
  gap: 40px;
}
.mc-readonly-summary__item { min-width: 120px; }
.mc-readonly-summary__label {
  font-size: 12px;
  color: var(--ink-500);
  margin-bottom: 6px;
}
.mc-readonly-summary__value {
  font-size: 24px;
  font-weight: 600;
}
.mc-readonly-summary__value .t-score { font-size: 24px; }
.mc-readonly-summary__hint {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-500);
  max-width: 360px;
  line-height: 1.6;
}

.mc-readonly {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px 40px 40px;
}
.mc-readonly--single {
  grid-template-columns: 1fr;
  max-width: 960px;
  margin: 0 auto;
}
.mc-readonly__left,
.mc-readonly__right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mc-readonly__section {
  background: var(--ink-0);
  border: 1px solid var(--ink-150);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}
.mc-readonly__section-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink-100);
  display: flex;
  align-items: center;
  gap: 8px;
}
.mc-readonly__section-title::before {
  content: "";
  width: 3px;
  height: 12px;
  background: var(--brand-600);
  border-radius: 2px;
}
.mc-readonly__section-hint {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--ink-500);
  font-weight: 400;
}

/* Report card (inline, opens slide viewer) */
.mc-rpt-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.mc-rpt-card:hover {
  border-color: var(--brand-500);
  box-shadow: 0 4px 12px oklch(0.55 0.16 258 / 0.12);
}
.mc-rpt-card__icon {
  width: 44px; height: 44px;
  border-radius: 8px;
  background: var(--brand-100);
  color: var(--brand-700);
  display: grid; place-items: center;
  flex: none;
}
.mc-rpt-card__main { flex: 1; min-width: 0; }
.mc-rpt-card__name {
  font-weight: 500;
  color: var(--ink-900);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mc-rpt-card__meta {
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 3px;
  font-family: var(--font-num);
}
.mc-rpt-card__score-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 6px;
}
.mc-rpt-card__actions {
  display: flex;
  gap: 6px;
  flex: none;
}

/* Detection items by environment grouping (reuse cr-* classes from styles.css) */
.mc-readonly__section .cr-group {
  margin-bottom: 16px;
}
.mc-readonly__section .cr-group:last-child {
  margin-bottom: 0;
}
.mc-readonly__section .cr-group__title--env {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-700);
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--ink-150);
}

/* ============================================================
   Experiment page
   ============================================================ */
.s-exp {
  height: calc(100vh - 60px);
  display: grid;
  grid-template-rows: 56px 1fr;
}

.s-exp__top {
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: var(--ink-0);
  border-bottom: 1px solid var(--ink-150);
  gap: 16px;
}
.s-exp__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-700);
}
.s-exp__back:hover { background: var(--ink-100); color: var(--ink-900); }
.s-exp__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.s-exp__name-text {
  max-width: 480px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.s-exp__top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Countdown */
.s-countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--ink-75);
  border: 1px solid var(--ink-150);
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--ink-800);
  font-weight: 500;
}
.s-countdown__label {
  font-size: 11.5px;
  color: var(--ink-500);
  font-weight: 400;
  font-family: var(--font-sans);
}
.s-countdown--warn {
  background: oklch(0.96 0.06 75);
  border-color: oklch(0.85 0.10 75);
  color: oklch(0.40 0.16 50);
}
.s-countdown--danger {
  background: oklch(0.95 0.08 25);
  border-color: oklch(0.82 0.15 25);
  color: oklch(0.40 0.18 25);
  animation: pulseBg 1.4s ease-in-out infinite;
}
@keyframes pulseBg {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

.s-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
}
.s-btn--default {
  background: var(--ink-0);
  border-color: var(--ink-200);
  color: var(--ink-700);
}
.s-btn--default:hover { border-color: var(--brand-500); color: var(--brand-600); }
.s-btn--primary { background: var(--brand-600); color: white; }
.s-btn--primary:hover { background: var(--brand-700); }
.s-btn--danger {
  background: var(--ink-0);
  border-color: oklch(0.85 0.10 25);
  color: var(--danger-500);
}
.s-btn--danger:hover { background: var(--danger-50); }
.s-btn--ghost { color: var(--ink-600); }
.s-btn--ghost:hover { background: var(--ink-100); color: var(--ink-900); }

/* Main body grid */
.s-exp__body {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 0;
}

/* Left info panel */
.s-info {
  border-right: 1px solid var(--ink-150);
  background: var(--ink-0);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.s-info__card {
  border-bottom: 1px solid var(--ink-100);
}
.s-info__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
}
.s-info__head-bar {
  width: 3px; height: 14px;
  border-radius: 2px;
  background: var(--brand-600);
}
.s-info__base {
  padding: 0 20px 18px;
}
.s-info__name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.45;
  margin-bottom: 10px;
}
.s-info__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.s-info__meta-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.s-info__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-700);
}
.s-info__meta-label {
  width: 64px;
  color: var(--ink-500);
  font-size: 12.5px;
  flex: none;
}
.s-info__meta-value {
  color: var(--ink-900);
  flex: 1;
  min-width: 0;
}

/* Manual */
.s-manual {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.s-manual__body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px 24px;
}
.s-manual__body .md-preview {
  padding: 0;
  font-size: 13.5px;
  line-height: 1.65;
}
.s-manual__body .md-preview h1 { font-size: 17px; padding-bottom: 6px; }
.s-manual__body .md-preview h2 { font-size: 15px; }
.s-manual__body .md-preview h3 { font-size: 14px; }
.s-manual__body .md-preview pre {
  background: var(--ink-900);
  color: oklch(0.92 0.01 255);
  border: none;
  padding: 0;
  position: relative;
  font-size: 12.5px;
  margin: 8px 0 14px;
}
.s-manual__body .md-preview pre code {
  display: block;
  padding: 14px 16px 14px 16px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  line-height: 1.6;
}
.s-manual__body .md-preview pre .md-insert {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.1);
  color: oklch(0.96 0.005 255);
  border-radius: 4px;
  font-size: 11.5px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.15);
  font-family: var(--font-sans);
}
.s-manual__body .md-preview pre .md-insert:hover {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: white;
}

/* Right env panel */
.s-env {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--ink-50);
}
.s-env__tabs {
  background: var(--ink-0);
  border-bottom: 1px solid var(--ink-150);
  display: flex;
  align-items: stretch;
  padding: 0 18px;
  gap: 4px;
  overflow-x: auto;
}
.s-env__tab {
  padding: 12px 16px 10px;
  font-size: 13.5px;
  color: var(--ink-600);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}
.s-env__tab:hover { color: var(--ink-900); }
.s-env__tab--active {
  color: var(--brand-700);
  border-bottom-color: var(--brand-600);
  font-weight: 500;
}
.s-env__tab-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
}

.s-env__content {
  flex: 1;
  position: relative;
  background: var(--ink-50);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Docker / Jupyter sample */
.s-jupyter {
  flex: 1;
  background: var(--ink-0);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.s-jupyter__bar {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid var(--ink-150);
  font-size: 12.5px;
  color: var(--ink-600);
  gap: 12px;
  background: var(--ink-25);
}
.s-jupyter__file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-800);
  font-weight: 500;
}
.s-jupyter__tools {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.s-jupyter__tool {
  width: 26px; height: 26px;
  border-radius: 4px;
  display: inline-grid;
  place-items: center;
  color: var(--ink-500);
}
.s-jupyter__tool:hover { background: var(--ink-100); color: var(--ink-800); }
.s-jupyter__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.s-cell {
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
}
.s-cell__marker {
  width: 44px;
  flex: none;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: var(--ink-400);
  padding-top: 8px;
  text-align: right;
  user-select: none;
}
.s-cell__body {
  flex: 1;
  min-width: 0;
}
.s-cell__code {
  background: var(--ink-50);
  border: 1px solid var(--ink-150);
  border-left: 3px solid var(--brand-500);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-800);
  white-space: pre;
  overflow-x: auto;
}
.s-cell__code .tok-k { color: oklch(0.45 0.17 295); }
.s-cell__code .tok-s { color: oklch(0.45 0.16 145); }
.s-cell__code .tok-c { color: var(--ink-400); font-style: italic; }
.s-cell__code .tok-f { color: oklch(0.50 0.17 230); }
.s-cell__code .tok-n { color: oklch(0.47 0.17 260); }
.s-cell__out {
  margin-top: 6px;
  padding: 8px 14px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--ink-700);
  background: transparent;
  border-left: 3px solid var(--ink-200);
  white-space: pre-wrap;
}

/* KVM */
.s-vm {
  flex: 1;
  background: oklch(0.20 0.012 250);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.s-vm__topbar {
  height: 28px;
  background: oklch(0.27 0.012 250);
  border-bottom: 1px solid oklch(0.32 0.012 250);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  color: oklch(0.78 0.008 250);
  font-size: 11.5px;
}
.s-vm__topbar-dot { width: 8px; height: 8px; border-radius: 50%; background: oklch(0.55 0.16 145); }
.s-vm__body {
  flex: 1;
  background: oklch(0.16 0.012 250);
  position: relative;
}
.s-vm__terminal {
  position: absolute;
  inset: 18px;
  background: oklch(0.10 0.012 250);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  color: oklch(0.88 0.005 250);
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  box-shadow: inset 0 0 0 1px oklch(0.32 0.012 250 / 0.5);
}
.s-vm__cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  vertical-align: -2px;
  background: oklch(0.88 0.005 250);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.s-vm__prompt { color: oklch(0.65 0.15 145); }
.s-vm__user { color: oklch(0.70 0.15 220); }
.s-vm__out { color: oklch(0.75 0.005 250); }
.s-vm__hl { color: oklch(0.85 0.10 75); }

/* Link iframe */
.s-iframe-mock {
  flex: 1;
  background: var(--ink-0);
  display: flex;
  flex-direction: column;
}
.s-iframe-mock__bar {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--ink-50);
  border-bottom: 1px solid var(--ink-150);
}
.s-iframe-mock__url {
  flex: 1;
  height: 24px;
  background: var(--ink-0);
  border: 1px solid var(--ink-150);
  border-radius: 4px;
  padding: 0 8px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: var(--ink-700);
  display: flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.s-iframe-mock__body {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--ink-0);
}
.s-iframe-mock__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-500);
  text-align: center;
  padding: 24px;
}
.s-iframe-mock__hero {
  width: 220px;
  height: 140px;
  border-radius: 12px;
  background: linear-gradient(135deg, oklch(0.92 0.06 240), oklch(0.85 0.10 220));
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  color: oklch(0.40 0.16 240);
}
.s-iframe-mock__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 4px;
}
.s-iframe-mock__url-label {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--brand-600);
  margin-top: 8px;
}

/* Unavailable env */
.s-env-error {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  background: var(--ink-50);
  color: var(--ink-500);
}
.s-env-error__icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: oklch(0.96 0.04 25);
  color: var(--danger-500);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}
.s-env-error__title {
  font-size: 15px;
  color: var(--ink-800);
  font-weight: 500;
  margin-bottom: 4px;
}
.s-env-error__hint {
  font-size: 13px;
  color: var(--ink-500);
  margin-bottom: 16px;
}

/* Last detection summary (bottom-right floating) */
.s-detect-summary {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink-0);
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(20,28,50,0.10), 0 2px 5px rgba(20,28,50,0.06);
  border: 1px solid var(--ink-150);
  cursor: pointer;
  z-index: 5;
  transition: all 0.18s;
}
.s-detect-summary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(20,28,50,0.14), 0 4px 8px rgba(20,28,50,0.08);
}
.s-detect-summary__icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
}
.s-detect-summary__icon--ok { background: oklch(0.95 0.07 155); color: var(--success-500); }
.s-detect-summary__icon--mid { background: oklch(0.95 0.07 75); color: oklch(0.50 0.16 50); }
.s-detect-summary__icon--bad { background: var(--danger-50); color: var(--danger-500); }
.s-detect-summary__score {
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}
.s-detect-summary__score-total { font-size: 12px; color: var(--ink-500); font-weight: 400; }
.s-detect-summary__time { font-size: 11.5px; color: var(--ink-500); margin-top: 2px; }
.s-detect-summary__link { font-size: 12px; color: var(--brand-600); margin-left: 6px; }

/* Detection slide panel */
.s-slide-bg {
  position: fixed;
  inset: 0;
  background: rgba(20,28,50,0.32);
  z-index: 80;
  animation: fadein 0.18s ease;
}
.s-slide {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 460px;
  max-width: 100vw;
  background: var(--ink-0);
  z-index: 81;
  display: flex;
  flex-direction: column;
  box-shadow: -16px 0 48px rgba(20,28,50,0.14);
  animation: drawer-in 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.s-slide__head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--ink-150);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.s-slide__head-main { flex: 1; }
.s-slide__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
}
.s-slide__score-row {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.s-slide__score {
  font-family: var(--font-num);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-900);
}
.s-slide__score--ok { color: var(--success-500); }
.s-slide__score--mid { color: oklch(0.55 0.16 50); }
.s-slide__score--bad { color: var(--danger-500); }
.s-slide__score-total {
  font-size: 16px;
  color: var(--ink-500);
  font-family: var(--font-num);
}
.s-slide__time {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-500);
  font-family: var(--font-num);
}
.s-slide__close {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: grid; place-items: center;
  color: var(--ink-500);
}
.s-slide__close:hover { background: var(--ink-100); color: var(--ink-800); }
.s-slide__body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 22px 24px;
}
.s-slide__group { margin-top: 16px; }
.s-slide__group:first-child { margin-top: 0; }
.s-slide__group-title {
  font-size: 12px;
  color: var(--ink-500);
  letter-spacing: 0.3px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.s-slide__group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ink-150);
}
.s-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ink-100);
}
.s-item:last-child { border-bottom: none; }
.s-item__status {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex: none;
  margin-top: 2px;
}
.s-item__status--ok { background: oklch(0.95 0.08 155); color: var(--success-500); }
.s-item__status--bad { background: var(--danger-50); color: var(--danger-500); }
.s-item__status--err { background: oklch(0.95 0.06 75); color: oklch(0.50 0.16 50); }
.s-item__main { flex: 1; min-width: 0; }
.s-item__name {
  font-size: 13.5px;
  color: var(--ink-900);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.s-item__type {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 3px;
}
.s-item__fail {
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--danger-50);
  border-left: 3px solid var(--danger-500);
  border-radius: 4px;
  font-size: 12px;
  color: oklch(0.40 0.16 25);
  line-height: 1.5;
}
.s-item__score {
  margin-left: auto;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
  flex: none;
  text-align: right;
  font-weight: 500;
}
.s-item__score-actual--ok { color: var(--success-500); }
.s-item__score-actual--bad { color: var(--ink-400); }
.s-item__score-total { font-size: 11px; color: var(--ink-500); font-weight: 400; }

/* Confirm dialog (already exists but ensure tweaked) */
.s-confirm-modal { max-width: 440px; }

/* Algo experiment full content */
.s-iframe-mock__embed {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--ink-0);
}
.s-iframe-mock__embed-hero {
  padding: 32px 32px 24px;
  background: linear-gradient(135deg, oklch(0.94 0.06 295), oklch(0.90 0.10 305));
}
.s-iframe-mock__embed-hero-title {
  font-size: 22px;
  font-weight: 600;
  color: oklch(0.30 0.15 295);
  margin-bottom: 6px;
}
.s-iframe-mock__embed-hero-sub { font-size: 13px; color: oklch(0.40 0.10 295); }
.s-iframe-mock__embed-body {
  padding: 24px 32px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.s-iframe-mock__lesson {
  background: var(--ink-0);
  border: 1px solid var(--ink-150);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  gap: 14px;
}
.s-iframe-mock__lesson-num {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: oklch(0.94 0.06 295);
  color: oklch(0.40 0.16 295);
  display: grid; place-items: center;
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 16px;
  flex: none;
}
.s-iframe-mock__lesson-title { font-size: 14px; font-weight: 500; color: var(--ink-900); }
.s-iframe-mock__lesson-meta { font-size: 12px; color: var(--ink-500); margin-top: 3px; }

/* Env action bar (icon-only group) */
.s-env-iconbar {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  background: var(--ink-50);
  border: 1px solid var(--ink-150);
  border-radius: 8px;
  margin-right: 8px;
}
.s-env-iconbar__sep {
  width: 1px;
  height: 16px;
  background: var(--ink-200);
  margin: 0 4px;
}
.s-env-iconbtn {
  width: 30px; height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  color: var(--ink-600);
  background: transparent;
  border: none;
  transition: all 0.12s;
}
.s-env-iconbtn:hover {
  background: var(--ink-0);
  color: var(--brand-600);
  box-shadow: var(--shadow-sm);
}
.s-env-iconbtn--record { color: var(--danger-500); }
.s-env-iconbtn--record:hover { color: var(--danger-500); background: var(--danger-50); box-shadow: none; }
.s-env-iconbtn--warn:hover { color: oklch(0.50 0.16 50); }

/* env unavailable inline tip */
.s-detect-tip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  font-size: 11.5px;
  color: var(--ink-400);
}