/* ============================================================
   赛博霓虹风 · 深色终端质感
   老浏览器兼容：无 CSS 变量，flex 用 -webkit- 前缀兜底
   ============================================================ */
* { margin: 0; padding: 0; }

body {
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: #d6d6e4;
  background: #0a0a14;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-text-size-adjust: 100%;
}

/* 等宽字体，用于数字、状态、代码 */
code, .ticker, .stat-v, .batt-info strong, .src li span, .post .date,
article code, .chips a b, .src h3 em {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap.wide { max-width: 1240px; }

header {
  padding: 44px 0 22px 0;
  border-bottom: 1px solid #1c1c2e;
}

header h1 {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #f0f0ff;
}

header h1 a {
  color: #f0f0ff;
  text-decoration: none;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
}

header h1 a::before {
  content: ">_ ";
  color: #00e5ff;
}

header p {
  margin-top: 8px;
  font-size: 13px;
  color: #6b6b86;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

nav.plain { margin-top: 16px; font-size: 13px; }

nav.plain a {
  color: #6b6b86;
  text-decoration: none;
  margin-right: 18px;
  padding-bottom: 2px;
  transition: color .15s, border-color .15s;
}

nav.plain a:hover {
  color: #00e5ff;
  border-bottom: 1px solid #00e5ff;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

/* ---- 顶部状态条（终端 ticker） ---- */
.ticker {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-top: 14px;
  background: #0d0d1c;
  border: 1px solid #1c1c36;
  border-left: 2px solid #00e5ff;
  border-radius: 6px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
}

.ticker-item {
  margin-right: 20px;
  color: #9a9ab5;
  white-space: nowrap;
}

.ticker-item::before {
  content: "▸ ";
  color: #ff2d78;
}

/* ---- 源标签栏（吸顶） ---- */
.chips {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 10;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
  padding: 12px 0 10px 0;
  margin-bottom: 6px;
  background: rgba(10, 10, 20, 0.96);
  border-bottom: 1px solid #1c1c2e;
}

.chips a {
  display: inline-block;
  margin: 0 8px 6px 0;
  padding: 4px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #9a9ab5;
  background: #12121f;
  border: 1px solid #23233c;
  border-radius: 4px;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}

.chips a:hover {
  color: #00e5ff;
  border-color: #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.25);
}

.chips a b {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #ff2d78;
}

main { padding: 18px 0 8px 0; }

/* ---- 分源卡片 ---- */
.sources {
  display: -ms-grid;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-gap: 16px;
  gap: 16px;
  -webkit-box-align: start;
  -webkit-align-items: start;
  align-items: start;
}

.src {
  background: #10101c;
  border: 1px solid #1f1f38;
  border-radius: 8px;
  padding: 2px 16px 6px 16px;
  overflow: hidden;
  scroll-margin-top: 76px;
  transition: border-color .15s, box-shadow .15s;
}

.src:hover {
  border-color: #2a2a4a;
}

.src:target {
  border-color: #00e5ff;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.18);
}

.src h3 {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  -webkit-box-align: baseline;
  -webkit-align-items: baseline;
  align-items: baseline;
  padding: 12px 0 10px 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-bottom: 1px solid #1c1c30;
}

.src h3 a { color: #e0e0f0; text-decoration: none; }

.src h3 a:hover { color: #00e5ff; }

.src h3 em {
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 4px;
  padding: 1px 8px;
}

.src ul { list-style: none; }

.src li {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: baseline;
  -webkit-align-items: baseline;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid #171726;
}

.src li:last-child { border-bottom: none; }

.src li a {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  margin-right: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: #c8c8da;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s;
}

.src li a:hover { color: #00e5ff; }

.src li span {
  font-size: 11px;
  color: #55556e;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.src .empty {
  padding: 14px 0;
  font-size: 13px;
  color: #55556e;
}

.src.bad {
  border-color: #3a1c28;
  background: #150d12;
}

/* ---- 旧版文章页 ---- */
.post {
  padding: 18px 0;
  border-bottom: 1px solid #1c1c2e;
  max-width: 760px;
}

.post:last-child { border-bottom: none; }

.post .date {
  font-size: 12px;
  color: #55556e;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 6px;
}

.post h2 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 6px;
}

.post h2 a { color: #e0e0f0; text-decoration: none; transition: color .15s; }
.post h2 a:hover { color: #00e5ff; }

.post p { font-size: 14px; color: #8a8aa0; }

article { padding: 8px 0 24px 0; max-width: 760px; }

article h1 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 10px;
  color: #f0f0ff;
}

article .meta {
  font-size: 12px;
  color: #55556e;
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid #1c1c2e;
}

article p { margin-bottom: 18px; color: #c8c8da; }

article h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 28px 0 12px 0;
  color: #00e5ff;
}

article ul, article ol { margin: 0 0 18px 22px; color: #c8c8da; }

article li { margin-bottom: 8px; }

article code {
  font-size: 13px;
  background: #161626;
  border: 1px solid #23233c;
  padding: 1px 5px;
  border-radius: 3px;
  color: #00e5ff;
}

article blockquote {
  border-left: 2px solid #ff2d78;
  padding-left: 16px;
  color: #8a8aa0;
  font-size: 15px;
  margin-bottom: 18px;
}

footer {
  padding: 30px 0 50px 0;
  margin-top: 20px;
  border-top: 1px solid #1c1c2e;
  font-size: 12px;
  color: #55556e;
}

footer a { color: #6b6b86; text-decoration: none; }
footer a:hover { color: #00e5ff; }

/* ---- 电池卡片 ---- */
.batt {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  background: #10101c;
  border: 1px solid #1f1f38;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 6px;
}

.batt-bar {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  height: 10px;
  background: #1c1c2e;
  border-radius: 4px;
  overflow: hidden;
  margin-right: 16px;
}

.batt-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: #00e5ff;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
  -webkit-transition: width .4s;
  transition: width .4s;
}

.batt-info { white-space: nowrap; }

.batt-info strong {
  font-size: 18px;
  font-weight: 600;
  color: #00e5ff;
  margin-right: 10px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

.batt-info span {
  font-size: 13px;
  color: #9a9ab5;
  margin-right: 10px;
}

.batt-info .batt-sub {
  color: #55556e;
  font-size: 12px;
}

.batt-low { border-color: #4a1c28; background: #150d12; }
.batt-low .batt-bar span { background: #ff2d78; box-shadow: 0 0 8px rgba(255, 45, 120, 0.6); }

.batt-full { border-color: #1c4a34; background: #0d1512; }
.batt-full .batt-bar span { background: #2eff8a; box-shadow: 0 0 8px rgba(46, 255, 138, 0.6); }

/* ---- 访问计数器 ---- */
.counter {
  font-size: 12px;
  color: #9a9ab5;
  text-align: center;
  padding: 8px 0;
  margin-bottom: 18px;
  letter-spacing: .5px;
}

.counter strong {
  color: #ff2d78;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(255, 45, 120, 0.5);
  margin: 0 2px;
}


/* ---- 状态页 ---- */
.stat-grid {
  display: -ms-grid;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  grid-gap: 12px;
  gap: 12px;
}

.stat {
  background: #10101c;
  border: 1px solid #1f1f38;
  border-radius: 8px;
  padding: 14px 16px;
  transition: border-color .15s;
}

.stat:hover { border-color: #2a2a4a; }

.stat-k {
  display: block;
  font-size: 12px;
  color: #55556e;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.stat-v {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #e0e0f0;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.stat-note {
  margin-top: 16px;
  font-size: 12px;
  color: #55556e;
}

/* 状态页紧凑行式布局 */
.stat-list {
  background: #0e0e1a;
  border: 1px solid #1f1f38;
  border-radius: 10px;
  padding: 6px 20px;
}

.stat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid #141426;
}
.stat-line:last-child { border-bottom: none; }

.stat-line .k {
  font-size: 13px;
  color: #6b6b86;
  flex: none;
}

.stat-line .v {
  font-size: 14px;
  font-weight: 600;
  color: #d6d6e4;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  word-break: break-all;
}

.stat-line .v.good { color: #2eff8a; }
.stat-line .v.warn { color: #ffd166; }
.stat-line .v.off  { color: #6b6b86; }


/* ---- 全球行情页 ---- */
.mkt-group {
  font-size: 15px;
  font-weight: 600;
  color: #00e5ff;
  margin: 24px 0 10px 0;
  padding-left: 10px;
  border-left: 2px solid #ff2d78;
}

.mkt-grid {
  display: -ms-grid;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-gap: 12px;
  gap: 12px;
}

.mkt {
  background: #10101c;
  border: 1px solid #1f1f38;
  border-radius: 8px;
  padding: 14px 16px;
  transition: border-color .15s;
}

.mkt:hover { border-color: #2a2a4a; }

.mkt-name {
  font-size: 13px;
  color: #6b6b86;
  margin-bottom: 6px;
}

.mkt-price {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.mkt-chg {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  margin-top: 4px;
}

.mkt-time {
  font-size: 11px;
  color: #55556e;
  margin-top: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* 涨红跌绿（A股习惯） */
.mkt.up .mkt-price, .mkt.up .mkt-chg { color: #ff4d6d; text-shadow: 0 0 8px rgba(255, 77, 109, 0.4); }
.mkt.down .mkt-price, .mkt.down .mkt-chg { color: #2eff8a; text-shadow: 0 0 8px rgba(46, 255, 138, 0.4); }
.mkt.flat .mkt-price { color: #d6d6e4; }
.mkt.flat .mkt-chg { color: #55556e; }

/* ---- 城市天气 ---- */
.wth-temp {
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: #00e5ff;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.wth-cond {
  font-size: 14px;
  color: #d6d6e4;
  margin-top: 4px;
}

.wth-icon {
  font-size: 22px;
  line-height: 1;
  margin-right: 6px;
  vertical-align: middle;
}

/* AQI 分级着色 */
.wth-aqi {
  display: inline-block;
  font-size: 11px;
  border-radius: 4px;
  padding: 1px 7px;
  margin-top: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.wth-aqi.lv1 { color: #2eff8a; border: 1px solid rgba(46, 255, 138, 0.35); }
.wth-aqi.lv2 { color: #ffd166; border: 1px solid rgba(255, 209, 102, 0.35); }
.wth-aqi.lv3 { color: #ffa94d; border: 1px solid rgba(255, 169, 77, 0.35); }
.wth-aqi.lv4 { color: #ff7a5c; border: 1px solid rgba(255, 122, 92, 0.35); }
.wth-aqi.lv5 { color: #ff4d6d; border: 1px solid rgba(255, 77, 109, 0.35); }
.wth-aqi.lv6 { color: #c0399b; border: 1px solid rgba(192, 57, 155, 0.4); }

/* 天气类别卡片色调：降水偏蓝、晴偏暖、霾偏灰 */
.mkt.rain  { border-left: 2px solid #3b82f6; }
.mkt.snow  { border-left: 2px solid #a5d8ff; }
.mkt.sun   { border-left: 2px solid #ffd166; }
.mkt.haze  { border-left: 2px solid #8a8a9a; }

/* 窄屏 */
@media (max-width: 760px) {
  .sources { grid-template-columns: 1fr; }
  .wrap.wide { padding: 0 14px; }
  header { padding-top: 26px; }
}

/* ---- 网络联通质量 ---- */
.net-card {
  background: #0e0e1a;
  border: 1px solid #1f1f38;
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 14px;
}

.net-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid #141426;
}
.net-row:last-child { border-bottom: none; }

.net-name {
  width: 150px;
  flex: none;
  font-size: 14px;
  color: #c8c8dc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.net-bar {
  flex: 1;
  height: 8px;
  background: #181830;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.net-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.25);
}

.net-ms {
  width: 84px;
  flex: none;
  text-align: right;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: #d6d6e4;
}

.net-loss {
  width: 46px;
  flex: none;
  text-align: right;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: #55556e;
  font-variant-numeric: tabular-nums;
}

/* 丢包高亮（独立于延迟色，用小圆点提示） */
.net-loss.has-loss { color: #ffd166; }
.net-loss.bad-loss { color: #ff4d6d; }

.net-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-size: 12px;
  color: #6b6b86;
  margin: 0 0 18px 0;
  padding: 10px 14px;
  background: #0e0e1a;
  border: 1px solid #1f1f38;
  border-radius: 8px;
}
.net-legend .lg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.net-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

