:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #f97316;
  --shadow: 0 8px 20px rgba(15, 39, 68, 0.06);
}

[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #121b2c;
  --surface-2: #172235;
  --text: #e8eef7;
  --muted: #94a3b8;
  --line: #243049;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Sans 3", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

h2, .brand strong, .card-title {
  font-family: Lexend, "Source Sans 3", sans-serif;
}

a { color: inherit; text-decoration: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 24px 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark,
.brand-mark svg {
  width: 36px;
  height: 36px;
  color: var(--text);
  display: block;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { letter-spacing: 0.12em; font-size: 15px; }
.brand-text small { color: var(--muted); font-size: 12px; margin-top: 3px; }

.theme-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 200ms ease;
}

.theme-btn:hover { border-color: var(--accent); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .icon-moon { display: none; }
[data-theme="dark"] .theme-btn .icon-sun { display: none; }
[data-theme="dark"] .theme-btn .icon-moon { display: block; }

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 24px 56px;
}

.group { margin-bottom: 28px; }
.group h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.card {
  display: block;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 200ms ease, background-color 200ms ease;
}

.card:hover {
  border-color: var(--accent);
}

.card:focus-visible,
.theme-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card.is-disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.card.is-disabled:hover { border-color: var(--line); }

.card-body { display: grid; gap: 4px; min-width: 0; }
.card-title { font-weight: 600; font-size: 16px; }
.card-url {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 700px) {
  .topbar, main { padding-left: 16px; padding-right: 16px; }
  .cards { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .theme-btn { transition: none; }
}
