:root {
  color-scheme:dark;
  --surface-base:#0c0e12;
  --surface:#11141a;
  --surface-raised:#171c25;
  --control:#191f2a;
  --control-hover:#232d3d;
  --line:#292f3b;
  --control-line:#3a465a;
  --ink:#edf2fb;
  --muted:#a6b2c5;
  --soft:#8b9bb2;
  --blue:#a8caff;
  --blue-tint:#1b2a44;
  --blue-button:#2b5dc5;
  --blue-button-hover:#3168d4;
  --focus:#83aeff;
  --warning:#ffcb87;
  --sidebar:188px;
  font-family:"Inter","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  font-size:16px;
}

*,*::before,*::after {
  box-sizing:border-box;
}

body {
  margin:0;
  background:var(--surface-base);
  color:var(--ink);
  font-size:.9375rem;
}

a {
  color:inherit;
  text-decoration:none;
}

button,input,select {
  font:inherit;
}

button {
  cursor:pointer;
}

button:disabled {
  cursor:default;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible {
  outline:2px solid var(--focus);
  outline-offset:3px;
}

[hidden] {
  display:none!important;
}

.icon {
  width:18px;
  height:18px;
  display:block;
  flex:none;
}

button {
  color:inherit;
}

h2,p {
  margin:0;
}

.sidebar {
  width:var(--sidebar);
  position:fixed;
  inset:0 auto 0 0;
  display:flex;
  flex-direction:column;
  padding:29px 15px 16px;
  background:linear-gradient(180deg,#141d2b,#101620 55%);
  border-right:1px solid var(--line);
  color:var(--ink);
  z-index:2;
}

.brand {
  display:flex;
  gap:11px;
  align-items:center;
  margin:0 6px 38px;
  white-space:nowrap;
}

.brand strong {
  font-size:1.125rem;
  letter-spacing:.025em;
}

.nav-caption {
  font-size:.75rem;
  letter-spacing:.13em;
  color:var(--soft);
  margin:0 10px 10px;
}

.navigation a {
  height:44px;
  display:flex;
  align-items:center;
  gap:11px;
  border-radius:8px;
  padding:0 12px;
  color:var(--muted);
  font-size:.875rem;
}

.navigation a:hover {
  background:var(--control-hover);
  color:var(--ink);
}

.navigation a[aria-current] {
  color:var(--ink);
  background:var(--blue-tint);
  box-shadow:inset 3px 0 0 var(--focus);
}

.navigation a[aria-current] .icon {
  color:var(--blue);
}

.workspace {
  margin-left:var(--sidebar);
  min-width:0;
}

.topbar {
  min-height:60px;
  padding:0 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:var(--surface);
  border-bottom:1px solid var(--line);
}

.view-tabs {
  min-width:0;
}

#view-tabs {
  display:flex;
  gap:6px;
}

.view-tabs a {
  display:grid;
  place-items:center;
  min-height:59px;
  padding:0 12px;
  border-bottom:2px solid transparent;
  color:var(--muted);
  white-space:nowrap;
  font-size:.875rem;
  font-weight:600;
}

.view-tabs a:hover {
  color:var(--blue);
}

.view-tabs a[aria-selected="true"] {
  border-bottom-color:currentColor;
  color:var(--blue);
}

.view-tabs a:focus-visible {
  outline-offset:-4px;
}

.top-status {
  border:1px solid var(--control-line);
  border-radius:7px;
  background:var(--control);
  display:flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  font-size:.8125rem;
  white-space:nowrap;
  color:var(--muted);
}

.top-status:hover {
  background:var(--control-hover);
}

.top-actions {
  display:flex;
  flex:none;
  align-items:center;
  gap:8px;
}

.button.manual-button {
  background:var(--blue-button);
  border-color:var(--blue-button);
  color:#fff;
}

.button.manual-button:hover:not(:disabled) {
  background:var(--blue-button-hover);
  border-color:var(--blue-button-hover);
  color:#fff;
}

.manual-dialog {
  max-width:420px;
}

.manual-password {
  display:block;
  margin-bottom:6px;
  font-weight:600;
}

#manual-token {
  width:100%;
  border:1px solid var(--control-line);
  background:var(--control);
  color:var(--ink);
  border-radius:7px;
  padding:9px 10px;
}

.top-status .icon {
  width:14px;
  height:14px;
}

.signal {
  width:7px;
  height:7px;
  border-radius:50%;
  background:#8b9bb0;
}

.signal.good {
  background:#44d4a4;
  box-shadow:0 0 0 3px #44d4a427;
}

.signal.warn {
  background:#ffc078;
  box-shadow:0 0 0 3px #ffc07827;
}

.content {
  margin:0 auto;
  padding:20px 24px 24px;
  max-width:1640px;
}

.notice {
  background:#231b13;
  color:var(--warning);
  border:1px solid #5d462e;
  border-radius:8px;
  padding:11px 14px;
  margin:0 0 12px;
  font-size:.875rem;
  line-height:1.5;
}

.manual-notice[data-status="running"] {
  background:var(--blue-tint);
  border-color:#384c72;
  color:var(--blue);
}

.manual-notice[data-status="ok"] {
  background:#142821;
  border-color:#305b49;
  color:#9ce7c7;
}

.manual-progress-heading {
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:4px 12px;
}

#manual-elapsed {
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}

#manual-progress {
  display:block;
  width:100%;
  height:7px;
  margin-top:9px;
  accent-color:var(--focus);
}

.metrics {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:15px;
  margin:0 0 16px;
}

.metric {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:12px;
  display:flex;
  align-items:flex-start;
  gap:12px;
  min-width:0;
  padding:17px 14px;
}

.metric-icon {
  display:grid;
  place-items:center;
  flex:none;
  width:36px;
  height:36px;
  border-radius:9px;
}

.metric-icon .icon {
  width:18px;
  height:18px;
}

.blue {
  color:var(--blue);
  background:var(--blue-tint);
}

.teal {
  color:#82e4cf;
  background:#15322f;
}

.violet {
  color:#cfb4ff;
  background:#2b2341;
}

.amber {
  color:var(--warning);
  background:#362a1e;
}

.metric-label {
  color:var(--muted);
  font-size:.8125rem;
  line-height:1.4;
}

.metric-value {
  font-weight:740;
  font-size:1.63rem;
  letter-spacing:-.045em;
  margin:3px 0;
  line-height:1.25;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere;
}

.panel {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:13px;
  overflow:hidden;
}

.panel-heading {
  display:flex;
  gap:14px;
  justify-content:space-between;
  align-items:center;
  padding:19px 20px 15px;
}

.panel-heading h2 {
  display:flex;
  gap:9px;
  align-items:center;
  font-size:1.12rem;
  font-weight:735;
}

#calendar-view .panel-heading {
  justify-content:flex-end;
}

.count-badge {
  font-size:.75rem;
  background:var(--blue-tint);
  color:var(--blue);
  border-radius:20px;
  padding:2px 8px;
  font-weight:630;
}

.button,.select-wrap select,.search {
  background:var(--control);
  border:1px solid var(--control-line);
  border-radius:7px;
  min-height:37px;
}

.button {
  display:inline-flex;
  align-items:center;
  gap:6px;
  justify-content:center;
  padding:0 11px;
  white-space:nowrap;
  font-size:.8125rem;
  font-weight:600;
}

.button:hover:not(:disabled) {
  background:var(--control-hover);
  border-color:var(--focus);
  color:var(--blue);
}

.button:disabled {
  opacity:.5;
}

.button .icon {
  width:15px;
  height:15px;
}

.filters {
  display:flex;
  gap:9px;
  align-items:center;
  padding:0 20px 16px;
  flex-wrap:wrap;
}

.search {
  flex:1 1 215px;
  max-width:355px;
  color:var(--soft);
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 10px;
}

.search .icon,.select-wrap .icon {
  width:15px;
  height:15px;
}

.search:focus-within {
  outline:2px solid var(--focus);
}

.search input {
  height:35px;
  flex:1;
  min-width:0;
  width:100%;
  border:0;
  background:transparent;
  outline:0;
  color:var(--ink);
  font-size:.875rem;
}

.search input:focus-visible {
  outline:0;
}

.search input::placeholder {
  color:var(--soft);
}

.select-wrap {
  position:relative;
  display:inline-flex;
  align-items:center;
}

.select-wrap select {
  appearance:none;
  color:var(--ink);
  padding:0 30px 0 10px;
  cursor:pointer;
  font-size:.8125rem;
  max-width:190px;
}

.select-wrap>span {
  position:absolute;
  right:9px;
  color:var(--soft);
  pointer-events:none;
}

.table-scroll {
  overflow:auto;
}

table {
  width:100%;
  border-spacing:0;
  min-width:720px;
  text-align:left;
}

thead {
  background:var(--surface-raised);
}

th {
  font-size:.8125rem;
  font-weight:600;
  color:var(--muted);
  padding:12px 10px;
  white-space:nowrap;
  border-block:1px solid var(--line);
}

td {
  padding:12px 10px;
  border-bottom:1px solid var(--line);
  vertical-align:middle;
  font-size:.875rem;
}

th:first-child,td:first-child {
  padding-left:20px;
}

th:last-child,td:last-child {
  padding-right:20px;
}

tr:last-child td {
  border-bottom:0;
}

tbody tr:hover {
  background:var(--surface-raised);
}

.product-cell {
  display:flex;
  align-items:center;
  gap:12px;
  min-width:255px;
}

.course-cover {
  width:84px;
  aspect-ratio:16/9;
  border:1px solid var(--control-line);
  border-radius:8px;
  overflow:hidden;
  display:grid;
  grid-template: minmax(0,1fr) / minmax(0,1fr);
  place-items:center;
  color:var(--blue);
  background:var(--blue-tint);
  flex:none;
}

.course-cover img {
  width:100%;
  height:100%;
  object-fit:cover;
  grid-area:1/1;
  background:var(--surface-base);
}

.course-cover .icon {
  grid-area:1/1;
}

.product-name {
  color:var(--ink);
  font-weight:670;
  text-align:left;
  background:none;
  border:0;
  padding:0;
  font-size:.875rem;
  line-height:1.45;
}

.product-name:hover .product-title,.link-button:hover {
  color:var(--blue);
  text-decoration:underline;
  text-underline-offset:2px;
}

.product-name:hover .course-cover,.product-name:focus-visible .course-cover {
  border-color:var(--focus);
}

.product-category {
  display:block;
  margin-top:4px;
  font-size:.75rem;
  color:var(--muted);
}

.hover-preview {
  position:fixed;
  z-index:5;
  inset:0 auto auto 0;
  width:max-content;
  max-width:min(284px,var(--preview-width,284px));
  overflow:hidden;
  border:1px solid var(--control-line);
  border-radius:12px;
  background:var(--surface-raised);
  color:var(--ink);
  box-shadow:0 12px 32px #0008,0 2px 8px #0005;
  pointer-events:none;
}

.hover-preview:has(img) {
  width:min(284px,var(--preview-width,284px));
}

.hover-preview img {
  display:block;
  width:100%;
  aspect-ratio:16/9;
  max-height:142px;
  object-fit:contain;
  background:var(--surface-base);
  border-bottom:1px solid var(--line);
}

.hover-preview-body {
  display:grid;
  gap:6px;
  padding:11px 13px 13px;
}

.hover-preview-type {
  display:flex;
  align-items:center;
  gap:6px;
  color:var(--preview-accent,var(--blue));
  font-size:.7rem;
  font-weight:650;
}

.hover-preview-type::before {
  content:"";
  width:6px;
  height:6px;
  border-radius:50%;
  background:currentColor;
}

.hover-preview-title,.hover-preview-meta {
  display:-webkit-box;
  -webkit-box-orient:vertical;
  overflow:hidden;
  overflow-wrap:anywhere;
}

.hover-preview-title {
  -webkit-line-clamp:3;
  font-size:.875rem;
  line-height:1.45;
}

.hover-preview-meta {
  -webkit-line-clamp:2;
  color:var(--muted);
  font-size:.75rem;
  line-height:1.45;
}

.price {
  font-weight:700;
  color:var(--blue);
  white-space:nowrap;
}

.old-price {
  display:block;
  color:var(--muted);
  font-size:.75rem;
  text-decoration:line-through;
  margin-top:2px;
}

.unknown {
  color:var(--muted);
  font-size:.8125rem;
  white-space:nowrap;
}

.teacher-cell {
  max-width:200px;
  overflow-wrap:anywhere;
}

.pill {
  background:var(--control);
  color:var(--muted);
  border-radius:5px;
  padding:4px 7px;
  font-size:.75rem;
  white-space:nowrap;
}

.link-button {
  background:none;
  border:0;
  padding:4px 0;
  color:var(--blue);
  font-weight:620;
  white-space:nowrap;
  font-size:.8125rem;
}

.empty-cell,.empty {
  padding:35px 20px!important;
  text-align:center;
  color:var(--muted);
  line-height:1.65;
}

.panel-footer {
  padding:12px 20px;
  border-top:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  color:var(--muted);
  font-size:.8125rem;
}

.pagination {
  display:flex;
  align-items:center;
  gap:9px;
  white-space:nowrap;
}

.pagination button {
  width:29px;
  height:29px;
  border-radius:6px;
  background:var(--control);
  border:1px solid var(--control-line);
  display:grid;
  place-items:center;
  padding:0;
}

.pagination button:not(:disabled):hover {
  border-color:var(--focus);
  background:var(--control-hover);
  color:var(--blue);
}

.pagination button:disabled {
  color:var(--soft);
  opacity:.6;
}

.pagination .icon {
  width:15px;
  height:15px;
}

.panel-heading + .calendar-list {
  border-top:1px solid var(--line);
}

.calendar-date {
  margin:0;
  padding:9px 20px;
  background:var(--surface-raised);
  color:var(--muted);
  font-size:.875rem;
}

.timeline-row {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:13px 20px;
  border-bottom:1px solid var(--line);
  font-size:.875rem;
}

.timeline-row:last-child {
  border-bottom:0;
}

.timeline-row small {
  display:block;
  color:var(--muted);
  margin-top:4px;
  font-size:.8125rem;
}

.timeline-row strong {
  font-weight:670;
}

.timeline-row .event-data {
  display:flex;
  align-items:center;
  gap:10px;
  line-height:1.5;
}

.timeline-row .event-tag {
  color:var(--blue);
  background:var(--blue-tint);
  padding:3px 7px;
  border-radius:5px;
  flex:none;
  font-size:.75rem;
}

.timeline-row .event-time {
  color:var(--muted);
  white-space:nowrap;
}

.calendar-more {
  padding:12px 20px;
  display:flex;
  justify-content:center;
}

.details {
  width:min(735px,calc(100% - 24px));
  max-height:calc(100% - 28px);
  border:1px solid var(--line);
  border-radius:15px;
  padding:0;
  color:var(--ink);
  background:var(--surface);
  box-shadow:0 18px 80px #0009;
  overflow:auto;
}

.details::backdrop {
  background:#05070dbb;
}

.details-top {
  background:var(--surface-raised);
  border-bottom:1px solid var(--line);
  padding:20px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}

.details-top h2 {
  font-size:1.3rem;
  margin:5px 0 7px;
  line-height:1.4;
}

.details-top p {
  font-size:.8125rem;
  color:var(--muted);
}

.product-summary {
  display:flex;
  align-items:center;
  gap:16px;
  min-width:0;
}

.product-summary h2 {
  overflow-wrap:anywhere;
}

.details-cover {
  width:clamp(120px,25vw,200px);
  aspect-ratio:16/9;
  flex:none;
  object-fit:contain;
  border:1px solid var(--control-line);
  border-radius:9px;
  background:var(--surface-base);
}

.close-button {
  display:grid;
  place-items:center;
  border:1px solid var(--control-line);
  background:var(--control);
  border-radius:7px;
  width:34px;
  height:34px;
  flex:none;
  padding:0;
}

.close-button:hover {
  background:var(--control-hover);
}

.details-body {
  padding:18px 20px;
}

.details-meta {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin:0;
}

.details-meta>div {
  padding:10px 11px;
  border-radius:7px;
  border:1px solid var(--line);
  min-width:0;
}

.details-meta dt {
  font-size:.8125rem;
  color:var(--muted);
}

.details-meta dd {
  margin:4px 0 0;
  line-height:1.45;
  font-weight:650;
  overflow-wrap:anywhere;
}

.details-actions {
  display:flex;
  gap:8px;
  margin:15px 0;
  flex-wrap:wrap;
}

.details-section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:18px 0 10px;
}

.details-section-heading h3 {
  font-size:1rem;
  margin:0;
}

.details-section-heading span {
  font-size:.8125rem;
  color:var(--muted);
}

.lesson-row {
  display:grid;
  grid-template-columns:25px minmax(0,1fr) auto;
  gap:8px;
  padding:9px 0;
  border-top:1px solid var(--line);
  align-items:center;
  font-size:.875rem;
}

.lesson-row small {
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:.8125rem;
}

.lesson-index {
  font-variant-numeric:tabular-nums;
  color:var(--soft);
  align-self:start;
}

.details-warning {
  color:var(--warning);
  font-size:.8125rem;
  margin:9px 0;
  line-height:1.5;
}

.description {
  color:var(--muted);
  line-height:1.6;
  font-size:.875rem;
  overflow-wrap:anywhere;
}

@media(max-width:1080px) {
  :root {
    --sidebar:154px;
  }

  .content,.topbar {
    padding-inline:16px;
  }

  .metrics {
    gap:9px;
  }

  .metric {
    padding:13px 10px;
    gap:8px;
  }

  .metric-icon {
    width:31px;
    height:31px;
  }

  .metric-icon .icon {
    width:16px;
    height:16px;
  }

}

@media(max-width:850px) {
  .metrics {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .course-cover {
    width:72px;
  }

}

@media(max-width:780px) {
  .sidebar {
    width:auto;
    position:static;
    border-right:0;
    border-bottom:1px solid var(--line);
    flex-direction:row;
    justify-content:space-between;
    align-items:center;
    gap:8px;
    padding:8px 12px;
  }

  .brand {
    margin:0;
    gap:8px;
  }

  .brand img {
    width:29px;
    height:29px;
  }

  .brand strong {
    font-size:.95rem;
  }

  .nav-caption {
    display:none;
  }

  .navigation a {
    height:33px;
    padding:0 9px;
    gap:6px;
    font-size:.8125rem;
    white-space:nowrap;
  }

  .navigation .icon {
    width:15px;
    height:15px;
  }

  .workspace {
    margin:0;
  }

  .topbar {
    min-height:0;
    padding:0 12px;
  }

  .view-tabs a {
    min-height:44px;
    padding-inline:8px;
    font-size:.8125rem;
  }
}

@media(max-width:665px) {
  .content {
    padding:12px;
  }

  .metric-value {
    font-size:1.33rem;
  }

  .panel-heading,.panel-footer {
    padding-inline:12px;
  }

  .panel-heading {
    align-items:flex-start;
  }

  .filters {
    padding-inline:12px;
  }

  .search {
    max-width:none;
    flex-basis:100%;
  }

  .timeline-row {
    padding-inline:12px;
    align-items:flex-start;
    flex-wrap:wrap;
  }

  .timeline-row .event-data {
    flex-wrap:wrap;
  }

  .details-meta {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .details-body,.details-top {
    padding-inline:13px;
  }

}

@media(max-width:560px) {
  .topbar {
    flex-wrap:wrap;
    gap:0;
    padding-bottom:8px;
  }

  .view-tabs {
    flex-basis:100%;
  }

  #view-tabs {
    justify-content:space-between;
    gap:0;
  }

  .top-actions {
    margin-left:auto;
    margin-top:6px;
  }
}

@media(max-width:665px) {
  .table-scroll {
    overflow:visible;
  }

  table,tbody {
    display:block;
    min-width:0;
  }

  thead {
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip-path:inset(50%);
  }

  tbody tr {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:3px 9px;
    padding:9px 10px 6px;
    border:1px solid var(--line);
    border-radius:8px;
    margin:0 12px 9px;
  }

  tbody td,tbody td:first-child,tbody td:last-child {
    border:0;
    padding:6px 0;
    max-width:none;
  }

  tbody td:first-child {
    grid-column:1/-1;
  }

  .product-cell {
    min-width:0;
  }

  td[data-label]::before {
    content:attr(data-label);
    display:block;
    color:var(--muted);
    font-size:.75rem;
    margin-bottom:3px;
  }

  tbody td:last-child:not(:first-child) {
    justify-self:end;
    align-self:end;
  }

}

@media(max-width:480px) {
  .product-summary {
    flex-direction:column;
    align-items:flex-start;
    gap:11px;
  }

  .details-cover {
    width:min(200px,100%);
  }
}
