:root {
  --bg: #071a12;
  --bg-soft: #0d2b1d;
  --panel: rgba(255, 252, 248, 0.96);
  --ink: #1f2a24;
  --ink-soft: #5c6b63;
  --line: #e4ddd2;
  --gold: #c9a227;
  --gold-soft: #f3e6b5;
  --pine: #0d2b1d;
  --ok: #1f7a4c;
  --ok-bg: #e8f6ee;
  --bad: #b42318;
  --bad-bg: #fdecec;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --radius: 14px;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: Georgia, "Songti SC", "SimSun", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 50% -80px, rgba(201, 162, 39, 0.18), transparent 60%),
    linear-gradient(180deg, #0a2218 0%, var(--bg) 42%, #05140e 100%);
  padding: 28px 16px 40px;
  padding-bottom: max(40px, env(safe-area-inset-bottom));
  line-height: 1.55;
}

.page {
  width: min(720px, 100%);
  margin: 0 auto;
}

.hero {
  text-align: center;
  color: #f6f1e8;
  margin-bottom: 22px;
  padding: 8px 8px 4px;
}

.hero-kicker {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-soft);
  opacity: 0.9;
  margin-bottom: 10px;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff8e8;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  margin-bottom: 12px;
}

.hero-permanent {
  font-size: 15px;
  font-weight: 650;
  color: var(--gold);
  margin-bottom: 6px;
}

.hero-tip {
  font-size: 13px;
  color: rgba(246, 241, 232, 0.72);
}

.app-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: linear-gradient(135deg, rgba(255, 248, 232, 0.96), rgba(243, 230, 181, 0.88));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.app-card-copy {
  min-width: 0;
}

.app-card-copy strong {
  display: block;
  color: var(--pine);
  font-size: 15px;
  font-weight: 750;
  margin-bottom: 2px;
}

.app-card-copy p {
  margin: 0;
  color: #6b5a2e;
  font-size: 12px;
  line-height: 1.45;
}

.app-download {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--pine);
  color: #f6f1e8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.app-download:hover { background: #164532; }

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 18px 16px 16px;
}

.panel-head {
  margin: 0 4px 14px;
}

.panel-head h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--pine);
}

.panel-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-soft);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.cell-ms {
  display: flex;
  justify-content: center;
}

.ms {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  min-width: 64px;
  padding: 7px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: #f3f0ea;
  color: var(--ink-soft);
}

.ms small {
  font-size: 10px;
  font-weight: 600;
  margin-left: 1px;
}

.ms.is-pending {
  color: #8a7f6e;
  background: #f4efe6;
  animation: pulse 1.1s ease-in-out infinite;
}

.ms.is-done {
  color: var(--ok);
  background: var(--ok-bg);
}

.ms.is-best {
  color: #7a5a00;
  background: var(--gold-soft);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.45);
}

.ms.is-timeout {
  color: var(--bad);
  background: var(--bad-bg);
}

.cell-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cell-url {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
}

.tag-best {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: #7a5a00;
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 3px 8px;
}

.enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--pine);
  color: #f6f1e8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.12s ease;
}

.enter:hover { background: #164532; }
.enter:active { transform: scale(0.97); }

.retest {
  display: block;
  width: 100%;
  margin-top: 14px;
  min-height: 44px;
  border: 1px solid rgba(13, 43, 29, 0.18);
  border-radius: 12px;
  background: #f3efe6;
  color: var(--pine);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s ease, opacity 0.12s ease;
}

.retest:hover:not(:disabled) { background: #ebe4d8; }
.retest:disabled {
  opacity: 0.65;
  cursor: default;
}

.empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--ink-soft);
  font-size: 14px;
}

.foot {
  margin-top: 18px;
  text-align: center;
  color: rgba(246, 241, 232, 0.55);
  font-size: 12px;
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@media (max-width: 560px) {
  body { padding: 20px 12px 32px; }
  .panel { padding: 14px 12px 12px; }
  .app-card {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }
  .app-download { width: 100%; }
  .row {
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-areas:
      "ms main"
      "btn btn";
  }
  .cell-ms { grid-area: ms; }
  .cell-main { grid-area: main; }
  .cell-btn {
    grid-area: btn;
  }
  .enter { width: 100%; }
  .ms { min-width: 56px; padding: 6px 6px; }
  .cell-url { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .ms.is-pending { animation: none; }
  .enter { transition: none; }
}
