/* 手机上一门课的浮层（mcourse.js）：底部一组按钮、改名的小窗口。尺寸照样式稿 docs/mockups/course-nav/ 第 2.4 节。归 M1。 */
.mco-veil { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .28); animation: mco-fade-in .22s ease; }
.mco-veil.mco-out { animation: mco-fade-out .2s ease forwards; }
.mco-veil.mco-still { animation: none; }
.mco-sheet { position: fixed; left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom, 0px)); z-index: 101; display: flex; flex-direction: column; gap: 8px;
  animation: mco-sheet-in .32s var(--ease-sheet); }
.mco-sheet.mco-out { animation: mco-sheet-out .2s ease forwards; }
.mco-card { border-radius: 14px; background: var(--panel); overflow: hidden; }
.mco-title { padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mco-i { display: grid; place-items: center; width: 100%; height: 56px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none;
  color: var(--tint); font: inherit; font-size: 17px; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mco-i:hover { text-decoration: none; }
.mco-i + .mco-i { border-top: 1px solid var(--line); }
.mco-i:active, .mco-cancel:active { background: var(--soft); }
.mco-cancel { height: 56px; margin: 0; border: 0; border-radius: 14px; background: var(--panel); color: var(--tint); font: inherit; font-size: 17px; font-weight: 600;
  cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mco-alert { position: fixed; left: 50%; top: 36%; z-index: 101; width: min(300px, calc(100vw - 48px)); padding: 18px 16px 0; border-radius: 16px; background: var(--panel);
  text-align: center; transform: translate(-50%, -50%); animation: mco-alert-in .22s ease; }
.mco-alert b { display: block; color: var(--ink); font-size: 17px; font-weight: 600; }
.mco-alert p { margin: 4px 0 12px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
/* 字号 16：不到 16 的话 iOS 聚焦时会把页面放大 */
input.mco-in { display: block; width: 100%; height: 38px; margin: 0; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--panel);
  color: var(--ink); font: inherit; font-size: 16px; outline: none; }
input.mco-in:focus { border-color: var(--tint); box-shadow: 0 0 0 3px var(--tint-soft); }
.mco-btns { display: flex; margin: 16px -16px 0; border-top: 1px solid var(--line); }
.mco-btns button { flex: 1; height: 46px; margin: 0; border: 0; border-radius: 0; background: none; color: var(--tint); font: inherit; font-size: 17px; cursor: pointer; }
.mco-btns button + button { border-left: 1px solid var(--line); font-weight: 600; }
.mco-btns button:active { background: var(--soft); }
@keyframes mco-sheet-in { from { transform: translateY(100%); } }
@keyframes mco-sheet-out { to { transform: translateY(110%); } }
@keyframes mco-fade-in { from { opacity: 0; } }
@keyframes mco-fade-out { to { opacity: 0; } }
@keyframes mco-alert-in { from { opacity: 0; transform: translate(-50%, -50%) scale(1.06); } }
@media (prefers-reduced-motion: reduce) {
  .mco-veil, .mco-sheet, .mco-alert, .mco-veil.mco-out, .mco-sheet.mco-out { animation-duration: 1ms; }
}
/* 左右滑换栏的正文（mcourse.js 的 swipeTabs）：竖着滚交给浏览器，横着拖由页面自己跟手；别让浏览器把横扫当「后退」 */
@media (max-width: 759.98px) {
  .mco-swipe { touch-action: pan-y; overscroll-behavior-x: none; }
}

/* ---------------------------------------------------------------- 课程页顶上一条（mcourse.js 的 phoneTop）：只在手机上有。
   课程目录和课程页不显示网站的助手那一条（side.js 的 .mtop）：页面里带 mco-hidetop 的就藏掉它 */
.mco-top { display: none; }
@media (max-width: 759.98px) {
  .main:has(.mco-hidetop) > .mtop { display: none; }
  .mco-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px; height: 52px; padding: 0 4px;
    padding-left: max(4px, env(safe-area-inset-left, 0px)); padding-right: max(4px, env(safe-area-inset-right, 0px));
    background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); transition: background-color .2s ease; }
  /* 换课面板开着：这一条抬到遮罩和面板上面（胶囊不动），两边的按钮让开 */
  .mco-top:has(.mco-pill.is-open) { z-index: 102; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .mco-top:has(.mco-pill.is-open) .mco-back, .mco-top:has(.mco-pill.is-open) .mco-more { opacity: 0; pointer-events: none; }
  a.mco-back { flex: none; display: inline-flex; align-items: center; width: 84px; height: 44px; padding: 0 4px; color: var(--tint); font-size: 16px; text-decoration: none;
    transition: opacity .2s ease; -webkit-tap-highlight-color: transparent; }
  a.mco-back:hover { text-decoration: none; }
  .mco-back .ic { width: 22px; height: 22px; }
  .mco-mid { flex: 1; min-width: 0; display: flex; justify-content: center; }
  .mco-pill { position: relative; display: inline-flex; align-items: center; max-width: 100%; height: 36px; padding-right: 4px; border-radius: 999px; background: var(--soft); }
  button.mco-pname { min-width: 0; height: 36px; margin: 0; padding: 0 6px 0 14px; border: 0; border-radius: 999px 0 0 999px; background: none; color: var(--ink);
    font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color .15s; }
  button.mco-pname:active { color: var(--muted); }
  .mco-pname span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  button.mco-ptog { flex: none; display: grid; place-items: center; width: 34px; height: 36px; margin: 0; padding: 0; border: 0; background: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent; }
  .mco-pcirc { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e4e4e9; transition: background-color .15s; }
  button.mco-ptog:active .mco-pcirc { background: #d6d6dc; }
  .mco-pcirc .ic { width: 15px; height: 15px; color: var(--text); transition: transform .34s var(--ease-sheet); }
  .mco-pill.is-open .mco-pcirc .ic { transform: rotate(180deg); }
  button.mco-more { flex: none; display: flex; align-items: center; justify-content: flex-end; width: 84px; height: 44px; margin: 0; padding: 0 12px; border: 0;
    background: none; color: var(--tint); cursor: pointer; transition: opacity .2s ease; -webkit-tap-highlight-color: transparent; }
  span.mco-more { flex: none; width: 84px; }
  .mco-ttl { overflow: hidden; color: var(--ink); font-size: 17px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
  button.mco-more .ic { width: 22px; height: 22px; }
}
/* 换课面板（mcourse.js 的 openDrop）：和胶囊同一种灰，从胶囊后面长出来 */
.mco-dveil { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0); transition: background-color .3s ease; }
.mco-dveil.is-open { background: rgba(0, 0, 0, .25); }
.mco-drop { position: fixed; top: 4px; left: 8px; right: 8px; z-index: 101; display: flex; flex-direction: column; max-height: 62vh; border-radius: 18px;
  background: var(--soft); transition: clip-path .34s var(--ease-sheet); }
.mco-drop-list { overflow-y: auto; padding: 0 8px 10px; scrollbar-width: none; opacity: 0; transform: translateY(-8px);
  transition: opacity .16s ease, transform .3s var(--ease-sheet); }
.mco-drop-list::-webkit-scrollbar { display: none; }
.mco-drop.is-open .mco-drop-list { opacity: 1; transform: none; transition-delay: .08s; }
a.mco-dr { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 12px 0 10px; border-radius: 12px; color: inherit; text-decoration: none;
  -webkit-tap-highlight-color: transparent; }
a.mco-dr:hover { text-decoration: none; }
a.mco-dr:active { background: var(--soft-2); }
a.mco-dr.is-cur { background: var(--panel); }
.mco-dr .cmono { flex: none; width: 32px; height: 32px; margin: 0; border-radius: 9px; background: var(--panel); font-size: 15px; }
.mco-dr.is-cur .cmono { background: var(--tint-soft); color: var(--tint); }
.mco-dr-n { flex: 1; min-width: 0; color: var(--ink); font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mco-dr .cnt { margin: 0; background: var(--panel); }
.mco-dr .cnt.hot { background: var(--red); }
@media (prefers-reduced-motion: reduce) {
  .mco-dveil, .mco-drop, .mco-drop-list, .mco-pcirc .ic { transition-duration: 1ms; transition-delay: 0s !important; }
}

/* ---------------------------------------------------------------- 手机的课程目录（mcourse.js 的 courseDirectory）：灰底上一组组白色圆角列表 */
.mco-list { display: grid; gap: 4px; }
.mco-list-top { display: flex; align-items: flex-end; gap: 8px; padding: 0 0 6px 4px; }
.mco-list-top h1 { margin: 0; color: var(--ink); font-size: 28px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.mco-wk { padding-bottom: 4px; color: var(--muted); font-size: 13px; }
.mco-sync-w { margin-left: auto; }
button.mco-sync { display: grid; place-items: center; width: 40px; height: 40px; margin: 0 -8px 0 0; padding: 0; border: 0; border-radius: 50%; background: none;
  color: var(--tint); cursor: pointer; }
button.mco-sync .ic { width: 20px; height: 20px; }
button.mco-sync.is-spin .ic { animation: u-spin .9s linear infinite; }
.mco-body { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.mco-group { border-radius: 14px; background: var(--panel); overflow: hidden; }
.mco-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px; margin: 0; padding: 10px 12px 10px 14px; border: 0;
  border-radius: 0; background: var(--panel); color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.mco-row:hover { color: inherit; text-decoration: none; }
.mco-row + .mco-row::before, .mco-off::before, .mco-off-kids::before { content: ""; position: absolute; top: 0; left: 62px; right: 0; height: 1px; background: var(--line); }
.mco-off-kids { position: relative; }
.mco-row:active { background: var(--soft-2); }
/* 按住拿起来、拖着排先后（#831，dragsort.js） */
.mco-row.srt-lift { z-index: 2; background: var(--soft); box-shadow: var(--shadow); }
.mco-row.srt-lift::before, .mco-row.srt-lift + .mco-row::before { opacity: 0; }
.cmono.mco-mono { width: 36px; height: 36px; margin: 0; border-radius: 10px; font-size: 16px; }
.mco-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mco-n { color: var(--ink); font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mco-n.muted { color: var(--muted); }
.mco-next { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mco-next.hot { color: var(--red); }
.mco-row .cnt { margin: 0; }
.mco-chev { flex: none; width: 16px; height: 16px; color: var(--faint); stroke-width: 2.2; transition: transform .2s var(--ease-out); }
.mco-row[aria-expanded="true"] .mco-chev { transform: rotate(90deg); }
.mco-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--soft-2); color: var(--text); }
.mco-ic .ic { width: 20px; height: 20px; }
.mco-off { position: relative; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 12px 0 14px; }
.mco-off-kids > .mco-off:first-child::before { display: none; }
a.mco-off-b { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; height: 56px; color: var(--muted); font-size: 15px; text-decoration: none;
  -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
a.mco-off-b:hover { text-decoration: none; }
a.mco-off-b span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mco-off-b .cmono { width: 36px; height: 36px; margin: 0; border-radius: 10px; font-size: 16px; color: var(--muted); }
@media (max-width: 759.98px) {
  .main:has(.mco-list) { min-height: 100vh; min-height: 100dvh; background: var(--soft); }
  .view .page:has(> .mco-list) { padding: 16px 16px 24px; }
}

/* ---------------------------------------------------------------- 分段按钮（mcourse.js 的 segTabs）：只在手机上用 */
.mco-seg { position: relative; display: flex; margin: 8px 0 10px; padding: 3px; border-radius: 11px; background: var(--soft); }
.mco-seg-ind { position: absolute; top: 3px; bottom: 3px; left: 3px; border-radius: 8px; background: var(--panel);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 0 0 .5px rgba(0, 0, 0, .04); transition: transform .3s var(--ease-sheet), opacity .2s ease; }
.mco-seg-ind.off { opacity: 0; }
.mco-seg-ind.jump { transition: opacity .2s ease; }
button.mco-seg-b { position: relative; z-index: 1; flex: 1 1 0; min-width: 0; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 8px; background: none;
  color: var(--muted); font: inherit; font-size: 14px; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button.mco-seg-b:hover { background: none; }
button.mco-seg-b.on { color: var(--ink); font-weight: 600; }
.mco-seg-dot { display: none; position: absolute; top: 6px; left: calc(50% + 15px); width: 6px; height: 6px; border-radius: 50%; }
.mco-seg-dot.is-new { display: block; background: var(--tint); }
.mco-seg-dot.is-hot { display: block; background: var(--red); }
@media (prefers-reduced-motion: reduce) {
  .mco-seg-ind { transition-duration: 1ms; }
}
