:root {
  --theme: #10b981;
  --theme-dark: #0ea371;
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #8b95a1;
  --line: #eef1f4;
  --danger: #ef4444;
  --warn: #f59e0b;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(31, 41, 55, 0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

.wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px calc(32px + env(safe-area-inset-bottom));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶部标题 ---------- */
.brand {
  text-align: center;
  margin: 18px 0 22px;
}
.brand h1 {
  font-size: clamp(22px, 6vw, 28px);
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.brand .badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--theme);
  background: rgba(16, 185, 129, 0.1);
  border-radius: 999px;
  padding: 3px 12px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  margin: 0 0 16px;
  color: var(--text);
}

/* ---------- 线路入口 ---------- */
.link-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 12px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s;
  background: #fff;
}
.link-item:last-child { margin-bottom: 0; }
.link-item:active { transform: scale(0.985); border-color: var(--theme); }

.link-icon {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--theme);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.link-body { flex: 1; min-width: 0; }
.link-title {
  font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.link-remark { font-size: 12px; color: var(--muted); margin-top: 2px; }

.ping {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f1f3f5;
  color: var(--muted);
  min-width: 56px;
  text-align: center;
}
.ping.good { background: rgba(16,185,129,0.12); color: var(--theme); }
.ping.mid  { background: rgba(245,158,11,0.14); color: var(--warn); }
.ping.bad  { background: rgba(239,68,68,0.12); color: var(--danger); }

/* loading 骨架 */
.skeleton {
  height: 72px; border-radius: 14px; margin-bottom: 12px;
  background: linear-gradient(90deg, #f0f2f4 25%, #e6e9ec 37%, #f0f2f4 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { 0%{background-position:100% 0} 100%{background-position:-100% 0} }

/* ---------- 表单/按钮 ---------- */
.field {
  display: flex; align-items: center;
  background: #f1f3f5;
  border-radius: 12px;
  padding: 0 14px;
  margin-bottom: 14px;
}
.field input {
  flex: 1; border: 0; background: transparent; outline: none;
  padding: 14px 8px; font-size: 15px; color: var(--text);
}
.field .ico { color: var(--muted); font-size: 16px; }

.btn {
  display: block; width: 100%;
  border: 0; cursor: pointer;
  background: var(--theme); color: #fff;
  font-size: 16px; font-weight: 600;
  padding: 14px; border-radius: 12px;
  transition: background 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); background: var(--theme-dark); }
.btn.secondary { background: #eef1f4; color: var(--text); }
.btn.danger { background: var(--danger); }

.msg { font-size: 13px; text-align: center; margin: 4px 0 12px; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--theme); }

/* ---------- 信息卡 ---------- */
.info-row { text-align: center; color: var(--muted); font-size: 13px; }
.info-row strong { color: var(--text); }
.tips { font-size: 13px; color: var(--muted); }
.tips p { margin: 8px 0; white-space: pre-line; word-break: break-word; }

.footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: auto; padding-top: 18px; }

.copyright-card { padding: 16px 18px; margin-top: auto; }
.copyright-card .info-row { font-size: 13px; line-height: 1.9; }
.copyright-card .info-row strong { color: var(--text); font-weight: 600; }

/* ---------- 拦截遮罩 ---------- */
.blocked {
  position: fixed; inset: 0;
  background: rgba(17, 24, 39, 0.92);
  color: #fff; z-index: 9999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 24px;
}
.blocked .arrow { font-size: 48px; position: absolute; top: 16px; right: 24px; animation: bounce 1s infinite; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
.blocked h2 { font-size: 20px; margin: 0 0 12px; }
.blocked p { font-size: 14px; opacity: 0.85; max-width: 320px; margin: 6px 0; }
.blocked .steps { margin-top: 18px; font-size: 13px; opacity: 0.75; }
