:root {
  --bg: #0b0f17;
  --panel: #121a28;
  --panel2: #0f1623;
  --text: #e8eefc;
  --muted: #a9b6d3;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #4da3ff;
  --danger: #ff5c6a;
  --radius: 12px;
  --pad: 14px;
  --maxw: 480px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 700px at 50% -10%, #152541 0%, var(--bg) 45%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  color: var(--text);
}

.app {
  height: 100vh;
  display: flex;
  justify-content: center;
  padding: 10px;
}

.shell {
  width: 100%;
  max-width: var(--maxw);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px var(--pad);
  background: rgba(0, 0, 0, 0.22);
  border-bottom: 1px solid var(--border);
  justify-content: center;
  position: relative;
}

.topbar h1 {
  font-size: 14px;
  margin: 0;
  letter-spacing: 0.2px;
}

.topbar .spacer {
  flex: 1;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 600;
  cursor: pointer;
}

.btn.icon {
  width: 32px;
  padding: 6px 8px;
  font-size: 14px;
  line-height: 1;
}

.refresh-btn {
  position: absolute;
  right: var(--pad);
}

.btn:active {
  transform: translateY(1px);
}

.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

.content {
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.scroll-area {
  flex: 1;
  overflow: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scroll-area::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.muted {
  color: var(--muted);
}

.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.team {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  text-decoration: none;
  color: inherit;
}

.team .name {
  font-weight: 800;
  font-size: 13px;
}

.team .hint {
  color: var(--muted);
  font-size: 11px;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.tabs.header-tabs {
  justify-content: center;
}

.tabs.team-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabs.team-tabs::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.tab {
  flex: 1;
}

.tab button {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.tabs.team-tabs .tab button {
  font-size: 0.75em;
  padding: 6px 8px;
  white-space: nowrap;
}

.tab button[aria-selected="true"] {
  border-color: rgba(77, 163, 255, 0.55);
  background: rgba(77, 163, 255, 0.12);
}

.list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  text-decoration: none;
  color: inherit;
}

.post.visited {
  background: rgba(255, 255, 255, 0.015);
  border-color: rgba(255, 255, 255, 0.05);
}

.post.visited .title,
.post.visited .title-text {
  color: var(--muted);
  font-weight: 600;
}

.post.visited .comment-count {
  color: var(--muted);
}

.post .title {
  font-weight: 800;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.post-icon {
  font-size: 12px;
}

.title-text {
  flex: 0 1 auto;
}

.comment-count {
  color: var(--accent);
  font-weight: 700;
  font-size: 11px;
}

.post .meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}

.footerline {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}

.topbar-delay {
  position: absolute;
  right: var(--pad);
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  white-space: nowrap;
}

.delay-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
}

.delay-input {
  width: 56px;
  padding: 4px 6px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: right;
  appearance: textfield;
}

.delay-input::-webkit-outer-spin-button,
.delay-input::-webkit-inner-spin-button {
  margin: 0;
}

@media (max-width: 360px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
