:root {
  --bg: #0b0a10;
  --bg-2: #13111c;
  --card: #181524;
  --card-hover: #201b30;
  --line: #2a2438;
  --text: #ece9f5;
  --dim: #8d86a3;
  --pink: #ff6b9d;
  --pink-2: #ff3d7f;
  --gold: #ffc257;
  --purple: #b484ff;
  --blue: #6f9bff;
  --radius: 14px;
}

* { box-sizing: border-box; }

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

a { color: inherit; text-decoration: none; }
a:hover { color: var(--pink); }

.glow {
  position: fixed;
  inset: -30% -10% auto -10%;
  height: 70vh;
  background:
    radial-gradient(closest-side, rgba(255, 107, 157, 0.22), transparent 70%),
    radial-gradient(closest-side at 75% 40%, rgba(180, 132, 255, 0.16), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}

/* ---------- header ---------- */
.hero {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 21, 36, 0.9), rgba(11, 10, 16, 0.4));
  backdrop-filter: blur(8px);
}
.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 14px;
  font-size: 24px; font-weight: 800;
  color: #1a0d16;
  background: linear-gradient(135deg, var(--pink), var(--gold));
  box-shadow: 0 6px 24px rgba(255, 61, 127, 0.35);
  flex: none;
}
h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0.02em;
}
h1 .dot { color: var(--pink); }
.sub {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--dim);
}
.sub .sep { margin: 0 7px; color: var(--line); }
.sub .credit a {
  color: var(--text);
  border-bottom: 1px solid rgba(255, 107, 157, 0.35);
  padding-bottom: 1px;
}
.sub .credit a:hover {
  color: var(--pink);
  border-bottom-color: var(--pink);
}

.hero-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.updated {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6);
  animation: pulse 2.4s infinite;
  flex: none;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

/* ---------- layout ---------- */
main {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 20px 10px;
}

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 26px;
}
.stat {
  background: linear-gradient(160deg, var(--card), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-value {
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, #fff, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label {
  font-size: 12.5px;
  color: var(--dim);
  margin-top: 2px;
}

/* ---------- controls ---------- */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.tabs { display: flex; gap: 6px; background: var(--bg-2); padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.tab {
  border: 0;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 13.5px;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab b { font-weight: 600; color: inherit; opacity: 0.65; margin-left: 2px; font-variant-numeric: tabular-nums; }
.tab:hover { color: var(--text); }
.tab.is-active {
  background: linear-gradient(135deg, var(--pink-2), #c9348f);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 61, 127, 0.3);
}
.tab.is-active b { opacity: 0.85; }

.tools { display: flex; gap: 8px; flex-wrap: wrap; }
.search, .select {
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search { width: 220px; }
.search::placeholder { color: #5f5875; }
.search:focus, .select:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.15);
}
.select { cursor: pointer; }

/* ---------- grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 10px;
}

.card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  position: relative;
  overflow: hidden;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
  animation: rise 0.28s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.card:hover {
  background: var(--card-hover);
  border-color: #3b3352;
  transform: translateY(-2px);
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent, #444);
}
.card.lv1 { --accent: var(--gold); }
.card.lv2 { --accent: var(--purple); }
.card.lv3 { --accent: var(--blue); }
.card.is-off { opacity: 0.62; }
.card.is-off:hover { opacity: 1; }

.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #241f33;
  flex: none;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
}

.meta { min-width: 0; flex: 1; }
.name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.name:hover { color: var(--pink); }
.uid {
  font-size: 11.5px;
  color: #6b6480;
  font-variant-numeric: tabular-nums;
}
.tags {
  display: flex;
  gap: 5px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.tag {
  font-size: 10.5px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--dim);
  white-space: nowrap;
}
.tag.lv1 { color: var(--gold); border-color: rgba(255, 194, 87, 0.35); background: rgba(255, 194, 87, 0.08); }
.tag.lv2 { color: var(--purple); border-color: rgba(180, 132, 255, 0.35); background: rgba(180, 132, 255, 0.08); }
.tag.lv3 { color: var(--blue); border-color: rgba(111, 155, 255, 0.35); background: rgba(111, 155, 255, 0.08); }
.tag.off { color: #ff8a8a; border-color: rgba(255, 138, 138, 0.3); background: rgba(255, 138, 138, 0.07); }
.tag.new { color: #3ddc84; border-color: rgba(61, 220, 132, 0.3); background: rgba(61, 220, 132, 0.07); }

/* ---------- more / empty ---------- */
.more { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 0 10px; }
.load-more {
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 26px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.load-more:hover { border-color: var(--pink); background: rgba(255, 107, 157, 0.08); }
.empty { color: var(--dim); font-size: 13.5px; text-align: center; padding: 40px 0; margin: 0; }

/* ---------- footer ---------- */
.foot {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 20px auto 0;
  padding: 22px 20px 46px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 12.5px;
  line-height: 1.8;
}
.foot p { margin: 0 0 6px; }
.foot .dim { color: #5f5875; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { padding: 20px 16px; }
  h1 { font-size: 17.5px; }
  main { padding: 20px 16px 0; }
  .search { width: 100%; }
  .tools { width: 100%; }
  .search, .select { flex: 1 1 auto; }
  .grid { grid-template-columns: 1fr; }
}

/* ---------- 万舰纪念页 ---------- */
.ms-link {
  font-size: 12.5px;
  color: var(--gold);
  background: rgba(255, 194, 87, 0.08);
  border: 1px solid rgba(255, 194, 87, 0.3);
  padding: 7px 14px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.ms-link:hover {
  color: var(--gold);
  background: rgba(255, 194, 87, 0.16);
  border-color: var(--gold);
}

.ms-callout {
  background: linear-gradient(160deg, rgba(255, 107, 157, 0.1), rgba(180, 132, 255, 0.06));
  border: 1px solid rgba(255, 107, 157, 0.25);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 13.5px;
  line-height: 1.8;
  margin-bottom: 18px;
}
.ms-callout code {
  background: rgba(255, 255, 255, 0.07);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12.5px;
}
.dim { color: var(--dim); }

.ms-legend { font-size: 12.5px; color: var(--dim); padding: 8px 12px; }

.ms-list { display: flex; flex-direction: column; gap: 6px; }

.ms-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 14px;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.ms-row:hover {
  background: var(--card-hover);
  border-color: #3b3352;
  transform: translateX(2px);
}

.ms-no {
  width: 64px;
  flex: none;
  text-align: right;
  color: #6b6480;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.ms-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: #241f33;
  border: 1.5px solid rgba(255, 255, 255, 0.07);
}
.ms-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ms-uid {
  display: block;
  font-size: 11px;
  color: #6b6480;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.ms-meta {
  flex: none;
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
}
.ms-date {
  width: 100px;
  flex: none;
  text-align: right;
  font-size: 12.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .ms-no { width: 44px; font-size: 11.5px; }
  .ms-date { display: none; }
  .ms-meta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
