/* ============================================
   辰龙的学习笔记 — 亮色主题 v2
   参考映曦布局 + 紫色强调
   ============================================ */

:root {
  --bg: #f8f9fb;
  --card: #ffffff;
  --card-hover: #f3f4f8;
  --card2: #f0f1f5;
  --border: rgba(108, 92, 231, 0.12);
  --border-hover: rgba(108, 92, 231, 0.30);
  --accent: #6c5ce7;
  --accent-hover: #5a4bd1;
  --accent-soft: rgba(108, 92, 231, 0.06);
  --accent-glow: rgba(108, 92, 231, 0.10);
  --text: #1a1a2e;
  --text-secondary: #5a5a78;
  --text-muted: #9090a8;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.04);
  --shadow-hover: 0 8px 28px rgba(108,92,231,0.08);
  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
  --max-width: 860px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

/* --- Nav --- */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 32px;
  height: 56px; display: flex; align-items: center; justify-content: space-between;
}
.logo { font-size: 1.05rem; color: var(--text); font-weight: 600; }
.logo:hover { color: var(--accent); }
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--text-secondary); font-size: 0.92rem; font-weight: 500; }
.nav-links a:hover { color: var(--accent); }

main {
  flex: 1; max-width: var(--max-width); margin: 0 auto;
  padding: 0 32px 80px; width: 100%;
}

/* --- Hero --- */
.hero { text-align: center; padding: 64px 0 44px; }
.hero h1 {
  font-size: 2.2rem; font-weight: 700; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero .subtitle {
  font-size: 1.02rem; color: var(--text-secondary); max-width: 560px;
  margin: 0 auto 22px; line-height: 1.8;
}
.hero .tag-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tag {
  display: inline-block; padding: 5px 16px; font-size: 0.85rem;
  color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--border); border-radius: 20px; transition: all 0.2s;
}
.tag:hover { background: var(--accent-glow); border-color: var(--accent); }

/* --- Stats --- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 12px 0 56px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 16px; text-align: center;
  transition: all 0.25s; box-shadow: var(--shadow);
}
.stat-card:hover {
  border-color: var(--accent); box-shadow: var(--shadow-hover); transform: translateY(-2px);
}
.stat-number { display: block; font-size: 2.1rem; font-weight: 700; color: var(--accent); line-height: 1.2; }
.stat-label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* --- Section --- */
.section { margin: 56px 0; }
.section-title {
  font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}

/* --- Skill Cards --- */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.skill-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 18px; text-align: center;
  transition: all 0.25s; box-shadow: var(--shadow);
}
.skill-card:hover {
  border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-hover);
}
.skill-icon { font-size: 2rem; display: block; margin-bottom: 10px; }
.skill-name { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.skill-detail { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* --- Post List --- */
.post-item { display: flex; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.post-item:last-child { border-bottom: none; }
.post-date { font-family: var(--mono); font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; padding-top: 4px; min-width: 90px; }
.post-info h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.post-info h3 a { color: var(--text); }
.post-info h3 a:hover { color: var(--accent); }
.post-info p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; }
.post-tags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.post-tag {
  font-size: 0.75rem; padding: 2px 10px; background: var(--accent-soft);
  color: var(--accent); border-radius: 12px;
}
.view-all { display: inline-block; margin-top: 24px; font-size: 0.9rem; font-weight: 500; }

/* --- Project Cards --- */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.project-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 20px;
  transition: all 0.25s; box-shadow: var(--shadow);
}
.project-card:hover {
  border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-hover);
}
.project-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.project-card h3 a { color: var(--text); }
.project-card h3 a:hover { color: var(--accent); }
.project-card p { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }
.project-tech { display: flex; gap: 6px; flex-wrap: wrap; }
.tech-tag {
  font-size: 0.75rem; padding: 2px 10px; background: var(--card2);
  color: var(--text-secondary); border-radius: 4px; border: 1px solid var(--border);
}

/* --- Tools Pills --- */
.tools-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-pill {
  display: inline-block; padding: 6px 16px; font-size: 0.88rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.tool-pill:hover { border-color: var(--accent); color: var(--accent); }

/* --- About Page --- */
.about-content { max-width: 680px; margin: 40px auto; }
.about-content h3 { margin: 28px 0 10px; color: var(--accent); }
.about-content ul { padding-left: 20px; }
.about-content li { margin: 6px 0; color: var(--text-secondary); }
.about-content li strong { color: var(--text); }

/* --- Single Post --- */
.post-header { margin: 50px 0 30px; text-align: center; }
.post-header h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 12px; }
.post-meta { font-size: 0.88rem; color: var(--text-muted); }
.post-body { font-size: 1rem; line-height: 1.85; }
.post-body p { margin: 18px 0; }
.post-body h2 { font-size: 1.3rem; margin: 40px 0 14px; color: var(--accent); }
.post-body h3 { font-size: 1.1rem; margin: 30px 0 10px; }
.post-body ul, .post-body ol { margin: 14px 0; padding-left: 24px; }
.post-body li { margin: 6px 0; }
.post-body blockquote {
  border-left: 3px solid var(--accent); padding: 12px 20px; margin: 20px 0;
  background: var(--accent-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}
.post-body code {
  font-family: var(--mono); font-size: 0.9em; padding: 2px 6px;
  background: var(--card2); border-radius: 4px; border: 1px solid var(--border);
}
.post-body pre {
  background: #1e1e2e; color: #e0e0f0; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; overflow-x: auto; margin: 20px 0;
  font-size: 0.88rem;
}
.post-body pre code { border: none; padding: 0; background: none; color: inherit; }
.post-body a { border-bottom: 1px solid var(--border-hover); }
.post-body a:hover { border-bottom-color: var(--accent); }
.post-body img { max-width: 100%; border-radius: var(--radius); margin: 20px 0; }

/* --- List Page --- */
.list-header { margin: 50px 0 30px; }
.list-header h1 { font-size: 1.6rem; }

/* --- Footer --- */
footer {
  text-align: center; padding: 36px 24px; color: #b8b8cc;
  font-size: 0.88rem; border-top: 1px solid rgba(0,0,0,0.06); margin-top: auto;
  background: #2a2a3a;
}
footer a { color: #c8c8d8; }
footer a:hover { color: #b4a6ff; }
footer p { margin: 6px 0; }
footer .beian-link { color: #d0d0e0; font-size: 0.88rem; font-weight: 500; }
footer .beian-link:hover { color: #b4a6ff; }
footer .beian-link img { opacity: 0.70; vertical-align: middle; margin-right: 4px; }
footer .beian-link:hover img { opacity: 1; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero { padding: 40px 0 24px; }
  .hero h1 { font-size: 1.7rem; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .projects-grid { grid-template-columns: 1fr; }
  .post-item { flex-direction: column; gap: 4px; }
  .post-date { min-width: auto; }
  .nav-inner { padding: 0 16px; }
  main { padding: 0 16px 60px; }
}

@media (max-width: 480px) {
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { gap: 14px; }
  .hero h1 { font-size: 1.4rem; }
}

/* --- Dropdown Menu --- */
.nav-item { position: relative; }
.nav-parent { cursor: default; }
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 0;
  min-width: 160px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  z-index: 200;
}
.nav-item:hover .nav-dropdown { display: block; }
.nav-dropdown a {
  display: block;
  padding: 8px 18px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.nav-dropdown a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* --- Frieren Portal --- */
.frieren-page { max-width: 720px; margin: 0 auto; }
.frieren-hero {
  text-align: center; padding: 48px 0 32px;
  border-bottom: 1px solid var(--border); margin-bottom: 32px;
}
.frieren-hero-text .frieren-subtitle {
  font-size: 1rem; color: var(--text-secondary); margin-bottom: 12px;
}
.frieren-hero-text .frieren-bio {
  font-size: 0.95rem; color: var(--text-secondary);
  max-width: 560px; margin: 0 auto; line-height: 1.9;
}
.frieren-hero-text .frieren-bio strong { color: var(--text); }
.frieren-hero-text .frieren-bio a { color: var(--accent); }

.frieren-dynamic { margin-bottom: 8px; }
.frieren-loading { color: var(--text-secondary); font-size: 0.85rem; font-style: italic; }
.frieren-empty { color: var(--text-secondary); font-size: 0.85rem; padding: 8px 0; }

.frieren-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 20px;
  margin-bottom: 10px; transition: border-color 0.2s;
}
.frieren-card:hover { border-color: var(--accent); }
.frieren-card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.frieren-card-date { font-size: 0.78rem; color: var(--text-secondary); }
.frieren-card-tag {
  font-size: 0.7rem; background: var(--accent-soft);
  padding: 1px 8px; border-radius: 6px; color: var(--text-secondary);
}
.frieren-card-title { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.frieren-card-title a { color: var(--text); text-decoration: none; }
.frieren-card-title a:hover { color: var(--accent); }
.frieren-card-body {
  font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7;
}

.frieren-crosslink {
  padding: 7px 0; border-bottom: 1px solid var(--border);
  font-size: 0.88rem; color: var(--text-secondary);
}
.frieren-crosslink:last-child { border-bottom: none; }
.frieren-crosslink-domains { font-size: 0.75rem; color: var(--accent); margin-right: 6px; }

.frieren-metrics-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 24px;
}
.frieren-metric {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 8px; text-align: center;
}
.frieren-metric-val { font-size: 1.6rem; font-weight: 600; color: var(--accent); }
.frieren-metric-label { font-size: 0.75rem; color: var(--text-secondary); margin-top: 4px; }

.frieren-status-bar {
  margin-top: 32px; padding: 12px 20px;
  background: var(--accent-soft); border-radius: 12px;
  font-size: 0.85rem; color: var(--text-secondary);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; max-width: 720px; margin-left: auto; margin-right: auto;
}
.frieren-status-bar strong { color: var(--accent); }
.frieren-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.frieren-dot.on { background: #7cb874; }
.frieren-dot.off { background: #c47474; }

@media (max-width: 600px) {
  .frieren-hero { padding: 32px 0 24px; }
  .frieren-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .frieren-status-bar { flex-direction: column; align-items: flex-start; }
}
