/* 梦想家魔方 · 魔方作战基地（仅电脑端） */
@media (min-width: 769px) {
  body.desktop-base-active {
    --base-page: #f6f1e7;
    --base-panel: #fffdf8;
    --base-line: #e8ddca;
    --base-text: #3f392f;
    --base-muted: #8d8271;
    --base-paper: #fffdf8;
    --base-orange: #f5a623;
    --base-orange-soft: #f7b84b;
    --base-green: #35ad76;
    background: var(--base-page);
  }

  body.desktop-base-active .sidebar {
    background: #081522;
    border-right: 1px solid #294158;
    box-shadow: 12px 0 40px rgba(0, 0, 0, .18);
  }

  body.desktop-base-active .sidebar .logo {
    color: var(--base-orange);
    border-bottom-color: #294158;
    letter-spacing: .04em;
  }

  body.desktop-base-active .sidebar nav a {
    color: #8fa6b9;
    border-radius: 2px;
  }

  body.desktop-base-active .sidebar nav a:hover {
    color: #e6eef4;
    background: rgba(72, 103, 130, .18);
  }

  body.desktop-base-active .sidebar nav a.active {
    color: #fff;
    background: #173049;
    box-shadow: inset 3px 0 0 var(--base-orange);
  }

  body.desktop-base-active .main {
    background: var(--base-page);
  }

  body.desktop-base-active .header {
    min-height: 70px;
    color: var(--base-text);
    background: rgba(255, 253, 248, .96);
    border-bottom: 1px solid var(--base-line);
    box-shadow: none;
    backdrop-filter: blur(16px);
  }

  body.desktop-base-active .header h1 {
    color: var(--base-text);
    font-family: "Avenir Next Condensed", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 20px;
    letter-spacing: .06em;
  }

  body.desktop-base-active .page-subtitle { color: var(--base-muted); }
  body.desktop-base-active .notify-bell { background: #fffaf0; border-color: var(--base-line); }
  body.desktop-base-active .content {
    display: block;
    padding: 0;
    overflow: auto;
    background: transparent;
  }

  .desktop-base {
    position: relative;
    min-height: calc(100vh - 70px);
    padding: 24px 28px 26px;
    color: var(--base-text, #3f392f);
    font-family: "Avenir Next Condensed", "PingFang SC", "Microsoft YaHei", sans-serif;
    overflow: hidden;
    isolation: isolate;
  }

  .desktop-base::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
      linear-gradient(116deg, transparent 0 68%, rgba(245, 166, 35, .075) 68% 68.14%, transparent 68.14%),
      radial-gradient(circle at 50% 56%, rgba(129, 150, 163, .11), transparent 34%);
  }

  .desktop-base__intro {
    position: relative;
    z-index: 4;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 0 2px 18px;
  }

  .desktop-base__eyebrow {
    margin: 0 0 6px;
    color: var(--base-orange, #f5a623);
    font: 700 10px/1 "DIN Condensed", "Avenir Next Condensed", sans-serif;
    letter-spacing: .24em;
  }

  .desktop-base__intro h2 {
    margin: 0 0 5px;
    color: var(--base-text, #3f392f);
    font-size: clamp(23px, 2.2vw, 30px);
    font-weight: 800;
    letter-spacing: .04em;
  }

  .desktop-base__intro p:last-child {
    margin: 0;
    color: var(--base-muted, #8d8271);
    font-size: 12px;
  }

  .desktop-base__state {
    position: relative;
    min-width: 218px;
    padding: 10px 14px 10px 34px;
    border: 1px solid var(--base-line, #e8ddca);
    background: rgba(255, 253, 248, .9);
    box-shadow: 0 6px 18px rgba(92, 72, 43, .055);
  }

  .desktop-base__state > span {
    position: absolute;
    top: 16px;
    left: 14px;
    width: 7px;
    height: 7px;
    background: var(--base-green, #35ad76);
    box-shadow: 0 0 9px rgba(53, 173, 118, .42);
  }

  .desktop-base__state strong,
  .desktop-base__state small { display: block; }
  .desktop-base__state strong { color: var(--base-text, #3f392f); font-size: 12px; letter-spacing: .05em; }
  .desktop-base__state small { margin-top: 3px; color: var(--base-muted, #8d8271); font-size: 9px; }

  .desktop-base__board {
    position: relative;
    width: 100%;
    min-height: 520px;
    height: calc(100vh - 212px);
    max-height: 700px;
    overflow: hidden;
    border: 1px solid var(--base-line, #e8ddca);
    background: var(--base-panel, #fffdf8);
    box-shadow: inset 0 0 90px rgba(172, 145, 101, .045), 0 18px 42px rgba(92, 72, 43, .08);
    animation: desktop-base-arrive 180ms ease-out both;
  }

  .desktop-base__board::before,
  .desktop-base__board::after {
    content: "";
    position: absolute;
    pointer-events: none;
  }

  .desktop-base__board::before {
    inset: 18px;
    border: 1px dashed rgba(129, 150, 163, .3);
    clip-path: polygon(8% 0, 92% 0, 100% 14%, 100% 86%, 92% 100%, 8% 100%, 0 86%, 0 14%);
  }

  .desktop-base__board::after {
    top: 20px;
    left: 20px;
    width: 58px;
    height: 14px;
    border-top: 2px solid var(--base-orange, #f5a623);
    border-left: 2px solid var(--base-orange, #f5a623);
  }

  .desktop-base__grid {
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: -42%;
    height: 84%;
    opacity: .34;
    transform: perspective(460px) rotateX(58deg);
    transform-origin: center top;
    background-image:
      linear-gradient(rgba(129, 150, 163, .24) 1px, transparent 1px),
      linear-gradient(90deg, rgba(129, 150, 163, .24) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 76%, transparent);
  }

  .desktop-base__orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(52vw, 670px);
    height: min(28vw, 350px);
    border: 1px solid rgba(129, 150, 163, .42);
    transform: translate(-50%, -50%) rotate(-4deg);
    clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  }

  .desktop-base__orbit::before,
  .desktop-base__orbit::after {
    content: "";
    position: absolute;
    background: var(--base-orange, #f5a623);
  }

  .desktop-base__orbit::before { top: -2px; left: 49%; width: 18px; height: 3px; }
  .desktop-base__orbit::after { right: -2px; top: 49%; width: 3px; height: 18px; }

  .desktop-base__core {
    position: absolute;
    top: 47%;
    left: 50%;
    z-index: 3;
    width: 172px;
    height: 172px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    color: #081522;
  }

  .desktop-base__core::before {
    content: "";
    position: absolute;
    inset: 20px;
    background: #3b4a57;
    border: 2px solid #93a4ae;
    transform: rotate(30deg);
    box-shadow: 15px 15px 0 rgba(63, 57, 47, .16), 0 0 30px rgba(245, 166, 35, .13);
  }

  .desktop-base__cube {
    position: relative;
    z-index: 2;
    width: 72px;
    height: 72px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 3px;
    padding: 8px;
    background: var(--base-orange, #f5a623);
    box-shadow: 0 0 26px rgba(245, 166, 35, .25);
    transform: rotate(-5deg);
  }

  .desktop-base__cube::before,
  .desktop-base__cube::after,
  .desktop-base__cube i {
    content: "";
    display: block;
    background: #10243a;
    border: 1px solid rgba(255,255,255,.2);
  }

  .desktop-base__cube::before { grid-column: 1; grid-row: 1; }
  .desktop-base__cube::after { grid-column: 3; grid-row: 3; }
  .desktop-base__cube i:nth-child(1) { grid-column: 2; grid-row: 1; }
  .desktop-base__cube i:nth-child(2) { grid-column: 1 / 3; grid-row: 2 / 4; }
  .desktop-base__cube i:nth-child(3) { grid-column: 3; grid-row: 1 / 3; }

  .desktop-base__core strong,
  .desktop-base__core small { position: relative; z-index: 3; }
  .desktop-base__core strong { margin-top: 7px; color: #f8c76f; font: 900 15px/1 "DIN Condensed", sans-serif; letter-spacing: .16em; }
  .desktop-base__core small { margin-top: 4px; color: #d6dfe4; font-size: 9px; letter-spacing: .1em; }

  .desktop-base__node {
    --node-accent: #65b3f3;
    position: absolute;
    z-index: 4;
    width: 184px;
    min-height: 82px;
    padding: 25px 42px 12px 14px;
    overflow: visible;
    color: var(--base-text, #3f392f);
    text-align: left;
    font-family: inherit;
    background: var(--base-panel, #fffdf8);
    border: 1px solid var(--base-line, #e8ddca);
    border-radius: 0;
    box-shadow: 7px 8px 0 rgba(113, 91, 56, .08);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  }

  .desktop-base__node::before {
    content: "";
    position: absolute;
    top: 10px;
    right: 12px;
    width: 8px;
    height: 42px;
    background: var(--node-accent);
    box-shadow: 0 0 10px color-mix(in srgb, var(--node-accent), transparent 62%);
  }

  .desktop-base__node::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 42px;
    height: 8px;
    border-top: 2px solid var(--base-orange, #f5a623);
    border-left: 2px solid var(--base-orange, #f5a623);
  }

  .desktop-base__node > span,
  .desktop-base__node > small { display: block; }
  .desktop-base__node > span { font-size: 14px; font-weight: 800; letter-spacing: .04em; }
  .desktop-base__node > small { margin-top: 5px; color: var(--base-muted, #8d8271); font-size: 9px; letter-spacing: .08em; }
  .desktop-base__node > i {
    position: absolute;
    right: 14px;
    bottom: 10px;
    width: 5px;
    height: 5px;
    background: var(--base-orange, #f5a623);
    box-shadow: -9px 0 0 rgba(245,166,35,.45), -18px 0 0 rgba(245,166,35,.2);
  }

  .desktop-base__node:hover {
    z-index: 6;
    color: var(--base-text, #3f392f);
    border-color: var(--base-orange-soft, #f7b84b);
    background: #fffaf1;
    box-shadow: 8px 9px 0 rgba(113, 91, 56, .1), 0 12px 24px rgba(92, 72, 43, .08);
    transform: translateY(-3px);
  }

  .desktop-base__node:focus-visible {
    outline: 2px solid var(--base-orange, #f5a623);
    outline-offset: 4px;
  }

  .desktop-base__node--schedule { top: 9%; left: 2%; --node-accent: #62aef2; }
  .desktop-base__node--timetable { top: 9%; right: 2%; --node-accent: #3dd3cc; }
  .desktop-base__node--students { top: 43%; right: 1.5%; --node-accent: #f5a623; }
  .desktop-base__node--teachers { top: 43%; left: 1.5%; --node-accent: #4bd48b; }
  .desktop-base__node--analytics { bottom: 8%; left: 2%; --node-accent: #62aef2; }
  .desktop-base__node--settings { right: 2%; bottom: 8%; --node-accent: #ff6058; }

  .desktop-base__hub {
    position: absolute;
    z-index: 3;
    top: 18px;
    right: 204px;
    bottom: 50px;
    left: 204px;
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    background: #fbf7ef;
    border: 1px solid #d9c9ae;
    box-shadow: 0 14px 32px rgba(74, 56, 31, .12), inset 0 0 0 5px rgba(255, 253, 248, .58);
  }

  .desktop-base__hub::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 76px;
    height: 7px;
    background: var(--base-orange, #f5a623);
  }

  .desktop-base__hub-head {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 11px 15px 9px;
    border-bottom: 1px solid #e4d7c3;
    background: rgba(255, 253, 248, .86);
  }

  .desktop-base__hub-head div { display: flex; align-items: baseline; gap: 9px; }
  .desktop-base__hub-head small { color: #c27a24; font: 800 8px/1 "DIN Condensed", sans-serif; letter-spacing: .16em; }
  .desktop-base__hub-head strong { color: var(--base-text); font-size: 15px; letter-spacing: .05em; }
  .desktop-base__hub-head > span { color: var(--base-muted); font-size: 9px; font-variant-numeric: tabular-nums; }

  .desktop-base__hub-body {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    gap: 9px;
    padding: 11px;
  }

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

  .desktop-base__metrics article {
    position: relative;
    min-width: 0;
    padding: 10px 10px 9px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #eadfce;
    box-shadow: 0 5px 13px rgba(74, 56, 31, .05);
  }

  .desktop-base__metrics article::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 22px;
    height: 3px;
    background: #6daedc;
  }

  .desktop-base__metrics article:nth-child(2)::after { background: #36b8b0; }
  .desktop-base__metrics article:nth-child(3)::after { background: #4ab981; }
  .desktop-base__metrics article.is-warning::after { background: var(--base-orange); }
  .desktop-base__metrics small { display: block; overflow: hidden; color: #847967; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  .desktop-base__metrics strong { display: inline-block; margin-top: 3px; color: #29343b; font-size: clamp(20px, 2vw, 28px); line-height: 1; font-variant-numeric: tabular-nums; }
  .desktop-base__metrics article.is-warning strong { color: #c86d24; }
  .desktop-base__metrics article > span { margin-left: 4px; color: #a39786; font-size: 9px; }

  .desktop-base__panels {
    display: grid;
    min-height: 0;
    flex: 1;
    grid-template-columns: 1.15fr .85fr;
    gap: 9px;
  }

  .desktop-base__panel {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid #eadfce;
  }

  .desktop-base__panel--today { border-top: 2px solid #4e9ed5; }
  .desktop-base__panel--renewal { border-top: 2px solid #d98731; }

  .desktop-base__panel > header {
    display: flex;
    min-height: 62px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px 7px;
    border-bottom: 1px solid #eee3d3;
    background: #fffdf9;
  }

  .desktop-base__panel > header small { color: #9b8e7a; font: 800 7px/1 "DIN Condensed", sans-serif; letter-spacing: .18em; }
  .desktop-base__panel > header h3 { margin: 4px 0 0; color: #40392f; font-size: 12px; }
  .desktop-base__panel > header h3 b { margin-left: 4px; color: #c86d24; font-size: 9px; font-weight: 700; }

  .desktop-base__panel-actions { display: flex; max-width: 76%; flex-direction: column; align-items: flex-end; gap: 4px; }
  .desktop-base__summary-action {
    padding: 4px 8px;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    background: #c86d24;
    border: 1px solid #b95f1e;
    border-radius: 3px;
    cursor: pointer;
  }
  .desktop-base__summary-action:hover { background: #ad571c; }
  .desktop-base__summary-action:focus-visible { outline: 2px solid #263944; outline-offset: 2px; }

  .desktop-base__teacher-filter {
    display: flex;
    max-width: 68%;
    gap: 3px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .desktop-base__teacher-filter button {
    flex: 0 0 auto;
    padding: 3px 7px;
    color: #786d5e;
    font: 600 8px/1.2 inherit;
    background: #fff;
    border: 1px solid #ded2c0;
    border-radius: 10px;
    cursor: pointer;
  }

  .desktop-base__teacher-filter button:hover,
  .desktop-base__teacher-filter button.active {
    color: #fff;
    background: #263944;
    border-color: #263944;
  }

  .desktop-base__teacher-filter button:focus-visible { outline: 2px solid var(--base-orange); outline-offset: 2px; }
  .desktop-base__teacher-filter button:disabled { color: #fff; opacity: 1; cursor: default; background: #263944; border-color: #263944; }

  .desktop-base__panel-body { min-height: 0; flex: 1; overflow: auto; scrollbar-width: thin; }

  .desktop-base__course-row {
    display: grid;
    grid-template-columns: 76px minmax(74px, 1fr) minmax(54px, .8fr) 42px;
    gap: 7px;
    align-items: center;
    padding: 8px 10px;
    color: #766c5d;
    font-size: 9px;
    border-bottom: 1px solid #f1eadf;
  }

  .desktop-base__course-row time { color: #7b6d59; font-variant-numeric: tabular-nums; }
  .desktop-base__course-row strong { overflow: hidden; color: #3f392f; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .desktop-base__course-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .desktop-base__course-row i { padding: 2px 4px; color: #16745b; font-style: normal; text-align: center; background: #e9f7f1; }
  .desktop-base__course-row i.done { color: #55715f; background: #edf3ee; }

  .desktop-base__renewal-row {
    display: grid;
    grid-template-columns: minmax(68px, 1fr) minmax(48px, .7fr) 50px 55px;
    gap: 6px;
    align-items: center;
    padding: 9px 10px;
    color: #7b705f;
    font-size: 9px;
    border-bottom: 1px solid #f1eadf;
  }

  .desktop-base__renewal-row strong { overflow: hidden; color: #3f392f; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .desktop-base__renewal-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .desktop-base__renewal-row i { color: #bf6728; font-style: normal; }
  .desktop-base__renewal-row b { color: #97603a; font-size: 9px; text-align: right; font-variant-numeric: tabular-nums; }
  .desktop-base__renewal-row--expired { background: #fff8f4; }
  .desktop-base__renewal-row--expired i,
  .desktop-base__renewal-row--expired b { color: #bd4d3a; }

  .desktop-base__empty {
    display: grid;
    min-height: 112px;
    place-items: center;
    color: #998d7b;
    font-size: 10px;
  }

  .desktop-base__skeleton > span,
  .desktop-base__skeleton.desktop-base__panels > span {
    min-height: 64px;
    background: linear-gradient(100deg, #f0e8dc 20%, #fbf7ef 42%, #f0e8dc 64%);
    background-size: 240% 100%;
    border: 1px solid #eadfce;
    animation: desktop-hub-pulse 1.1s ease-in-out infinite;
  }

  .desktop-base__skeleton.desktop-base__panels > span { min-height: 220px; }

  .desktop-base__error {
    display: flex;
    min-height: 260px;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #8b7e6c;
    text-align: center;
  }

  .desktop-base__error > span { color: #c56b2b; font: 800 8px/1 "DIN Condensed", sans-serif; letter-spacing: .2em; }
  .desktop-base__error h3 { margin: 8px 0 4px; color: #4b4236; font-size: 16px; }
  .desktop-base__error p { max-width: 360px; margin: 0; font-size: 10px; }
  .desktop-base__error button { margin-top: 13px; padding: 7px 14px; color: #fff; background: #263944; border: 0; cursor: pointer; }
  .desktop-base__error button:focus-visible { outline: 2px solid var(--base-orange); outline-offset: 3px; }

  .desktop-base__legend {
    position: absolute;
    bottom: 17px;
    left: 18px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 8px 11px;
    color: var(--base-muted, #8d8271);
    font-size: 9px;
    background: rgba(255, 253, 248, .9);
    border-left: 3px solid var(--base-orange, #f5a623);
  }

  .desktop-base__legend span { display: flex; align-items: center; gap: 7px; }
  .desktop-base__legend span i { width: 7px; height: 7px; background: var(--base-green, #35ad76); box-shadow: 0 0 7px rgba(53,173,118,.45); }
  .desktop-base__legend b { color: var(--base-text, #3f392f); font-weight: 600; }

  .desktop-lazy-loading,
  .desktop-lazy-error {
    min-height: calc(100vh - 145px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #7c8ba0;
    text-align: center;
  }

  .desktop-lazy-loading small { color: #a0a9b7; }
  .desktop-lazy-spinner {
    width: 34px;
    height: 34px;
    margin-bottom: 7px;
    border: 2px solid rgba(245, 166, 35, .16);
    border-top-color: #f5a623;
    border-radius: 50%;
    animation: desktop-spin .7s linear infinite;
  }

  .desktop-lazy-error__code { color: #d97706; font: 800 10px/1 "DIN Condensed", sans-serif; letter-spacing: .2em; }
  .desktop-lazy-error h3 { margin: 3px 0; color: #334155; font-size: 18px; }
  .desktop-lazy-error p { max-width: 520px; margin: 0 0 8px; color: #8490a4; font-size: 12px; }
  .desktop-lazy-error .btn + .btn { margin-left: 4px; }

  @keyframes desktop-spin { to { transform: rotate(360deg); } }
  @keyframes desktop-hub-pulse { from { background-position: 100% 0; } to { background-position: -100% 0; } }
  @keyframes desktop-base-arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

  @media (max-width: 1120px) {
    .desktop-base { padding-inline: 18px; }
    .desktop-base__board { min-height: 560px; }
    .desktop-base__node { width: 132px; min-height: 68px; padding: 21px 30px 9px 11px; }
    .desktop-base__node > span { font-size: 12px; }
    .desktop-base__node > small { font-size: 8px; }
    .desktop-base__hub { right: 146px; left: 146px; }
    .desktop-base__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .desktop-base__panels { grid-template-columns: 1fr; overflow: auto; }
    .desktop-base__panel { min-height: 180px; }
    .desktop-base__teacher-filter { max-width: 62%; }
  }

  @media (prefers-reduced-motion: reduce) {
    .desktop-base__board { animation: none; }
    .desktop-base__node { transition: none; }
    .desktop-lazy-spinner { animation: none; }
    .desktop-base__skeleton > span { animation: none; }
  }
}
