/* ===== 基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0f1115;
  --bg-soft: #13161f;
  --card: #161922;
  --card-hover: #1c2030;
  --text: #e5e7eb;
  --sub: #9ca3af;
  --accent: #7c5cff;
  --accent-soft: rgba(124, 92, 255, 0.15);
  --border: #232736;
  --danger: #ef4444;
  --ok: #22c55e;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; display: block; }

/* ===== 导航 ===== */
header {
  position: fixed; top: 0; left: 0; width: 100%;
  background: rgba(15, 17, 21, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}
nav {
  max-width: 1000px; margin: auto;
  padding: 14px 20px;
  display: flex; justify-content: space-between; align-items: center;
}
nav .logo { font-weight: 700; letter-spacing: .5px; }
nav ul { display: flex; list-style: none; gap: 24px; }
nav ul li a {
  font-size: 14px; color: var(--sub);
  transition: color .2s;
  padding: 4px 0;
}
nav ul li a:hover, nav ul li a.active {
  color: var(--accent); text-decoration: none;
}
.admin-entry { color: var(--accent) !important; font-size: 13px; }

/* ===== 访客统计 ===== */
.visitor-count {
  margin-top: 88px;
  text-align: center;
  font-size: 13px;
  color: var(--sub);
}
.visitor-count b { color: var(--accent); }

/* ===== 布局 ===== */
.container { max-width: 1000px; margin: auto; padding: 30px 20px; }
section { margin-top: 52px; scroll-margin-top: 80px; }
h2 {
  font-size: 22px; margin-bottom: 20px;
  border-left: 4px solid var(--accent);
  padding-left: 12px;
}

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  padding: 24px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

/* ===== 简介 ===== */
.hero {
  display: flex; align-items: center; gap: 32px;
  background: linear-gradient(135deg, var(--card), var(--bg-soft));
  padding: 36px; border-radius: 16px;
  border: 1px solid var(--border);
}
.hero img {
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  object-fit: cover; flex-shrink: 0;
}
.hero h1 { font-size: 28px; margin-bottom: 8px; }
.hero .highlight { color: var(--accent); }
.hero .bio { color: var(--sub); margin-top: 10px; font-size: 15px; }

/* ===== 时间线 ===== */
.timeline {
  border-left: 2px solid var(--border);
  padding-left: 24px;
}
.timeline-item { position: relative; margin-bottom: 28px; }
.timeline-item .dot {
  position: absolute; left: -31px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-item .year {
  font-size: 13px; color: var(--accent);
  font-weight: 600; margin-bottom: 4px;
}
.timeline-item h3 { font-size: 17px; margin-bottom: 6px; }
.timeline-item p { color: var(--sub); font-size: 14px; }

/* ===== 项目 ===== */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.project {
  background: var(--card);
  padding: 22px;
  border-radius: 14px;
  border: 1px solid var(--border);
  transition: transform .25s, border-color .25s;
}
.project:hover { transform: translateY(-4px); border-color: var(--accent); }
.project h3 { margin-bottom: 8px; font-size: 17px; }
.project p { color: var(--sub); font-size: 14px; margin-bottom: 12px; }
.project .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tag {
  font-size: 12px; padding: 3px 10px; border-radius: 20px;
  background: var(--accent-soft); color: var(--accent);
}

/* ===== 博客 ===== */
.blog-item {
  background: var(--card);
  padding: 22px; border-radius: 14px;
  margin-bottom: 16px; border: 1px solid var(--border);
  transition: background .2s;
}
.blog-item:hover { background: var(--card-hover); }
.blog-item h3 { margin-bottom: 8px; }
.blog-item .summary { color: var(--sub); font-size: 14px; margin-bottom: 12px; }
.blog-item .date { font-size: 12px; color: var(--sub); }

/* ===== 回到顶部 ===== */
#backTop {
  position: fixed; right: 24px; bottom: 30px;
  width: 44px; height: 44px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 50%;
  font-size: 18px; cursor: pointer;
  display: none; box-shadow: 0 6px 20px rgba(124,92,255,.4);
}
#backTop:hover { transform: translateY(-2px); }

.loading { color: var(--sub); font-size: 14px; }
.error { color: var(--danger); font-size: 14px; }

/* ===== 提示条 ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); padding: 10px 20px; border-radius: 10px;
  font-size: 14px; opacity: 0; transition: opacity .3s; z-index: 2000;
  pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.error { border-color: var(--danger); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .hero { flex-direction: column; text-align: center; padding: 28px; }
  nav ul { display: none; }
}
