:root {
  --bg: #eef1f4;
  --card: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f3f4f6;
  --ok: #16a34a;
  --ok-bg: #e8f8ee;
  --wait: #6b7280;
  --wait-bg: #f3f4f6;
  --backup: #64748b;
  --down: #dc2626;
  --down-bg: #fef2f2;
  --btn: #111827;
  --btn-text: #ffffff;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* 顶部多留一点 + 安全区，避免「加到主屏幕」后语言切换被系统栏挡住 */
  padding:
    calc(40px + env(safe-area-inset-top, 0px))
    16px
    calc(40px + env(safe-area-inset-bottom, 0px));
}

@media (display-mode: standalone), (display-mode: fullscreen) {
  .page {
    padding-top: calc(52px + env(safe-area-inset-top, 0px));
  }
}

.topbar {
  width: min(520px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  position: relative;
  z-index: 2;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.language-switcher__select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
  border-radius: 999px;
  padding: 6px 26px 6px 10px;
  font-size: 12px;
  color: var(--ink);
  max-width: 120px;
  cursor: pointer;
}

html[dir="rtl"] .language-switcher__select {
  background-position: left 8px center;
  padding: 6px 10px 6px 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  background: #111827;
  display: block;
}

.brand-text strong {
  display: block;
  font-size: 14px;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.brand-text span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.badge-demo {
  font-size: 12px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
}
.badge-demo:hover { color: var(--ink); border-color: #cfd4dc; }

.card {
  width: min(520px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px 22px;
}

.hero {
  text-align: center;
  margin-bottom: 22px;
}

.hero-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--soft);
  display: grid;
  place-items: center;
  color: #111827;
}

.hero-icon svg { width: 28px; height: 28px; }
.hero-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
  border-radius: 10px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.cta-wrap {
  margin-bottom: 16px;
}

.lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 12px;
  background: var(--soft);
  border: 1px solid transparent;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.line.is-ok {
  background: var(--ok-bg);
  border-color: rgba(22, 163, 74, 0.18);
}

.line.is-checking {
  background: #fff;
  border-color: var(--line);
}

.line.is-down {
  background: var(--down-bg);
  border-color: rgba(220, 38, 38, 0.12);
}

.line-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.line-ico {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: #fff;
  color: var(--wait);
  border: 1px solid var(--line);
}

.line.is-ok .line-ico {
  color: var(--ok);
  border-color: rgba(22, 163, 74, 0.25);
  background: #fff;
}

.line.is-down .line-ico {
  color: var(--down);
  border-color: rgba(220, 38, 38, 0.2);
}

.line-name {
  font-size: 15px;
  font-weight: 650;
}

.line-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.line-status {
  font-size: 13px;
  font-weight: 600;
  color: var(--wait);
  white-space: nowrap;
}

.line.is-ok .line-status { color: var(--ok); }
.line.is-down .line-status { color: var(--down); }
.line.is-backup .line-status { color: var(--backup); }

.spin {
  width: 14px;
  height: 14px;
  border: 2px solid #d1d5db;
  border-top-color: #6b7280;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.cta {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--btn);
  color: var(--btn-text);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity .18s ease, transform .18s ease;
}

.cta:hover:not(:disabled) { transform: translateY(-1px); }
.cta:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.cta svg { width: 16px; height: 16px; }

.note {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
}

.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 40;
  padding: 16px;
}
.sheet-mask[hidden] { display: none !important; }
.sheet {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 18px 18px 14px 14px;
  padding: 20px 18px 16px;
  box-shadow: 0 -8px 30px rgba(0,0,0,.12);
}
.sheet h2 { margin: 0 0 8px; font-size: 18px; }
.sheet-desc { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.sheet-desc code { font-size: 12px; background: var(--soft); padding: 1px 6px; border-radius: 6px; }
.sheet-steps { margin: 0 0 16px; padding-left: 20px; color: var(--ink); font-size: 14px; line-height: 1.7; }
.sheet-close { margin-top: 0; }

.share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -4px;
  margin: 0 2px;
  color: #007aff;
}
.share-icon svg {
  display: block;
}

.tip {
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px dashed #d1d5db;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.tip svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: #6b7280;
}

.msg {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  display: none;
}
.msg.show { display: block; }

@media (max-width: 480px) {
  .card { padding: 24px 16px 18px; }
  .hero h1 { font-size: 22px; }
}
