





:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-2: rgba(0, 0, 0, 0.8);
  --text-3: rgba(0, 0, 0, 0.48);
  --accent: #0071e3;
  --accent-weak: rgba(0, 113, 227, 0.1);
  --line: rgba(0, 0, 0, 0.08);
  --gray-bg: #f5f5f7;
  --success: #1d8a3f;
  --warn: #b26a00;
  --shadow: rgba(0, 0, 0, 0.22) 3px 5px 30px;
  --radius-s: 8px;
  --radius-m: 11px;
  --radius-l: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;

  







  --header-h: 64px;
  --side-w: 208px;
  --frame-bg: var(--card);
  --frame-fg: var(--text);
  --frame-fg-2: var(--text-2);
  --frame-line: var(--line);
  


  --panel-radius: 2px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}















body.admin-body {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 100vh;
}

.hidden { display: none !important; }




.perm-off { display: none !important; }
.muted { color: var(--text-3); }
















.app-header {
  flex: none;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  height: var(--header-h);
  padding: 0 16px 0 0;
  background: var(--frame-bg);
  border-bottom: 1px solid var(--frame-line);
}




.app-brand {
  flex: 0 0 var(--side-w);
  min-width: 0;
  padding: 0 14px 0 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}





.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}








.header-btn {
  appearance: none;
  border: 1px solid var(--frame-line);
  background: transparent;
  color: var(--frame-fg-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.header-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-weak);
}
.theme-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 12px;
  border: 1px solid var(--frame-line);
  background: transparent;
  border-radius: var(--radius-s);
}
.theme-label {
  font-size: 12px;
  color: var(--frame-fg-2);
  white-space: nowrap;
}
.theme-select {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--frame-fg-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 0 4px 0 0;
  cursor: pointer;
}
.theme-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }




.app-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--frame-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-subtitle {
  margin: 1px 0 0;
  color: var(--frame-fg-2);
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
























.app-body {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  position: relative;
  min-height: 0;
  padding: 0;
}







.app-body::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--side-w);
  background: var(--frame-bg);
  border-right: 1px solid var(--frame-line);
}

.app-nav {
  position: sticky;
  top: var(--header-h);
  flex: 0 0 var(--side-w);
  align-self: flex-start;
  
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 12px 0;
  background: transparent;
}




.nav-group + .nav-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--frame-line);
}
















.nav-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 18px 9px;
  border: none;
  background: transparent;
  color: var(--frame-fg);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  

  letter-spacing: 0.02em;
  text-align: left;
  cursor: pointer;
  transition: color 0.22s;
}
.nav-group-head:hover { color: var(--accent); }
.nav-group-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.nav-group-label { flex: 1; }




.nav-group-head .nav-ico {
  width: 18px;
  height: 18px;
  opacity: 1;
}


.nav-caret {
  flex: none;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.3s ease;
}
.nav-group.is-collapsed .nav-caret { transform: rotate(-90deg); }









.nav-group-body {
  display: flex;
  flex-direction: column;
  max-height: 400px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.24s ease;
}
.nav-group.is-collapsed .nav-group-body {
  max-height: 0;
  opacity: 0;
}







.tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--frame-fg-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  padding: 9px 18px;
  border-radius: 0;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}



.tab-btn:hover { color: var(--frame-fg); background: var(--accent-weak); }
.tab-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }




.tab-btn.active {
  color: #fff;
  background: var(--accent);
  font-weight: 500;
}







.tab-btn-page { text-decoration: none; }
.tab-btn-page::after {
  content: "↗";
  margin-left: auto;
  font-size: 11px;
  line-height: 1;
  opacity: 0.5;
}



.nav-ico {
  flex: none;
  display: block;
  width: 17px;
  height: 17px;
  opacity: 0.66;
  transition: opacity 0.14s;
}
.nav-ico svg { display: block; width: 100%; height: 100%; }
.tab-btn:hover .nav-ico,
.tab-btn.active .nav-ico { opacity: 1; }





.app-main {
  flex: 1 1 auto;
  min-width: 0;             
  padding: 16px 20px 32px;
}






@media (max-width: 900px) {
  .app-body { flex-direction: column; }
  .app-body::before { display: none; }
  .app-brand { flex: 0 1 auto; padding-left: 16px; }
  .app-nav {
    position: static;
    flex: none;
    width: 100%;
    max-height: none;
    padding: 10px 0;
    background: var(--frame-bg);
    border-bottom: 1px solid var(--frame-line);
  }
  .nav-group + .nav-group { margin-top: 6px; padding-top: 6px; }
  .nav-group-body { flex-direction: row; flex-wrap: wrap; }
  
  .tab-btn { width: auto; border-radius: var(--radius-s); padding: 7px 12px; }
  .app-main { padding: 12px 16px 32px; }
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }


.select,
.input,
.search-input {
  appearance: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.select { min-width: 150px; cursor: pointer; }

.select:disabled {
  color: var(--text-3);
  background: var(--gray-bg);
  cursor: not-allowed;
}
.search-input { width: 100%; }
.select:focus,
.input:focus,
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

.btn {
  appearance: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-s);
  padding: 8px 14px;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
.btn:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--gray-bg); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-3); }
.btn-danger { background: #d70015; color: #fff; }
.btn-small { padding: 4px 10px; font-size: 12px; }





.nav-bar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  padding: 10px 14px;
  margin-bottom: 16px;
}
.nav-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}
.nav-row + .nav-row { margin-top: 4px; }




.nav-row.nav-row-boxed {
  margin-top: 6px;
  padding: 6px 10px;
  

  border: 1px dashed var(--text-3);
  border-radius: var(--radius-s);
}
.nav-label {
  flex: none;
  width: 46px;
  font-size: 12px;
  color: var(--text-3);
}
.nav-chips {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--gray-bg);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-chip:hover { background: var(--accent-weak); color: var(--text); }
.nav-chip.active { background: var(--accent); color: #fff; font-weight: 600; }
.chip-badge {
  font-size: 10px;
  color: var(--text-3);
  background: rgba(0, 0, 0, 0.05);
  border-radius: 999px;
  padding: 1px 6px;
  white-space: nowrap;
}
.chip-badge.has { color: var(--accent); }
.nav-chip.active .chip-badge { background: rgba(255, 255, 255, 0.24); color: #fff; }
.nav-add {
  flex: none;
  padding: 5px 12px;
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
}
.nav-add:hover { border-color: var(--accent); color: var(--accent); }
.nav-empty { font-size: 12px; color: var(--text-3); }
.nav-crumb {
  flex: none;
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

.nav-bar.nav-collapsed .nav-collapsible { display: none; }
.nav-bar.nav-collapsed .nav-label { display: none; }

.rail-btn {
  flex: none;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--gray-bg);
  border: 0;
  border-radius: var(--radius-s);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.rail-btn:hover { background: var(--accent-weak); color: var(--accent); }

.nav-add-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0 2px 54px;
}
.input-sm { width: 220px; padding: 4px 8px; font-size: 12px; }


.levels-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  align-items: start;
}
.levels-list-col {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  padding: 14px;
}
.levels-list-col .search-input { margin-bottom: 10px; }

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.list-head .col-title { margin: 0; }
.col-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.45;
}

.level-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}
.level-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px;
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: background 0.15s;
}
.level-item:hover { background: var(--gray-bg); }
.level-item.active { background: var(--accent-weak); }
.level-item-main { display: flex; flex-direction: column; min-width: 0; }
.level-no { font-size: 12px; color: var(--accent); font-weight: 600; }
.level-title {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.level-flags { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.li-stars { color: #f0a020; font-size: 12px; white-space: nowrap; }
.li-dot { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.li-dot.filled { color: var(--success); }
.li-scope { font-size: 11px; color: var(--text-3); }


.level-detail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  padding: 24px 28px;
  min-height: 420px;
}

.block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.block-head .block-title,
.block-head .detail-title { margin: 0; }
.block-tools { display: flex; gap: 6px; flex: none; }


.detail-block.basic-block { margin-top: 6px; }
.basic-block .star-list { margin-top: 10px; }
.detail-crumb { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.detail-title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px;
  color: var(--text-2);
  background: var(--gray-bg);
  border-radius: 999px;
  padding: 3px 10px;
}
.muted-tag { color: var(--text-3); }

.detail-block { margin-top: 20px; }
.block-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.block-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  word-break: break-word;
}
.block-note { margin: 8px 0 0; font-size: 12px; color: var(--text-3); }


.star-list { list-style: none; margin: 0; padding: 0; }
.star-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-2);
}
.star-cond { color: var(--accent); font-weight: 600; }
.star-cond.muted { color: var(--text-3); font-weight: 400; }

.hint-block .block-body {
  background: var(--accent-weak);
  border-radius: var(--radius-m);
  padding: 12px 14px;
}


.answer-box {
  background: var(--gray-bg);
  border-radius: var(--radius-m);
  padding: 14px 16px;
  margin-bottom: 10px;
}


.detail-empty,
.empty-hint {
  color: var(--text-3);
  text-align: center;
}
.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  padding: 0 20px;
}
.detail-empty-icon { font-size: 40px; margin-bottom: 12px; }
.detail-empty h2 { margin: 0 0 8px; font-size: 17px; font-weight: 600; color: var(--text-2); }
.detail-empty p { margin: 0; font-size: 13px; max-width: 360px; }
.empty-hint { padding: 24px 8px; font-size: 13px; }




.records-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  padding: 14px 16px;
}
.toolbar-label { font-size: 13px; color: var(--text-2); font-weight: 600; }

.new-lesson-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  padding: 14px 16px;
  margin-top: 12px;
}
.new-lesson-form .input { min-width: 140px; }
.nl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: 100%; }


.nl-units-block {
  width: 100%;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.nl-units-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
  margin-bottom: 8px;
}
.nl-units-title { font-size: 13px; font-weight: 600; color: var(--text-2); }
.nl-units-hint { font-size: 12px; color: var(--text-3); }
.nl-units {
  display: flex; flex-wrap: wrap; gap: 10px 20px;
  max-height: 190px; overflow-y: auto;
}
.nl-units-group { flex: 1 1 190px; min-width: 170px; }
.nl-units-group-head { font-size: 12px; font-weight: 600; color: var(--text-3); margin-bottom: 2px; }
.nl-units-items { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.nl-unit-item { font-size: 13px; }

.records-body {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  padding: 16px;
  margin-top: 12px;
}



.record-wrap {
  overflow: auto;
  max-height: 72vh;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}
.record-wrap .empty-hint { padding: 18px 14px; }

.record-grid {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  

  --stu-w: 168px;
}
.record-grid th,
.record-grid td {
  padding: 8px 10px;
  text-align: center;
  white-space: nowrap;
}
.record-grid thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--gray-bg);
  color: var(--text-2);
  font-weight: 600;
  font-size: 12px;
}


.record-grid .sticky-col,
.record-grid .sticky-unit {
  position: sticky;
  z-index: 2;
  background: var(--card);
  text-align: left;
}
.record-grid .sticky-col { left: 0; width: var(--stu-w); min-width: var(--stu-w); }
.record-grid .sticky-unit {
  left: var(--stu-w);          
  min-width: 170px;
  border-right: 1px solid var(--line);
}
.record-grid thead .sticky-col,
.record-grid thead .sticky-unit,
.corner {
  z-index: 4;
  background: var(--gray-bg);
}
.student-cell { border-right: 1px solid var(--line); }

.stu-inner {
  display: flex;
  align-items: baseline;
  gap: 5px;
  width: calc(var(--stu-w) - 20px);
  overflow: hidden;
}
.stu-inner .stu-name { overflow: hidden; text-overflow: ellipsis; }
.stu-inner .stu-pass { margin-left: auto; }
.unit-cell { font-size: 12px; color: var(--text-2); }


.record-grid tbody tr + tr > td { border-top: 1px solid var(--line); }
.record-grid tbody tr.stu-first > td { border-top: 2px solid var(--line); }
.stu-seat { font-size: 11px; color: var(--text-3); }


.stu-name { font-weight: 600; cursor: pointer; }
.stu-name:hover { color: var(--accent); text-decoration: underline dotted; }

.cell {
  cursor: pointer;
  min-width: 62px;
  border-radius: var(--radius-s);
  transition: background 0.12s;
  
  font-size: 13px;
}

.cell:hover { box-shadow: inset 0 0 0 2px var(--accent); }






.cell-pick.cell-stars-0 { background: #fff0d9; color: #8a5300; }
.cell-pick.cell-stars-1 { background: #e6f4ea; color: #1d8a3f; }
.cell-pick.cell-stars-2 { background: #b7dfc4; color: #146c31; font-weight: 600; }
.cell-pick.cell-stars-3 { background: #1d8a3f; color: #ffffff; font-weight: 700; }


.cell-none { color: var(--text-3); font-size: 12px; }





.cell.official {
  background: var(--accent-weak);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  outline: 1px dashed var(--accent);
  outline-offset: -1px;
}
.cell.official:hover { outline: 2px solid var(--accent); outline-offset: -2px; }




.rec-star-on, .rec-star-off { font-weight: inherit; }   
.rec-star-on { color: var(--success); }

.cell-pick .rec-star-on, .pick-official .rec-star-on { color: inherit; }
.rec-star-off { opacity: 0.34; }   


.cell-picker {
  position: fixed; z-index: 60;
  display: flex; gap: 4px; padding: 6px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-m); box-shadow: var(--shadow);
}
.cell-pick {
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: var(--radius-s); padding: 6px 10px;
  font-size: 13px; font-family: var(--font); cursor: pointer; min-width: 44px;
}
.cell-pick.cell-none { background: var(--bg); color: var(--text-3); }
.cell-pick:hover { outline: 2px solid var(--accent-weak); outline-offset: 1px; }
.cell-pick.is-current { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-weak); }



.cell-picker .pick-official {
  border: 1px dashed var(--accent); background: var(--accent-weak); color: var(--accent);
  border-radius: var(--radius-s); padding: 6px 10px; margin-right: 4px;
  font-size: 13px; font-family: var(--font); font-weight: 600; cursor: pointer; white-space: nowrap;
}
.cell-picker .pick-official:hover { outline: 2px solid var(--accent-weak); outline-offset: 1px; }


.stu-panel {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(0, 0, 0, 0.28);
}
.stu-card {
  width: min(760px, 100%); max-height: min(86vh, 780px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border-radius: var(--radius-m); box-shadow: var(--shadow);
}
.stu-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.stu-title { font-size: 15px; font-weight: 600; }
.stu-title i { margin-left: 8px; font-size: 12px; font-style: normal; font-weight: 400; color: var(--text-3); }
.stu-head .stu-adopt { margin-left: auto; }
.stu-close {
  border: 0; background: transparent; color: var(--text-3);
  font-size: 15px; line-height: 1; padding: 5px 7px; border-radius: var(--radius-s); cursor: pointer;
}
.stu-close:hover { background: var(--gray-bg); color: var(--text); }
.stu-body { overflow: auto; padding: 4px 18px 18px; }

.stu-group-name {
  position: sticky; top: 0; z-index: 1;
  padding: 10px 0 6px; background: var(--card);
  font-size: 12px; font-weight: 600; color: var(--text-2);
}
.stu-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.stu-lv {
  flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stu-lv i { margin-left: 8px; font-style: normal; color: var(--text-3); }

.stu-of {
  flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--accent-weak);
}
.stu-picks { flex: 0 0 auto; display: flex; gap: 4px; }
.stu-picks .cell-pick { min-width: 42px; padding: 4px 6px; font-size: 12px; }

.stu-adopt {
  border: 1px dashed var(--accent); background: var(--accent-weak); color: var(--accent);
  border-radius: var(--radius-s); padding: 7px 12px;
  font-size: 13px; font-family: var(--font); font-weight: 600; cursor: pointer; white-space: nowrap;
}
.stu-adopt:hover { outline: 2px solid var(--accent-weak); outline-offset: 1px; }


.unit-star-head { min-width: 62px; }


.unit-star {
  min-width: 62px;
  font-weight: 600;
  color: var(--success);
  background: rgba(29, 138, 63, 0.06);
  border-left: 1px solid var(--line);
}

.cell-na { background: var(--gray-bg); min-width: 62px; }   




.stu-pass {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: var(--radius-s);
  background: var(--accent-weak);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}

.grid-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}



.grid-actions .btn { flex: 0 0 auto; white-space: nowrap; }
.grid-actions .dirty-flag { flex: 0 0 auto; white-space: nowrap; }
.grid-actions .grid-tip { flex: 1 1 auto; min-width: 0; }
.dirty-flag {
  font-size: 12px;
  color: var(--warn);
  font-weight: 600;
}
.grid-tip { font-size: 12px; color: var(--text-3); }
.grid-scope { font-size: 12px; font-weight: 600; color: var(--accent); }

.official-note { margin: 0 0 8px; font-size: 12px; color: var(--accent); }
.official-note.warn { color: var(--warn); }


.history-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  padding: 18px 20px;
  margin-top: 16px;
}
.section-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}
.history-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.history-timeline { display: flex; flex-direction: column; gap: 14px; }
.history-head { font-size: 14px; font-weight: 600; }
.history-group {
  border-left: 2px solid var(--accent-weak);
  padding-left: 12px;
}
.history-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.history-date { font-size: 13px; font-weight: 600; color: var(--text-2); }
.history-count { font-size: 12px; color: var(--accent); font-weight: 600; }
.history-levels { display: flex; flex-wrap: wrap; gap: 6px; }
.history-chip {
  font-size: 12px;
  color: var(--text-2);
  background: var(--gray-bg);
  border-radius: 999px;
  padding: 3px 10px;
}




.md-p { margin: 0 0 10px; }
.md-p:last-child { margin-bottom: 0; }
.md-h { margin: 14px 0 8px; font-weight: 600; color: var(--text); }
.md-h1 { font-size: 17px; }
.md-h2 { font-size: 15px; }
.md-h3 { font-size: 14px; }

.md-h4 { font-size: 13.5px; }
.md-h5 { font-size: 13px; }
.md-h6 { font-size: 12.5px; color: var(--text-2); }
.md-list { margin: 0 0 10px; padding-left: 22px; }
.md-list li { margin: 2px 0; }
.md-inline-code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  padding: 1px 5px;
}
.md-img {
  display: block;
  max-width: 100%;
  border-radius: var(--radius-s);
  margin: 6px 0;
}
.md-empty { margin: 0; font-size: 13px; color: var(--text-3); }









.md-table-wrap {
  margin: 0 0 12px;
  overflow-x: auto;                 
  -webkit-overflow-scrolling: touch;
}
.md-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  line-height: 1.6;
}
.md-table th,
.md-table td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  vertical-align: top;
  text-align: left;
}
.md-table thead th {
  background: var(--gray-bg);
  font-weight: 600;
  white-space: nowrap;
}
.md-table tbody tr:nth-child(even) td { background: rgba(0, 0, 0, 0.015); }

.md-quote {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-left: 3px solid var(--line);
  background: var(--gray-bg);
  color: var(--text-2);
  border-radius: 0 6px 6px 0;
}
.md-quote:last-child { margin-bottom: 0; }

.md-hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

.md-del { opacity: 0.7; }


.md-list .md-list { margin: 4px 0 0; }


.md-task-box {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 6px;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  vertical-align: -1px;
  text-align: center;
  font-size: 10px;
  line-height: 11px;
  color: #fff;
}
.md-task-box.on { background: var(--accent); border-color: var(--accent); }


.md-code-wrap {
  margin: 10px 0;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: #1d1d1f;
}
.md-code-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 14px;
  background: rgba(255, 255, 255, 0.07);
}
.md-code-lang { font-size: 11px; color: rgba(255, 255, 255, 0.5); }
.md-code-lines { font-size: 11px; color: rgba(255, 255, 255, 0.35); }
.md-code-head .btn-ghost { color: rgba(255, 255, 255, 0.72); margin-left: auto; }


.md-code-body { display: flex; align-items: stretch; }
.md-code-gutter {
  flex: none;
  margin: 0;
  padding: 12px 10px 12px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.28);
  font-family: "SF Mono", Menlo, Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  text-align: right;
  white-space: pre;
  user-select: none;
}
.md-code {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  color: #f5f5f7;
  font-family: "SF Mono", Menlo, Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;      
  overflow-x: auto;
  tab-size: 4;
}




.form-row { margin-bottom: 12px; }
.form-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.form-grid .form-row { margin-bottom: 0; }

.form-grid.basic-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
.basic-grid .form-label { font-size: 12px; line-height: 1.3; }
.md-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.md-input {
  width: 100%;
  resize: vertical;
  font-family: var(--font);
  line-height: 1.6;
}
.md-preview {
  margin-top: 8px;
  padding: 12px 14px;
  background: var(--gray-bg);
  border-radius: var(--radius-m);
}
.preview-head {
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-3);
}



.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.28);
}
.modal {
  width: 100%;
  max-width: 380px;
  





  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);   
  overflow-y: auto;
  padding: 20px;
  background: var(--card);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow);
  animation: modal-in 0.14s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.modal-title { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.modal-text { margin: 0 0 16px; font-size: 13px; color: var(--text-2); line-height: 1.65; white-space: pre-line; }
.modal-input { width: 100%; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.modal-actions-split > .btn-danger { margin-right: auto; }




.answer-sub + .answer-sub { margin-top: 18px; }
.part-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.answer-part + .answer-part { margin-top: 16px; }
.answer-part .part-title { margin: 0 0 8px; }
.md-hint { font-size: 11px; color: var(--text-3); margin-right: auto; }
.inline-label { display: inline-block; margin: 0 4px 0 0; }
.select-sm { min-width: 0; padding: 3px 8px; font-size: 12px; }
.code-input {
  font-family: "SF Mono", Menlo, Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.6;
  tab-size: 4;
}




.tok-kw { color: #bf5af2; font-weight: 600; }   
.tok-st { color: #30d158; }                     
.tok-cm { color: #98989d; font-style: italic; } 
.tok-nu { color: #ff9f0a; }                     
.tok-bi { color: #64d2ff; }                     
.tok-pp { color: #ff375f; }                     
.detail-empty-tip { margin-top: 10px; font-size: 12px; color: var(--accent); }




.loading-mask {
  position: fixed;
  inset: 0;
  background: rgba(245, 245, 247, 0.5);
  display: flex;
  

  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 999;
}

.loading-mask-text,
.panel-mask-text {
  font-size: 13px;
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.spinner {
  width: 34px;
  height: 34px;
  





  border: 3px solid var(--text-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }











.panel-mask {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg);
  opacity: 0.94;
}
#tab-students,
#tab-classes { position: relative; }






.is-skel, .is-skel-bare { animation: skelDim 1.1s ease-in-out infinite; }
.is-skel-bare::before {
  content: "";
  display: block;
  height: 180px;
  border-radius: var(--radius-s);
  background: repeating-linear-gradient(to bottom, var(--line) 0 14px, transparent 14px 32px);
}
@keyframes skelDim { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: var(--radius-s);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s;
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: rgba(29, 138, 63, 0.95); }
.toast-error { background: rgba(178, 40, 40, 0.95); }
.toast-warn { background: rgba(178, 106, 0, 0.95); }




.level-title { cursor: pointer; }
.level-title:hover { color: var(--accent); }



.level-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}
.level-title-row .level-title {
  flex: 0 0 auto;        
  max-width: 100%;
}
.level-tags {
  flex: 1 1 auto;        
  min-width: 0;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow: hidden;
}
.tag-chip {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-weak);
  color: var(--accent);
  white-space: nowrap;
}

.tag-more {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--gray-bg);
  color: var(--text-3);
  white-space: nowrap;
}
.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
  margin-bottom: 12px;
}
.tag-pick {
  padding: 4px 11px;
  background: var(--gray-bg);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tag-pick:hover { background: var(--accent-weak); color: var(--accent); }
.tag-pick.on { background: var(--accent); color: #fff; font-weight: 600; }
.tag-empty { font-size: 12px; color: var(--text-3); }
.tag-input-row { margin-bottom: 16px; }






.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
}
.toolbar-spacer { flex: 1; }
.toolbar-note { font-size: 12px; color: var(--text-3); }
.student-search { flex: 1; min-width: 220px; max-width: 380px; }


.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  overflow-x: auto;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  padding: 11px 14px;
  background: var(--gray-bg);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  color: var(--text);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: rgba(0, 0, 0, 0.015); }
.data-table .col-op { width: 195px; white-space: nowrap; text-align: right; }


.data-table .col-op.col-op-wide { width: 1%; }

















.data-table .col-op .op-rows {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.data-table .op-seg {
  display: inline-flex;
  align-items: stretch;
  vertical-align: middle;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--card);
  overflow: hidden;
}
.data-table .op-seg > .btn {
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  margin: 0;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text-3);
  opacity: 1;                         
}

.data-table .op-seg > .btn + .btn { border-left: 1px solid var(--line); }
.data-table .op-seg > .btn:hover,
.data-table .op-seg > .btn:focus-visible { background: var(--gray-bg); }
.data-table .op-seg > .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.data-table .op-seg > .btn-danger-text { color: #d70015; }
.data-table .op-seg > .btn-danger-text:hover,
.data-table .op-seg > .btn-danger-text:focus-visible { background: rgba(215, 0, 21, 0.08); }
.data-table .empty-hint { padding: 34px 14px; }
.cell-main { font-weight: 600; }
.cell-sub { display: block; font-size: 11px; color: var(--text-3); }





.cell-name {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}
.cell-name:hover .cell-main { color: var(--accent); }
.cell-name:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-s); }
.text-3 { color: var(--text-3); }
.btn-danger-text { color: #d70015; }
.btn-danger-text:hover { background: rgba(215, 0, 21, 0.08); }
.tag-muted { color: var(--text-3); background: var(--gray-bg); }
.tag-type { color: var(--accent); background: var(--accent-weak); }
.tag-ok { color: var(--success); background: rgba(29, 138, 63, 0.12); }

.icode-badges { display: flex; margin-top: 4px; }


.tag-honor { color: #8a5300; background: rgba(240, 160, 32, 0.16); }



.tag-star,
.tag-official { color: var(--accent); background: var(--accent-weak); }


.cell-link {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.cell-go {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  opacity: 0.6;
  transition: opacity 0.15s;
}
.cell-link:hover .cell-go,
.cell-link:focus-visible .cell-go { opacity: 1; }
.cell-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-s); }


.modal.modal-wide { max-width: 620px; }


.modal.modal-pwd { max-width: 440px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  margin-bottom: 18px;
}
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.wide { grid-column: 1 / -1; }
.field-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field-label .req { color: #d70015; font-style: normal; }
.field-control { display: block; }


.field-tip {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}




.field-tip[hidden] { display: none; }
.field-control .input,
.field-control .select { width: 100%; }
.pw-wrap { display: flex; align-items: center; gap: 6px; }
.pw-wrap .input { flex: 1; }
.form-field textarea.input { resize: vertical; line-height: 1.5; font-family: var(--font); }


.class-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: start;
}
.class-side {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  padding: 14px;
}
.class-list { list-style: none; margin: 0; padding: 0; }


.class-row { display: flex; align-items: center; gap: 2px; }
.class-row.dragging { opacity: 0.4; }
.class-row .class-item { flex: 1; min-width: 0; }
.drag-handle {
  flex: none;
  padding: 0 2px;
  font-size: 11px;
  letter-spacing: -2px;
  color: var(--text-3);
  cursor: grab;
  user-select: none;
}
.class-row:hover .drag-handle { color: var(--text-2); }


.check-list { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 4px 0; }
.check-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.check-empty { font-size: 12px; color: var(--text-3); }


.tag-list { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.class-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 4px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-s);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.class-item:hover { background: var(--gray-bg); }
.class-item.active { background: var(--accent-weak); }
.ci-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ci-name { font-size: 14px; font-weight: 600; color: var(--text); }
.class-item.active .ci-name { color: var(--accent); }
.ci-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); }
.ci-count { flex: none; font-size: 12px; color: var(--text-3); }
.class-item.active .ci-count { color: var(--accent); }
.unassigned-tip {
  margin-top: 10px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-3);
  background: var(--gray-bg);
  border-radius: var(--radius-s);
}

.class-detail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  padding: 18px 20px;
  min-height: 220px;
}
.class-note { margin: 10px 0 0; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.members-head { margin-top: 22px; }
.members-head .block-title { margin: 0; }


.pick-list {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
}
.pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}
.pick-row:hover { background: var(--gray-bg); }
.pick-name { flex: 1; color: var(--text); }
.pick-where { font-size: 11px; color: var(--text-3); }
.modal-hint { margin-right: auto; font-size: 12px; color: var(--text-3); }


.data-table .col-points { width: 72px; }
.pt-val { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-3); }
.pt-val.has { color: var(--accent); }   





.pt-cell {
  font: inherit; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--text-3); background: none; border: none; padding: 0;
  border-bottom: 1px dashed transparent; cursor: pointer;
  transition: color .2s, border-color .2s;
}
.pt-cell:hover { color: var(--accent); border-bottom-color: var(--accent); }
.pt-cell.has { color: var(--accent); }




.data-table .col-op > .btn + .btn { margin-left: 6px; }

.pt-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.pt-now { font-size: 13px; color: var(--text-3); }
.pt-now b {
  font-size: 24px; font-weight: 600; color: var(--text);
  margin: 0 2px; font-variant-numeric: tabular-nums;
}
.pt-tip { margin-left: auto; font-size: 12px; color: var(--text-3); }
.pt-tip.warn { color: #d70015; font-weight: 600; }   

.pt-dir { display: flex; gap: 8px; margin-bottom: 14px; }
.pt-dir-btn {
  flex: 1;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--gray-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  padding: 9px 0;
  cursor: pointer;
}
.pt-dir-btn:hover { background: #ececf0; }
.pt-dir-btn.is-on {
  color: var(--accent);
  background: var(--accent-weak);
  border-color: rgba(0, 113, 227, 0.35);
}

.pt-log-head { margin-top: 18px; }
.pt-log-head .block-title { margin: 0; }


.pt-log-hint { margin-left: auto; font-size: 12px; color: var(--text-3); }
.pt-logs {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
}
.pt-log {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  font-size: 13px;
}
.pt-log + .pt-log { border-top: 1px solid var(--line); }
.pt-log-d { font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-log-d.plus { color: var(--success); }
.pt-log-d.minus { color: #d70015; }
.pt-log-r { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-log-t {
  font-size: 11px; color: var(--text-3);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pt-log-empty { margin: 0; padding: 22px 0; text-align: center; font-size: 13px; color: var(--text-3); }




.pt-log-foot {
  margin: 0; padding: 10px 12px; text-align: center;
  font-size: 12px; color: var(--text-3); background: var(--gray-bg);
}


.pt-sub { margin: 20px 0 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.pt-sub-hint { margin-left: 8px; font-weight: 400; font-size: 12px; color: var(--text-3); }








.reason-combo { position: relative; display: block; }
.reason-combo .reason-input { width: 100%; padding-right: 32px; }
.reason-caret {
  position: absolute; top: 0; right: 1px; height: 100%; width: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--text-3);
  font-size: 10px; line-height: 1; cursor: pointer;
  border-radius: var(--radius-s);
}
.reason-caret:hover { color: var(--text); }
.reason-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
  max-height: 178px; overflow-y: auto;
  padding: 4px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow);
}
.reason-item {
  display: block; width: 100%; text-align: left;
  padding: 7px 9px; border: 0; border-radius: var(--radius-s);
  background: transparent; color: var(--text);
  font-family: inherit; font-size: 13px; cursor: pointer;
}
.reason-item:hover,
.reason-item:focus { background: var(--accent-weak); outline: none; }
.reason-menu-empty {
  display: block; padding: 8px 9px; font-size: 12px; color: var(--text-3); line-height: 1.6;
}




.rank-actions { display: flex; flex-wrap: wrap; gap: 6px; flex: none; }
.toolbar-divider { width: 1px; height: 18px; background: var(--line); margin: 0 2px; flex: none; }



.modal.modal-lb { max-width: 460px; }   





.lb-tools { margin-bottom: 12px; }
.lb-tool { display: flex; align-items: center; gap: 8px; }
.lb-tool-n { flex: none; font-size: 12px; color: var(--text-3); }
.lb-tool .input-sm { flex: 1; width: auto; min-width: 0; }

.lb-count { margin-right: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.lb-body { max-height: 58vh; overflow-y: auto; margin-bottom: 16px; }
.lb-list { list-style: none; margin: 0; padding: 0; }
.lb-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-s);
  font-size: 13px;
}
.lb-row:nth-child(even) { background: var(--gray-bg); }
.lb-rank {
  text-align: center; font-weight: 600; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.lb-rank.lb-medal { color: var(--accent); }   
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.lb-val i { font-style: normal; font-size: 11px; font-weight: 400; color: var(--text-3); margin-left: 2px; }
.lb-empty { margin: 0; padding: 22px 0; text-align: center; font-size: 13px; color: var(--text-3); }


.lb-foot { padding: 10px 0 4px; text-align: center; font-size: 12px; color: var(--text-3); }


.lb-count b { font-weight: 600; color: var(--text-2); }


.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  font-size: 12px;
  color: var(--text-3);
}
.pager:empty { display: none; }   
.pager-size .select { display: inline-block; width: auto; margin: 0 2px; vertical-align: middle; }
.pager-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.pager-cur { padding: 0 6px; font-weight: 600; color: var(--text-2); }


@media (max-width: 820px) {
  .app-header, .tabs, .app-main { padding-left: 16px; padding-right: 16px; }
  .levels-layout { grid-template-columns: 1fr; }
  .nav-label { display: none; }
  .nav-add-form { padding-left: 0; }
  .nav-crumb { display: none; }
  .class-layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid.basic-grid { grid-template-columns: 1fr 1fr; }
  .modal.modal-wide { max-width: none; }
}




.settings-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--panel-radius);
  padding: 18px 20px;
  margin-top: 14px;
}

.settings-desc {
  margin: 4px 0 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-3);
}


.settings-desc.settings-danger {
  color: #d70015;
  font-weight: 600;
}




.https-pem {
  width: 100%; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 12px; line-height: 1.45; white-space: pre; overflow-x: auto;
}
.https-info {
  list-style: none; margin: 0 0 10px; padding: 0;
  font-size: 13px; line-height: 1.9; color: var(--text-2);
}
.https-info b { display: inline-block; min-width: 62px; color: var(--text-3); font-weight: 600; }



.settings-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 560px;
}
.settings-input-row .input { flex: 1; min-width: 0; }









.brand-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
}
.brand-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-actions { margin-top: 14px; }



.pr-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.pr-list .pr-del { flex: none; }


#import-file {
  padding: 6px 0;
  font-size: 13px;
}

.settings-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: var(--gray-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}

.stat-card .stat-label { font-size: 12px; color: var(--text-3); }
.stat-card .stat-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.stat-card .stat-sub { font-size: 12px; color: var(--text-3); }


.stat-card-danger {
  background: rgba(215, 0, 21, 0.06);
  border-color: rgba(215, 0, 21, 0.28);
}
.stat-card-danger .stat-label,
.stat-card-danger .stat-sub { color: #d70015; }
.stat-card-danger .stat-value { color: #d70015; }

.settings-list-head { margin-top: 4px; }
.settings-list-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}
.settings-pick-all { margin: 0; }

.settings-orphan-list { margin-top: 8px; }
.settings-orphan-list .col-check { width: 40px; }
.settings-orphan-list .col-check input { cursor: pointer; }

@media (max-width: 720px) {
  .settings-stats { grid-template-columns: 1fr; }
}





.collapse-card { padding-top: 0; }

.collapse-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  cursor: pointer;
  user-select: none;
}

.collapse-toggle {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-s);
}
.collapse-toggle:hover { background: var(--gray-bg); color: var(--text); }

.collapse-header .col-title { margin: 0; }


.collapse-summary {
  font-size: 12px;
  color: var(--text-3);
  padding: 2px 10px;
  background: var(--gray-bg);
  border-radius: 999px;
  white-space: nowrap;
}
.collapse-summary:empty { display: none; }


.collapse-spacer { flex: 1; }


.collapse-card.is-collapsed .collapse-body { display: none; }


.collapse-body { padding-bottom: 20px; }




.db-section { margin-bottom: 18px; }
.db-section .block-title { margin: 0 0 8px; }


.current-conn {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 12px 14px;
  background: var(--gray-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  font-size: 13px;
  color: var(--text-2);
}
.current-conn .conn-item { display: flex; gap: 6px; align-items: baseline; }
.current-conn .conn-key { color: var(--text-3); }
.current-conn .conn-val { font-weight: 600; color: var(--text); }


.tag-source {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
  vertical-align: middle;
}
.tag-source:empty { display: none; }
.tag-source.tag-default { color: var(--text-3); background: var(--gray-bg); }
.tag-source.tag-local { color: var(--success); background: rgba(29, 138, 63, 0.12); }
.tag-source.tag-env { color: #b26a00; background: rgba(178, 106, 0, 0.14); }


.form-field.locked .input { background: var(--gray-bg); color: var(--text-3); cursor: not-allowed; }
.field-lock-note {
  margin-top: 2px;
  font-size: 11px;
  color: var(--warn);
}





.notice-bar {
  


  margin: 12px 20px 0;
  padding: 10px 16px;
  font-size: 13px;
  line-height: 1.6;
  border-radius: var(--panel-radius);
}
.notice-warn {
  background: rgba(178, 106, 0, 0.12);
  border: 1px solid rgba(178, 106, 0, 0.3);
  color: #8a5200;
}




.update-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--gray-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  font-size: 13px;
  color: var(--text-2);
}
.update-info .conn-item { display: flex; gap: 6px; align-items: baseline; }
.update-info .conn-key { color: var(--text-3); flex: none; }
.update-info .conn-val { font-weight: 600; color: var(--text); }


.update-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
}
.update-step { display: flex; gap: 8px; align-items: baseline; color: var(--text-2); }




.update-stamp {
  margin-bottom: 2px;
  font-size: 12px;
  color: var(--text-3);
}
.update-step-mark { flex: none; width: 16px; text-align: center; }
.update-step.step-running { color: var(--accent); }
.update-step.step-done .update-step-mark { color: var(--success); }
.update-step.step-fail { color: #d70015; }
.update-step.step-fail .update-step-mark { color: #d70015; }






.update-step-detail {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-3);
  white-space: pre-wrap;
  word-break: break-word;
}

.update-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}


.update-note {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-3);
  white-space: pre-line;
}

@media (max-width: 820px) {
  .notice-bar { margin-left: 16px; margin-right: 16px; }
}


.form-field .field-check { margin: 2px 0 0; }


.field-error {
  grid-column: 1 / -1;
  padding: 8px 12px;
  font-size: 13px;
  color: #d70015;
  background: rgba(215, 0, 21, 0.06);
  border: 1px solid rgba(215, 0, 21, 0.28);
  border-radius: var(--radius-m);
}
.field-error[hidden] { display: none; }

.db-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.form-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-3);
}
.form-note code {
  padding: 1px 5px;
  background: var(--gray-bg);
  border-radius: 4px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
}


@media (max-width: 720px) {
  .form-grid.db-config { grid-template-columns: 1fr; }
}




.student-main {
  max-width: 720px;
  margin: 0 auto;
}

.student-hero {
  margin: 8px 0 16px;
}

.student-greet {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.student-sub {
  margin: 4px 0 0;
  color: var(--text-3);
  font-size: 13px;
}




.hall-entry {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 980px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}

.hall-entry:hover {
  color: var(--text);
  border-color: var(--text-3);
}

.settings-empty {
  color: var(--text-3);
  font-size: 13px;
  padding: 10px 0;
}





.sync-block { margin-top: 10px; }

.sync-block-title {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 4px;
}

.sync-picks {
  display: flex;
  flex-direction: column;
  gap: 2px;
}


.conn-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.conn-list .conn-item { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.conn-list .conn-key { flex: none; width: 116px; color: var(--text-3); }
.conn-list .conn-val { color: var(--text); font-weight: 600; }


.sync-notes {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}

.sync-notes li { margin-bottom: 4px; }


.sync-log {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
}

.sync-log summary { cursor: pointer; }

.sync-log pre {
  margin: 6px 0 0;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-2);
  background: var(--gray-bg);
  border-radius: var(--radius-s);
  padding: 8px 10px;
}








.storage-dirs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.storage-dir {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 980px;
  background: var(--gray-bg);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.storage-dir:hover { background: var(--bg); }
.storage-dir input { cursor: pointer; accent-color: var(--accent); }
.storage-dir-name { font-weight: 600; font-family: "SF Mono", ui-monospace, Consolas, monospace; }
.storage-dir-meta { color: var(--text-3); font-size: 11.5px; }



.storage-dir.is-gated { border-color: #d70015; }
.storage-dir-warn {
  color: #d70015;
  font-size: 11px;
  border-left: 1px solid var(--line);
  padding-left: 7px;
}

.storage-list {
  margin-top: 8px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--card);
}

.storage-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 11px;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.storage-file:last-child { border-bottom: 0; }


label.storage-file { cursor: pointer; }
.storage-file input { cursor: pointer; accent-color: var(--accent); }
.storage-file-key {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "SF Mono", ui-monospace, Consolas, monospace;
  color: var(--text-2);
}
.storage-file-size { color: var(--text-3); font-variant-numeric: tabular-nums; }
.storage-file-state { font-size: 11.5px; }


.storage-file.is-new .storage-file-state { color: var(--accent); }
.storage-file.is-changed .storage-file-state { color: var(--warn); }
.storage-file.is-same { opacity: .55; }
.storage-file.is-same .storage-file-state { color: var(--text-3); }





.storage-file.is-absent .storage-file-state { color: #d70015; }
.storage-file.is-out { opacity: .5; }
.storage-file.is-out .storage-file-state { color: var(--text-3); }




.storage-list .link-btn {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
}
.storage-list .link-btn:hover { text-decoration: underline; }
.storage-view { color: var(--accent); }          
.storage-del { color: #d70015; }


#cos-action-note { white-space: pre-line; }





.storage-steps {
  margin: 0 0 10px;
  padding: 10px 12px 10px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--gray-bg);
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text-2);
  list-style: decimal;
}
.storage-steps li::marker { color: var(--accent); font-weight: 600; }
.storage-steps strong { color: var(--text); }

.storage-empty {
  margin: 0;
  padding: 14px 12px;
  font-size: 12.5px;
  color: var(--text-3);
  text-align: center;
}










.notice-danger {
  background: rgba(215, 0, 21, 0.1);
  border: 1px solid rgba(215, 0, 21, 0.32);
  color: #a3000f;
}
.notice-danger strong { font-weight: 600; }



.db-standby {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}


.db-standby-actions { margin-top: 10px; }
.db-standby .form-note { margin: 0 0 10px; }












.db-chip {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  vertical-align: 1px;
  white-space: nowrap;
}

.db-chip.is-primary {
  background: var(--accent-weak);
  border-color: rgba(0, 113, 227, 0.45);
  color: #0a5fbf;
}
.db-chip.is-primary.is-hot {
  background: rgba(215, 0, 21, 0.12);
  border-color: rgba(215, 0, 21, 0.45);
  color: #a3000f;
}

.db-chip.is-standby {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.14);
  color: var(--text-3);
}



.db-role-note {
  margin-left: 8px;
  font-weight: 400;
  font-size: 12px;
  color: var(--text-2);
}
.db-role-note.is-warn { color: #a3000f; }





.db-role-rows { display: block; }
.db-role-rows .conn-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 3px 0;
}
.db-role-rows .conn-key { flex: 0 0 66px; }








.storage-file.is-updated { background: rgba(178, 106, 0, 0.06); }
.storage-file.is-updated .storage-file-state { color: var(--warn); font-weight: 600; }


.storage-file-meta {
  color: var(--text-3);
  font-size: 11.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}



#btn-cos-abort {
  background: #d70015;
  border-color: #d70015;
  color: #fff;
}
#btn-cos-abort:disabled { opacity: .5; cursor: default; }


#storage-record { margin: 6px 0 10px; }



.storage-del { color: #d70015; }



.update-notes {
  margin: 10px 0 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s, 8px);
  background: var(--gray-bg);
}
.update-notes-title {
  margin-bottom: 6px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}
.update-notes-list {
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow: auto;
  list-style: none;
}
.update-notes-list li {
  display: flex;
  gap: 8px;
  padding: 3px 0;
  font-size: 13px;
  line-height: 1.5;
}
.update-notes-list .un-date { flex: 0 0 auto; color: var(--text-3); font-variant-numeric: tabular-nums; }
.update-notes-list .un-subj { flex: 1 1 auto; min-width: 0; color: var(--text); }
.update-notes-list .un-sha  { flex: 0 0 auto; color: var(--text-3); font-family: ui-monospace, monospace; }
.update-step.step-skip { opacity: .72; }















.home {
  max-width: 900px;                 
  padding: 6px 0 40px;
}

.home-hi {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--text);
}

.home-date {
  margin: 7px 0 0;
  font-size: 14px;
  color: var(--text-3);
}


.home-who {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-3);
}

.home-title {
  margin: 30px 0 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text-2);
}

.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 12px;
}


.home-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;            
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.home-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
  transform: translateY(-1px);
}
.home-card:active { transform: none; }
.home-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }


.home-ico {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-weak);
  color: var(--accent);
}

.home-ico .nav-ico { width: 19px; height: 19px; opacity: 1; }

.home-label { flex: 1 1 auto; min-width: 0; font-weight: 500; }
.home-note { flex: 0 0 auto; font-size: 11px; color: var(--text-3); }

.home-tip {
  margin: 22px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-3);
}










.up-kind {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.up-kind:first-child { margin-top: 6px; padding-top: 0; border-top: 0; }

.up-kind-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.up-kind-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1 1 320px;
}
.up-kind-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.up-kind-dir {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.05);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11.5px;
  color: var(--text-2);
}
body.tech .up-kind-dir { background: rgba(255, 255, 255, 0.08); }
.up-kind-num { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.up-kind-num b { color: var(--text); font-weight: 600; }

.up-kind-tools { display: flex; align-items: center; gap: 10px; }
.up-kind-lock { font-size: 12px; color: var(--text-3); }

.up-kind-desc { margin: 6px 0 8px; font-size: 12.5px; line-height: 1.7; color: var(--text-3); }
.up-kind-warn {
  margin: 0 0 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 159, 10, 0.12);
  font-size: 12.5px;
  color: #b26a00;
}
body.tech .up-kind-warn { background: rgba(255, 159, 10, 0.16); color: #ffb340; }






.side-drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  z-index: 130;
  display: flex;
  justify-content: flex-end;
}
.side-drawer {
  width: min(880px, 100vw);
  height: 100%;
  background: var(--card);
  color: var(--text);
  display: flex;
  flex-direction: column;
  box-shadow: -18px 0 48px rgba(0, 0, 0, 0.18);
  animation: sideDrawerIn 0.22s ease-out;
}
@keyframes sideDrawerIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .side-drawer { animation: none; } }
.side-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.side-drawer-title { font-size: 17px; font-weight: 600; line-height: 1.35; }
.side-drawer-title .sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  line-height: 1.6;
}
.side-drawer-x {
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  flex: none;
}
.side-drawer-x:hover { color: var(--text); background: var(--gray-bg); }
.side-drawer-body { flex: 1 1 auto; overflow: auto; padding: 16px 20px; }
.side-drawer-foot {
  flex: none;
  border-top: 1px solid var(--line);
  padding: 12px 20px;
  background: var(--card);
}
@media (max-width: 768px) {
  .side-drawer { width: 100vw; }
  .side-drawer-head { padding: 14px 14px 10px; }
  .side-drawer-body { padding: 12px 14px; }
  .side-drawer-foot { padding: 10px 14px; }
}









.settings-block[data-drawer-card] { padding-top: 0; padding-bottom: 0; }
.settings-block[data-drawer-card]:hover { border-color: rgba(0, 113, 227, 0.38); }
.settings-block[data-drawer-card] .collapse-header { padding: 15px 0; }
.settings-block[data-drawer-card] .collapse-header:hover .col-title { color: var(--accent); }
.settings-block[data-drawer-card] .col-title { font-size: 15px; }


.drawer-caret {
  flex: none;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 17px;
  line-height: 1;
  transition: transform 0.12s, color 0.12s;
}
.drawer-caret::before { content: "›"; font-weight: 600; }
.settings-block[data-drawer-card] .collapse-header:hover .drawer-caret {
  color: var(--accent);
  transform: translateX(2px);
}

.settings-block[data-drawer-card] .collapse-header:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-s);
}



.side-drawer-settings .side-drawer-body > .collapse-body { padding-bottom: 4px; }
.side-drawer-settings .collapse-body > :first-child { margin-top: 0; }

.side-drawer-settings .settings-input-row .input { max-width: 320px; }




.side-drawer-head .sd-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: none;
}
.side-drawer-head .sd-actions:empty { display: none; }

.side-drawer-settings .side-drawer-title { flex: 1 1 auto; min-width: 0; }






.m3d-search { flex: 0 1 280px; min-width: 180px; }
.m3d-bound { flex: none; }


.col-idx {
  width: 64px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.m3d-account,
.m3d-password {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}
.m3d-password { letter-spacing: 0.3px; }




.m3d-draft {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 159, 10, 0.5);
  border-left: 3px solid #ff9f0a;
  border-radius: var(--radius-s);
  background: rgba(255, 159, 10, 0.1);
  color: #8a4b00;
  font-size: 12.5px;
  line-height: 1.6;
}
.m3d-draft-x {
  margin-left: auto;
  flex: none;
  padding: 2px 10px;
  border: 1px solid rgba(255, 159, 10, 0.55);
  border-radius: 999px;
  background: #fff;
  color: #8a4b00;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.m3d-draft-x:hover { background: rgba(255, 159, 10, 0.16); }
.m3d-draft-x:focus-visible { outline: 2px solid #ff9f0a; outline-offset: 1px; }



.cell-bind {
  border: 1px dashed var(--line);
  background: none;
  color: var(--text-3);
  font: inherit;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  cursor: pointer;
}
.cell-bind:hover { border-color: var(--accent); color: var(--accent); }
.cell-bind:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.cell-code {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
}
.cell-code:hover { text-decoration: underline; }
.cell-code:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }


.m3d-pick-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.m3d-pick-bar .input { flex: 1 1 auto; min-width: 0; }
.m3d-pick-list { display: flex; flex-direction: column; gap: 8px; }
.m3d-pick {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--card);
  font: inherit;
  color: var(--text);
}
.m3d-pick:hover { border-color: var(--accent); background: var(--gray-bg); }
.m3d-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.m3d-pick-main { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; }
.m3d-pick-sub { font-size: 12px; color: var(--text-3); }
.m3d-pick-empty { padding: 24px 12px; text-align: center; color: var(--text-3); line-height: 1.8; }
