/* ============ Bot 管理面板 · 现代主题 ============ */
:root {
  --brand: #16689C;
  --brand-dark: #12527B;
  --brand-light: #E3EEF7;
  --bg: #F4F6F9;
  --card-border: #E7EBF0;
  --text: #1F2937;
  --muted: #6B7280;
  --ok: #198754;
  --bad: #DC3545;
  --warn: #B7791F;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .12);
}
body { background: var(--bg); color: var(--text); font-size: 14px; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: #fff; border-bottom: 1px solid var(--card-border);
  position: sticky; top: 0; z-index: 1020;
}
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; }
.brand { font-weight: 800; font-size: 17px; color: var(--brand); white-space: nowrap; }
.brand small { font-weight: 400; font-size: 11px; color: var(--muted); margin-left: 2px; }
.nav-scroll { display: flex; gap: 6px; flex: 1; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.nav-scroll::-webkit-scrollbar { display: none; }
.nav-scroll .nav-link {
  color: #4B5563; font-size: 13.5px; padding: 7px 12px; border-radius: 9px; text-decoration: none; font-weight: 500;
}
.nav-scroll .nav-link:hover { background: var(--brand-light); color: var(--brand); }
.nav-scroll .nav-link.active { background: var(--brand); color: #fff; font-weight: 600; }
.nav-dot {
  display: none; width: 7px; height: 7px; border-radius: 50%; background: #E5484D;
  margin-left: 6px; vertical-align: 3px; box-shadow: 0 0 0 2px rgba(229,72,77,.15);
}
.nav-scroll .nav-link.active .nav-dot { box-shadow: 0 0 0 2px rgba(255,255,255,.6); }
.logout-btn { color: #9AA0A6; font-size: 13px; cursor: pointer; padding: 7px 10px; border-radius: 9px; white-space: nowrap; }
.logout-btn:hover { background: #FDECEC; color: var(--bad); }

/* ---------- 布局 ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 20px 16px 70px; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.page-title { font-size: 20px; font-weight: 700; margin: 0; }
.meta-pill { font-size: 12.5px; color: var(--muted); background: #fff; border: 1px solid var(--card-border); border-radius: 20px; padding: 4px 12px; }
.meta-pill b { color: var(--text); font-weight: 600; }

/* ---------- 卡片（.p-card 与 .card 同一套样式，合并避免漂移） ---------- */
.p-card, .card {
  background: #fff; border: 1px solid var(--card-border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.p-card { height: 100%; }   /* 仅 .p-card 在栅格中自动等高，.card 保持内容高度 */
.p-card h3, .card h3, .p-card .card-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card h4 { font-size: 13px; font-weight: 600; color: #374151; }
.card-link { font-size: 12.5px; color: var(--brand); text-decoration: none; }
.card-link:hover { text-decoration: underline; }

/* ---------- 模块状态 chips ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; background: #fff; border: 1px solid var(--card-border);
  border-radius: 20px; padding: 5px 12px; font-size: 12.5px; color: #374151; box-shadow: var(--shadow);
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dot.green { background: #22C55E; }
.dot.red { background: #EF4444; }
.dot.gray { background: #CBD5E1; }
.chip .chip-time { color: var(--muted); font-size: 11px; }

/* ---------- 资讯流 ---------- */
.feed-item {
  display: flex; align-items: baseline; gap: 10px; padding: 11px 8px; border-bottom: 1px solid #F1F5F9;
  text-decoration: none; color: inherit; border-radius: 8px;
}
.feed-item:last-child { border-bottom: none; }
.feed-item:hover { background: #F8FAFC; }
.feed-item .t { flex: 1; font-size: 13.5px; line-height: 1.55; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.feed-item:hover .t { color: var(--brand); }
.feed-item .tm { flex: 0 0 auto; font-size: 11.5px; color: #9CA3AF; font-variant-numeric: tabular-nums; }
.badge-tag { font-size: 10.5px; border-radius: 4px; padding: 2px 7px; font-weight: 600; flex: 0 0 auto; }
.badge-tag.news { color: var(--brand); background: var(--brand-light); }
.badge-tag.article { color: #8A5A00; background: #FBF0D8; }
.feed-more { padding: 16px 0; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ---------- 配置行（避免与 Bootstrap .row 栅格冲突） ---------- */
.cfg-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #F1F5F9; flex-wrap: wrap; }
.cfg-row:last-child { border-bottom: none; }

/* ---------- 统计 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-item { background: #F8FAFC; border: 1px solid var(--card-border); border-radius: 12px; padding: 12px; text-align: center; }
.stat-item .v { font-size: 21px; font-weight: 800; color: var(--brand); }
.stat-item .k { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------- 表格（.p-table 与裸 table 同一套样式） ---------- */
.p-table, table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.p-table thead th, table thead th { background: #F8FAFC; color: #4B5563; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--card-border); white-space: nowrap; }
.p-table tbody td, table tbody td { padding: 10px 12px; border-bottom: 1px solid #F1F5F9; word-break: normal; vertical-align: top; }
.p-table td.nt { white-space: nowrap; }                       /* 短数字/标签列：不换行，窄屏横向滚动 */
.p-table td.clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* 内容列：超长省略号 */
.p-table tbody tr:last-child td, table tbody tr:last-child td { border-bottom: none; }
.p-table tbody tr:hover, table tbody tr:hover { background: #F8FAFC; }

/* ---------- 提醒列表 ---------- */
.remind-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #F1F5F9; flex-wrap: wrap; }
.remind-item:last-child { border-bottom: none; }
.state-tag { font-size: 11px; border-radius: 5px; padding: 2px 8px; font-weight: 600; flex: 0 0 auto; }
.state-tag.on { color: var(--brand); background: var(--brand-light); }
.state-tag.off { color: #9AA0A6; background: #F1F5F9; }

/* ---------- 表单 ---------- */
.form-control, .form-select { border-radius: 9px; border-color: #D1D5DB; font-size: 13.5px; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22, 104, 156, .12); }
.form-label { font-size: 13px; font-weight: 600; color: #374151; }

/* ---------- 按钮 ---------- */
.btn { border-radius: 9px; font-size: 13.5px; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-outline-brand { color: var(--brand); border-color: var(--brand); }
.btn-outline-brand:hover { background: var(--brand); color: #fff; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: calc(100vh - 80px); display: flex; align-items: center; justify-content: center; padding: 30px 16px; }
.login-card { width: 100%; max-width: 400px; }
.login-card .card-body { padding: 32px; }
.login-logo { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, #1B7BB8, #12527B); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; margin: 0 auto 14px; box-shadow: var(--shadow-lg); }

/* ---------- Toast（底部居中，页面内可见） ---------- */
#msg {
  display: none; position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  z-index: 9999; padding: 11px 24px; border-radius: 12px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg); max-width: 90vw; text-align: center; color: #fff;
}
#msg.ok { display: block; background: var(--ok); }
#msg.err { display: block; background: var(--bad); }

/* ---------- 其他 ---------- */
.muted { color: var(--muted); }
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }
.warn { color: var(--warn); font-weight: 600; }
.search-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.search-row .form-control { flex: 1 1 260px; max-width: 420px; }
.pager { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pager .page-info { font-size: 13px; color: #4B5563; }
.acc-row { display: flex; gap: 4px; flex-wrap: nowrap; }
.acc-row .btn { white-space: nowrap; }

/* ---------- 菜园子旧页（药剂手册/种植参考）补齐 ---------- */
.tabbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--card-border); padding-bottom: 12px; }
.tabbar a { padding: 7px 16px; border-radius: 9px; font-size: 13.5px; color: #4B5563; text-decoration: none; background: #fff; border: 1px solid var(--card-border); font-weight: 500; }
.tabbar a:hover { background: var(--brand-light); color: var(--brand); }
.tabbar a.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }

.vegchip { display: inline-block; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--card-border); background: #fff; color: #444; font-size: 13px; font-weight: 500; }
.vegchip:hover { border-color: var(--brand); color: var(--brand); }
