/* ============ 淡淡的个人空间 · 蓝白简约主题 ============ */
:root {
  --bg: #FFFFFF;
  --bg-soft: #F0F5FB;
  --primary: #3B7DD8;
  --accent: #60A5FA;
  --grad: linear-gradient(135deg, #3B7DD8, #60A5FA);
  --text: #1E293B;
  --text-dim: #64748B;
  --border: #E2E8F0;
  --radius: 12px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 2px 8px rgba(30, 41, 59, 0.06);
  --shadow-lg: 0 8px 24px rgba(59, 125, 216, 0.16);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ============ 导航 ============ */
.site-nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.site-nav .nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.nav-logo { font-size: 18px; font-weight: 700; color: var(--text); }
.nav-logo:hover { color: var(--primary); }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: var(--text-dim); font-size: 15px; padding: 8px 14px;
  position: relative; transition: color .25s var(--ease);
}
.nav-links a::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 2px; background: var(--primary); transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-burger { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text); }

/* ============ Hero ============ */
.hero {
  background: linear-gradient(180deg, #EFF6FF 0%, #FFFFFF 100%);
  text-align: center; padding: 80px 24px 64px;
}
.hero .avatar {
  width: 120px; height: 120px; border-radius: 50%;
  object-fit: cover; border: 4px solid #fff; box-shadow: var(--shadow-lg);
  background: var(--bg-soft); margin: 0 auto 24px;
  transition: transform .4s var(--ease);
}
.hero .avatar:hover { transform: scale(1.05) rotate(3deg); }
.hero h1 { font-size: 48px; font-weight: 700; line-height: 1.2; margin-bottom: 12px; }
.hero .subtitle { font-size: 18px; color: var(--text-dim); margin-bottom: 8px; }
.hero .intro { font-size: 16px; color: var(--text-dim); max-width: 560px; margin: 0 auto 24px; }
.hero .socials { display: flex; gap: 14px; justify-content: center; }
.hero .socials a {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); color: var(--text-dim); font-size: 18px;
  transition: all .25s var(--ease);
}
.hero .socials a:hover { color: #fff; background: var(--grad); border-color: transparent; transform: translateY(-2px); }

/* ============ 区块 ============ */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-soft); }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.section-title { font-size: 28px; font-weight: 700; }
.section-more { font-size: 14px; color: var(--text-dim); }
.section-more:hover { color: var(--primary); }

/* ============ 卡片 ============ */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--bg-soft); }
.card .card-body { padding: 18px 20px; display: flex; flex-direction: column; flex: 1; }
.card .card-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.card .card-desc { font-size: 14px; color: var(--text-dim); line-height: 1.6; margin-bottom: 12px; }
.card .card-desc p { margin: 0; }
.card .card-desc ul, .card .card-desc ol { margin: 4px 0 4px 18px; }
.card .card-desc strong { color: var(--text); }
.card .card-meta { margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }

.tag { background: rgba(59, 125, 216, 0.1); color: var(--primary); padding: 2px 10px; border-radius: 20px; font-size: 12px; }

/* 工具卡片 */
.tool-card { align-items: flex-start; }
.tool-card .tool-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.tool-card .tool-icon { font-size: 26px; line-height: 1; }
.tool-card .tool-name { font-size: 16px; font-weight: 700; }
.tool-card .tool-desc { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.tool-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15), var(--shadow-lg); }

/* ============ 分类导航 ============ */
.cat-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.cat-btn {
  border: 1px solid var(--border); background: #fff; color: var(--text-dim);
  padding: 7px 18px; border-radius: 20px; font-size: 14px; cursor: pointer;
  transition: all .2s var(--ease);
}
.cat-btn:hover { color: var(--primary); border-color: var(--accent); }
.cat-btn.active { background: var(--grad); color: #fff; border-color: transparent; }

/* ============ 文章详情 ============ */
.article-wrap { max-width: 720px; margin: 0 auto; padding: 48px 24px; }
.article-wrap h1 { font-size: 32px; font-weight: 700; margin-bottom: 16px; }
.article-wrap .meta { color: var(--text-dim); font-size: 14px; margin-bottom: 28px; }
.article-wrap .content { font-size: 16px; line-height: 1.8; }
.article-wrap .content h2 { font-size: 24px; margin: 32px 0 14px; }
.article-wrap .content h3 { font-size: 20px; margin: 24px 0 10px; }
.article-wrap .content p { margin: 14px 0; }
.article-wrap .content img { max-width: 100%; border-radius: 8px; }
.article-wrap .content pre { background: var(--bg-soft); border-radius: 8px; padding: 16px; overflow-x: auto; margin: 16px 0; }
.article-wrap .content code { background: var(--bg-soft); padding: 2px 6px; border-radius: 4px; font-size: 14px; }
.article-wrap .content pre code { background: none; padding: 0; }
.article-wrap .content table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14px; }
.article-wrap .content th, .article-wrap .content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.article-wrap .content th { background: var(--bg-soft); }
.article-wrap .content blockquote { border-left: 3px solid var(--primary); padding-left: 14px; color: var(--text-dim); margin: 14px 0; }
.article-wrap .content ul, .article-wrap .content ol { margin: 12px 0 12px 22px; }
.article-wrap .content .mermaid { text-align: center; margin: 20px 0; overflow-x: auto; }
.article-wrap .content .mermaid svg { max-width: 100%; height: auto; }

/* ============ 关于我 ============ */
.about-story { display: flex; gap: 40px; align-items: center; }
.about-story .portrait { width: 200px; height: 200px; border-radius: var(--radius); object-fit: cover; background: var(--bg-soft); flex-shrink: 0; }
.skill-cloud { display: flex; flex-wrap: wrap; gap: 12px; }
.skill-cloud .skill { padding: 8px 18px; border-radius: 20px; background: var(--bg-soft); color: var(--text); font-size: 14px; border: 1px solid var(--border); transition: all .2s var(--ease); }
.skill-cloud .skill:hover { background: var(--grad); color: #fff; border-color: transparent; }
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline .tl-item { position: relative; margin-bottom: 28px; }
.timeline .tl-item::before { content: ''; position: absolute; left: -26px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--border); }
.timeline .tl-year { font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.timeline .tl-text { color: var(--text-dim); font-size: 15px; }

/* ============ 吐槽专区（蓝白） ============ */
.gate-wrap { max-width: 380px; margin: 80px auto; text-align: center; }
.gate-wrap .gate-icon { font-size: 40px; margin-bottom: 16px; }
.gate-wrap .gate-title { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.gate-wrap .gate-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }
.gate-wrap input {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 12px 16px; font-size: 15px; text-align: center; outline: none;
  margin-bottom: 14px; transition: border-color .2s;
}
.gate-wrap input:focus { border-color: var(--primary); }
.gate-wrap .shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-8px)} 40%,80%{transform:translateX(8px)} }

.rant-head { display: flex; justify-content: space-between; align-items: center; padding: 24px 0 16px; border-bottom: 1px solid var(--border); }
.rant-head .r-title { font-size: 20px; font-weight: 700; color: var(--text); }
.rant-compose { margin: 20px 0; }
.rant-compose textarea {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 14px; font-size: 15px; min-height: 90px; resize: vertical; outline: none;
}
.rant-compose textarea:focus { border-color: var(--primary); }
.rant-post { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; }
.rant-post .rp-time { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; display: flex; justify-content: space-between; }
.rant-post .rp-content { font-size: 15px; white-space: pre-wrap; word-break: break-word; color: var(--text); }

/* ============ 管理后台 ============ */
.admin-tabs { display: flex; gap: 6px; margin: 20px 0; border-bottom: 1px solid var(--border); }
.admin-tabs button { background: none; border: none; padding: 10px 18px; font-size: 15px; color: var(--text-dim); cursor: pointer; border-bottom: 2px solid transparent; }
.admin-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.admin-list .admin-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; }
.admin-item .ai-title { font-weight: 600; }
.admin-item .ai-actions { display: flex; gap: 8px; flex-shrink: 0; }
.form-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.form-card h3 { margin-bottom: 16px; font-size: 17px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.form-row input, .form-row textarea, .form-row select {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  font-size: 15px; font-family: inherit; outline: none; color: var(--text); background: #fff;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: var(--primary); }
.form-row textarea { min-height: 90px; resize: vertical; }
.form-row .hint { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.preview-img { max-width: 160px; border-radius: 8px; margin-top: 8px; border: 1px solid var(--border); }

/* ============ 按钮 ============ */
.btn {
  display: inline-block; background: var(--grad); color: #fff; border: none;
  border-radius: 8px; padding: 10px 20px; font-size: 15px; cursor: pointer;
  transition: opacity .2s, transform .2s;
}
.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-danger { background: #EF4444; }

/* ============ Footer ============ */
.site-footer { background: var(--bg-soft); padding: 40px 0; text-align: center; }
.site-footer .signature { color: var(--text-dim); font-size: 14px; margin-bottom: 12px; }
.site-footer .socials { display: flex; gap: 12px; justify-content: center; margin-bottom: 12px; }
.site-footer .socials a { color: var(--text-dim); font-size: 18px; }
.site-footer .socials a:hover { color: var(--primary); }
.site-footer .copyright { color: var(--text-dim); font-size: 12px; }

/* ============ 空状态 ============ */
.empty { text-align: center; color: var(--text-dim); padding: 50px 0; font-size: 14px; }

/* ============ Toast ============ */
#toast {
  display: none; position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  max-width: 88vw; background: #1E293B; color: #fff; border-radius: 10px;
  padding: 12px 18px; font-size: 14px; z-index: 999; cursor: pointer; text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
}
#toast::after { content: " ✕"; opacity: 0.6; }

/* ============ 响应式 ============ */
@media (max-width: 1023px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .about-story { flex-direction: column; text-align: center; }
}
@media (max-width: 767px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--border); padding: 8px 0; }
  .nav-links.open { display: flex; }
  .nav-burger { display: block; }
  .hero h1 { font-size: 32px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section-title { font-size: 24px; }
}
