*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fff;
  color: #111;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 3rem 2rem 2rem;
  text-align: center;
}

header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #111;
}

.tagline {
  margin-top: 0.5rem;
  color: #666;
  font-size: 1rem;
}

main {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* Search form */
.search-form {
  margin-top: 1.5rem;
  text-align: center;
}

.input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 520px;
  margin: 0 auto;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
}

.at-prefix {
  padding: 0 0.6rem 0 1rem;
  color: #999;
  font-size: 1.1rem;
  user-select: none;
}

.input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #111;
  font-size: 1.1rem;
  padding: 0.75rem 0.5rem;
}

.input-row input::placeholder { color: #aaa; }

.input-row button {
  background: #ff0000;
  color: #fff;
  border: none;
  padding: 0.75rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.input-row button:hover { background: #cc0000; }

.hint {
  margin-top: 0.6rem;
  color: #aaa;
  font-size: 0.85rem;
}

.hint code {
  color: #888;
  font-family: monospace;
}

/* Error */
.error-box {
  margin-top: 1.5rem;
  background: #fff0f0;
  border: 1px solid #fcc;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  color: #c00;
  font-size: 0.95rem;
}

/* Channel header */
.channel-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
}

.channel-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #111;
}

.meta {
  margin-top: 0.25rem;
  color: #999;
  font-size: 0.9rem;
}

/* Big stat */
.big-stat {
  margin-top: 2.5rem;
  text-align: center;
  padding: 2rem;
  background: #f9f9f9;
  border-radius: 12px;
  border: 1px solid #eee;
}

.stat-number {
  font-size: 4rem;
  font-weight: 800;
  color: #e00;
  line-height: 1;
  letter-spacing: -2px;
}

.stat-label {
  margin-top: 0.4rem;
  font-size: 1.1rem;
  color: #555;
}

.stat-sub {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #aaa;
}

/* Table */
.table-section {
  margin-top: 2.5rem;
}

.table-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  text-align: left;
  color: #aaa;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #eee;
}

thead th.num { text-align: right; }

tbody tr {
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.1s;
}

tbody tr:hover { background: #fafafa; }

tbody td {
  padding: 0.65rem 0.75rem;
  vertical-align: top;
}

.rank {
  color: #ccc;
  font-size: 0.8rem;
  width: 1.5rem;
}

.title-cell a {
  color: #111;
  text-decoration: none;
}

.title-cell a:hover { color: #000; text-decoration: underline; }

.pub-date {
  display: block;
  color: #bbb;
  font-size: 0.78rem;
  margin-top: 0.2rem;
}

.num { text-align: right; color: #888; }

.collective { color: #111; }

.sub-num {
  display: block;
  color: #bbb;
  font-size: 0.78rem;
}

.another {
  margin-top: 2rem;
  text-align: center;
}

.another a {
  color: #aaa;
  text-decoration: none;
  font-size: 0.9rem;
}

.another a:hover { color: #666; }

footer {
  padding: 1.5rem;
  text-align: center;
  color: #ccc;
  font-size: 0.8rem;
  border-top: 1px solid #eee;
}

footer a { color: #bbb; }
footer a:hover { color: #888; }

/* Dark mode */

@media (prefers-color-scheme: dark) {
  body { background: #0f0f0f; color: #e8e8e8; }
  header h1 { color: #fff; }
  .tagline { color: #888; }
.input-row { border-color: #333; background: #1a1a1a; }
  .input-row input { color: #fff; }
  .input-row input::placeholder { color: #555; }
  .hint { color: #555; }
  .hint code { color: #888; }
  .error-box { background: #2a1010; border-color: #5c1a1a; color: #f87171; }
  .channel-header { border-bottom-color: #222; }
  .channel-header h2 { color: #fff; }
  .meta { color: #666; }
  .big-stat { background: #1a1a1a; border-color: #2a2a2a; }
  .stat-number { color: #ff4444; }
  .stat-label { color: #aaa; }
  .stat-sub { color: #555; }
  .table-section h3 { color: #888; }
  thead th { color: #555; border-bottom-color: #222; }
  tbody tr { border-bottom-color: #1a1a1a; }
  tbody tr:hover { background: #161616; }
  .rank { color: #444; }
  .title-cell a { color: #e8e8e8; }
  .title-cell a:hover { color: #fff; }
  .pub-date { color: #555; }
  .num { color: #aaa; }
  .collective { color: #e8e8e8; }
  .sub-num { color: #555; }
  .another a { color: #555; }
  .another a:hover { color: #aaa; }
  footer { color: #444; border-top-color: #1a1a1a; }
  footer a { color: #555; }
  footer a:hover { color: #888; }
}

/* Privacy page prose */
.prose h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.prose h3 { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 0.4rem; color: #555; }
.prose p, .prose ul { font-size: 0.95rem; line-height: 1.6; color: #444; margin-bottom: 0.5rem; }
.prose ul { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.25rem; }
.prose a { color: #111; }
.prose .updated { color: #aaa; font-size: 0.85rem; margin-top: -0.5rem; margin-bottom: 1.5rem; }
@media (prefers-color-scheme: dark) {
  .prose h3 { color: #888; }
  .prose p, .prose ul { color: #aaa; }
  .prose a { color: #e8e8e8; }
}
