/* ============================================================
 * NetPulse 测速站 — 中国科学技术大学测速站风格（基于 LibreSpeed 引擎）
 * 白底蓝调学术风 · 双 Canvas 圆弧仪表 · 四格指标
 * ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  border: none;
  background: #f5f5f5;
  color: #202020;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Roboto", system-ui, sans-serif;
}
body { text-align: center; -webkit-font-smoothing: antialiased; }

a { color: inherit; }

/* ===== 顶部条 ===== */
.top {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
}
.logo { font-weight: 800; letter-spacing: .5px; font-size: 1.05rem; color: #404040; }
.logo b { color: #6060AA; }
.nav a { color: #707070; font-size: .88rem; margin-left: 16px; text-decoration: none; transition: color .2s; }
.nav a:hover { color: #404040; }

/* ===== 主标题 ===== */
.site-title {
  color: #404040; font-size: 1.5rem; font-weight: 700;
  margin: 6px 0 2px;
}
.site-sub { color: #909090; font-size: .85rem; margin-bottom: 18px; }

/* ===== 开始测速按钮 ===== */
#startStopBtn {
  display: inline-block; margin: 0 auto;
  color: #6060AA; background: transparent;
  border: 0.15em solid #6060FF; border-radius: 0.3em;
  transition: all 0.3s;
  width: 8em; height: 3em; line-height: 2.7em;
  cursor: pointer; font-size: 1.05rem; font-family: inherit;
  box-shadow: 0 0 0 rgba(0,0,0,0.1), inset 0 0 0 rgba(0,0,0,0.1);
}
#startStopBtn:hover { box-shadow: 0 0 2em rgba(0,0,0,0.1), inset 0 0 1em rgba(0,0,0,0.1); }
#startStopBtn.running { background: #FF3030; border-color: #FF6060; color: #FFFFFF; }
#startStopBtn:before { content: "开始测速"; }
#startStopBtn.running:before { content: "终止测速"; }

.privacy {
  display: inline-block; font-size: 0.8em; color: #808080;
  padding: 0 3em; cursor: pointer; margin: 8px 0 6px;
  text-decoration: underline; opacity: .7; transition: opacity .2s;
}
.privacy:hover { opacity: 1; }

/* ===== 测速区 ===== */
#test { margin-top: 0.5em; }
.testGroup { display: block; margin: 0 auto; }

.testArea {
  display: inline-block; width: 16em; height: 12.5em;
  position: relative; box-sizing: border-box;
  margin: 2px;
}
.testArea2 {
  display: inline-block; width: 14em; height: 7em;
  position: relative; box-sizing: border-box; text-align: center;
  margin: 2px;
}
.testArea .testName { position: absolute; top: 0.4em; left: 0; width: 100%; font-size: 1.05rem; z-index: 9; color: #707070; }
.testArea2 .testName { display: block; text-align: center; font-size: 1.05rem; color: #707070; margin-top: 14px; }
.testArea .meterText { position: absolute; bottom: 1.55em; left: 0; width: 100%; font-size: 2.5em; z-index: 9; font-weight: 700; }
.testArea2 .meterText { display: inline-block; font-size: 2.2em; font-weight: 700; }
.meterText:empty:before { content: "0.00"; }
.testArea .unit { position: absolute; bottom: 2em; left: 0; width: 100%; z-index: 9; color: #909090; font-size: .8em; }
.testArea2 .unit { display: inline-block; color: #909090; font-size: .8em; }
.testArea canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }

/* IP 区 */
#ipArea {
  margin: 6px auto 0; max-width: 640px;
  color: #707070; font-size: .95rem; min-height: 1.6em;
}
#ipArea #ip { color: #404040; font-weight: 600; }
#ipArea #geoInfo { color: #707070; }

/* 进度条 */
.progress-wrap {
  max-width: 480px; margin: 10px auto 0; height: 4px;
  background: #e8e8e8; border-radius: 3px; overflow: hidden;
}
.progress-fill { height: 100%; width: 0; background: #6060AA; transition: width .3s linear; }

/* ===== 服务信息 / 友链 / 页脚 ===== */
.server-info {
  margin: 22px auto 8px; max-width: 640px;
  font-size: .82rem; color: #808080; line-height: 1.9;
}
.server-info a { color: #6060AA; text-decoration: none; }
.server-info a:hover { text-decoration: underline; }
.friends {
  margin: 4px auto 0; max-width: 640px;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.friends a {
  font-size: .82rem; color: #707070; text-decoration: none;
  padding: 4px 12px; border: 1px solid #e0e0e0; border-radius: 6px;
  transition: all .2s;
}
.friends a:hover { border-color: #6060FF; color: #6060AA; }
.foot { color: #aaa; font-size: .78rem; padding: 12px 20px 24px; }

/* ===== 隐私弹层 ===== */
#privacyPolicy {
  position: fixed; top: 2em; bottom: 2em; left: 2em; right: 2em;
  overflow-y: auto; width: auto; height: auto;
  box-shadow: 0 0 3em 1em rgba(0,0,0,.5); z-index: 999999;
  text-align: left; background: #FFFFFF; padding: 1.5em;
  border-radius: 10px; max-width: 560px; margin: 0 auto;
}
#privacyPolicy h2 { color: #404040; margin-bottom: 8px; }
#privacyPolicy ul { padding-left: 1.4em; line-height: 1.9; }
.closePrivacyPolicy { width: 100%; text-align: center; margin-top: 12px; }

/* ===== 地球连接 加载动画（1.2 秒） ===== */
#loader {
  position: fixed; inset: 0; z-index: 50;
  background: #f5f5f5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  transition: opacity .45s ease;
}
#loader .skip {
  position: absolute; top: 16px; right: 20px;
  color: #808080; font-size: .85rem; cursor: pointer;
  border: 1px solid #e0e0e0; border-radius: 999px; padding: 5px 14px;
  transition: all .2s;
}
#loader .skip:hover { color: #404040; border-color: #909090; }
.globe-wrap { width: 150px; height: 150px; }
.globe-wrap svg { width: 100%; height: 100%; }
.loader-text { color: #808080; font-size: .95rem; letter-spacing: 1px; }
.loader-text .dots::after { content: ""; animation: dots 1.4s steps(4,end) infinite; }
@keyframes dots { 0%{content:""} 25%{content:"."} 50%{content:".."} 75%{content:"..."} 100%{content:""} }
.load-bar { width: 140px; height: 3px; background: #e8e8e8; border-radius: 3px; overflow: hidden; }
.load-bar i { display: block; height: 100%; width: 0; background: #6060AA; }
.globe-spin.css-spin { animation: spin 20s linear infinite; transform-origin: 130px 130px; }
@keyframes spin { to { transform: rotate(360deg); } }
.load-bar.css-run i { animation: bar 1.2s ease forwards; }
@keyframes bar { to { width: 100%; } }

/* ===== Toast（可选小提示） ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #fff; color: #202020; padding: 10px 24px;
  border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,.12);
  font-size: .9rem; z-index: 60; opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* ===== 响应式 ===== */
@media all and (max-width: 40em) {
  body { font-size: 0.82em; }
  .site-title { font-size: 1.2rem; }
}
