/* === 十年之约 · 博客名录 === */

/* ── Theme Variables ── */
/* Colors from zui.re */
:root {
  --bg-primary: #FAF7F2;
  --bg-secondary: #FDF9F3;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F5F0E8;
  --border: #E5DFD6;
  --border-light: #EEEBE5;
  --text-primary: #2C2A28;
  --text-secondary: #6B6560;
  --text-muted: #9E9790;
  --accent: #D94F30;
  --accent-dim: #FDEEE9;
  --accent-glow: rgba(217, 79, 48, 0.10);
  --red: #C93B3B;
  --red-dim: rgba(201, 59, 59, 0.12);
  --shadow: 0 1px 2px rgba(44, 42, 40, .05);
  --shadow-hover: 0 4px 12px rgba(44, 42, 40, .08);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', 'Menlo', monospace;
  --transition: 0.2s ease;
  --avatar-size: 52px;
  --card-padding: 14px 16px;
  --card-gap: 14px;
}

[data-theme="dark"] {
  --bg-primary: #1E1E2E;
  --bg-secondary: #2E2D38;
  --bg-card: #2A2935;
  --bg-card-hover: #252538;
  --border: #3A3840;
  --border-light: #2E2D35;
  --text-primary: #D4D0CB;
  --text-secondary: #A09B95;
  --text-muted: #6B6560;
  --accent: #D94F30;
  --accent-dim: #3A2025;
  --accent-glow: rgba(217, 79, 48, 0.10);
  --red: #C93B3B;
  --red-dim: rgba(201, 59, 59, 0.12);
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.4);
}

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

html { font-size: 16px; }

body {
  background: var(--bg-primary);
  background-image: radial-gradient(ellipse at 20% 50%, rgba(217, 79, 48, 0.03) 0%, transparent 50%);
  color: var(--text-primary);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

/* ── Container ── */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ── */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background var(--transition), border-color var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  flex-shrink: 0;
}

.logo-sub {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.06em;
}

/* ── Stats ── */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.73rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.stat-value {
  color: var(--text-secondary);
  font-weight: 600;
}

.divider {
  width: 1px;
  height: 12px;
  background: var(--border-light);
  flex-shrink: 0;
}

/* ── Header Actions (search + theme) ── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Search ── */
.search-box {
  position: relative;
  width: 200px;
  flex-shrink: 0;
}

.search-box input {
  width: 100%;
  padding: 6px 10px 6px 30px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-box input::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Theme Toggle ── */
.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

/* ── Nav Buttons ── */
.nav-btn {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.73rem;
  font-family: var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-btn:hover {
  background: var(--bg-card-hover);
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Tabs ── */
.tabs-wrapper {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 50px;
  margin-top: -1px;
  z-index: 99;
  transition: background var(--transition), border-color var(--transition);
}

.tabs-scroll {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tabs-scroll::-webkit-scrollbar { display: none; }

.tabs {
  display: flex;
  min-width: max-content;
}

.tab-btn {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all var(--transition);
}

.tab-btn:hover { color: var(--text-secondary); }

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-btn .count {
  font-size: 0.6rem;
  opacity: 0.55;
  margin-left: 2px;
}

/* ── Main ── */
.main {
  padding: 24px 0 64px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .badge {
  font-size: 0.68rem;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 1px 8px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
}

/* ── Toggle ── */
.toggle-group {
  display: flex;
  background: var(--bg-primary);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.toggle-btn {
  padding: 6px 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  white-space: nowrap;
}

.toggle-btn.active {
  background: var(--accent);
  color: #fff;
}

.toggle-btn.red.active {
  background: var(--red);
  color: #fff;
}

/* ── Cards ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.card {
  display: flex;
  align-items: center;
  gap: var(--card-gap);
  padding: var(--card-padding);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  height: 90px;
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.card:active {
  background: var(--bg-card);
  border-color: var(--border);
  transform: none;
  box-shadow: var(--shadow);
}

.card:focus {
  background: var(--bg-card);
  border-color: var(--border);
  transform: none;
  box-shadow: var(--shadow);
}

.card:focus-visible {
  outline: none;
}

/* ── Avatar ── */
.card-avatar-wrap {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-primary);
  border: 2px solid var(--border-light);
}

.card-avatar {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  border: 2px solid var(--border-light);
}

.card-avatar-placeholder {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--bg-primary);
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ── Card Body ── */
.card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
}

.card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-link {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-date {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  opacity: 0.7;
}

/* ── Abnormal cards ── */
.card.abnormal { border-color: var(--red-dim); }

.card.abnormal:hover { border-color: var(--red); }

.card.abnormal:active { border-color: var(--red-dim); }

.card.abnormal:focus { border-color: var(--red-dim); }

.card.abnormal .card-name { color: var(--red); }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.empty-state .icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  opacity: 0.2;
}

.empty-state p { font-size: 0.85rem; }

/* ── Footer ── */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 18px 0;
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.footer a { color: var(--accent); opacity: 0.7; text-decoration: none; }

.footer a:hover { opacity: 1; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ══════════════════════════════════════
   MOBILE (max-width: 768px)
   ══════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --avatar-size: 40px;
    --card-padding: 12px;
    --card-gap: 10px;
    --card-min-height: 78px;
  }

  .container { padding: 0 14px; }

  /* Header stack */
  .header-inner {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }

  .logo { font-size: 0.95rem; }
  .logo-sub { display: none; }

  .stats-bar {
    font-size: 0.66rem;
    gap: 8px;
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: 2px;
  }

  .header-actions {
    margin-left: 0;
    order: 2;
  }

  .search-box {
    width: 130px;
  }

  .search-box input {
    font-size: 0.73rem;
    padding: 5px 8px 5px 28px;
  }

  .theme-toggle {
    width: 32px;
    height: 32px;
  }

  /* Tabs sticky offset */
  .tabs-wrapper { top: 76px; }
  .tab-btn { padding: 9px 12px; font-size: 0.75rem; }

  /* Cards */
  .main { padding: 18px 0 48px; }
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .card { height: 78px; }

  .section-header { flex-wrap: wrap; }

  .section-title { font-size: 0.92rem; }

  .toggle-btn { padding: 5px 12px; font-size: 0.73rem; }
}

/* Very small phone */
@media (max-width: 400px) {
  .cards-grid { grid-template-columns: 1fr; }
  .card { height: 72px; }
}


