/* ============================================
   Photography Portfolio — Complete Stylesheet
   ============================================ */

/* --- CSS Variables --- */
:root {
  --color-bg: #fafaf9;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-secondary: #6b7280;
  --color-text-muted: #9ca3af;
  --color-accent: #d4a574;
  --color-accent-hover: #c4955f;
  --color-accent-light: #fdf2e9;
  --color-border: #e5e7eb;
  --color-border-light: #f3f4f6;
  --color-danger: #ef4444;
  --color-danger-hover: #dc2626;
  --color-success: #10b981;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Georgia", "Noto Serif SC", serif;
  --max-width: 1280px;
  --header-height: 72px;

  /* Logo 专色（支持深色模式自适应） */
  --color-logo-text: #1a1a1a;
  --color-logo-accent: #D4A574;

  /* 原来硬编码的半透明色，提取为变量以支持深色主题 */
  --color-header-bg: rgba(255, 255, 255, 0.85);
  --color-close-btn-bg: rgba(255, 255, 255, 0.95);
  --color-fc-panel-bg: rgba(255, 255, 255, 0.9);
  --color-bar-track: rgba(0, 0, 0, 0.06);
  --color-bar-track-light: rgba(0, 0, 0, 0.04);
  --color-bar-track-lighter: rgba(0, 0, 0, 0.025);
  --color-scrollbar-thumb: rgba(0, 0, 0, 0.28);
  --color-muted-hover: rgba(0, 0, 0, 0.08);
  --color-tag-managing-bg: #fef2f2;
  --color-tag-managing-hover: #fee2e2;

  /* Logo 专色（支持深色模式自适应） */
  --color-logo-text: #1a1a1a;
  --color-logo-accent: #D4A574;
}

/* --- 深色主题覆盖 --- */
[data-theme="dark"] {
  --color-bg: #1a1a1e;
  --color-surface: #252528;
  --color-text: #e5e5e5;
  --color-text-secondary: #9ca3af;
  --color-text-muted: #6b7280;
  --color-accent: #dbb88a;
  --color-accent-hover: #e0c59a;
  --color-accent-light: rgba(212, 165, 116, 0.12);
  --color-border: #3a3a3e;
  --color-border-light: #2a2a2e;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.45);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.55);
  --color-header-bg: rgba(30, 30, 35, 0.85);
  --color-close-btn-bg: rgba(50, 50, 55, 0.95);
  --color-fc-panel-bg: rgba(40, 40, 45, 0.9);
  --color-bar-track: rgba(255, 255, 255, 0.08);
  --color-bar-track-light: rgba(255, 255, 255, 0.06);
  --color-bar-track-lighter: rgba(255, 255, 255, 0.04);
  --color-scrollbar-thumb: rgba(255, 255, 255, 0.28);
  --color-muted-hover: rgba(255, 255, 255, 0.14);
  --color-tag-managing-bg: rgba(239, 68, 68, 0.12);
  --color-tag-managing-hover: rgba(239, 68, 68, 0.2);
  --color-logo-text: #e5e5e5;
  --color-logo-accent: #dbb88a;
}

/* --- 自动跟随系统深色模式（当未显式设置 light 主题时） --- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #1a1a1e;
    --color-surface: #252528;
    --color-text: #e5e5e5;
    --color-text-secondary: #9ca3af;
    --color-text-muted: #6b7280;
    --color-accent: #dbb88a;
    --color-accent-hover: #e0c59a;
    --color-accent-light: rgba(212, 165, 116, 0.12);
    --color-border: #3a3a3e;
    --color-border-light: #2a2a2e;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.45);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.55);
    --color-header-bg: rgba(30, 30, 35, 0.85);
    --color-close-btn-bg: rgba(50, 50, 55, 0.95);
    --color-fc-panel-bg: rgba(40, 40, 45, 0.9);
    --color-bar-track: rgba(255, 255, 255, 0.08);
    --color-bar-track-light: rgba(255, 255, 255, 0.06);
    --color-bar-track-lighter: rgba(255, 255, 255, 0.04);
    --color-scrollbar-thumb: rgba(255, 255, 255, 0.28);
    --color-muted-hover: rgba(255, 255, 255, 0.14);
    --color-tag-managing-bg: rgba(239, 68, 68, 0.12);
    --color-tag-managing-hover: rgba(239, 68, 68, 0.2);
    --color-logo-text: #e5e5e5;
    --color-logo-accent: #dbb88a;
  }
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--color-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-accent-hover); }
img { max-width: 100%; display: block; }

/* --- Header / Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  height: 100%;
}

.site-logo-svg { display: block; height: 48px; width: auto; }

.nav-links { display: flex; gap: 22px; align-items: center; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-secondary);
  font-size: 0.925rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

.nav-link:hover { color: var(--color-text); }

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.3s;
}

.nav-link:hover::after { width: 100%; }

/* SVG icon — visible only on mobile (controlled in @media below) */
.nav-icon {
  width: 22px;
  height: 22px;
  display: none;
  flex-shrink: 0;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  text-align: center;
  padding: 100px 24px;
  max-width: none;
  margin: 0 0 12px;
  overflow: hidden;
  background-color: var(--color-bg);
  transition: background-image 0.5s ease;
}

.hero.has-banner {
  padding: 80px 24px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1;
}

.hero.has-banner .hero-overlay {
  display: block;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--color-text);
  transition: color 0.3s ease;
}

.hero.has-banner h1 {
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero p {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
  max-width: 560px;
  margin: 0 auto;
  transition: color 0.3s ease;
}

.hero.has-banner p {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

@media (max-width: 640px) {
  :root { --header-height: 60px; }
  .site-logo-svg { height: 38px; }

  /* Mobile nav: icon-only round buttons, hide text labels */
  .header-inner { padding: 0 16px; }
  .nav-links { gap: 8px; }
  .nav-link { padding: 0; width: 40px; height: 40px; justify-content: center; border-radius: 50%; }
  .nav-link::after { display: none; }
  .nav-icon { display: block; width: 22px; height: 22px; color: var(--color-text-secondary); }
  .nav-link:hover .nav-icon { color: var(--color-accent); }
  .nav-label { display: none; }
  .dropdown-chevron { display: none; }

  .theme-toggle { width: 40px; height: 40px; }

  .hero { padding: 60px 20px; }
  .hero.has-banner { padding: 60px 20px; }
  .hero h1 { font-size: 2rem; }
}

/* --- Hero Banner (old standalone — kept for reference, now unused on homepage) --- */
.hero-banner {
  width: 100%;
  height: 360px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* --- Gallery Grid (Masonry) --- */
.gallery-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 80px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--color-text);
}

.gallery-grid {
  /* JS-driven masonry: cards are absolutely positioned by layoutMasonry() in
     main.js. This keeps the staggered waterfall look while avoiding CSS
     multi-column (columns), whose Safari rendering bugs made cards flicker,
     vanish, or leak content on hover. Each card is independently positioned,
     so transform hover animations work correctly in all browsers.
     The container height is set by JS. Falls back to a simple block flow if JS
     hasn't run yet. */
  position: relative;
}

/* --- Post Card --- */
.post-card {
  /* Absolutely positioned by the masonry layout (main.js). */
  position: absolute;
  top: 0;
  left: 0;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.post-card-cover {
  width: 100%;
  display: block;
  aspect-ratio: auto;
  object-fit: cover;
  background: var(--color-border-light);
}

.post-card-body { padding: 20px; }

.post-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text);
  line-height: 1.4;
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* --- Reactions --- */
.reactions-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.reaction-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: var(--color-accent-light);
}

.reaction-btn.active {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: #fff;
}

.reaction-btn .count { font-weight: 600; }

/* --- Post Detail Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.35s ease;
  /* Firefox: thin, translucent scrollbar that fades with the .scrolling class */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.4s ease;
}
.modal-content.scrolling {
  scrollbar-color: var(--color-scrollbar-thumb) transparent;
}

/* WebKit (Chrome/Safari/Edge): custom overlay-style scrollbar.
   The thumb is transparent by default and fades in only while scrolling. */
.modal-content::-webkit-scrollbar {
  width: 8px;
}
.modal-content::-webkit-scrollbar-track {
  background: transparent;
}
.modal-content::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
  transition: background-color 0.4s ease;
}
.modal-content.scrolling::-webkit-scrollbar-thumb {
  background-color: var(--color-scrollbar-thumb);
}
.modal-content.scrolling::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.45);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 文章详情弹窗的定位包装器，让关闭按钮相对于弹窗内容定位 */
.modal-wrapper {
  position: relative;
  max-width: 900px;
  width: 100%;
}

.modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--color-close-btn-bg);
  color: var(--color-text);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.modal-close:hover { background: var(--color-surface); transform: scale(1.1); }

.modal-header { padding: 32px 32px 0; }

.modal-header h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
}

.modal-header .date {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: 8px;
}

.modal-body {
  padding: 20px 32px 32px;
  margin-top: 4px;
  position: relative;
}
/* A subtle divider between the meta area (title/date/tags) and the body,
   inset from the rounded corners so it doesn't touch the edges. */
.modal-body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 32px;
  right: 32px;
  height: 1px;
  background: var(--color-border-light);
}
/* Kill the leading margin of the body's first block so it sits right under
   the divider instead of adding another large gap. */
.modal-body.article-body > :first-child {
  margin-top: 0;
}

.modal-body .content-text {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--color-text);
  white-space: pre-wrap;
  margin-bottom: 32px;
}

.modal-images { display: flex; flex-direction: column; gap: 16px; }

.modal-images img {
  width: 100%;
  border-radius: var(--radius-md);
  cursor: zoom-in;
  transition: opacity 0.2s;
  background: var(--color-border-light);
}

.modal-images img:hover { opacity: 0.92; }

/* EXIF Badge on each photo */
.modal-image-wrap {
  margin-bottom: 24px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
  background: var(--color-bg);
}

.modal-image-wrap .modal-image {
  display: block;
  width: 100%;
  cursor: zoom-in;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: 1px solid var(--color-border-light);
}

.exif-badge {
  margin: 0;
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.exif-camera { font-weight: 500; color: var(--color-text); margin-bottom: 2px; }
.exif-lens { margin-bottom: 2px; }
.exif-params {
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 0.78rem;
  color: var(--color-accent);
  letter-spacing: 0.02em;
}
.exif-location { margin-top: 2px; }

.modal-reactions {
  display: flex;
  gap: 12px;
  padding: 0 32px 32px;
  flex-wrap: wrap;
}

.modal-reactions .reaction-btn { font-size: 0.9rem; padding: 6px 16px; }

/* --- Lightbox --- */
/* z-index 600: above map-overlay (400) and the temporarily-raised post modal
   (500, set in JS when opening a post from the map). The lightbox must always
   be on top so it's not hidden behind the map when opened from a map-launched
   post detail. */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: fadeIn 0.2s ease;
}

.lightbox-overlay img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transition: transform 0.12s ease-out;
}

.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}

.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
  background: rgba(255,255,255,0.25);
}

.lightbox-close { top: 16px; right: 16px; width: 48px; height: 48px; font-size: 1.5rem; }
.lightbox-prev { left: 20px; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 1.5rem; }
.lightbox-next { right: 20px; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 1.5rem; }

/* --- Photography Map Button (now a nav-link, see index.html) --- */

/* --- Theme Toggle --- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
  margin-left: 4px;
}
.theme-toggle:hover {
  color: var(--color-accent);
  background: var(--color-accent-light);
}
.theme-icon { width: 18px; height: 18px; }
.theme-icon-light { display: none; }
.theme-icon-dark { display: block; }
/* 深色模式下显示太阳图标，浅色模式下显示月亮图标 */
[data-theme="dark"] .theme-icon-light { display: block; }
[data-theme="dark"] .theme-icon-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-light { display: block; }
  :root:not([data-theme="light"]) .theme-icon-dark { display: none; }
}

/* --- Tools Dropdown (hover to open, nav-link style) --- */
.tools-dropdown {
  position: relative;
}

.dropdown-chevron {
  transition: transform 0.2s;
  opacity: 0.5;
}

.tools-dropdown:hover .dropdown-chevron,
.tools-dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* hover 展开下拉菜单（JS 控制，带延迟关闭） */
.tools-dropdown.open .tools-dropdown-menu {
  display: block;
}

/* 鼠标移到菜单上时保持打开（防止间隙闪烁） */
.tools-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 1000;
  /* 透明桥接区域，防止鼠标从按钮移到菜单时闪烁 */
  margin-top: 4px;
}

.tools-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: background 0.15s;
  white-space: nowrap;
}

.tools-dropdown-item:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

/* --- Photography Map Overlay --- */
.map-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.map-modal {
  position: relative;
  width: 90vw;
  height: 85vh;
  background: var(--color-surface)
  border-radius: 12px;
  overflow: visible;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.map-container {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
}

.map-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--color-text-muted);
  font-size: 1rem;
}

.map-close {
  position: absolute;
  top: -12px;
  right: -12px;
  z-index: 1000;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--color-close-btn-bg);
  color: var(--color-text);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.map-close:hover {
  background: var(--color-surface);
  transform: scale(1.1);
}

/* --- Thumbnail Bubble Markers --- */
.map-thumb-marker {
  position: absolute;
  width: 52px;
  height: 52px;
  cursor: pointer;
  z-index: 1;
  will-change: transform;
}

.map-thumb-marker:hover {
  z-index: 10;
}

.map-thumb-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  background: var(--color-border-light);
  transition: transform 0.2s;
}

.map-thumb-marker:hover .map-thumb-inner {
  transform: scale(1.15);
}

.map-thumb-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: var(--color-surface, #fff);
  border: 2px solid var(--color-border, #ddd);
}

/* --- Focus Marker (post opened from detail view) --- */
/* A distinct arrow/pin marker — no thumbnail bubble, visually separated from
   the homepage's round photo markers. Pure CSS so it always renders crisp. */
.map-focus-marker {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  will-change: transform;
}

.map-focus-pin {
  position: relative;
  width: 28px;
  height: 28px;
}

/* The round pin head */
.map-focus-pin::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  background: #dc3545;
  transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  border: 2px solid #fff;
}

/* The white dot in the center of the pin head */
.map-focus-pin::after {
  content: '';
  position: absolute;
  top: 7px;
  left: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-surface)
}

/* Pulsing ring at the pin's anchor point */
.map-focus-pulse {
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  border-radius: 50%;
  background: rgba(220, 53, 69, 0.4);
  animation: map-focus-pulse-anim 1.8s ease-out infinite;
}

@keyframes map-focus-pulse-anim {
  0%   { transform: scale(0.4); opacity: 0.9; }
  100% { transform: scale(3.5); opacity: 0;   }
}

/* --- Post Modal Location Line --- */
.post-location {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.post-location:hover {
  color: var(--color-accent);
}

/* --- Load More --- */
.load-more-wrap {
  text-align: center;
  margin: 40px 0;
}

.btn-load-more {
  padding: 12px 40px;
  border-radius: 50px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-load-more:hover {
  border-color: var(--color-text);
  box-shadow: var(--shadow-md);
}

.btn-load-more:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--color-text-muted);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state p { font-size: 1.1rem; }

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 40px 24px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border-light);
}
.site-footer .icp {
  margin-top: 6px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.site-footer .icp a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
}
.site-footer .icp a:hover {
  color: var(--color-text);
  text-decoration: underline;
}
.site-footer .icp .beian-icon {
  width: 12px;
  height: auto;
  margin-right: 2px;
}
.site-footer .icp-sep {
  color: var(--color-text-muted);
  opacity: 0.5;
}

/* ========================================
   Login Page
   ======================================== */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  padding: 24px;
}

.login-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
}

.login-logo {
  height: 48px;
  width: auto;
  display: block;
}

.login-card .subtitle {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.form-group { margin-bottom: 20px; text-align: left; }

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--color-bg);
  color: var(--color-text);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(212,165,116,0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  border: 1px solid transparent;   /* reserve border space so bordered and
                                       borderless buttons share the same height */
  font-size: 0.95rem;
  line-height: 1.4;          /* fixed line-height so emoji glyphs of different
                                heights (💾 vs 🗑) don't change button height */
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  width: 100%;
}

.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); }

.btn-danger {
  background: var(--color-surface)
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

.btn-danger:hover { background: var(--color-danger); color: #fff; }

.btn-sm { padding: 6px 16px; font-size: 0.8rem; }

.error-msg {
  color: var(--color-danger);
  font-size: 0.85rem;
  margin-top: 12px;
  display: none;
}

.error-msg.show { display: block; }

/* ========================================
   Admin Page
   ======================================== */

.admin-page { background: var(--color-bg); min-height: 100vh; }

.admin-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.2s;
  /* 抵消 SVG 内部留白，让视觉中心与右边文字对齐 */
  margin-bottom: -1px;
}
.admin-logo-link:hover { opacity: 1; }

.admin-logo-svg {
  display: block;
  vertical-align: middle;
}

.admin-subtitle {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  line-height: 1;
  color: var(--color-text-muted);
  padding-left: 14px;
  border-left: 1px solid var(--color-border);
  /* 与 SVG 在 flex 行内垂直居中对齐 */
  align-self: center;
}

.btn-sm { padding: 6px 16px; font-size: 0.8rem; }

.admin-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  align-items: start;
}
.admin-sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
}

/* --- Post List Sidebar --- */
.post-list-panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  overflow: hidden;
}

.panel-header {
  padding: 20px;
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.panel-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;   /* keep "📝 文章列表" on one line */
  flex-shrink: 0;
}

/* "+ 新建" button: size to its content, never stretch to fill the row */
.panel-header .btn {
  flex-shrink: 0;
  white-space: nowrap;
  width: auto;
}

.post-list { max-height: calc(100vh - 300px); overflow-y: auto; }

.post-list-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-list-item:hover { background: var(--color-accent-light); }
.post-list-item.active { background: var(--color-accent-light); border-left: 3px solid var(--color-accent); }

.post-list-item .thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--color-border-light);
  flex-shrink: 0;
}

.post-list-item .info { flex: 1; min-width: 0; }

.post-list-item .info .title {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-list-item .info .date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Pager */
.post-list-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--color-border-light);
}
.pager-btn {
  border: 1px solid var(--color-border);
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  background: var(--color-bg);
}
.pager-btn:disabled { opacity: 0.4; cursor: default; }
.pager-info { font-size: 0.78rem; color: var(--color-text-muted); }

/* Sidebar nav cards — separate rounded panel */
.sidebar-nav-panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-nav-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--color-text-secondary);
  transition: all 0.15s;
  width: 100%;
  text-align: left;
}
.sidebar-nav-card:hover {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
}
.sidebar-nav-card.active {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 600;
}
.nav-card-icon { font-size: 1.1rem; }
.nav-card-badge {
  margin-left: auto;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.68rem;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
}

.post-list-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* --- Editor Panel --- */
.editor-panel {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  padding: 28px;
}

.editor-panel .editor-placeholder {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}

.editor-form { display: none; }

.form-row { margin-bottom: 20px; }

/* Field labels only — exclude labels that are actually styled as buttons
   (e.g. the file-upload <label class="btn">), which must keep .btn layout. */
.form-row label:not(.btn) {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-row input[type="text"],
.form-row textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.2s;
}

.form-row input[type="text"]:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(212,165,116,0.15);
}

.form-row textarea { resize: vertical; min-height: 200px; line-height: 1.7; }

/* 火烧云数据源选择器 */
.fc-source-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.15s, background 0.15s;
}
.fc-source-opt:hover {
  border-color: var(--color-accent);
}
.fc-source-opt input[type="radio"] { accent-color: var(--color-accent); }

/* --- Image Upload Area --- */
.upload-area {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  background: var(--color-bg);
}

.upload-area:hover, .upload-area.dragover {
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

.upload-area .upload-icon { font-size: 2.5rem; margin-bottom: 12px; }

.upload-area p { font-size: 0.9rem; color: var(--color-text-secondary); }
.upload-area p strong { color: var(--color-accent); }

.upload-area .hint { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 4px; }

/* --- Image Preview Grid --- */
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.image-preview-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--color-border-light);
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-item .pending-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 8px;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.7rem;
  border-radius: 10px;
  font-weight: 600;
  pointer-events: none;
}

.image-preview-item .delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.image-preview-item:hover .delete-btn { opacity: 1; }

.image-preview-item .uploading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Editor Actions --- */
.editor-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border-light);
  align-items: center;
}
/* Save button: fill the remaining space (override the global .btn-primary
   width:100% used on the login page). Delete button: compact, never wraps. */
.editor-actions .btn-primary {
  width: auto;
  flex: 1;
}
.editor-actions .btn-danger {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* --- Toast Notifications --- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 400;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(80px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-success { background: var(--color-success); }
.toast-error { background: var(--color-danger); }

/* --- Page Loading --- */
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: var(--color-text-muted);
  font-size: 1rem;
}

/* --- Tags --- */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.6;
  transition: all 0.2s;
  cursor: default;
}

/* Tag color palette — cycled via JS data attribute */
.tag[data-color="1"] { background: #fef3c7; color: #92400e; }
.tag[data-color="2"] { background: #dbeafe; color: #1e40af; }
.tag[data-color="3"] { background: #d1fae5; color: #065f46; }
.tag[data-color="4"] { background: #fce7f3; color: #9d174d; }
.tag[data-color="5"] { background: #ede9fe; color: #5b21b6; }
.tag[data-color="6"] { background: #e0e7ff; color: #3730a3; }
.tag[data-color="7"] { background: #f3f4f6; color: #374151; }
.tag[data-color="8"] { background: var(--color-tag-managing-hover); color: #991b1b; }

/* Post card tags */
.post-card-tags {
  margin-top: 10px;
  margin-bottom: 6px;
}

.post-card-tags .tag {
  font-size: 0.7rem;
  padding: 2px 10px;
}

/* Modal tags */
.modal-tags {
  padding: 0 32px 20px;
}

.modal-tags .tag {
  font-size: 0.78rem;
  padding: 4px 14px;
}

/* --- Tag Selector (Admin) --- */
.tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag-selector .tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: inherit;
  background: var(--color-border-light);
  color: var(--color-text-secondary);
}

.tag-selector .tag-chip:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.tag-selector .tag-chip.selected {
  background: var(--color-accent);
  color: #fff;
}

/* --- Tag manage mode (delete tags) --- */
.tag-selector .tag-chip.managing {
  cursor: default;
  background: var(--color-tag-managing-bg);
  color: var(--color-danger);
  padding-right: 6px;
}
.tag-selector .tag-chip.managing:hover {
  background: var(--color-tag-managing-hover);
  color: var(--color-danger);
}
.tag-selector .tag-chip .tag-chip-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 2px;
  border-radius: 50%;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
  transition: background 0.15s, transform 0.15s;
}
.tag-selector .tag-chip .tag-chip-del:hover {
  background: var(--color-danger);
  color: #fff;
  transform: scale(1.12);
}

.tag-manage-toggle {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px dashed var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  transition: all 0.2s;
}
.tag-manage-toggle:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  border-style: solid;
}

.tag-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tag-input {
  padding: 4px 12px;
  border: 1px dashed var(--color-border);
  border-radius: 20px;
  font-size: 0.8rem;
  font-family: inherit;
  background: transparent;
  color: var(--color-text);
  width: 100px;
  transition: all 0.2s;
}

.tag-input:focus {
  outline: none;
  border-color: var(--color-accent);
  width: 140px;
}

.tag-input::placeholder {
  color: var(--color-text-muted);
}

.tag-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 50;
  min-width: 140px;
  max-height: 160px;
  overflow-y: auto;
  display: none;
}

.tag-suggestions.show {
  display: block;
}

.tag-suggestion-item {
  padding: 6px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: background 0.15s;
}

.tag-suggestion-item:hover,
.tag-suggestion-item.active {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

/* --- End Tags --- */

/* ========================================
   Fire Cloud Prediction (火烧云预测)
   ======================================== */

/* 弹窗容器 — 桌面端宽弹窗，手机端全宽 */
.fc-modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 96vw;
  max-width: 1080px;         /* 进一步增加宽度，给 3 列预留极度舒适的空间 */
  max-height: 88vh;
  position: relative;
  overflow: visible;
}

.fc-modal-body {
  padding: 28px 28px 24px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: var(--radius-xl);
}

.fc-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.fc-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

/* 日期卡片网格 — 桌面端三列横排，手机端单列竖排 */
.fc-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.fc-day-card {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color 0.2s;
}
.fc-day-card:hover { border-color: var(--color-border); }

.fc-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.fc-day-date {
  font-weight: 600;
  font-size: 0.95rem;
}
.fc-day-weather {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.fc-period {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.fc-period:last-child { margin-bottom: 0; }

.fc-period-icon { font-size: 1.1rem; width: 24px; text-align: center; }
.fc-period-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  width: 36px;
}
/* 进度条轨道 — 半透明，不抢眼 */
.fc-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--color-bar-track);
  border-radius: 4px;
  overflow: hidden;
}
.fc-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.fc-score {
  font-size: 0.8rem;
  font-weight: 600;
  width: 100px;             /* 拓宽宽度以承载 1.85 (优质大烧) 的指数等级格式 */
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fc-time {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.fc-details {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border-light);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

/* 新增：云属/时段/通透信息网格 — 1行横向等分排版 */
.fc-info-grid {
  display: flex;
  flex-wrap: nowrap;          /* 强行不折行 */
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--color-bar-track-lighter);
  border-radius: 6px;
}

.fc-info-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  white-space: nowrap;        /* 强行不折行 */
}

.fc-info-item .fc-info-label {
  color: var(--color-text-muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.fc-info-item .fc-info-value {
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

/* 颜色色块（已弃用，保留以备后用）*/
.fc-color-bar { display: none; }

/* 伴随天象 */
.fc-phenomena {
  margin-top: 6px;
  padding: 6px 10px;
  background: linear-gradient(135deg, rgba(255, 154, 60, 0.08), rgba(255, 90, 60, 0.04));
  border-radius: 6px;
  font-size: 0.72rem;
  color: #d4742a;
  line-height: 1.5;
}

/* 预测载入与空状态（稳定高度避免抖动，支持垂直居中） */
.fc-empty-state, .fc-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;      /* 稳定垂直高度 */
  color: var(--color-text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Loading 旋转动画 */
.fc-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 90, 60, 0.1);
  border-radius: 50%;
  border-top-color: var(--color-accent);
  animation: fc-spin 0.8s linear infinite;
  margin-bottom: 14px;
}

@keyframes fc-spin {
  to { transform: rotate(360deg); }
}

/* 搜索历史标签 */
.fc-history-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fc-history-title {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.fc-history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fc-history-tag {
  font-size: 0.72rem;
  padding: 4px 10px;
  background: var(--color-bar-track-light);
  border: 1px solid transparent;
  color: var(--color-text-secondary);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.fc-history-tag:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* 当前位置建议项 — 蓝色高亮 */
.location-suggest-item.current-loc {
  color: var(--color-accent);
  font-weight: 600;
}

/* 补全：前台通用位置搜索建议提示列表（与输入框保持距离） */
.location-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,0.08));
  max-height: 240px;
  overflow-y: auto;
  z-index: 1010;
  margin-top: 6px;       /* 增加间距，避免紧贴输入框 */
  display: none;
}

.location-suggest-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border-light);
  line-height: 1.4;
  transition: background 0.15s;
}

.location-suggest-item:last-child {
  border-bottom: none;
}

.location-suggest-item:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

/* 手机端：单列 + 紧凑间距 */
@media (max-width: 640px) {
  .fc-modal {
    width: 94vw;
    max-width: none;
    border-radius: var(--radius-lg);
  }
  .fc-modal-body { padding: 20px 18px 18px; }
  .fc-results-grid { grid-template-columns: 1fr; }
  .fc-title { font-size: 1.2rem; }
}

/* 火烧云预测结果头部的"查看周边分布地图"按钮 */
.fc-map-btn {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-light);
  border: 1px solid var(--color-accent);
  padding: 4px 10px;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  user-select: none;
}

.fc-map-btn:hover {
  background: var(--color-accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 90, 60, 0.15);
}

/* 一键直达全国分布图大按钮 */
.fc-direct-map-btn {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--color-accent), #ea580c);
  border: none;
  width: 100%;
  padding: 10px 16px;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
  box-shadow: 0 4px 15px rgba(255, 90, 60, 0.25);
  transition: all 0.25s ease;
}

.fc-direct-map-btn:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(255, 90, 60, 0.35);
}

/* 地图内火烧云 3天x晨晚霞 切换面板 (毛玻璃风格) */
.map-fc-panel {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 990;
  display: flex;
  align-items: center;
  background: var(--color-fc-panel-bg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  padding: 10px 16px;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.fc-panel-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fc-panel-title {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.fc-panel-tabs {
  display: flex;
  gap: 4px;
}

.fc-slot-section {
  gap: 10px;
}

.fc-slot-tabs {
  flex-wrap: wrap;
  justify-content: center;
  max-width: 620px;
}

.fc-panel-tab {
  font-size: 0.75rem;
  padding: 4px 12px;
  background: var(--color-bar-track-light);
  color: var(--color-text-secondary);
  border-radius: 30px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-weight: 500;
}

.fc-panel-tab:hover {
  background: var(--color-muted-hover);
}

.fc-panel-tab.active {
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
}

.fc-panel-divider {
  width: 1px;
  height: 20px;
  background: var(--color-border);
  margin: 0 8px;
}

/* 手机端面板适配 */
@media (max-width: 640px) {
  .map-fc-panel {
    width: 90%;
    bottom: 16px;
    flex-direction: column;
    gap: 10px;
    border-radius: var(--radius-lg);
    padding: 12px 16px;
  }
  .fc-panel-divider {
    display: none;
  }
  .fc-panel-section {
    width: 100%;
    justify-content: space-between;
  }
  .fc-slot-section {
    align-items: flex-start;
  }
  .fc-slot-tabs {
    justify-content: flex-end;
    max-width: calc(100% - 64px);
  }
  .fc-panel-tab {
    padding: 4px 9px;
    font-size: 0.72rem;
  }
}

/* ========================================
   Banner Editor (admin)
   ======================================== */
.banner-editor-wrap {
  margin-bottom: 12px;
}

.banner-editor {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background-color: var(--color-border-light);
  background-repeat: no-repeat;
  cursor: grab;
  position: relative;
  user-select: none;
}

.banner-editor:active {
  cursor: grabbing;
}

.banner-editor-hint {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.3);
  padding: 2px 8px;
  border-radius: 4px;
  pointer-events: none;
  transition: opacity 0.3s;
}

.banner-editor:hover .banner-editor-hint {
  opacity: 0;
}

.banner-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* ============================================================
   Rich Editor (Editor.js) — admin panel
   ============================================================ */
.editor-tip {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 4px 0 12px;
  line-height: 1.6;
}
.editor-tip strong { color: var(--color-accent); }

.editorjs-holder {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  min-height: 260px;
  background: var(--color-surface);
  transition: border-color 0.2s;
}
.editorjs-holder:focus-within {
  border-color: var(--color-accent);
}
/* Editor.js internal spacing tweaks to match the site's serif reading style */
.editorjs-holder .ce-block__content,
.editorjs-holder .ce-toolbar__content {
  max-width: 100%;
}
.editorjs-holder .ce-paragraph,
.editorjs-holder .cdx-block {
  line-height: 1.75;
  font-size: 0.98rem;
}
.editorjs-holder .cdx-quote__text {
  min-height: auto;
}
.editorjs-holder .image-tool__caption {
  font-size: 0.85rem;
}

/* ============================================================
   Editor.js 暗色模式 — 工具栏/弹窗/占位文字均为 JS 注入行内样式，需全局覆盖
   ============================================================ */
[data-theme="dark"] .ce-popover,
[data-theme="dark"] .ce-conversion-toolbar,
[data-theme="dark"] .ce-inline-toolbar {
  background: var(--color-surface);
  border-color: var(--color-border);
}
[data-theme="dark"] .ce-popover__item,
[data-theme="dark"] .ce-inline-tool { color: var(--color-text); }
[data-theme="dark"] .ce-popover__item:hover,
[data-theme="dark"] .ce-inline-tool:hover { background: var(--color-bar-track); }
[data-theme="dark"] .ce-paragraph[data-placeholder]:empty::before,
[data-theme="dark"] .ce-header[data-placeholder]:empty::before,
[data-theme="dark"] .cdx-block[data-placeholder]:empty::before { color: var(--color-text-muted); }
[data-theme="dark"] .ce-toolbar__plus,
[data-theme="dark"] .ce-toolbar__settings-btn { color: var(--color-text-secondary); }
[data-theme="dark"] .ce-code__textarea { color: var(--color-text); caret-color: var(--color-text); }
[data-theme="dark"] .image-tool__caption { color: var(--color-text-secondary); }
[data-theme="dark"] .image-tool__caption[contenteditable]:empty::before { color: var(--color-text-muted); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ce-popover,
  :root:not([data-theme="light"]) .ce-conversion-toolbar,
  :root:not([data-theme="light"]) .ce-inline-toolbar {
    background: var(--color-surface);
    border-color: var(--color-border);
  }
  :root:not([data-theme="light"]) .ce-popover__item,
  :root:not([data-theme="light"]) .ce-inline-tool { color: var(--color-text); }
  :root:not([data-theme="light"]) .ce-popover__item:hover,
  :root:not([data-theme="light"]) .ce-inline-tool:hover { background: var(--color-bar-track); }
  :root:not([data-theme="light"]) .ce-paragraph[data-placeholder]:empty::before,
  :root:not([data-theme="light"]) .ce-header[data-placeholder]:empty::before,
  :root:not([data-theme="light"]) .cdx-block[data-placeholder]:empty::before { color: var(--color-text-muted); }
  :root:not([data-theme="light"]) .ce-toolbar__plus,
  :root:not([data-theme="light"]) .ce-toolbar__settings-btn { color: var(--color-text-secondary); }
  :root:not([data-theme="light"]) .ce-code__textarea { color: var(--color-text); caret-color: var(--color-text); }
  :root:not([data-theme="light"]) .image-tool__caption { color: var(--color-text-secondary); }
  :root:not([data-theme="light"]) .image-tool__caption[contenteditable]:empty::before { color: var(--color-text-muted); }
}

/* ============================================================
   Public article body — rendered from content_json blocks
   ============================================================ */
.article-body {
  font-family: var(--font-serif);
  color: var(--color-text);
  line-height: 1.85;
  font-size: 1.02rem;
}
.article-body p {
  margin: 0 0 1.1em;
}
.article-body h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin: 1.4em 0 0.5em;
  color: var(--color-text);
}
.article-body h3 {
  font-size: 1.15rem;
  margin: 1.2em 0 0.4em;
  color: var(--color-text);
}
.article-body ul,
.article-body ol {
  margin: 0 0 1.1em;
  padding-left: 1.4em;
}
.article-body li { margin-bottom: 0.35em; }
.article-body a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-body mark {
  background: var(--color-accent-light);
  padding: 0 3px;
  border-radius: 3px;
}
.article-body code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  background: var(--color-border-light);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.88em;
}
.article-body blockquote.article-quote {
  margin: 1.4em 0;
  padding: 12px 20px;
  border-left: 3px solid var(--color-accent);
  background: var(--color-accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-body blockquote.article-quote p {
  margin: 0 0 0.4em;
  font-style: italic;
}
.article-body blockquote.article-quote cite {
  display: block;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  font-style: normal;
}
.article-body .article-delimiter {
  text-align: center;
  color: var(--color-text-muted);
  letter-spacing: 0.5em;
  margin: 1.8em 0;
  font-size: 0.9rem;
}
.article-body pre.article-code {
  background: #1e1e1e;
  color: #e6e6e6;
  padding: 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 1.2em 0;
}
.article-body pre.article-code code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Image blocks inside the article */
.article-body figure.article-image {
  margin: 1.4em 0;
}
.article-body figure.article-image .modal-image-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
}
.article-body figure.article-image img.modal-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
  cursor: zoom-in;
  transition: opacity 0.2s;
}
.article-body figure.article-image img.modal-image:hover { opacity: 0.93; }
.article-body figure.article-image.with-border img { border: 1px solid var(--color-border); }
.article-body figure.article-image.with-background {
  background: var(--color-border-light);
  padding: 16px;
  border-radius: var(--radius-md);
}
.article-body figure.article-image figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-top: 8px;
  font-family: var(--font-sans);
}

/* ============================================================
   Admin header — icon buttons with hover tooltips
   ============================================================ */
.admin-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.admin-header-actions .admin-user {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-right: 4px;
}

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
  text-decoration: none;
}
.icon-btn:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-accent-light);
  transform: translateY(-1px);
}
.icon-btn:active { transform: translateY(0); }

.icon-btn-danger:hover {
  color: var(--color-danger);
  border-color: var(--color-danger);
  background: var(--color-tag-managing-bg);
}

/* Tooltip on hover — pure CSS, driven by data-tooltip */
.icon-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 0.75rem;
  line-height: 1;
  white-space: nowrap;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 50;
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.12));
}
/* Little arrow above the tooltip */
.icon-btn[data-tooltip]::before {
  content: "";
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border: 5px solid transparent;
  border-bottom-color: var(--color-text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 50;
}
.icon-btn[data-tooltip]:hover::after,
.icon-btn[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.icon-btn[data-tooltip]:hover::before,
.icon-btn[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   Custom confirm dialog (admin)
   ============================================================ */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: confirmFade 0.15s ease;
}
@keyframes confirmFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.confirm-box {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  max-width: 380px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--shadow-xl, 0 20px 50px rgba(0,0,0,0.25));
  animation: confirmPop 0.18s ease;
}
@keyframes confirmPop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.confirm-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
}
.confirm-message {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: 22px;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============================================================
   Feedback modal (homepage)
   ============================================================ */
.feedback-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.feedback-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  padding: 20px;
  animation: confirmFade 0.15s ease;
}
.feedback-box {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-xl, 0 20px 50px rgba(0,0,0,0.25));
  position: relative;
}
.feedback-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1;
}
.feedback-close:hover { color: var(--color-text); }
.feedback-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}
.feedback-desc {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}
.feedback-textarea {
  width: 100%;
  height: 140px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  line-height: 1.6;
}
.feedback-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-light);
}
.feedback-meta {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.feedback-name,
.feedback-email {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.85rem;
  font-family: inherit;
}
.feedback-name:focus,
.feedback-email:focus {
  outline: none;
  border-color: var(--color-accent);
}
.feedback-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}
.feedback-count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Admin feedback list */
.feedback-list-item {
  padding: 14px;
  border-bottom: 1px solid var(--color-border-light);
}
.feedback-list-item:last-child { border-bottom: none; }
.feedback-list-item.unread { background: var(--color-accent-light); }
.feedback-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.feedback-item-author {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}
.feedback-item-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.feedback-item-content {
  font-size: 0.88rem;
  color: var(--color-text);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.feedback-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.feedback-empty {
  text-align: center;
  padding: 40px;
  color: var(--color-text-muted);
}
