:root {
  --bg-canvas: #F2F4F2;
  --bg-surface: #FCFBF9;
  --bg-subtle: #EAECE9;
  --bg-hover: #F5F6F4;
  --text-primary: #1E2421;
  --text-secondary: #5C6560;
  --text-muted: #76807A;
  --accent: #2B6A5E;
  --accent-hover: #21544B;
  --accent-tint: #EAF1EF;
  --status-warn: #8E5A28;
  --border-hairline: #E2E5E1;
  --border-strong: #CFD4CE;
  --shadow-soft: 0 4px 18px rgba(24, 34, 30, 0.045);
  --radius-card: 10px;
  --radius-control: 8px;
}

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

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1 0 auto;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header / Top Bar */
.site-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-hairline);
  position: sticky;
  top: 0;
  z-index: 1020;
}

.site-header .navbar {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand-wordmark {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-wordmark:hover {
  color: var(--accent);
}

.site-nav-link {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.45rem 0.25rem;
  margin: 0 0.65rem;
  border-bottom: 2px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-nav-link:hover {
  color: var(--text-primary);
  border-bottom-color: var(--border-strong);
}

.site-nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

@media (min-width: 992px) {
  #siteMainNav { min-width: 0; }
  #siteMainNav .navbar-nav { min-width: 0; overflow-x: auto; scrollbar-width: thin; }
  #siteMainNav > .btn.w-100 { width: auto !important; flex: 0 0 auto; white-space: nowrap; }
  #lifeCategoryNav, #lifeArticleNav, #compositionNavLinks { display: flex; flex-shrink: 0; }
}

#filter-form button[type="submit"] { width: auto !important; flex: 1 1 0; min-width: 0; }
#clear-filters { flex: 0 0 auto; }

.navbar-toggler {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  padding: 0.42rem 0.65rem;
  min-width: 44px;
  min-height: 44px;
  color: var(--text-primary);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 2px rgba(43, 106, 94, 0.25);
}

/* Buttons & Controls */
.btn-teal {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.52rem 1.15rem;
  min-height: 42px;
  border-radius: var(--radius-control);
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.btn-teal:hover,
.btn-teal:focus {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #FFFFFF;
}

.btn-outline-board {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 1.05rem;
  min-height: 42px;
  border-radius: var(--radius-control);
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn-outline-board:hover {
  background-color: var(--bg-subtle);
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.form-control,
.form-select {
  background-color: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  color: var(--text-primary);
  min-height: 44px;
  font-size: 0.9375rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 106, 94, 0.14);
}

textarea.form-control {
  min-height: 132px;
}

/* Surface Cards & Bulletin Board Containers */
.board-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

.hero-search-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 1.75rem;
}

.hero-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
  text-wrap: balance;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 0.96875rem;
  margin-bottom: 1.35rem;
}

.section-heading {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.section-link {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.section-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Category Entry Cards */
.category-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  padding: 1.15rem 1.25rem;
  height: 100%;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.18s ease, box-shadow 0.18s ease;
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
}

.category-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.category-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background-color: var(--accent-tint);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.category-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.category-title {
  font-size: 1.03125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
}

.category-desc {
  font-size: 0.84375rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Segmented Category Filter Tabs */
.board-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0.35rem;
  padding: 0.25rem;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-control);
  scrollbar-width: none;
}

.board-tabs::-webkit-scrollbar {
  display: none;
}

.board-tab-btn {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  min-height: 38px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.board-tab-btn:hover {
  color: var(--text-primary);
}

.board-tab-btn.active {
  background-color: var(--bg-surface);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(24, 34, 30, 0.08);
}

/* Listing List Board & Horizontal Rows */
.listings-board {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.listing-row {
  display: flex;
  align-items: stretch;
  gap: 1.25rem;
  padding: 1.25rem 1.4rem;
  border-bottom: 1px solid var(--border-hairline);
  transition: background-color 0.15s ease;
}

.listing-row:last-child {
  border-bottom: none;
}

.listing-row:hover {
  background-color: var(--bg-hover);
}

.listing-thumb-wrap {
  width: 156px;
  flex: 0 0 156px;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  align-self: center;
}

.listing-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.listing-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: var(--text-muted);
  background: linear-gradient(135deg, #EAECE9 0%, #F2F4F2 100%);
  font-size: 0.75rem;
  padding: 0.5rem;
  text-align: center;
}

.listing-row-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
}

.listing-row-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.listing-title-link {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.45;
  display: inline-block;
}

.listing-title-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.listing-key-figure {
  font-size: 1.03125rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}

.listing-summary {
  color: var(--text-secondary);
  font-size: 0.90625rem;
  margin: 0;
  line-height: 1.58;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.meta-sep {
  color: var(--border-strong);
  user-select: none;
}

.meta-cat {
  color: var(--text-primary);
  font-weight: 600;
}

.meta-status-active {
  color: var(--accent);
  font-weight: 600;
}

.meta-status-urgent {
  color: var(--status-warn);
  font-weight: 600;
}

.meta-key-sub {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Listing Detail Page */
.breadcrumb-bar {
  font-size: 0.84375rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.breadcrumb-bar a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.detail-main-title {
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

.detail-gallery-main {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 440px;
  border-radius: var(--radius-control);
  overflow: hidden;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
}

.detail-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-thumbs-row {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.detail-thumb-btn {
  width: 84px;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--bg-subtle);
  cursor: pointer;
}

.detail-thumb-btn.active {
  border-color: var(--accent);
}

.detail-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-prose {
  color: var(--text-primary);
  font-size: 0.96875rem;
  line-height: 1.75;
}

.detail-prose p {
  margin-bottom: 0.95rem;
}

.detail-prose p:last-child {
  margin-bottom: 0;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table tr {
  border-bottom: 1px solid var(--border-hairline);
}

.specs-table tr:last-child {
  border-bottom: none;
}

.specs-table th {
  width: 34%;
  padding: 0.72rem 0.75rem 0.72rem 0;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.875rem;
  vertical-align: top;
}

.specs-table td {
  padding: 0.72rem 0;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9375rem;
  vertical-align: top;
}

.detail-sidebar-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 1.4rem;
}

.detail-price-highlight {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.25;
}

.contact-reveal-box {
  background-color: var(--accent-tint);
  border: 1px solid rgba(43, 106, 94, 0.22);
  border-radius: var(--radius-control);
  padding: 1rem;
}

.mobile-summary-strip {
  background-color: var(--bg-subtle);
  border-radius: var(--radius-control);
  padding: 0.9rem 1rem;
  margin-bottom: 1.25rem;
}

/* Publish Page Image Previews */
.upload-drop-area {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-control);
  background-color: #FFFFFF;
  padding: 1.25rem;
  text-align: center;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.upload-drop-area:hover {
  border-color: var(--accent);
  background-color: var(--bg-hover);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.preview-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  background-color: var(--bg-subtle);
}

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

.preview-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: rgba(30, 36, 33, 0.78);
  color: #FFFFFF;
  font-size: 0.875rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.preview-remove-btn:hover {
  background: rgba(30, 36, 33, 0.95);
}

/* Auth Pages */
.auth-wrapper {
  max-width: 440px;
  margin: 0 auto;
}

.password-toggle-btn {
  border: 1px solid var(--border-strong);
  border-left: 0;
  background-color: #FFFFFF;
  color: var(--text-secondary);
  padding: 0 0.85rem;
  min-height: 44px;
  border-top-right-radius: var(--radius-control);
  border-bottom-right-radius: var(--radius-control);
  font-size: 0.84375rem;
  white-space: nowrap;
}

.password-toggle-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-subtle);
}

.input-group > .form-control.has-toggle {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* Footer */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 3.5rem;
}

.footer-link {
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Empty State */
.empty-board-state {
  padding: 3rem 1.5rem;
  text-align: center;
}

/* Responsive Adjustments */
@media (max-width: 767.98px) {
  .hero-search-panel {
    padding: 1.25rem;
  }

  .listing-row {
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.1rem 1rem;
  }

  .listing-thumb-wrap {
    width: 100%;
    flex: none;
    max-height: 210px;
  }

  .listing-row-header {
    flex-direction: column;
    gap: 0.3rem;
  }

  .listing-key-figure {
    text-align: left;
  }

  .site-nav-link {
    margin: 0.25rem 0;
    padding: 0.55rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
