:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --accent: #7c6fff;
  --accent2: #4fd1c5;
  --text: #e2e8f0;
  --text-muted: #718096;
  --border: #2d3748;
  --radius: 12px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* NAV */
nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #7c6fff 0%, #4fd1c5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo:hover { text-decoration: none; opacity: 0.85; }

/* 首页 Hero Logo */
.hero-logo {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 3px;
  background: linear-gradient(135deg, #7c6fff 0%, #4fd1c5 60%, #7c6fff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
  margin-bottom: 0.5rem;
  display: inline-block;
}
@keyframes shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); text-decoration: none; }
.nav-links a.active { border-bottom: 2px solid var(--accent); padding-bottom: 2px; }

/* CONTAINER */
.container { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; }

/* HERO */
.hero {
  text-align: center;
  padding: 4rem 2rem 3rem;
}
.hero h1 { font-size: 2.2rem; font-weight: 700; margin-bottom: 0.75rem; }
.hero h1 span { color: var(--accent); }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 500px; margin: 0 auto 2rem; }

/* CARDS */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }
.card-link {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity 0.2s;
}
.card-link:hover { opacity: 0.85; text-decoration: none; }

/* DIGEST LIST */
.digest-list { display: flex; flex-direction: column; gap: 0.75rem; }
.digest-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.2s;
}
.digest-item:hover { border-color: var(--accent); }
.digest-date {
  color: var(--accent2);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 90px;
}
.digest-title { flex: 1; font-size: 0.95rem; }
.digest-tag {
  font-size: 0.75rem;
  background: var(--surface2);
  color: var(--text-muted);
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
}

/* ARTICLE */
.article-header { margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.article-header h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.article-meta { color: var(--text-muted); font-size: 0.85rem; }
.article-body { line-height: 1.85; }
.article-body h2 { margin: 1.75rem 0 0.75rem; font-size: 1.15rem; color: var(--accent2); }
.article-body h3 { margin: 1.25rem 0 0.5rem; font-size: 1rem; }
.article-body p { margin-bottom: 1rem; }
.article-body ul, .article-body ol { margin: 0.5rem 0 1rem 1.5rem; }
.article-body li { margin-bottom: 0.35rem; }
.article-body code {
  background: var(--surface2);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: 'JetBrains Mono', monospace;
}
.article-body pre {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}
.article-body pre code { background: none; padding: 0; }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--text-muted);
  margin: 1rem 0;
}
.divider-line {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* LEARNING TABS */
.tab-bar { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.tab-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.tab-btn:hover { border-color: var(--accent); color: var(--text); }
.tab-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* WEEK CARD */
.week-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}
.week-header {
  background: var(--surface2);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.week-body { padding: 0.75rem 1.25rem; }
.day-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.day-row:last-child { border-bottom: none; }
.day-label { color: var(--accent2); min-width: 40px; font-size: 0.8rem; font-weight: 600; }

/* BACK LINK */
.back-link { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.5rem; }
.back-link:hover { color: var(--text); text-decoration: none; }

/* FOOTER */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

/* BADGE */
.badge {
  display: inline-block;
  background: var(--surface2);
  color: var(--accent2);
  border: 1px solid var(--border);
  padding: 0.2rem 0.7rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* EMPTY STATE */
.empty { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.empty .empty-icon { font-size: 3rem; margin-bottom: 1rem; }

@media (max-width: 600px) {
  nav { padding: 0 1rem; gap: 1rem; }
  .hero h1 { font-size: 1.6rem; }
  .container { padding: 1.5rem 1rem; }
}
