/* ============================================================
   石墨极简（Graphite）  ·  Homepage 2.7.0  ·  v4  (2026-11-09)
   纯色深底 + 发丝边线，无背景图；文字对比度按 WCAG AA 上调
   依赖：settings.yaml → theme: dark / fullWidth: true / headerStyle: boxedWidgets
   回滚：custom-light.css.bak（浅色）/ custom-console.css.bak（监控台）
   ============================================================ */

:root {
  --g-bg: #0D1117;
  --g-card: #151A21;
  --g-card-hover: #1A2028;
  --g-line: #242C36;
  --g-line-hover: #3A4550;
  /* 文字四档对比度：标题 > 值 > 描述 > 标签 */
  --g-t1: #F4F7FA;   /* 卡片标题  ~15.8:1 */
  --g-t2: #E4EBF2;   /* 数值      ~12.6:1 */
  --g-t3: #BAC6D4;   /* 描述      ~9.6:1  */
  --g-t4: #8B97A6;   /* 次要标签  ~5.6:1  */
  --g-accent: #58A6FF;
  --g-good: #3FB950;
}

/* ---------- 页面底 ---------- */
html,
body {
  background: var(--g-bg) !important;
  color: var(--g-t2) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 55% at 50% -18%, #131A23 0%, rgba(19, 26, 35, 0) 62%),
    var(--g-bg);
}

.container {
  position: relative;
  z-index: 10;
}

/* ---------- 顶栏资源盒 ---------- */
/* 本机资源是 div.widget-container，远程资源是 a.information-widget-resources，两者都要覆盖 */
#information-widgets .widget-container,
#information-widgets .information-widget-resources,
#widgets-wrap > a {
  background: var(--g-card) !important;
  border: 0 !important;
  border-radius: 10px !important;
  box-shadow: inset 0 0 0 1px var(--g-line) !important;
}

#widgets-wrap > a:hover {
  background: var(--g-card-hover) !important;
}

/* 顶栏文字：资源数值提亮 */
#widgets-wrap .resource-value {
  color: var(--g-t1) !important;
  font-weight: 600 !important;
  font-variant-numeric: tabular-nums;
}

#widgets-wrap .resource-usage {
  background: #2B343F !important;
}

#widgets-wrap .resource-usage > div {
  background: var(--g-accent) !important;
  opacity: 0.85;
}

/* 顶栏默认 justify-between 会把两个资源盒拉到大屏两端，改靠左聚拢 */
#widgets-wrap {
  justify-content: flex-start !important;
  align-items: stretch !important;
  column-gap: 10px !important;
  row-gap: 10px !important;
}

/* ---------- 分组标题 ---------- */
#layout-groups {
  margin: 16px 16px 10px !important;
}

.services-group {
  padding: 2px 2px 0 !important;
}

.services-group > button {
  border-bottom: 1px solid var(--g-line) !important;
  padding-bottom: 8px !important;
  margin-bottom: 4px !important;
}

.services-group > button > h2,
h2.service-group-name {
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0.07em !important;
  color: var(--g-t1) !important;
  /* 分组标题用短竖线做锚点，比整条下划线更轻 */
  padding-left: 11px !important;
  position: relative;
}

.services-group > button > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 3px;
  border-radius: 2px;
  background: var(--g-accent);
  opacity: 0.75;
}

/* ---------- 卡片栅格 ---------- */
ul.services-list {
  margin-top: 10px !important;
  column-gap: 10px !important;
  gap: 10px !important;
}

/* ---------- 卡片 ---------- */
.service-card {
  background: var(--g-card) !important;
  border: 1px solid var(--g-line) !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  margin-bottom: 0 !important;
  height: 100%;
  min-height: 62px;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.service-card:hover {
  background: var(--g-card-hover) !important;
  border-color: var(--g-line-hover) !important;
}

/* 图标：40px，与深色底适配的暗色瓦片 */
.service-icon {
  width: 44px !important;
  min-width: 44px !important;
}

.service-icon img {
  width: 40px !important;
  height: 40px !important;
  border-radius: 9px;
  object-fit: contain !important;
}

/* 卡片标题：提亮 + 加粗 + 略带字距 */
.service-name {
  padding: 2px 6px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em !important;
  color: var(--g-t1) !important;
}

/* 描述：从 #8B949E 提到 #AEBAC8，是这次对比度提升最明显的一处 */
.service-description {
  margin-top: 2px;
  font-size: 11.5px !important;
  font-weight: 400 !important;
  letter-spacing: 0.01em !important;
  color: var(--g-t3) !important;
}


/* ---------- 右侧极小标注（由 custom.js 注入） ----------
   说明流量口径：只统计 Z4 自身 bond0，不含全屋其他设备 */
.service-name {
  position: relative;
}

.hp-note {
  position: absolute;
  right: 10px;
  top: 3px;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--g-t4);
  opacity: 0.9;
  pointer-events: none;
  white-space: nowrap;
}

/* ---------- 状态点 ---------- */
.service-site-monitor {
  padding: 7px !important;
}

.site-monitor-status {
  padding: 0 !important;
  background: transparent !important;
}

.site-monitor-status > div {
  width: 8px !important;
  height: 8px !important;
  background: var(--g-good) !important;
  box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.15);
}

/* ---------- widget 数值行 ---------- */
.service-card > div.flex.flex-col {
  margin: 2px 0 0 2px !important;
  padding-bottom: 0 !important;
}

.service-card > div.flex.flex-col > div {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  font-size: 11.5px !important;
  letter-spacing: 0.01em;
  color: var(--g-t2) !important;
}

.service-card dt,
.service-card .widget-label {
  color: var(--g-t4) !important;
  font-size: 10.5px !important;
}

/* ---------- glances 类卡片的角落浮层 ---------- */
.service-card .service-container > div.absolute.bottom-3.right-3 {
  position: static !important;
  margin-top: 3px;
  padding-right: 0 !important;
}

.service-card .service-container > div.absolute.bottom-3.right-3 > div {
  font-size: 11px !important;
  opacity: 1 !important;
  color: var(--g-t2) !important;
  line-height: 1.55;
}

.service-card .service-container > div.absolute.bottom-3.left-3 {
  display: none !important;
}

/* ---------- 搜索框 ---------- */
#information-widgets input {
  background: var(--g-card) !important;
  border: 1px solid var(--g-line) !important;
  border-radius: 9px !important;
  color: var(--g-t1) !important;
}

#information-widgets input::placeholder {
  color: var(--g-t4) !important;
}

#information-widgets input:focus {
  border-color: #4A5A6B !important;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.12);
}

/* ---------- 书签 ---------- */
.bookmark {
  border-radius: 9px;
  color: var(--g-t2);
  transition: background-color 0.16s ease;
}

.bookmark:hover {
  background: var(--g-card-hover) !important;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #2B343F;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3A4550;
}
