*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue',
               'Microsoft YaHei', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  color: #151515;
  min-height: 100vh;
}

body {
  background:
    radial-gradient(900px 500px at 50% -100px, rgba(92, 222, 141, 0.35), transparent 60%),
    radial-gradient(700px 500px at 100% 30%, rgba(0, 204, 76, 0.12), transparent 60%),
    #F3FDF7;
  background-attachment: fixed;
  padding: 24px 16px 40px;
}

.container {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============ Brand Header ============ */
.brand {
  text-align: center;
  padding: 18px 0 4px;
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.logo {
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 204, 76, 0.3));
}

.brand-name {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  color: #151515;
  letter-spacing: 1px;
}

.brand-sub {
  font-size: 13px;
  color: rgba(20, 20, 20, 0.6);
  margin: 0 0 12px;
  letter-spacing: 4px;
  position: relative;
  display: inline-block;
  padding-bottom: 8px;
}
.brand-sub::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 50px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #5CDE8D, #00cc4c);
  transform: translateX(-50%);
}

.bookmark-tip {
  display: inline-block;
  font-size: 12px;
  color: #00a83e;
  background: rgba(0, 204, 76, 0.08);
  border: 1px solid rgba(0, 204, 76, 0.2);
  border-radius: 999px;
  padding: 5px 14px;
  margin: 10px 0 0;
}

/* ============ Permanent Domain Card ============ */
.permanent-card {
  text-align: center;
  background:
    linear-gradient(135deg, rgba(92, 222, 141, 0.08), rgba(0, 204, 76, 0.04)),
    #fff;
  border: 1px dashed rgba(0, 204, 76, 0.35);
  padding: 18px 18px 16px;
}

.permanent-label {
  font-size: 12px;
  color: #00a83e;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-weight: 500;
}

.permanent-domain {
  font-size: 28px;
  font-weight: 700;
  font-family: 'SF Mono', Menlo, Consolas, 'PingFang SC', monospace;
  background: linear-gradient(90deg, #5CDE8D, #00cc4c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 1px;
  margin: 4px 0 14px;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}

.permanent-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-outline {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #00a83e;
  background: rgba(0, 204, 76, 0.06);
  border: 1px solid rgba(0, 204, 76, 0.3);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}
.btn-outline:hover { background: rgba(0, 204, 76, 0.14); border-color: rgba(0, 204, 76, 0.5); }
.btn-outline:active { transform: scale(0.97); }

.permanent-tip {
  font-size: 12px;
  color: rgba(20, 20, 20, 0.55);
  margin: 12px 0 0;
}

/* ============ Cards ============ */
.card {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  box-shadow:
    0 1px 2px rgba(0, 100, 30, 0.04),
    0 8px 24px rgba(0, 100, 30, 0.06);
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  color: #151515;
  position: relative;
  padding-bottom: 8px;
}
.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #5CDE8D, #00cc4c);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-desc {
  font-size: 12px;
  color: rgba(20, 20, 20, 0.55);
  margin: 6px 0 14px;
}

/* ============ Buttons ============ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, #5CDE8D, #00cc4c);
  border: none;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 204, 76, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
}
.btn-primary:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 204, 76, 0.4); }
.btn-primary:not(:disabled):active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.7; cursor: wait; background: #A3EDBE; box-shadow: none; }

.btn-sm { font-size: 14px; padding: 8px 20px; }
.btn-lg { width: 100%; font-size: 17px; padding: 14px 24px; margin-top: 4px; }

/* ============ Download Card ============ */
.download-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.download-platform {
  font-size: 15px;
  font-weight: 600;
  color: #151515;
  margin-bottom: 2px;
}

.download-version {
  font-size: 12px;
  color: rgba(20, 20, 20, 0.55);
}

/* ============ Web Card / Hero ============ */
.hero-tip {
  font-size: 12px;
  color: rgba(20, 20, 20, 0.55);
  text-align: center;
  margin-top: 10px;
}

/* ============ Retest Button ============ */
.btn-retest {
  font: inherit;
  font-size: 12px;
  color: #00a83e;
  background: rgba(0, 204, 76, 0.08);
  border: 1px solid rgba(0, 204, 76, 0.2);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.btn-retest:hover { background: rgba(0, 204, 76, 0.14); }
.btn-retest:disabled { opacity: 0.5; cursor: wait; }

.retest-icon { display: inline-block; font-size: 14px; }
.btn-retest.testing .retest-icon { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Lines List ============ */
.lines-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.line-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fafdfb;
  border: 1px solid #ebf3ee;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  color: inherit;
}

.line-item:hover {
  background: #f0faf3;
  border-color: #A3EDBE;
  transform: translateX(2px);
}

.line-item.is-fastest {
  background: linear-gradient(90deg, rgba(92, 222, 141, 0.12), rgba(0, 204, 76, 0.04));
  border-color: rgba(0, 204, 76, 0.35);
}

.line-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cbd2d6;
  flex-shrink: 0;
}
.line-status-dot.testing {
  background: #5CDE8D;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}
.line-status-dot.fast { background: #00cc4c; box-shadow: 0 0 0 3px rgba(0, 204, 76, 0.15); }
.line-status-dot.medium { background: #f5a623; box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15); }
.line-status-dot.slow { background: #ff7a45; box-shadow: 0 0 0 3px rgba(255, 122, 69, 0.15); }
.line-status-dot.timeout { background: #ccc; }

.line-main { flex: 1; min-width: 0; }
.line-name {
  font-size: 15px;
  font-weight: 600;
  color: #151515;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.line-host {
  font-size: 11px;
  color: #999;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  word-break: break-all;
}

.line-meta { text-align: right; flex-shrink: 0; min-width: 60px; }
.line-latency { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.line-latency.fast { color: #00cc4c; }
.line-latency.medium { color: #f5a623; }
.line-latency.slow { color: #ff7a45; }
.line-latency.timeout { color: #bbb; font-size: 13px; font-weight: 500; }
.line-latency.testing { color: #686f7e; font-size: 13px; font-weight: 500; }
.line-unit { font-size: 11px; color: rgba(20, 20, 20, 0.5); margin-left: 2px; font-weight: 500; }

.fastest-badge {
  font-size: 10px;
  color: #fff;
  background: linear-gradient(90deg, #5CDE8D, #00cc4c);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ============ Footer ============ */
.footer { text-align: center; padding: 16px 0 8px; }
.footer-domain {
  font-size: 13px;
  color: rgba(20, 20, 20, 0.65);
  margin: 0 0 6px;
}
.footer-domain strong {
  color: #00a83e;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.copyright { font-size: 11px; color: rgba(20, 20, 20, 0.4); margin: 0; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 30, 24, 0.92);
  color: #fff;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 99;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ Responsive ============ */
@media (max-width: 380px) {
  .brand-name { font-size: 24px; }
  .logo { font-size: 30px; }
  .permanent-domain { font-size: 22px; }
  .btn-lg { font-size: 16px; padding: 13px 20px; }
  .card { padding: 14px; }
}
