/* ============================================================================
   MTing OS — Battery Reserve + Apple Screen-Time Style Token Breakdown
   (`os-compute.css`)
   ============================================================================ */

.cmp-wrap {
  display: flex;
  flex-direction: column;
  gap: 13px;
  font-variant-numeric: tabular-nums;
}

.cmp-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34C759;
  display: inline-block;
  flex-shrink: 0;
}
.cmp-dot.live {
  box-shadow: 0 0 7px rgba(52, 199, 89, 0.72);
}
.cmp-dot.warn {
  background: #FF9F0A;
  box-shadow: 0 0 7px rgba(255, 159, 10, 0.8);
}

.cmp-card {
  border-radius: 14px;
  padding: 15px 17px;
  background: #FFFFFF;
  border: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
html[data-appearance="dark"]:not([data-os="windows"]) .cmp-card {
  background: #1C1C1E;
  border-color: rgba(255, 255, 255, 0.09);
}
html[data-os="ios"] .cmp-card {
  border-radius: 22px;
  border: none;
  box-shadow: none;
}
html[data-os="ios"][data-appearance="dark"] .cmp-card {
  background: #1C1C1E;
}
html[data-os="windows"] .cmp-card {
  border-radius: 8px;
  background: rgba(251, 251, 251, 0.90);
  border: 1px solid #E5E5E5;
  box-shadow: none;
  color: #1B1B1B;
}
html[data-os="windows"][data-appearance="dark"] .cmp-card {
  background: #242429;
  border-color: rgba(255, 255, 255, 0.10);
  color: #F3F4F6;
}
html[data-os="android"] .cmp-card {
  border-radius: 22px;
  background: #FFFFFF;
  border: none;
  box-shadow: none;
}
html[data-os="android"][data-appearance="dark"] .cmp-card {
  background: #211F26;
}

/* ---------- 1. Compact Battery Reserve + 3-Metric Summary ---------- */
.cmp-bat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}
.cmp-bat-label {
  font-weight: 600;
  opacity: 0.65;
}
.cmp-bat-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.68;
}
.cmp-bat-status em {
  font-style: normal;
}

.cmp-bat-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 8px 0 12px;
}
.cmp-bat-pct {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  flex-shrink: 0;
}
.cmp-bat-pct strong {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1;
}
.cmp-bat-pct span {
  font-size: 19px;
  font-weight: 700;
  opacity: 0.56;
}

.cmp-bat-gauge {
  flex: 1;
  max-width: 210px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.cmp-bat-body {
  flex: 1;
  height: 26px;
  padding: 3px;
  border-radius: 8px;
  border: 1.5px solid rgba(120, 120, 128, 0.36);
  background: rgba(120, 120, 128, 0.10);
  box-sizing: border-box;
  overflow: hidden;
}
.cmp-bat-fill {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bat-c, #34C759) 88%, #FFFFFF), var(--bat-c, #34C759));
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.cmp-bat-cap {
  width: 3.5px;
  height: 10px;
  border-radius: 0 3px 3px 0;
  background: rgba(120, 120, 128, 0.40);
  flex-shrink: 0;
}

/* 3-Metric Compact Strip (`预计拥有 · 已经使用 · 总消耗`) */
.cmp-trio-grid {
  padding-top: 11px;
  border-top: 0.5px solid rgba(128, 128, 136, 0.20);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.cmp-trio-cell {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(120, 120, 128, 0.07);
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.cmp-trio-cell:hover {
  background: rgba(120, 120, 128, 0.13);
}
.cmp-trio-cell.active {
  background: rgba(10, 132, 255, 0.13);
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.45);
}
.cmp-trio-cell small {
  display: block;
  font-size: 11px;
  opacity: 0.62;
  margin-bottom: 2px;
}
.cmp-trio-cell strong {
  display: block;
  font-size: 15.5px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

/* ---------- 2. Apple Screen-Time Segmented Control (`每周 | 每天 | 总消耗`) ---------- */
.st-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.16);
  user-select: none;
}
html[data-appearance="dark"] .st-seg {
  background: rgba(118, 118, 128, 0.26);
}
.st-seg-btn {
  height: 30px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.76;
  cursor: pointer;
  transition: background 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
}
.st-seg-btn.active {
  background: #FFFFFF;
  opacity: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.10);
}
html[data-appearance="dark"] .st-seg-btn.active {
  background: #636366;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.st-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 0;
}
.st-sec-title {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.58;
}
.st-sec-action {
  border: none;
  background: transparent;
  color: #0A84FF;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.st-sec-action:hover {
  opacity: 0.82;
}

/* ---------- 3. Screen-Time Dual Chart Card ---------- */
.st-chart-kicker {
  font-size: 13px;
  opacity: 0.60;
  font-weight: 500;
}
.st-chart-hero-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 12px;
}
.st-chart-hero {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1.08;
}
.st-chart-delta {
  font-size: 12px;
  opacity: 0.56;
}

/* Chart Plot Area with Gridlines + Right Y-Axis + Dashed Avg Line */
.st-plot-wrap {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 6px;
  margin-bottom: 14px;
}
.st-plot-wrap.compact {
  margin-top: 8px;
  margin-bottom: 14px;
}
.st-plot {
  position: relative;
  height: 104px;
  border-top: 0.5px solid rgba(128, 128, 136, 0.22);
  border-bottom: 0.5px solid rgba(128, 128, 136, 0.28);
  display: flex;
  align-items: flex-end;
}
.st-plot.hourly {
  height: 82px;
}
.st-plot::before,
.st-plot::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  border-top: 0.5px dashed rgba(128, 128, 136, 0.16);
  pointer-events: none;
}
.st-plot::before { top: 33.3%; }
.st-plot::after { top: 66.6%; }

/* Green/Neutral Screen-Time Dashed Average Line */
.st-avg-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1.5px dashed rgba(52, 199, 89, 0.78);
  pointer-events: none;
  z-index: 3;
}
html[data-appearance="dark"] .st-avg-line {
  border-top-color: rgba(235, 235, 245, 0.58);
}

.st-bars {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: grid;
  align-items: end;
}
.st-bars.cols-7 { grid-template-columns: repeat(7, 1fr); }
.st-bars.cols-8 { grid-template-columns: repeat(8, 1fr); }
.st-bars.cols-24 { grid-template-columns: repeat(24, 1fr); }

.st-col {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  border-left: 0.5px dashed rgba(128, 128, 136, 0.16);
  padding: 0 18%;
  box-sizing: border-box;
  cursor: pointer;
}
.st-col:last-child {
  border-right: 0.5px dashed rgba(128, 128, 136, 0.16);
}
.st-bars.cols-24 .st-col {
  border-left: none;
  padding: 0 15%;
  cursor: default;
}
.st-bars.cols-24 .st-col.qmark {
  border-left: 0.5px dashed rgba(128, 128, 136, 0.22);
}

.st-stack {
  width: 100%;
  max-width: 22px;
  border-radius: 3.5px 3.5px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
  min-height: 2px;
  transition: height 0.25s ease, opacity 0.15s ease;
}
.st-bars.cols-24 .st-stack {
  max-width: 8px;
  border-radius: 2px 2px 0 0;
}
.st-stack.muted i {
  background: #C7C7CC !important;
}
html[data-appearance="dark"] .st-stack.muted i {
  background: #48484A !important;
}
.st-col:hover .st-stack.muted {
  opacity: 0.85;
}
.st-stack i {
  display: block;
  width: 100%;
}
.st-c-eng { background: #0A84FF; }
.st-c-vis { background: #32ADE6; }
.st-c-res { background: #FF9F0A; }

/* X-Axis Labels under Bars */
.st-x-labels {
  display: grid;
  font-size: 11px;
  opacity: 0.55;
  margin-top: 4px;
}
.st-x-labels.cols-7 { grid-template-columns: repeat(7, 1fr); }
.st-x-labels.cols-8 { grid-template-columns: repeat(8, 1fr); }
.st-x-labels.cols-4 { grid-template-columns: repeat(4, 1fr); }
.st-x-labels span {
  padding-left: 4px;
}
.st-x-labels span.sel {
  opacity: 1;
  font-weight: 700;
  color: #0A84FF;
}

/* Right Y-Axis Labels */
.st-yaxis {
  position: relative;
  height: 104px;
  font-size: 10.5px;
  opacity: 0.52;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-left: 2px;
  white-space: nowrap;
}
.st-yaxis.hourly {
  height: 82px;
}
.st-yaxis-avg {
  position: absolute;
  left: 2px;
  transform: translateY(50%);
  color: #34C759;
  font-weight: 600;
  opacity: 1;
}
html[data-appearance="dark"] .st-yaxis-avg {
  color: rgba(235, 235, 245, 0.78);
}

/* 3-Column Colored Category Summary Row (`工程与代码 / 影像与视觉 / 内容与调研`) */
.st-cats-row {
  padding-top: 12px;
  border-top: 0.5px solid rgba(128, 128, 136, 0.18);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.st-cat-col b {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
  margin-bottom: 2px;
}
.st-cat-col b.c0 { color: #0A84FF; }
.st-cat-col b.c1 { color: #32ADE6; }
.st-cat-col b.c2 { color: #FF9F0A; }
.st-cat-col strong {
  display: block;
  font-size: 15px;
  font-weight: 650;
}

.st-updated-foot {
  font-size: 11.5px;
  opacity: 0.50;
  padding: 0 4px;
  margin-top: -4px;
}

/* ---------- 4. Ranked `主要消耗明细` (`Most Consumed`) Progress List ---------- */
.st-rank-card {
  padding: 6px 16px;
}
.st-rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(128, 128, 136, 0.16);
}
.st-rank-row:last-child {
  border-bottom: none;
}
.st-rank-ic {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.st-rank-dot {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.st-rank-main {
  flex: 1;
  min-width: 0;
}
.st-rank-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.st-rank-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.st-rank-pct {
  font-size: 11.5px;
  opacity: 0.50;
  flex-shrink: 0;
}
.st-rank-barline {
  display: flex;
  align-items: center;
  gap: 9px;
}
.st-rank-track {
  height: 5.5px;
  border-radius: 3px;
  background: rgba(120, 120, 128, 0.24);
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 6px;
}
.st-rank-val {
  font-size: 12.5px;
  opacity: 0.65;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- 5. macOS 27 Tahoe Dual-Pane System Settings Window ---------- */
.mac-sysset {
  display: grid;
  grid-template-columns: 196px 1fr;
  width: 100%;
  height: 100%;
  background: #F4F4F7;
  color: #1D1D1F;
  overflow: hidden;
  border-radius: inherit;
}
html[data-appearance="dark"] .mac-sysset {
  background: #1C1C20;
  color: #F5F5F7;
}
.mac-sysset-side {
  display: flex;
  flex-direction: column;
  padding: 12px 10px 14px;
  background: rgba(236, 237, 242, 0.86);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  border-right: 0.5px solid rgba(128, 128, 136, 0.22);
  gap: 3px;
}
html[data-appearance="dark"] .mac-sysset-side {
  background: rgba(30, 30, 35, 0.94);
  border-right-color: rgba(255, 255, 255, 0.09);
}
.mac-sysset-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 12px;
  margin-bottom: 4px;
}
.mac-sysset-user img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.mac-sysset-user b { display: block; font-size: 13px; font-weight: 700; }
.mac-sysset-user small { display: block; font-size: 10.5px; opacity: 0.58; }

.mac-sysset-nav {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 32px;
  padding: 0 9px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}
.mac-sysset-nav:hover { background: rgba(120, 120, 128, 0.10); }
.mac-sysset-nav.active {
  background: #007AFF;
  color: #FFFFFF;
  font-weight: 600;
}
.mac-sysset-ic {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 11px;
  flex-shrink: 0;
}
.mac-sysset-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.mac-sysset-topbar {
  height: 44px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0.5px solid rgba(128, 128, 136, 0.16);
  flex-shrink: 0;
}
.mac-sysset-topbar strong { font-size: 15px; font-weight: 700; }
.mac-sysset-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 22px;
}

.mac-kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  font-size: 13px;
  border-bottom: 0.5px solid rgba(128, 128, 136, 0.16);
}
.mac-kv-row:first-child { padding-top: 2px; }
.mac-kv-row:last-child { border-bottom: none; padding-bottom: 2px; }
.mac-kv-row span:first-child { font-weight: 600; }
.mac-kv-row span:last-child { opacity: 0.68; }

.mac-appear-pills {
  display: inline-flex;
  gap: 6px;
  background: rgba(120, 120, 128, 0.14);
  padding: 3px;
  border-radius: 8px;
}
.mac-appear-pills button {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.mac-appear-pills button.on {
  background: #007AFF;
  color: #FFF;
}

/* Windows 11 Dark Mode Settings Polish */
html[data-appearance="dark"] .win-settings {
  background: #1B1B1F !important;
  color: #F3F4F6 !important;
}
html[data-appearance="dark"] .win-settings .ws-nav,
html[data-appearance="dark"] .win-settings .win-mp-titlebar {
  background: #18181C !important;
  color: #F3F4F6 !important;
}
html[data-appearance="dark"] .win-settings .ws-nav-item,
html[data-appearance="dark"] .win-settings .win-title-text,
html[data-appearance="dark"] .win-settings .win-icon-btn {
  color: #F3F4F6 !important;
}
html[data-appearance="dark"] .win-settings .ws-nav-item.active {
  background: rgba(255, 255, 255, 0.09) !important;
}
html[data-appearance="dark"] .win-settings .ws-card {
  background: #242429 !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
  color: #F3F4F6 !important;
}
html[data-appearance="dark"] .win-settings .win-search-box {
  background: #242429 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #F3F4F6 !important;
}

/* ---------- 6. Control Center Read-Only Strip (macOS Tahoe & Win11) ---------- */
.mcc-t-compute {
  border-radius: 20px;
  padding: 9px 13px;
  background: rgba(34, 36, 44, 0.74);
  backdrop-filter: blur(34px) saturate(195%);
  -webkit-backdrop-filter: blur(34px) saturate(195%);
  border: 0.5px solid rgba(255, 255, 255, 0.30);
  box-shadow: inset 0 1px 0.6px rgba(255, 255, 255, 0.42), 0 10px 24px rgba(0, 0, 0, 0.24);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.mcc-t-compute:hover { background: rgba(48, 50, 62, 0.80); }
.mcc-t-compute-ic {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #34C759;
  color: #FFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mcc-t-compute.warn .mcc-t-compute-ic {
  background: #FF9F0A;
}
.mcc-t-compute-txt {
  flex: 1;
  min-width: 0;
  line-height: 1.24;
}
.mcc-t-compute-txt b {
  display: block;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mcc-t-compute-txt small {
  display: block;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.70);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wqs-compute {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 10px;
  cursor: pointer;
  color: #1B1B1B;
  font-variant-numeric: tabular-nums;
}
.wqs-compute:hover {
  background: rgba(255, 255, 255, 0.90);
}
.wqs-compute-ic {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: #2E8B57;
  color: #FFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wqs-compute-ic.warn {
  background: #D83B01;
}
.wqs-compute-txt {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}
.wqs-compute-txt b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wqs-compute-txt small {
  display: block;
  font-size: 11px;
  color: #5D5D5D;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
