/* ===== H5 路亚钓场 - 全局样式 ===== */
:root {
  --primary: #2E7D32;
  --primary-light: #4CAF50;
  --accent: #FF6F00;
  --bg: #F5F5F5;
  --card: #FFFFFF;
  --text: #333333;
  --text2: #666666;
  --text3: #999999;
  --border: #EEEEEE;
  --danger: #E53935;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 15px; color: var(--text); background: var(--bg);
  -webkit-text-size-adjust: 100%; max-width: 500px; margin: 0 auto;
}
a { color: inherit; text-decoration: none; }

/* 页面切换 */
.page { display: none; padding: 12px 12px 70px; min-height: 100vh; }
.page.active { display: block; }

/* 卡片 */
.card {
  background: var(--card); border-radius: 12px; padding: 16px;
  margin-bottom: 12px; box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}

/* 标题 */
.section-title {
  font-size: 16px; font-weight: 600; margin-bottom: 12px;
  padding-left: 10px; border-left: 3px solid var(--primary);
}

/* ===== 底部 TabBar ===== */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 500px; margin: 0 auto;
  height: 56px; background: #fff; display: flex;
  box-shadow: 0 -1px 8px rgba(0,0,0,0.06); z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  color: var(--text3); font-size: 10px; cursor: pointer;
}
.tab.active { color: var(--primary); }
.tab-icon { font-size: 22px; line-height: 1; }
.tab-text { font-size: 11px; }

/* ===== 首页 Hero ===== */
.hero-card {
  background: linear-gradient(135deg, #2E7D32, #4CAF50);
  color: #fff; border-radius: 14px; padding: 24px 20px; margin-bottom: 12px;
}
.hero-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.hero-desc { font-size: 13px; opacity: 0.9; margin-bottom: 16px; line-height: 1.6; }
.hero-info {
  background: rgba(255,255,255,0.15); border-radius: 8px; padding: 12px 14px;
}
.info-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.info-row a { color: #FFD54F; }

.fee-section { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.2); }
.fee-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.fee-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.fee-item {
  background: rgba(255,255,255,0.2); border-radius: 6px; padding: 8px 12px;
  font-size: 12px; display: flex; justify-content: space-between; min-width: 140px;
}
.fee-price { font-weight: 600; color: #FFD54F; }

/* ===== 钓鱼指数 ===== */
.index-row { display: flex; justify-content: space-between; align-items: center; }
.index-score { font-size: 44px; font-weight: 700; line-height: 1; }
.index-level {
  display: inline-block; color: #fff; padding: 2px 12px;
  border-radius: 12px; font-size: 12px; margin-top: 4px;
}
.index-desc { font-size: 12px; color: var(--text2); margin-top: 6px; }
.index-right { text-align: center; padding-left: 16px; }
.wx-icon { font-size: 36px; }
.wx-temp { font-size: 20px; font-weight: 600; margin-top: 2px; }
.wx-text { font-size: 12px; color: var(--text2); }
.rec-fish { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.rec-fish .label { font-size: 12px; font-weight: 600; width: 100%; margin-bottom: 2px; }
.fish-tag {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 11px; background: rgba(46,125,50,0.1); color: var(--primary);
}
.fish-tag.inactive { background: rgba(229,57,53,0.1); color: var(--danger); }
.link-row { color: var(--primary); font-size: 13px; text-align: right; padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--border); cursor: pointer; }

/* ===== 活动 & 放鱼列表 ===== */
.act-item, .fish-item {
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.act-item:last-child, .fish-item:last-child { border-bottom: none; }
.act-title { font-size: 14px; font-weight: 500; }
.act-time { font-size: 12px; color: var(--text3); margin-top: 2px; }
.fish-header { display: flex; justify-content: space-between; align-items: center; }
.fish-species { font-size: 15px; font-weight: 600; }
.fish-meta { font-size: 12px; color: var(--text2); margin-top: 3px; }
.fish-remark { font-size: 12px; color: var(--text2); margin-top: 6px; padding-left: 8px; border-left: 3px solid var(--border); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; }
.badge-green { background: rgba(46,125,50,0.1); color: var(--primary); }
.badge-orange { background: rgba(255,111,0,0.1); color: var(--accent); }

/* ===== 天气页 ===== */
.weather-hero { background: linear-gradient(135deg, #1565C0, #42A5F5); color: #fff; }
.wx-main { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,0.2); }
.wx-big-temp { font-size: 42px; font-weight: 700; }
.wx-cur-text { color: rgba(255,255,255,0.8); font-size: 14px; margin-top: 2px; }
.wx-feels { color: rgba(255,255,255,0.6); font-size: 12px; }
.wx-big-icon { font-size: 52px; }
.wx-details { display: flex; justify-content: space-between; padding-top: 14px; }
.wx-detail { text-align: center; flex: 1; }
.wx-detail-label { font-size: 11px; color: rgba(255,255,255,0.6); }
.wx-detail-val { font-size: 13px; margin-top: 2px; font-weight: 500; }

.index-bar { height: 8px; background: #E8F5E9; border-radius: 4px; overflow: hidden; margin-bottom: 8px; }
.index-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s; }
.index-bar-label { display: flex; justify-content: space-between; font-size: 12px; }

/* 鱼种推荐卡片 */
.rec-item {
  padding: 14px; margin-bottom: 10px; background: #FAFAFA;
  border-radius: 8px; border-left: 4px solid var(--primary);
}
.rec-item.inactive { opacity: 0.5; border-left-color: var(--text3); }
.rec-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.rec-status { font-size: 11px; padding: 1px 8px; border-radius: 10px; background: var(--text3); color: #fff; }
.rec-status.active { background: var(--primary); }
.rec-row { display: flex; gap: 4px; font-size: 13px; margin-top: 6px; }
.rec-label { color: var(--text2); white-space: nowrap; }
.lure-tag { display: inline-block; padding: 1px 8px; background: rgba(46,125,50,0.1); color: var(--primary); border-radius: 4px; font-size: 11px; margin: 1px 2px; }
.rec-tips { margin-top: 8px; padding: 8px 10px; background: rgba(255,160,0,0.08); border-radius: 6px; font-size: 12px; color: var(--accent); line-height: 1.6; }

.tip-item { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.6; }
.tip-item:last-child { border-bottom: none; }

/* 预报 */
.fc-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.fc-item:last-child { border-bottom: none; }
.fc-date { width: 60px; font-weight: 500; font-size: 13px; }
.fc-weather { flex: 1; text-align: center; font-size: 13px; }
.fc-temp { width: 80px; text-align: center; font-size: 13px; font-weight: 500; }
.fc-wind { width: 70px; text-align: center; font-size: 12px; color: var(--text2); }
.fc-rain { width: 60px; text-align: right; font-size: 12px; }
.fc-rain.high { color: var(--accent); }

/* ===== 知识库 ===== */
.search-bar { margin-bottom: 10px; }
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 24px; padding: 8px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.search-wrap input { flex: 1; border: none; outline: none; font-size: 14px; background: none; }
.search-clear { color: var(--text3); cursor: pointer; display: none; }

.cat-scroll { overflow-x: auto; white-space: nowrap; margin-bottom: 12px; -webkit-overflow-scrolling: touch; }
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-item {
  display: inline-block; padding: 6px 16px; border-radius: 18px;
  background: #fff; font-size: 13px; color: var(--text2); margin-right: 8px;
  border: 1px solid var(--border); cursor: pointer;
}
.cat-item.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.article-card { padding: 0; overflow: hidden; cursor: pointer; }
.article-cover { width: 100%; height: 160px; object-fit: cover; }
.article-body { padding: 14px; }
.article-title { font-size: 15px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.article-summary { font-size: 12px; color: var(--text2); margin-top: 6px; line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.article-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.article-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.article-date { font-size: 11px; color: var(--text3); }

/* ===== 文章详情 ===== */
.detail-back { color: var(--primary); font-size: 14px; padding: 8px 0; cursor: pointer; }
.detail-card { padding-bottom: 70px; }
.detail-title { font-size: 22px; font-weight: 700; line-height: 1.4; margin-bottom: 12px; }
.detail-meta { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.detail-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.detail-date { font-size: 12px; color: var(--text3); }
.detail-cover { width: 100%; border-radius: 8px; margin-bottom: 16px; }
.detail-body { font-size: 15px; line-height: 1.8; }
.detail-body img { max-width: 100%; border-radius: 6px; margin: 8px 0; }

.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 500px; margin: 0 auto;
  height: 52px; background: #fff; display: flex; align-items: center; justify-content: space-around;
  box-shadow: 0 -1px 6px rgba(0,0,0,0.06); z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.bar-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--text2); cursor: pointer; }
.bar-btn.favorited { color: var(--danger); }

/* ===== 个人中心 ===== */
.profile-header { text-align: center; padding: 36px 0 24px; }
.avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; font-size: 32px;
  box-shadow: 0 2px 10px rgba(46,125,50,0.15);
}
.user-name { font-size: 18px; font-weight: 600; }
.user-desc { font-size: 13px; color: var(--text3); margin-top: 4px; }

.menu-card .menu-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 4px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.menu-card .menu-item:last-child { border-bottom: none; }
.menu-right { color: var(--text3); display: flex; align-items: center; gap: 6px; }

.admin-link { text-align: center; padding: 24px 0; font-size: 13px; color: var(--text3); opacity: 0.5; cursor: pointer; }

/* ===== 管理后台公共 ===== */
.admin-header { background: var(--primary); color: #fff; padding: 16px; text-align: center; font-size: 18px; font-weight: 600; }
.admin-tabs { display: flex; background: #fff; margin-bottom: 12px; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.admin-tab { flex: 1; text-align: center; padding: 12px 0; font-size: 13px; color: var(--text2); cursor: pointer; border-bottom: 2px solid transparent; }
.admin-tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 4px; }
.form-input, .form-textarea, .form-select {
  width: 100%; border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; font-size: 14px; outline: none; background: #fff;
  font-family: inherit;
}
.form-input:focus, .form-textarea:focus { border-color: var(--primary); }
.form-textarea { min-height: 100px; resize: vertical; }

.btn { display: inline-block; padding: 10px 24px; border-radius: 8px; font-size: 14px; border: none; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; text-align: center; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

.record-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.record-item:last-child { border-bottom: none; }
.record-actions { display: flex; gap: 8px; margin-top: 6px; }

.empty { text-align: center; padding: 40px 20px; color: var(--text3); font-size: 14px; }

/* 模态框 */
.modal-mask {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 200; display: flex;
  align-items: center; justify-content: center;
}
.modal-box { background: #fff; border-radius: 12px; padding: 24px; width: 85%; max-width: 360px; }
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; text-align: center; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; text-align: center; }

/* Toast */
.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75); color: #fff; padding: 10px 24px;
  border-radius: 8px; font-size: 14px; z-index: 300;
  animation: fadeInOut 2s ease-in-out;
}
@keyframes fadeInOut {
  0% { opacity: 0; } 10% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; }
}
