:root {
  color-scheme: light;
  --bg: #f7f5f2;
  --card-bg: #ffffff;

  /* 文字四级灰（加深颜色提高对比度） */
  --text-primary: #1c1c1c;
  --text-secondary: #4a4a4a;
  --text-tertiary: #7a7a7a;

  /* 主色（暗金） */
  --accent: #8b6914;
  --accent-light: #f5edd8;
  --accent-subtle: rgba(139,105,20,0.05);

  /* 边框 */
  --border: #e8e3db;
  --border-soft: #f0ece5;
  --border-hover: #d9d2c7;
  --dot-color: #d5cfc4;

  /* 半透明层 */
  --topbar-bg: rgba(247,245,242,0.9);
  --nav-bg: rgba(255,255,255,0.72);
  --notice-bg: #fdfcf9;

  /* 状态 */
  --status-living-bg: #e8f5e9;
  --status-living-text: #2e7d32;
  --status-living-dot: #43a047;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lift: 0 4px 16px rgba(0,0,0,0.06);

  /* 圆角与尺寸（宽屏自适应核心） */
  --radius: 8px;
  --radius-lg: 12px;
  --topbar-h: 56px;
  
  --content-min: 1200px; /* 最小宽度限制 */
  --content-max: 1440px; /* 最大宽度限制 */
  --content-padding: 40px; /* 两侧留白 */
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1917;
  --card-bg: #242220;

  --text-primary: #ebe7df;
  --text-secondary: #c2beb5;
  --text-tertiary: #8e8a81;

  --accent: #d4af5f;
  --accent-light: #3a3324;
  --accent-subtle: rgba(212,175,95,0.08);

  --border: #35322e;
  --border-soft: #2b2926;
  --border-hover: #4a4540;
  --dot-color: #4a4540;

  --topbar-bg: rgba(26,25,23,0.9);
  --nav-bg: rgba(36,34,32,0.82);
  --notice-bg: #1f1d1b;

  --status-living-bg: #1e3320;
  --status-living-text: #7ac480;
  --status-living-dot: #5db462;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lift: 0 4px 16px rgba(0,0,0,0.5);
}

/* ============================================================
   基础重置与排版
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
  
  /* 核心：防止PC端窗口过小导致排版崩坏 */
  min-width: var(--content-min); 
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Icons 雪碧图类 */
.bi {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  fill: currentColor;
  vertical-align: -0.125em;
  flex-shrink: 0;
  pointer-events: none;
}

/* ============================================================
   统一容器布局（流式 + 留白对齐）
   ============================================================ */
.topbar-inner, 
.breadcrumb-inner,
.page-main, 
.page-footer {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: var(--content-padding);
  padding-right: var(--content-padding);
}

/* ============================================================
   顶部栏（城市切换 + 品牌 + 导航 + 搜索 + 主题）
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.topbar-inner {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}

/* 左侧：城市切换 + 品牌 */
.topbar-left {
  display: flex; align-items: center; gap: 16px;
  flex-shrink: 0;
}

/* 城市切换按钮 */
.city-switch { position: relative; }
.city-switch-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 4px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px; font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: color .2s;
}
.city-switch-btn:hover {
  color: var(--accent);
}
.city-switch-icon { width: 16px; height: 16px; flex-shrink: 0; }
.city-switch-arrow { width: 14px; height: 14px; flex-shrink: 0; opacity: .7; transition: transform .2s; }
/* 下拉打开时，箭头旋转 */
.city-switch:hover .city-switch-arrow,
.city-switch:focus-within .city-switch-arrow { transform: rotate(180deg); }
.city-switch-btn:hover .city-switch-arrow {
  color: var(--accent);
}

/* 下拉面板 */
.city-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: max-content;
  min-width: 520px;
  padding: 24px 28px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
  z-index: 200;
}
.city-switch:hover .city-dropdown,
.city-switch:focus-within .city-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}

/* 标题 */
.city-dropdown-title {
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}

/* 网格：6列 */
.city-dropdown-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px 24px;
  margin-bottom: 24px;
}
.city-dropdown-grid a {
  display: block;
  font-size: 15px;
  color: var(--text-secondary);
  text-align: center;
  transition: color .15s;
  white-space: nowrap;
}
.city-dropdown-grid a:hover {
  color: var(--accent);
}

/* 底部更多城市链接 */
.city-dropdown-more {
  display: block;
  font-size: 14px;
  color: var(--accent); /* 主色（暗金） */
  text-align: right;
  font-weight: 500;
  transition: opacity .2s;
}
.city-dropdown-more:hover { opacity: 0.8; }

/* 品牌 */
.brand {
  font-size: 16px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--text-primary);
  white-space: nowrap;
}
.brand-sub {
  font-size: 13px; color: var(--text-tertiary);
  font-weight: 400; margin-left: 8px; letter-spacing: 0.02em;
}

/* 中部：导航 */
.topbar-nav {
  display: flex; align-items: center; gap: 4px;
  font-size: 15px; color: var(--text-secondary); font-weight: 500;
  flex-shrink: 0;
}
.topbar-nav a {
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: color .2s, background .2s;
  white-space: nowrap;
}
.topbar-nav a:hover {
  color: var(--accent);
  background: var(--accent-light);
}

/* 右侧：搜索 + 主题 */
.topbar-meta {
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}

/* 搜索框 */
.search-box {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  color: var(--text-tertiary);
  cursor: text;
  transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.search-box svg {
  width: 16px; height: 16px; flex-shrink: 0;
}
.search-box input {
  width: 160px;
  border: none; outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
}
.search-box input::placeholder { color: var(--text-tertiary); }

/* 主题切换按钮 */
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card-bg);
  color: var(--text-secondary); cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
  transition: all 0.22s ease; flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-light); transform: rotate(15deg);
}
.theme-toggle .bi { width: 18px; height: 18px; }
.theme-icon--light, .theme-icon--dark, .theme-icon--auto { display: none; }
[data-theme-mode="light"] .theme-icon--light { display: inline-block; }
[data-theme-mode="dark"] .theme-icon--dark { display: inline-block; }
[data-theme-mode="auto"] .theme-icon--auto { display: inline-block; }

/* ============================================================
   顶部栏：用户登录与信息模块
   ============================================================ */
.user-area {
  display: flex;
  align-items: center;
}

/* --- 未登录：登录按钮 --- */
.btn-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 20px; /* 胶囊形 */
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}
.btn-login .bi {
  width: 16px; height: 16px;
}
.btn-login:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* --- 已登录：用户摘要下拉 --- */
.user-profile {
  position: relative;
}
.user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 8px 0 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.2s;
}
.user-btn:hover {
  background: var(--accent-subtle);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}
.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-btn .bi {
  width: 14px; height: 14px;
  color: var(--text-tertiary);
  transition: transform 0.2s;
}
.user-profile:hover .user-btn .bi {
  transform: rotate(180deg);
}

/* 用户下拉菜单 */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 180px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.2s ease;
  z-index: 200;
}
.user-profile:hover .user-dropdown,
.user-profile:focus-within .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}
.user-dropdown a:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}
.user-dropdown .dropdown-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 6px 0;
}
.user-dropdown a.logout {
  color: #c0392b; /* 退出通常用警示色 */
}
.user-dropdown a.logout:hover {
  background: rgba(192, 57, 43, 0.05);
  color: #c0392b;
}

/* ============================================================
   面包屑
   ============================================================ */
.breadcrumb {
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0;
  z-index: 99;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transform: translateY(calc(-100% - var(--topbar-h) - 4px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}
.breadcrumb.show {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.breadcrumb-inner {
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
  line-height: 1.5;
}
.breadcrumb-inner a { color: var(--text-secondary); transition: color 0.2s; }
.breadcrumb-inner a:hover { color: var(--accent); }
.breadcrumb-sep {
  color: var(--text-tertiary);
  user-select: none;
  display: inline-flex; align-items: center;
}
.breadcrumb-sep .bi { width: 12px; height: 12px; }
.breadcrumb-current { color: var(--text-primary); font-weight: 500; }

/* ============================================================
   公共页脚
   ============================================================ */
.page-footer {
  padding-top: 32px;
  padding-bottom: 40px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: border-color .3s ease;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* 第一行：版权与链接 */
.copyright {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

.copyright a {
  color: var(--text-secondary);
  transition: color .2s;
  margin: 0 6px;
  font-weight: 500;
}
.copyright a:hover { color: var(--accent); }

.version-highlight {
  color: var(--accent);
  margin-left: 2px;
  font-weight: 600;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-links a {
  color: var(--text-secondary);
  transition: color .2s;
}
.footer-links a:hover { color: var(--accent); }
.footer-links .dot { color: var(--border-hover); user-select: none; }

/* 第二行：强制靠右对齐 */
.footer-row--filing {
  justify-content: flex-end;
  gap: 16px;
  font-size: 13px;
}

.filing-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-secondary);
  transition: color .2s;
  white-space: nowrap;
}
.filing-link:hover { color: var(--accent); }

.police-icon { width: 16px; height: 16px; flex-shrink: 0; color: currentColor; }
.filing-divider { color: var(--border-hover); user-select: none; margin: 0 4px; }
.footer-support { color: var(--text-secondary); }

/* 返回顶部 */
.back-to-top {
  position: fixed;
  bottom: 40px; right: 40px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden;
  transition: all 0.3s ease;
  z-index: 99;
}
.back-to-top .bi { width: 22px; height: 22px; }
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}