/* LoveIt Theme - 致敬原版 */

:root {
  --bg: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --bg-code: #f5f7fa;
  --text: #2e3440;
  --text-secondary: #6c757d;
  --text-light: #adb5bd;
  --border: #e9ecef;
  --accent: #4052b5;
  --accent-hover: #3341a3;
  --accent-light: rgba(64, 82, 181, 0.1);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --bg: #1a1b26;
  --bg-secondary: #24283b;
  --bg-card: #24283b;
  --bg-code: #292e42;
  --text: #c0caf5;
  --text-secondary: #9aa5ce;
  --text-light: #565f89;
  --border: #3b4261;
  --accent: #7aa2f7;
  --accent-hover: #89b4fa;
  --accent-light: rgba(122, 162, 247, 0.15);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-secondary);
  color: var(--text);
  line-height: 1.8;
}

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

.container { max-width: 780px; margin: 0 auto; padding: 0 1.5rem; }

/* Header - 左 logo 右导航 */
header {
  background: var(--bg);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 100%;
  padding: 0 1.5rem;
  position: relative;
}
.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
}
.site-title:hover { text-decoration: none; }
nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
nav a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
nav a:hover { color: var(--accent); }

.nav-icon-btn {
  background: none; border: none; cursor: pointer;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
}
.nav-icon-btn:hover { background: var(--accent-light); color: var(--accent); }

/* Profile 区域 - 居中布局 */
.home-profile {
  text-align: center;
  padding: 3rem 0 2rem;
}

.home-avatar {
  width: 120px;
  height: 120px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}
.home-avatar img { width: 100%; height: 100%; object-fit: cover; }

.home-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.home-social {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.home-social a {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.home-social a:hover { color: var(--accent); background: var(--accent-light); }
.home-social svg { width: 18px; height: 18px; }

/* Search */
.search-form {
  display: flex; gap: 0.5rem; margin-bottom: 2rem;
  background: var(--bg); padding: 1rem; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.search-input {
  flex: 1; padding: 0.75rem 1rem; border: 2px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg); font-size: 0.95rem;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-btn {
  padding: 0.75rem 1.5rem; background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm); font-weight: 500;
}

/* Post cards - 带大图 */
.post-card {
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.3s;
}
.post-card:hover { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12); }

.post-card-cover {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.post-card-body { padding: 1.5rem; }

.post-card-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}
.post-card-meta span { display: flex; align-items: center; gap: 0.3rem; }

.post-card-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--accent); text-decoration: none; }

.post-card-summary {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1rem;
}

.post-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.read-more {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
}
.read-more:hover { color: var(--accent-hover); }

.post-tags { display: flex; gap: 0.4rem; }
.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
}
.tag:hover { background: var(--accent); color: #fff; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin: 2rem 0; }
.pagination a, .pagination span { padding: 0.5rem 1rem; border-radius: var(--radius-sm); font-size: 0.9rem; }
.pagination a { background: var(--bg); color: var(--text-secondary); box-shadow: var(--shadow); }
.pagination a:hover { color: var(--accent); }
.pagination .current { background: var(--accent); color: #fff; }

/* Article */
.article-header {
  background: var(--bg); border-radius: var(--radius); padding: 2rem;
  margin-bottom: 1.5rem; box-shadow: var(--shadow);
}
.article-title { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.article-meta { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 1rem; }
.article-cover { width: 100%; border-radius: var(--radius); margin-bottom: 1.5rem; }
.article-tags { display: flex; gap: 0.5rem; }

.toc {
  background: var(--bg); border-radius: var(--radius); padding: 1.25rem;
  margin-bottom: 1.5rem; box-shadow: var(--shadow); border-left: 4px solid var(--accent);
}
.toc-title { font-weight: 700; margin-bottom: 0.75rem; color: var(--accent); }
.toc ul { list-style: none; }
.toc li { margin: 0.3rem 0; }
.toc a { color: var(--text-secondary); font-size: 0.85rem; padding: 0.2rem 0.5rem; border-radius: 4px; }
.toc a:hover { background: var(--accent-light); color: var(--accent); }

.article-content {
  background: var(--bg); border-radius: var(--radius); padding: 2rem;
  box-shadow: var(--shadow);
}
.article-content h2 { font-size: 1.5rem; margin: 2rem 0 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--border); }
.article-content h3 { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; }
.article-content p { margin-bottom: 1rem; }
.article-content blockquote {
  border-left: 4px solid var(--accent); padding: 0.75rem 1rem;
  margin: 1rem 0; background: var(--accent-light); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-content pre { background: var(--bg-code); border-radius: var(--radius-sm); padding: 1rem; overflow-x: auto; margin: 1rem 0; }
.article-content code { font-family: "JetBrains Mono", monospace; font-size: 0.85em; }
.article-content :not(pre) > code { background: var(--bg-code); padding: 0.15rem 0.4rem; border-radius: 3px; color: var(--accent); }
.article-content img { max-width: 100%; border-radius: var(--radius-sm); margin: 1rem 0; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.article-content th, .article-content td { border: 1px solid var(--border); padding: 0.6rem; }
.article-content th { background: var(--bg-secondary); }

/* Tags page */
.tags-list { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.tag-item {
  padding: 0.5rem 1rem; background: var(--bg); border-radius: 30px;
  box-shadow: var(--shadow); font-size: 0.9rem; color: var(--text-secondary);
}
.tag-item:hover { color: var(--accent); }
.tag-count { font-size: 0.75rem; background: var(--accent-light); padding: 0.1rem 0.4rem; border-radius: 10px; }

/* About */
.about-content { background: var(--bg); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.about-content p { margin-bottom: 1rem; }

/* Footer - 居中 */
footer {
  background: var(--bg);
  margin: 2rem auto;
  padding: 1.25rem;
  max-width: 780px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.footer-inner { text-align: center; }
.footer-copyright, .footer-links { font-size: 0.85rem; color: var(--text-secondary); }
.footer-links a { color: var(--text-secondary); font-size: 0.85rem; }
.footer-links a:hover { color: var(--accent); }
.footer-sep { color: var(--border); margin: 0 0.2rem; }

/* Search dropdown - 从按钮左侧弹出 */
.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 6.5rem;
  z-index: 200;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.2s ease;
}
.search-dropdown.active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}
.search-dropdown-form {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  overflow: hidden;
  width: 260px;
}
.search-dropdown-input {
  flex: 1;
  padding: 0.65rem 1rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

.empty-state {
  text-align: center; padding: 4rem 0; background: var(--bg);
  border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text-secondary);
}

/* Admin */
.admin-form { background: var(--bg); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.9rem; }
.form-input, .form-textarea { width: 100%; padding: 0.7rem 0.9rem; border: 2px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); font-size: 0.95rem; }
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--accent); }
.form-textarea { min-height: 300px; font-family: monospace; font-size: 0.85rem; resize: vertical; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }
.form-checkbox { display: flex; align-items: center; gap: 0.5rem; }
.form-checkbox input { width: auto; accent-color: var(--accent); }
.btn { display: inline-block; padding: 0.7rem 1.4rem; border: none; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.9rem; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: #dc3545; color: #fff; }
.btn-secondary { background: var(--bg-secondary); color: var(--text); border: 1px solid var(--border); }
.admin-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

.admin-list { list-style: none; }
.admin-item { display: flex; justify-content: space-between; align-items: center; padding: 1rem; background: var(--bg); border-radius: var(--radius); margin-bottom: 0.75rem; box-shadow: var(--shadow); }
.admin-item:hover { box-shadow: var(--shadow-hover); }
.admin-item-info { flex: 1; }
.admin-item-title { font-weight: 600; }
.admin-item-meta { font-size: 0.8rem; color: var(--text-secondary); }
.admin-item-actions { display: flex; gap: 0.5rem; }

@media (max-width: 768px) {
  .container { padding: 0 1rem; }
  .article-title { font-size: 1.6rem; }
  .form-row { flex-direction: column; }
  .admin-item { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .footer-inner { flex-direction: column; gap: 1rem; }
  .post-card-cover { height: 200px; }
}
