:root { color-scheme: light dark; }
[data-theme="light"] { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f6f8fa;
  color: #1f2328;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

  [data-theme="dark"] body { background: #0d1117; color: #e6edf3; }
  [data-theme="dark"] .card { background: #161b22; border-color: #30363d; }
  [data-theme="dark"] .top { background: #161b22; border-color: #30363d; }
  [data-theme="dark"] .gh-btn { background: #21262d; border-color: #30363d; color: #e6edf3; }
  [data-theme="dark"] .gh-btn:hover { background: #30363d; }
  [data-theme="dark"] a { color: #58a6ff; }
  [data-theme="dark"] .muted { color: #7d8590; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid #d0d7de;
}
.top .brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.top .brand img { width: 28px; height: 28px; border-radius: 6px; }
.top .brand a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.top .nav {
  display: flex; gap: 2px; flex: 1;
  justify-content: center;
  margin: 0 16px;
}
.top .top-right { display: flex; align-items: center; gap: 12px; }
.top .nav a {
  padding: 6px 12px; border-radius: 6px;
  font-size: 13px; font-weight: 500;
  color: #57606a; text-decoration: none;
  white-space: nowrap;
}
.top .nav a:hover { background: #eaeef2; color: #1f2328; }
.top .nav a.active { background: #eaeef2; color: #1f2328; font-weight: 600; }
.top .nav a .ext { font-size: 10px; opacity: .55; margin-left: 2px; vertical-align: 1px; }
.top .user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.top .user img { width: 24px; height: 24px; border-radius: 50%; }
.top .user a { color: inherit; text-decoration: none; opacity: 0.7; }
.top .user a:hover { opacity: 1; }

  [data-theme="dark"] .top .nav a { color: #7d8590; }
  [data-theme="dark"] .top .nav a:hover, [data-theme="dark"] .top .nav a.active { background: #21262d; color: #e6edf3; }

@media (max-width: 720px) {
  .top .nav { display: none; }
}
main { flex: 1; padding: 48px 24px; max-width: 960px; width: 100%; margin: 0 auto; }
h1 { margin: 0 0 8px; font-size: 28px; }
.muted { color: #57606a; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.card {
  display: block;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: transform .08s ease, border-color .08s ease;
}
.card:hover { transform: translateY(-1px); border-color: #8c959f; }
.card .name { font-weight: 600; margin-bottom: 4px; }
.card .desc { font-size: 13px; color: #57606a; }

  [data-theme="dark"] .card .desc { color: #7d8590; }

.login {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.login .box {
  text-align: center;
  padding: 40px 32px;
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  max-width: 380px;
  width: 100%;
}

  [data-theme="dark"] .login .box { background: #161b22; border-color: #30363d; }

.login img { width: 72px; height: 72px; border-radius: 12px; margin-bottom: 16px; }
.login h1 { font-size: 22px; margin-bottom: 6px; }
.login .sub { font-size: 14px; color: #57606a; margin-bottom: 28px; }
.gh-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  background: #1f2328; color: #fff;
  border: 1px solid #1f2328;
  border-radius: 6px;
  font-weight: 500; text-decoration: none;
  cursor: pointer;
}
.gh-btn:hover { background: #32383f; }
.gh-btn svg { width: 18px; height: 18px; fill: currentColor; }
.login .footer { margin-top: 24px; font-size: 12px; color: #57606a; }

/* Theme toggle button (in header) */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  padding: 0; margin: 0;
  background: transparent;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  color: #57606a;
  cursor: pointer;
  line-height: 1;
}
.theme-toggle:hover { background: #eaeef2; color: #1f2328; }
.theme-toggle svg { width: 16px; height: 16px; fill: currentColor; }
.theme-toggle .ti-sun  { display: none; }
.theme-toggle .ti-moon { display: block; }
[data-theme="dark"] .theme-toggle { border-color: #30363d; color: #7d8590; }
[data-theme="dark"] .theme-toggle:hover { background: #21262d; color: #e6edf3; }
[data-theme="dark"] .theme-toggle .ti-moon { display: none; }
[data-theme="dark"] .theme-toggle .ti-sun  { display: block; }
