/* 四川钓鱼天气 · 管理后台样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: #f4f6f9; color: #222; font-size: 14px;
}
a { color: #1a73e8; text-decoration: none; }
.layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
  width: 200px; background: #1e2a38; color: #cfd8e3;
  display: flex; flex-direction: column; position: fixed; height: 100vh;
}
.logo { display: flex; align-items: center; gap: 8px; padding: 18px 14px; border-bottom: 1px solid #2c3a4b; }
.logo-icon { font-size: 26px; }
.logo-title { font-size: 15px; font-weight: bold; color: #fff; }
.logo-sub { font-size: 11px; color: #7f8c9a; }
.menu { flex: 1; padding: 10px 0; overflow-y: auto; }
.menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px; color: #cfd8e3; font-size: 14px;
  border-left: 3px solid transparent;
}
.menu-item:hover { background: #263544; color: #fff; }
.menu-item.active { background: #263544; color: #4da3ff; border-left-color: #4da3ff; font-weight: bold; }
.mi-icon { width: 18px; text-align: center; }
.sidebar-foot { padding: 12px; border-top: 1px solid #2c3a4b; font-size: 12px; }
.admin-name { color: #fff; margin-bottom: 8px; }

/* 主区 */
.main { margin-left: 200px; flex: 1; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid #e3e8ef;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 17px; font-weight: 600; }
.content { padding: 20px; flex: 1; }

/* 卡片 */
.card { background: #fff; border-radius: 6px; padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; padding-left: 8px; border-left: 3px solid #4da3ff; }
.card-title small { font-weight: normal; color: #888; font-size: 12px; margin-left: 8px; }

/* 表单 */
.form-row { display: flex; align-items: center; margin-bottom: 14px; }
.form-row label { width: 130px; text-align: right; padding-right: 12px; color: #555; }
.form-row .input-wrap { flex: 1; max-width: 520px; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d5dae2; border-radius: 4px;
  font-size: 14px; font-family: inherit; outline: none; background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: #4da3ff; }
textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.hint { color: #999; font-size: 12px; margin-top: 4px; }

/* 按钮 */
.btn {
  display: inline-block; padding: 8px 18px; background: #4da3ff; color: #fff;
  border: none; border-radius: 4px; cursor: pointer; font-size: 14px; font-family: inherit;
}
.btn:hover { background: #3a8fe0; color: #fff; }
.btn-gray { background: #8a94a6; }
.btn-gray:hover { background: #727c8d; }
.btn-danger { background: #e74c3c; }
.btn-danger:hover { background: #c0392b; }
.btn-small { padding: 4px 10px; font-size: 12px; border-radius: 3px; }
.btn-mini { display: inline-block; padding: 5px 10px; font-size: 12px; background: #eef2f7; color: #555; border-radius: 3px; }
.btn-mini:hover { background: #dde5ef; }
.btn-row { margin-top: 18px; padding-left: 130px; }
.btn-row.center { padding-left: 0; text-align: center; }

/* 表格 */
table.grid { width: 100%; border-collapse: collapse; background: #fff; }
table.grid th { background: #f0f3f7; padding: 10px; text-align: left; font-weight: 600; border-bottom: 1px solid #e3e8ef; font-size: 13px; }
table.grid td { padding: 10px; border-bottom: 1px solid #eef1f5; font-size: 13px; vertical-align: middle; }
table.grid tr:hover td { background: #fafcff; }
.tc { text-align: center; }

/* 状态标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag-on { background: #e6f7ed; color: #18a058; }
.tag-off { background: #f5f5f5; color: #999; }
.tag-warn { background: #fff3e0; color: #e8912a; }

/* 提示条 */
.flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 14px; }
.flash-ok { background: #e6f7ed; color: #18a058; border: 1px solid #b7ebcd; }
.flash-error { background: #fdecea; color: #c0392b; border: 1px solid #f5c6c2; }

/* 统计小卡 */
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.stat {
  flex: 1; min-width: 140px; background: #fff; border-radius: 6px; padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.stat .num { font-size: 26px; font-weight: bold; color: #4da3ff; }
.stat .lab { color: #888; font-size: 13px; margin-top: 4px; }

/* 分页 */
.pager { margin-top: 14px; text-align: center; }
.pager a { display: inline-block; padding: 5px 11px; border: 1px solid #d5dae2; margin: 0 2px; border-radius: 3px; color: #555; }
.pager a.cur { background: #4da3ff; color: #fff; border-color: #4da3ff; }

/* 空状态 */
.empty { padding: 40px; text-align: center; color: #aaa; }

/* 登录页 */
.login-page { background: linear-gradient(135deg, #1e3c5a 0%, #2d6ea8 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box { background: #fff; border-radius: 8px; padding: 34px 30px; width: 360px; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.login-box h2 { text-align: center; margin-bottom: 6px; font-size: 20px; }
.login-box .sub { text-align: center; color: #999; font-size: 13px; margin-bottom: 22px; }
.login-box .form-row label { width: 60px; }
.login-box .btn { width: 100%; margin-top: 10px; padding: 10px; }

/* 开关样式 */
.switch-box { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.switch-box input { width: auto; }

/* 栏目管理：左右滑动开关 */
.sw { position: relative; display: inline-block; width: 50px; height: 26px; vertical-align: middle; }
.sw input { opacity: 0; width: 0; height: 0; position: absolute; }
.sw .slider { position: absolute; inset: 0; background: #ccd2dc; border-radius: 13px; transition: .2s; cursor: pointer; }
.sw .slider:before { content: ""; position: absolute; width: 22px; height: 22px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.sw input:checked + .slider { background: #2d8cf0; }
.sw input:checked + .slider:before { transform: translateX(24px); }
.sw-txt { font-size: 12px; color: #888; margin-left: 8px; vertical-align: middle; }

/* 数据看板 */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.dash-group { border: 1px solid #e8edf3; border-radius: 10px; padding: 12px 14px; background: #fafbfd; }
.dg-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; color: #444; margin-bottom: 10px; }
.dg-head a { font-size: 12px; color: #2d8cf0; text-decoration: none; font-weight: 400; }
.dg-head a:hover { text-decoration: underline; }
.dg-items { display: flex; gap: 10px; }
.dg-item { flex: 1; background: #fff; border: 1px solid #e8edf3; border-radius: 8px; padding: 12px 6px; text-align: center; text-decoration: none; display: block; transition: box-shadow .15s; }
.dg-item:hover { box-shadow: 0 2px 10px rgba(45,140,240,.12); }
.dg-item b { display: block; font-size: 24px; line-height: 1.2; color: #2d8cf0; }
.dg-item span { font-size: 12px; color: #999; }
.dg-item.warn b { color: #e74c3c; }
.dg-item.warn span { color: #e74c3c; }

/* 近 7 日趋势 */
.trend { display: flex; align-items: flex-end; gap: 8px; padding: 6px 4px 2px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.trend-bars { display: flex; align-items: flex-end; gap: 4px; height: 84px; }
.trend-bar { width: 12px; border-radius: 3px 3px 0 0; min-height: 4px; }
.b-u { background: #2d8cf0; }
.b-r { background: #f0a020; }
.b-s { background: #18a058; }
.trend-date { font-size: 11px; color: #999; text-align: center; line-height: 1.5; }
.trend-sum { color: #666; font-weight: 600; }
.card-title .lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: -1px; }
.lg-u { background: #2d8cf0; }
.lg-r { background: #f0a020; }
.lg-s { background: #18a058; }
