/* ============================================================
   willson0v0's Blog — Main Stylesheet
   "深夜厨房的温暖灯火"
   ============================================================ */

/* ── 1. CSS Reset + Base ───────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

a {
  color: var(--color-text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--color-primary-hover);
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--color-secondary-bg);
  color: var(--color-text);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--color-secondary-bg);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  overflow-x: auto;
  line-height: 1.6;
}

blockquote {
  margin: var(--space-lg) 0;
  padding: var(--space-md) var(--space-lg);
  border-left: 3px solid var(--color-primary-border);
  background: var(--color-bg-elevated);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-text-secondary);
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  color: var(--color-text);
}

/* ── 2. Design Tokens ──────────────────────────────────────── */

:root {
  /* ===== Light Theme (default) ===== */
  --color-primary:        #d4783b;
  --color-primary-hover:  #b8622d;
  --color-primary-light:  #fdf0e6;
  --color-primary-border: #f0cba8;

  --color-secondary:      #6b7280;
  --color-secondary-bg:   #f3f4f6;

  --color-bg:             #fdfcf9;
  --color-bg-card:        #ffffff;
  --color-bg-elevated:    #fafaf7;

  --color-text:           #1f1f1c;
  --color-text-secondary: #6b6b62;
  --color-text-muted:     #9d9d94;
  --color-text-link:      #b8622d;

  --color-border:         #e8e4dc;
  --color-border-light:   #f0ede7;

  --color-success:        #059669;
  --color-warning:        #d97706;
  --color-danger:         #dc2626;
  --color-info:           #2563eb;

  --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 32px rgba(0, 0, 0, 0.08);
  --shadow-focus:         0 0 0 3px rgba(212, 120, 59, 0.25);

  --radius-sm:            4px;
  --radius-md:            8px;
  --radius-lg:            12px;
  --radius-full:          9999px;

  --space-xs:             4px;
  --space-sm:             8px;
  --space-md:             16px;
  --space-lg:             24px;
  --space-xl:             32px;
  --space-2xl:            48px;
  --space-3xl:            64px;

  --font-sans:            "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --font-serif:           "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
  --font-mono:            "JetBrains Mono", "Fira Code", "Cascadia Code", "SF Mono", Consolas, monospace;

  --text-xs:              0.75rem;
  --text-sm:              0.875rem;
  --text-base:            1rem;
  --text-lg:              1.125rem;
  --text-xl:              1.25rem;
  --text-2xl:             1.5rem;
  --text-3xl:             1.875rem;
  --text-4xl:             2.25rem;

  --leading-tight:        1.25;
  --leading-normal:       1.6;
  --leading-relaxed:      1.75;

  --container-sm:         640px;
  --container-md:         768px;
  --container-lg:         960px;
  --container-xl:         1100px;

  --transition-fast:      150ms ease;
  --transition-base:      250ms ease;
  --transition-slow:      400ms ease;

  /* Navbar */
  --navbar-height:        64px;

  /* Post detail */
  --post-max-width:       720px;

  /* Foodie Design Tokens */
  --color-foodie-recommend:   #059669;
  --color-foodie-skip:        #dc2626;
  --color-foodie-tried:       #d97706;
  --color-foodie-price:       #d97706;

  /* Gallery Tokens */
  --gallery-mobile-item-width:   85vw;
  --gallery-desktop-cols:        2;
  --gallery-img-height-mobile:   240px;
  --gallery-img-height-desktop:  280px;

  /* Lightbox Tokens */
  --lightbox-bg:       rgba(0,0,0,0.92);
  --lightbox-z-index:  9999;
}

/* Dark Theme */
[data-theme="dark"] {
  --color-primary:        #e8945a;
  --color-primary-hover:  #f0a876;
  --color-primary-light:  #3d2418;
  --color-primary-border: #5a3824;

  --color-secondary:      #9ca3af;
  --color-secondary-bg:   #2d2d2a;

  --color-bg:             #1a1a17;
  --color-bg-card:        #242420;
  --color-bg-elevated:    #2a2a26;

  --color-text:           #e8e6df;
  --color-text-secondary: #a8a69e;
  --color-text-muted:     #6b6b62;
  --color-text-link:      #e8945a;

  --color-border:         #3d3d37;
  --color-border-light:   #2e2e2a;

  --color-success:        #34d399;
  --color-warning:        #fbbf24;
  --color-danger:         #f87171;
  --color-info:           #60a5fa;

  --shadow-sm:            0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md:            0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg:            0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-focus:         0 0 0 3px rgba(232, 148, 90, 0.3);

  /* Foodie Design Tokens */
  --color-foodie-recommend:   #10b981;
  --color-foodie-skip:        #ef4444;
  --color-foodie-tried:       #f59e0b;
  --color-foodie-price:       #f59e0b;
}

/* ── 3. Typography ─────────────────────────────────────────── */

h1 { font-size: var(--text-3xl); font-weight: 700; line-height: 1.3; }
h2 { font-size: var(--text-2xl); font-weight: 600; line-height: 1.35; }
h3 { font-size: var(--text-xl);  font-weight: 600; line-height: 1.4; }

/* ── 4. Layout ─────────────────────────────────────────────── */

.container {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}

.page-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin: 0;
}

.main-content {
  min-height: calc(100vh - var(--navbar-height) - 80px);
  padding-top: calc(var(--navbar-height) + var(--space-xl));
  padding-bottom: var(--space-3xl);
}

/* ── 5. Navbar ─────────────────────────────────────────────── */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  z-index: 100;
  background: rgba(253, 252, 249, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border-light);
  transition: box-shadow var(--transition-base);
}

[data-theme="dark"] .navbar {
  background: rgba(26, 26, 23, 0.85);
}

.navbar.scrolled {
  box-shadow: var(--shadow-sm);
}

.navbar-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: var(--space-lg);
}

.navbar-logo {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}
.navbar-logo:hover {
  color: var(--color-primary);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-left: auto;
}

.navbar-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.navbar-link:hover,
.navbar-link.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-lg);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  color: var(--color-text);
  transition: background var(--transition-fast);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-toggle:hover {
  background: var(--color-secondary-bg);
}

/* Admin entry icon in public navbar */
.navbar-admin-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-lg);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0.45;
}
.navbar-admin-link:hover {
  background: var(--color-secondary-bg);
  opacity: 1;
  color: var(--color-text);
}

/* Hamburger */
.navbar-hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-sm);
  margin-left: auto;
  color: var(--color-text);
  border-radius: var(--radius-md);
  line-height: 1;
}
.navbar-hamburger:hover {
  background: var(--color-secondary-bg);
}

/* ── 6. Article Cards / Foodie Cards ────────────────────────── */

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.post-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}
.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.post-card-link {
  display: block;
  padding: var(--space-xl);
  color: inherit;
  text-decoration: none;
  height: 100%;
}
.post-card-link:hover {
  color: inherit;
}

.post-card-badge {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-sm);
}

.post-card--foodie .post-card-title {
  color: var(--color-primary);
}

.post-card-title {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-sm);
  transition: color var(--transition-fast);
}
.post-card-link:hover .post-card-title {
  color: var(--color-primary);
}

.post-card-rating {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: var(--space-sm);
}

.star {
  color: var(--color-border);
  font-size: var(--text-base);
}
.star--filled {
  color: var(--color-primary);
}
.star--half {
  background: linear-gradient(to right, var(--color-primary) 50%, var(--color-border) 50%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.star--empty {
  color: var(--color-border);
}
.star--large {
  font-size: var(--text-xl);
}

.rating-text {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-left: var(--space-xs);
}
.rating-text--large {
  font-size: var(--text-sm);
}

.post-card-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
  margin: 0 0 var(--space-md);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.post-card-date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.post-card-tags {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.tag-pill {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.tag-pill--link {
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
}
.tag-pill--link:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ── 7. Post Detail ─────────────────────────────────────────── */

.post-detail {
  max-width: var(--post-max-width);
  margin: 0 auto;
}

.post-header {
  margin-bottom: var(--space-xl);
}

.post-source-badge {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 2px 12px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-md);
}

.post-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 var(--space-md);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.post-meta-sep {
  color: var(--color-border);
}

.post-meta-tags {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.post-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: var(--space-sm);
}

.post-location {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.post-location-coords {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Post body (markdown rendered content) */
.post-body {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
}

.post-body p {
  margin: 0 0 1.2em;
}

.post-body img {
  max-width: 100%;
  border-radius: var(--radius-md);
  display: block;
}

/* Image loading / error states */
.post-img-wrap {
  margin: 1.2em 0;
  position: relative;
  background: var(--color-secondary-bg);
  border-radius: var(--radius-md);
  min-height: 120px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-img-wrap img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  /* Shimmer while loading */
  background: linear-gradient(90deg,
    var(--color-secondary-bg) 25%,
    var(--color-border) 50%,
    var(--color-secondary-bg) 75%);
  background-size: 200% 100%;
  animation: img-shimmer 1.4s infinite;
}

.post-img-wrap img[src] {
  animation: none;
  background: none;
}

@keyframes img-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Error state: replace broken img with a placeholder message */
.post-img-wrap.img-error {
  border: 1px dashed var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.85em;
  min-height: 80px;
}

.post-img-wrap.img-error img {
  display: none;
}

.post-img-wrap.img-error::after {
  content: '🖼️ 图片加载失败';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-body pre {
  margin: var(--space-lg) 0;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

.post-body blockquote {
  margin: var(--space-lg) 0;
}

/* ── 8. Comment Section ─────────────────────────────────────── */

.comment-section {
  max-width: var(--post-max-width);
  margin: var(--space-3xl) auto 0;
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--color-border-light);
}

.comment-section-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin: 0 0 var(--space-lg);
}

/* Comment Form */
.comment-form {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-2xl);
  border: 1px solid var(--color-border-light);
}

.comment-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.comment-form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.comment-form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}

.required {
  color: var(--color-danger);
}

.comment-form-input,
.comment-form-textarea {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}
.comment-form-input:focus,
.comment-form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}
.comment-form-input::placeholder,
.comment-form-textarea::placeholder {
  color: var(--color-text-muted);
}
.comment-form-input:disabled,
.comment-form-textarea:disabled {
  background: var(--color-secondary-bg);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.comment-form-textarea {
  min-height: 100px;
  resize: vertical;
}

.comment-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

/* Comments List */
.comments-list {
  margin-top: var(--space-lg);
}

.comment {
  padding: var(--space-md) 0;
}

.comment--root {
  border-bottom: 1px solid var(--color-border-light);
}
.comment--root:last-child {
  border-bottom: none;
}

.comment--nested {
  border-left: 2px solid var(--color-border);
  padding-left: var(--space-lg);
  margin-left: var(--space-lg);
  margin-top: var(--space-sm);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.comment-author {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.comment-time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.comment-body {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.comment-reply-btn {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition-fast);
}
.comment-reply-btn:hover {
  color: var(--color-primary);
}

.comment-replies {
  margin-top: var(--space-sm);
}

.comments-empty {
  text-align: center;
  padding: var(--space-2xl) 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ── 9. MapWidget ────────────────────────────────────────────── */

.map-widget {
  margin: var(--space-md) 0 var(--space-lg);
  max-width: var(--post-max-width);
}

.map-widget-header {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.map-widget-icon {
  font-size: var(--text-base);
}

.map-widget-label {
  font-weight: 500;
}

.map-widget-sep {
  color: var(--color-border);
}

.map-widget-name {
  color: var(--color-text);
  font-weight: 500;
}

.map-container {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-secondary-bg);
}

.map-iframe {
  display: block;
  width: 100%;
  height: 280px;
  border: none;
}

.map-static-img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 150px;
  object-fit: cover;
  border-radius: 4px;
}

/* Fallback overlay */
.map-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-secondary-bg);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.map-container.failed .map-fallback {
  pointer-events: auto;
  opacity: 1;
}

.map-fallback-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.map-fallback-icon {
  font-size: 2.5rem;
}

.map-fallback-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}

.map-fallback-coords {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

/* Footer (external link) */
.map-widget-footer {
  text-align: right;
  margin-top: var(--space-xs);
}

.map-external-link {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition-fast);
}
.map-external-link:hover {
  color: var(--color-primary);
}

/* Dark mode: invert OSM iframe */
[data-theme="dark"] .map-iframe {
  filter: invert(0.9) hue-rotate(180deg);
}

/* ── 10. Buttons ──────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 8px 16px;
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1.4;
  font-family: var(--font-sans);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-secondary {
  background: var(--color-secondary-bg);
  color: var(--color-text);
  border-color: transparent;
}
.btn-secondary:hover {
  background: var(--color-border);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

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

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-secondary);
}
.btn-ghost:hover {
  background: var(--color-secondary-bg);
  color: var(--color-text);
}

.btn-sm {
  padding: 4px 12px;
  font-size: var(--text-xs);
}

/* ── 11. Pagination ─────────────────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border-light);
}

.pagination-info {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ── 12. Empty State ─────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: var(--space-3xl) 0;
}

.empty-state-text {
  font-size: var(--text-xl);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-sm);
}

.empty-state-hint {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

/* ── 13. Error Page ───────────────────────────────────────────── */

.error-page {
  text-align: center;
  padding: var(--space-3xl) 0;
}

.error-code {
  font-size: 5rem;
  font-weight: 800;
  color: var(--color-primary);
  margin: 0 0 var(--space-md);
  line-height: 1;
}

.error-message {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-xl);
}

/* ── 14. Site Footer ──────────────────────────────────────────── */

.site-footer {
  text-align: center;
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--color-border-light);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ── 15. Responsive ──────────────────────────────────────────── */

/* Mobile (< 768px) */
@media (max-width: 768px) {
  :root {
    --navbar-height: 56px;
  }

  .container {
    padding: 0 var(--space-md);
  }

  /* Navbar: hamburger mode */
  .navbar-hamburger {
    display: flex;
  }

  .navbar-links {
    display: none;
    position: absolute;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border-light);
    padding: var(--space-md);
    gap: var(--space-md);
    box-shadow: var(--shadow-md);
  }
  .navbar-links--open {
    display: flex;
  }

  .navbar-link {
    font-size: var(--text-base);
    padding: var(--space-sm) 0;
  }

  .theme-toggle {
    margin-left: 0;
  }

  /* Single column cards */
  .post-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .post-card-link {
    padding: var(--space-lg);
  }

  /* Post detail full-width on mobile */
  .post-detail,
  .comment-section,
  .map-widget {
    max-width: 100%;
  }

  .post-title {
    font-size: var(--text-2xl);
  }

  /* MapWidget mobile */
  .map-iframe {
    height: 200px;
  }

  .map-widget-footer {
    text-align: center;
  }

  .map-external-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: var(--space-sm);
    font-size: var(--text-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-card);
  }
  .map-external-link:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-border);
  }

  /* Comment form: single column */
  .comment-form-row {
    grid-template-columns: 1fr;
  }

  /* Comments: reduce nested indentation */
  .comment--nested {
    padding-left: var(--space-md);
    margin-left: var(--space-md);
  }

  /* Pagination compact */
  .pagination {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }
}

/* Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .post-detail,
  .comment-section,
  .map-widget {
    max-width: var(--post-max-width);
  }

  .map-iframe {
    height: 280px;
  }
}

/* Desktop (> 1024px) */
@media (min-width: 1025px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .post-detail,
  .comment-section,
  .map-widget {
    max-width: var(--post-max-width);
  }
}

/* ── Map loading state ───────────────────────────────── */
.map-loading { display: flex; align-items: center; justify-content: center; height: 200px; color: var(--color-text-muted, #6c757d); }

/* ============================================================
   Foodie UX — Design Components (C3)
   ============================================================ */

/* ── C3.1 评分+价格行 (§6.2) ───────────────────────────────── */

.foodie-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.foodie-meta-rating {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.foodie-meta-price {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--color-foodie-price);
  font-weight: 500;
}

.foodie-meta-price-label {
  color: var(--color-text-secondary);
  font-weight: 400;
}

/* ── C3.2 推荐/不推荐 Pills (§7) ──────────────────────────── */

.foodie-recommendations {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.foodie-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  line-height: 1.5;
}

.foodie-pill::before {
  font-size: var(--text-base);
  line-height: 1;
}

.foodie-pill--recommend {
  background: color-mix(in srgb, var(--color-foodie-recommend) 12%, transparent);
  color: var(--color-foodie-recommend);
}

.foodie-pill--skip {
  background: color-mix(in srgb, var(--color-foodie-skip) 12%, transparent);
  color: var(--color-foodie-skip);
}

.foodie-pill--tried {
  background: color-mix(in srgb, var(--color-foodie-tried) 12%, transparent);
  color: var(--color-foodie-tried);
}

.foodie-pill--recommend::before {
  content: "\2705";
}

.foodie-pill--skip::before {
  content: "\274C";
}

.foodie-pill--tried::before {
  content: "\2015";
}

/* ── C3.3 短评卡片 (§4) ───────────────────────────────────── */

.foodie-tldr-card {
  position: relative;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin: var(--space-md) 0;
  border-left: 4px solid var(--color-primary);
}

.foodie-tldr-card::before {
  content: "\1F4AC \4E00\53E5\8BDD\77ED\8BC4";
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.foodie-tldr-text {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  margin: 0;
}

/* ── C3.4 Gallery 样式 (§5.2) ─────────────────────────────── */

/* ── Gallery section ── */
.foodie-gallery {
  position: relative;
}

/* ── Gallery Cover (collapsed state) ─────────────────────────── */
.gallery-cover {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-md);
  max-height: 240px;
}
.gallery-cover img {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: filter 0.25s;
}
.gallery-cover:hover img {
  filter: brightness(0.75);
}
.gallery-cover-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px var(--space-md) var(--space-md);
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 500;
}
.gallery-cover-arrow {
  margin-left: auto;
  font-size: var(--text-xs);
  opacity: 0.8;
}

/* ── Gallery collapse button ── */
.gallery-collapse-btn {
  display: block;
  width: 100%;
  text-align: right;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  cursor: pointer;
  padding: 0 0 var(--space-sm) 0;
}
.gallery-collapse-btn:hover {
  color: var(--color-text);
}

.foodie-gallery-scroll {
  position: relative;
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-md) 0;
  scrollbar-width: auto;
}
.foodie-gallery-scroll::-webkit-scrollbar {
  height: 8px;
}
.foodie-gallery-scroll::-webkit-scrollbar-track {
  background: var(--color-bg-elevated);
  border-radius: 4px;
}
.foodie-gallery-scroll::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}
.foodie-gallery-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

.foodie-gallery-item {
  flex: 0 0 min(var(--gallery-mobile-item-width, 85vw), 340px);
  max-width: 340px;
  scroll-snap-align: start;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.foodie-gallery-item img {
  display: block;
  width: 100%;
  height: var(--gallery-img-height-mobile, 240px);
  object-fit: cover;
  border-radius: 0;
  transition: transform var(--transition-base);
}

.foodie-gallery-item:hover img {
  transform: scale(1.03);
}

.foodie-gallery-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-xs) var(--space-sm);
  background: linear-gradient(transparent, var(--lightbox-bg, rgba(0,0,0,0.92)));
  color: #fff;
  font-size: var(--text-xs);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 769px) {
  .foodie-gallery-scroll {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: var(--space-md) 0;
    scrollbar-width: auto;
  }

  .foodie-gallery-item {
    flex: 0 0 320px;
    max-width: 400px;
  }

  .foodie-gallery-item img {
    height: var(--gallery-img-height-desktop, 280px);
  }
}

/* ── C3.5 Lightbox 样式 (§5.2) ───────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--lightbox-z-index, 9999);
  background: var(--lightbox-bg, rgba(0,0,0,0.92));
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  cursor: pointer;
  padding: var(--space-md);
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  cursor: default;
  box-shadow: var(--shadow-lg);
}

.lightbox-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
  z-index: 1;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lightbox-caption {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: var(--text-sm);
  text-align: center;
  max-width: 80%;
  padding: var(--space-xs) var(--space-md);
  background: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-full);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
  z-index: 1;
  line-height: 1;
}

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

.lightbox-prev {
  left: var(--space-md);
}

.lightbox-next {
  right: var(--space-md);
}

/* ── C3.6 地图折叠按钮 (§8) ───────────────────────────────── */

.foodie-map-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-primary);
  background: none;
  border: 1px solid var(--color-primary-border);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--space-sm);
  text-decoration: none;
  line-height: 1.5;
  font-family: var(--font-sans);
}

.foodie-map-toggle:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.foodie-map-toggle[aria-expanded="true"]::after {
  content: "\25B2";
  font-size: var(--text-xs);
  margin-left: var(--space-xs);
}

.foodie-map-toggle[aria-expanded="false"]::after {
  content: "\25BC";
  font-size: var(--text-xs);
  margin-left: var(--space-xs);
}

.foodie-map-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow), opacity var(--transition-base);
  opacity: 0;
}

.foodie-map-container.expanded {
  max-height: 500px;
  opacity: 1;
}

/* ── C3.7 首页卡片 Mini 评分行 (§12) ──────────────────────── */

.foodie-mini-rating {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: var(--space-sm);
}

.foodie-mini-rating .star {
  font-size: var(--text-sm);
}

.foodie-mini-rating .star--filled {
  color: var(--color-primary);
}

.foodie-mini-rating .rating-text {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-left: var(--space-xs);
}
