/* ============================================
   极简博客主题
   ============================================ */

:root {
  --accent: #f97316;
  --accent-light: #fff7ed;
  --accent-dark: #ea580c;
  --text: #1c1917;
  --text-secondary: #78716c;
  --text-muted: #a8a29e;
  --bg: #ffffff;
  --bg-secondary: #fafaf9;
  --border: #e7e5e4;
  --radius: 12px;
  --font: "Noto Serif SC", "Source Han Serif SC", "Georgia", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  --max-w: 680px;
}

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; display: block; border-radius: var(--radius); }

/* ---------- 顶栏 ---------- */
.top-bar {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.site-name:hover { color: var(--accent); }

.top-links {
  display: flex;
  gap: 16px;
  list-style: none;
}
.top-links a {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}
.top-links a:hover { color: var(--text); }

/* ---------- 个人简介区 ---------- */
.bio {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 60px 24px 40px;
  text-align: center;
}

.bio-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  background: var(--bg-secondary);
}

.bio h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.bio p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

.bio-links {
  margin-top: 16px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.bio-links a {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.bio-links a:hover { color: var(--accent); }

.divider {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
.divider hr {
  border: none;
  border-top: 1px solid var(--border);
}

/* ---------- Feed 流 ---------- */
.feed {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.feed-header h2 {
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.feed-header a {
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.feed-header a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ---------- 单篇文章 ---------- */
.post {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.post:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.post-date {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.post-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--accent); }

.post-image {
  margin: 16px 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s;
}
.post-image:hover { opacity: 0.9; }

.post-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
}
.post-content p { margin-bottom: 12px; }
.post-content p:last-child { margin-bottom: 0; }
.post-content a { word-break: break-all; }

.post-link {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}
.post-link:hover { text-decoration: underline; }

.post-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}
.post-actions button {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.post-actions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.post-actions .btn-del:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: #fef2f2;
}

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 15px; }

/* ---------- 写文章页 ---------- */
.editor-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.editor-header h1 {
  font-size: 24px;
  font-weight: 700;
}
.editor-header a {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-secondary);
}

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  background: var(--bg);
  line-height: 1.6;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}
.form-group textarea {
  min-height: 200px;
  resize: vertical;
}
.form-hint {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.btn {
  padding: 10px 28px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn-danger {
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fecaca;
}
.btn-danger:hover { background: #fecaca; }

/* ---------- Token 设置 ---------- */
.token-bar {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.token-bar label {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
}
.token-bar input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: monospace;
  flex: 1;
  min-width: 120px;
}
.token-bar button {
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--font-sans);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-sans);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 999;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Lightbox ---------- */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(0,0,0,0.9);
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; object-fit: contain; border-radius: 4px; }
.lightbox-close {
  position: absolute; top: 20px; right: 24px;
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  font-size: 28px; width: 44px; height: 44px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }

/* ---------- Footer ---------- */
.footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
  .bio { padding: 40px 24px 28px; }
  .bio h1 { font-size: 24px; }
  .post-title { font-size: 19px; }
  .feed { padding: 24px 24px 40px; }
  .top-bar { padding: 24px 20px 0; }
}
