:root {
  --bg: #f5f5f5;
  --panel: #ffffff;
  --text: #202124;
  --muted: #74777f;
  --line: #e6e6e6;
  --dark: #2f2f2f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 28px 18px;
}

.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
}

.subtitle {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.updated {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  padding: 10px 11px;
  backdrop-filter: blur(3px);
}

.card-head {
  margin-bottom: 8px;
}

.card h2 {
  margin: 0 0 3px;
  font-size: 16px;
  line-height: 1.2;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.32;
}

.stats-line {
  margin-top: 4px !important;
  color: #565960 !important;
}

.open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 29px;
  border-radius: 7px;
  color: #ffffff;
  background: var(--dark);
  font-size: 12px;
  text-decoration: none;
  word-break: break-all;
}

.corner-character {
  position: fixed;
  right: 14px;
  bottom: 8px;
  width: clamp(220px, 36vw, 340px);
  max-height: 42vh;
  object-fit: contain;
  opacity: 0.52;
  pointer-events: none;
  z-index: 0;
}

.error {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  color: #9b1c1c;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(3px);
}

@media (max-width: 640px) {
  .shell { padding: 22px 12px; }
  .header { display: block; }
  .updated { margin-top: 8px; }
  .cards { grid-template-columns: 1fr; }
  .corner-character { width: 190px; max-height: 34vh; opacity: 0.44; }
}


@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --panel: #1b1b1b;
    --text: #ededed;
    --muted: #a5a5a5;
    --line: #303030;
    --dark: #f0f0f0;
  }

  .card {
    background: rgba(27, 27, 27, 0.58);
  }

  .stats-line {
    color: #c2c2c2 !important;
  }

  .open-link {
    color: #121212;
  }

  .error {
    color: #ff9b9b;
    background: rgba(27, 27, 27, 0.58);
  }

  .corner-character {
    opacity: 0.5;
  }
}
