* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font: 14px/1.5 "Microsoft YaHei", "PingFang SC", sans-serif; }
#map { position: absolute; inset: 0; }

.card {
  background: rgba(255,255,255,.96);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.hidden { display: none !important; }
.spacer { flex: 1; }

/* 顶部工具栏 */
#toolbar {
  position: absolute; top: 12px; left: 56px; right: 12px; z-index: 1000;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; flex-wrap: wrap;
}
#toolbar input, #toolbar select { padding: 4px 6px; border: 1px solid #ccc; border-radius: 6px; }
#toolbar button, #panel button {
  padding: 4px 10px; border: none; border-radius: 6px;
  background: #1976d2; color: #fff; cursor: pointer;
}
#toolbar button:hover, #panel button:hover { background: #1256a0; }
#toolbar a { color: #1976d2; text-decoration: none; font-size: 13px; }

/* 右侧面板 */
#panel {
  position: absolute; top: 64px; right: 12px; bottom: 12px; z-index: 999;
  width: 380px; max-width: calc(100vw - 24px);
  display: flex; flex-direction: column; overflow: hidden;
}
#panel-tabs { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid #eee; align-items: center; }
#panel-tabs .tab { background: #e3e9f0; color: #333; }
#panel-tabs .tab.active { background: #1976d2; color: #fff; }
#panel-close { background: #eee !important; color: #333 !important; }
.tab-page { flex: 1; overflow-y: auto; padding: 12px; }
h4 { margin: 12px 0 6px; color: #0d3c61; }
small { color: #888; font-weight: normal; }

/* 渔场信息 */
#ground-info h3 { color: #0d3c61; margin-bottom: 4px; }
#ground-info .meta { color: #666; font-size: 13px; margin-bottom: 6px; }
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 12px; color: #fff; margin-right: 4px;
}
.desc { color: #555; font-size: 13px; }
.warn { color: #c62828; font-size: 12px; }

/* 鱼种卡 */
.fish-card {
  display: flex; gap: 8px; align-items: center;
  border: 1px solid #e0e6ed; border-radius: 8px;
  padding: 8px; margin-bottom: 6px; cursor: pointer;
}
.fish-card:hover { background: #f2f7fd; }
.density { color: #f9a825; font-size: 12px; white-space: nowrap; }
.fish-card .fname { font-weight: bold; }
.fish-card .fhabit { color: #888; font-size: 12px; }

/* 水文 */
#hydro-latest { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.hydro-item {
  flex: 1 1 30%; background: #f2f7fd; border-radius: 8px;
  padding: 6px 8px; text-align: center;
}
.hydro-item b { display: block; font-size: 18px; color: #1565c0; }
.hydro-item span { font-size: 12px; color: #777; }
#hydro-chart { width: 100%; background: #fbfdff; border: 1px solid #e6eef5; border-radius: 8px; }
#hydro-legend { font-size: 12px; color: #666; text-align: center; margin-top: 2px; }

/* 钓点 */
.spot { border-left: 3px solid #1976d2; padding: 4px 8px; margin-bottom: 6px; background: #fafcff; border-radius: 0 6px 6px 0; }
.spot b { color: #333; }
.stars { color: #f9a825; }

/* 自检 */
#check-list { list-style: none; }
#check-list li { padding: 6px 4px; border-bottom: 1px dashed #eee; font-size: 13px; }
#check-list .pass { color: #2e7d32; }
#check-list .fail { color: #c62828; }
#check-list .detail { color: #999; font-size: 12px; }

/* toast */
#toast {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 2000; background: rgba(0,0,0,.75); color: #fff;
  padding: 8px 18px; border-radius: 20px; font-size: 13px;
}

/* 鱼种百科 */
#fish-keyword { padding: 6px; border: 1px solid #ccc; border-radius: 6px; margin-bottom: 8px; }
#fish-detail { background: #f7fafd; border-radius: 8px; padding: 10px; margin-top: 8px; font-size: 13px; }
#fish-detail h3 { color: #0d3c61; }
#fish-detail table { width: 100%; border-collapse: collapse; margin-top: 6px; }
#fish-detail td { padding: 3px 4px; border-bottom: 1px solid #e6eef5; }
#fish-detail td:first-child { color: #777; width: 90px; }

/* 弹窗 */
.leaflet-popup-content { font: 13px/1.5 "Microsoft YaHei", sans-serif; }
.ground-label { font-weight: bold; color: #0d3c61; }

/* 水系叠加层标签 */
.water-label { background: rgba(30,136,229,.85); color: #fff; border: none; font: 12px "Microsoft YaHei", sans-serif; padding: 1px 6px; border-radius: 8px; white-space: nowrap; }

/* 首页返回链接 */
.home-link { text-decoration: none; font-size: 18px; margin-right: 4px; }
#user-bar .home-link { margin-left: auto; }

/* 品牌 */
.brand { display: inline-flex; align-items: center; gap: 6px; }
.brand-logo { height: 28px; width: auto; vertical-align: -6px; border-radius: 6px; background: #fff; }
.home-header .logo small { font-size: 12px; color: #4d8a68; font-weight: normal; margin-left: 4px; }

/* 渔场实景图画廊（地图页详情） */
.gallery { display: flex; gap: 8px; margin: 8px 0; overflow-x: auto; }
.gallery img { width: 180px; height: 110px; object-fit: cover; border-radius: 8px; background: #f0f0f0; }

/* ============ v7.23 顶部工具栏：桌面通栏 / 手机折叠面板 ============ */
#toolbar-filters { display: contents; }
#btn-filter-toggle { display: none; white-space: nowrap; }
@media (max-width: 768px) {
  #toolbar { left: 12px; right: 12px; top: 10px; flex-wrap: nowrap; padding: 6px 10px; }
  #toolbar .brand { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #toolbar .brand-logo { height: 22px; }
  #btn-filter-toggle { display: inline-block; background: #1fa87a; margin-left: auto; }
  #toolbar-filters {
    display: none;
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 8px;
    background: rgba(255,255,255,.98); border-radius: 10px; padding: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
  }
  #toolbar-filters.open { display: flex; }
  #toolbar-filters input, #toolbar-filters select { width: 100%; }
  #toolbar-filters .spacer { display: none; }
  /* 缩放按钮移到顶栏下方，避免遮挡 */
  .leaflet-top.leaflet-left { top: 58px; }
  #panel { top: 60px; }
}

/* v7.64 塘主公告（用户端渔场详情） */
.pond-notice {
  margin: 8px 0; padding: 10px 12px;
  background: linear-gradient(135deg, #fff8e6, #ffefc9);
  border: 1px solid #f5d78e; border-radius: 10px;
  color: #7a5b12; font-size: 13px; line-height: 1.6;
}

/* v7.65 存塘条数（用户端鱼种卡片） */
.fstock { margin-top: 3px; font-size: 12px; color: #1fa87a; }
.fstock b { font-size: 14px; }
.fstock-empty { color: #e2543e; font-size: 11px; }

/* ===== v7.67 APP 沉浸式状态栏安全区（iOS刘海/Android沉浸） ===== */
body { padding-top: env(safe-area-inset-top, 0px); }
.sim-header { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
