/* GooseBlog — 基于 gooseAI 毛玻璃 UI */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #15131f;
  --bg-gradient: linear-gradient(135deg, #241a44 0%, #15131f 48%, #0e1a33 100%);
  --sidebar-bg: #1b1828;
  --surface: #221e30;
  --surface-hover: #2c2740;
  --border: #3a3357;
  --text: #f4f0fb;
  --text-secondary: #b4a9cf;
  --brand: #8b5cf6;
  --brand-soft: rgba(139, 92, 246, 0.18);
  --danger: #ef4444;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --surface-rgb: 34,30,48;
  --acrylic-sidebar: rgba(42,36,62,0.22);
  --acrylic-panel: rgba(42,36,62,0.15);
  --acrylic-header: rgba(42,36,62,0.14);
  --acrylic-input: rgba(42,36,62,0.18);
  --acrylic-bubble: rgba(42,36,62,0.12);
  --acrylic-bar: rgba(42,36,62,0.1);
  --sidebar-w: 260px;
  --topbar-h: 56px;
}

* { scrollbar-width: thin; }
*::-webkit-scrollbar { width: 4px; }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-gradient);
  color: var(--text);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('https://api.imlcd.cn/bg/gq.php') center/cover no-repeat;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

#root {
  position: relative;
  z-index: 1;
  height: 100vh;
  overflow: hidden;
}

/* ===== Layout ===== */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--acrylic-sidebar);
  -webkit-backdrop-filter: blur(26px);
  backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  transition: width .25s ease;
}

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 18px;
  color: var(--brand);
  user-select: none;
}
.logo-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #6d28d9);
  color: #fff; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.icon-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn:active { transform: scale(0.96); }

.nav-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  margin-bottom: 8px;
}
.nav-btn:hover { background: var(--surface-hover); border-color: var(--border); }
.nav-btn:active { transform: scale(0.98); }

.nav-list {
  flex: 1;
  overflow-y: auto;
  margin-top: 4px;
}
.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
  overflow: hidden;
}
.nav-item:hover { background: var(--surface-hover); }
.nav-item.active { background: var(--surface); color: var(--brand); }
.nav-item-icon { margin-right: 8px; color: var(--text-secondary); flex-shrink: 0; }
.nav-item.active .nav-item-icon { color: var(--brand); }
.nav-item-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }

.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; margin: 0 auto 6px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-secondary); cursor: pointer;
  font-size: 16px; transition: background .15s, color .15s;
}
.theme-toggle:hover { background: var(--surface-hover); color: var(--text); }

.user-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 6px;
  border-top: 1px solid var(--border);
  margin-top: auto;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.user-bar:hover { background: var(--surface-hover); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #6d28d9);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-name { flex: 1; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Main ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
}

.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--acrylic-header);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.mobile-header .logo { font-size: 16px; }

.chat-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--acrylic-panel);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.chat-center::-webkit-scrollbar { display: none; }

/* ===== 博客内容样式 ===== */
.page-hero { margin-bottom: 24px; }
.page-hero h1 { font-size: 24px; font-weight: 700; color: var(--brand); }
.page-hero p { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

.tag-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tag-pill {
  padding: 6px 14px; border-radius: var(--radius-pill); font-size: 13px; cursor: pointer;
  border: 1px solid var(--border);
  background: var(--acrylic-input);
  color: var(--text-secondary);
  transition: all .2s;
}
.tag-pill:hover { border-color: var(--brand); color: var(--text); }
.tag-pill.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 500; }

.heatmap-wrap {
  background: var(--acrylic-bar); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  margin-bottom: 20px; overflow-x: auto;
}
.heatmap { display: block; min-width: 600px; }
.heatmap-month, .heatmap-weekday { fill: var(--text-secondary); font-size: 9px; }
.heatmap-cell { cursor: pointer; transition: opacity .15s, transform .15s; }
.heatmap-cell:hover { opacity: .6; transform: scale(1.2); }
.heatmap-cell-future { fill: transparent; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.post-card {
  background: var(--acrylic-bar); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  transition: background .2s, border-color .2s, transform .2s;
}
.post-card:hover { background: var(--surface-hover); border-color: var(--brand); transform: translateY(-2px); }
.post-card-cover {
  width: 100%; aspect-ratio: 16/9;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 28px; font-weight: 700;
}
.post-card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card h3 { font-size: 15px; font-weight: 600; line-height: 1.35; }
.post-card-meta { font-size: 11px; color: var(--text-secondary); display: flex; gap: 10px; flex-wrap: wrap; }
.post-card-excerpt { font-size: 12px; color: var(--text-secondary); line-height: 1.55; }

.post-detail {
  background: var(--acrylic-bar); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  max-width: 720px; margin: 0 auto;
}
.post-detail .back-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text-secondary); font-size: 12px; margin-bottom: 16px;
  cursor: pointer; border: none; background: none; padding: 0;
  transition: color .2s;
}
.post-detail .back-link::before { content: '\2190'; }
.post-detail .back-link:hover { color: var(--brand); }
.post-detail h1 { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.post-detail .detail-meta {
  font-size: 12px; color: var(--text-secondary); display: flex; gap: 12px;
  margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.post-detail .detail-content { color: var(--text-secondary); font-size: 14px; line-height: 1.8; }
.post-detail .detail-content p { margin-bottom: 14px; }
.post-detail .detail-content h1, .post-detail .detail-content h2, .post-detail .detail-content h3 {
  color: var(--text); margin: 20px 0 10px;
}
.post-detail .detail-content code {
  background: var(--brand-soft); padding: 2px 6px; border-radius: 4px;
  font-size: 12px; color: var(--brand);
  font-family: 'SF Mono',Consolas,Monaco,monospace;
}
.post-detail .detail-content pre {
  background: rgba(0,0,0,0.35); padding: 14px; border-radius: var(--radius-sm);
  overflow-x: auto; margin-bottom: 14px;
}
.post-detail .detail-content pre code { background: none; padding: 0; }
.post-detail .detail-content blockquote {
  border-left: 2px solid var(--brand); padding: 6px 14px;
  margin: 14px 0; background: rgba(0,0,0,0.2);
}
.post-detail .detail-content a { color: var(--brand); }
.post-detail .detail-content a:hover { color: #a78bfa; }

.archive-year {
  background: var(--acrylic-bar); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 12px;
}
.archive-year h2 { font-size: 18px; font-weight: 700; color: var(--brand); margin-bottom: 12px; }
.archive-item {
  display: flex; gap: 12px; padding: 6px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .15s;
}
.archive-item:hover { background: var(--surface-hover); }
.archive-item .archive-date { font-size: 12px; color: var(--text-secondary); min-width: 70px; flex-shrink: 0; }
.archive-item .archive-title { font-size: 13px; }
.archive-item:hover .archive-title { color: var(--brand); }

.about-content {
  background: var(--acrylic-bar); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px 28px; text-align: center;
  max-width: 520px; margin: 0 auto;
}
.about-content .avatar {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--brand), #6d28d9);
  color: #fff; font-weight: 700; font-size: 28px;
  display: flex; align-items: center; justify-content: center;
}
.about-content h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; color: var(--brand); }
.about-content .bio { color: var(--text-secondary); font-size: 13px; line-height: 1.7; max-width: 420px; margin: 0 auto 20px; }
.about-content .social-links { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.about-content .social-links a {
  color: var(--text-secondary); font-size: 12px; padding: 5px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); text-decoration: none;
  transition: all .2s;
}
.about-content .social-links a:hover { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }

.admin-login-wrap { max-width: 360px; margin: 80px auto; }
.admin-card { background: var(--acrylic-bar); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.admin-editor-wrap { max-width: 900px; margin: 0 auto; }
.admin-editor-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.admin-field { margin-bottom: 14px; }
.admin-field label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.admin-input {
  width: 100%; padding: 9px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--acrylic-input); color: var(--text); font-size: 13px; outline: none;
  transition: border-color .2s;
}
.admin-input:focus { border-color: var(--brand); }
.admin-textarea {
  width: 100%; min-height: 280px; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--acrylic-input); color: var(--text); font-size: 13px; line-height: 1.6;
  font-family: 'SF Mono',Consolas,Monaco,'Courier New',monospace;
  outline: none; resize: vertical;
  transition: border-color .2s;
}
.admin-textarea:focus { border-color: var(--brand); }
.admin-md-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin-preview-pane {
  min-height: 280px; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--acrylic-bar); color: var(--text-secondary); font-size: 13px; line-height: 1.6;
  overflow-y: auto; word-break: break-word;
}
.admin-error { color: var(--danger); font-size: 12px; margin-bottom: 10px; display: none; }
.admin-btn {
  padding: 9px 20px; border-radius: var(--radius-pill); font-size: 13px; cursor: pointer;
  transition: background .2s, transform .15s;
}
.admin-btn-primary { border: none; background: var(--brand); color: #fff; }
.admin-btn-primary:hover { background: #7c3aed; transform: scale(1.02); }
.admin-btn-ghost { border: 1px solid var(--border); background: transparent; color: var(--text-secondary); }
.admin-btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.admin-actions { margin-top: 16px; }
.admin-status-msg { color: var(--text-secondary); font-size: 12px; }
.admin-status-success { color: #22c55e; font-size: 12px; }
.admin-status-error { color: var(--danger); font-size: 12px; }

.state-msg { text-align: center; padding: 48px 20px; color: var(--text-secondary); }
.state-msg .spinner {
  display: inline-block; width: 24px; height: 24px;
  border: 2px solid var(--border); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.state-msg p { margin-top: 10px; font-size: 12px; }
.state-msg.error p { color: var(--danger); }
.state-msg.error .retry-btn {
  margin-top: 10px; padding: 5px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-pill); background: var(--acrylic-input);
  color: var(--brand); font-size: 12px; cursor: pointer;
}
.state-msg.error .retry-btn:hover { background: var(--surface-hover); }
.state-msg .empty-icon {
  font-size: 28px; font-weight: 700;
  background: linear-gradient(135deg, var(--brand), #6d28d9);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Overlay ===== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 30;
  opacity: 0;
  transition: opacity .25s ease;
}
.overlay.show { opacity: 1; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .overlay.show { display: block; }
  .mobile-header { display: flex; }
  .chat-center { padding: 16px; }
}
