:root {
  --green: #2FA35C;
  --green-d: #1F7A43;
  --green-soft: #E8F6ED;
  --ink: #1F3B2C;
  --body: #45604F;
  --sub: #7C9186;
  --faint: #A3B3AA;
  --line: #E4EDE8;
  --bg: #F5F9F6;
  --card: #FFFFFF;
  --amber: #B77A16;
  --amber-bg: #FFF6E2;
  --red: #C0483C;
  --red-bg: #FDEDEB;
  --blue: #2F6FB5;
  --blue-bg: #E9F2FD;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(31, 59, 44, 0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  display: flex;
  background: var(--bg);
  color: var(--body);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============ 侧栏 ============ */
.side {
  flex: none;
  width: 216px;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 6px 22px;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #35B268, #1F8A4B);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(47, 163, 92, 0.28);
}

.bname {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.2px;
}

.bsub {
  font-size: 12px;
  color: var(--faint);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.navi {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--body);
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.navi .ni {
  width: 16px;
  font-size: 13px;
  color: var(--faint);
  text-align: center;
}

.navi:hover { background: #F3F8F5; }

.navi.on {
  background: var(--green-soft);
  color: var(--green-d);
  font-weight: 600;
}

.navi.on .ni { color: var(--green); }

.side-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 8px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--sub);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}

.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(47, 163, 92, 0.14); }

/* ============ 主区 ============ */
/* 宽度自适应：原来写死 max-width:1280px，5K / 4K 屏上只占左半屏、右侧整片空白。
   现在撑满可用宽度，只保留一个很高的兜底上限（6K 以上才生效）并居中。 */
.main {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 2400px;
  margin: 0 auto;
  padding: clamp(22px, 1.7vw, 40px) clamp(24px, 2.2vw, 52px) 72px;
}

.view { display: none; }
.view.on { display: block; animation: fade 0.18s ease; }

/* 只做位移不做透明度，避免切页瞬间出现"白屏"错觉 */
@keyframes fade {
  from { transform: translateY(4px); }
  to { transform: none; }
}

.page-h { margin-bottom: 22px; }
.page-h.row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-h h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.page-h p {
  margin: 0;
  max-width: 720px;
  font-size: 13px;
  color: var(--sub);
  line-height: 1.7;
}

.h-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

/* ============ 按钮 ============ */
.btn {
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--body);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover { border-color: #C9DCD1; background: #FAFDFB; }

.btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(47, 163, 92, 0.2);
}

.btn.primary:hover { background: var(--green-d); border-color: var(--green-d); }

.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--sub);
  padding-left: 6px;
}

.btn.ghost:hover { color: var(--green-d); background: transparent; }

.btn.sm { padding: 6px 11px; font-size: 12px; }

.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-bg); border-color: #F1C9C4; }

/* ============ 卡片 ============ */
.card {
  padding: 20px 22px;
  margin-bottom: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card.tight { padding: 16px 18px; }

.card h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.card h2 + .tip { margin-top: -6px; }

/* ============ 统计 ============ */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.stat {
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.s-n {
  font-size: 26px;
  font-weight: 700;
  color: var(--green-d);
  line-height: 1.2;
}

.s-l {
  margin-top: 3px;
  font-size: 12px;
  color: var(--sub);
}

/* ============ 表单 ============ */
.field {
  display: block;
  margin-bottom: 14px;
}

.field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #FCFEFD;
  color: var(--body);
  font-size: 13.5px;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  outline: none;
  border-color: #9FD4B5;
  box-shadow: 0 0 0 3px rgba(47, 163, 92, 0.1);
  background: #fff;
}

textarea.input { resize: vertical; }

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.search { flex: 1; }

.toolbar .input { width: auto; min-width: 140px; }

.row-btns {
  display: flex;
  gap: 9px;
  margin-top: 6px;
}

.save-state {
  font-size: 12px;
  color: var(--faint);
}

.save-state.dirty { color: var(--amber); }
.save-state.ok { color: var(--green); }

.tip {
  margin: 10px 0 0;
  padding: 11px 14px;
  border-radius: 10px;
  background: #F7FAF8;
  border: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--sub);
}

.tip code, .steps code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #EDF3EF;
  font-size: 12px;
  color: var(--green-d);
}

.steps {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--body);
}

.steps li { margin-bottom: 4px; }
.steps b { color: var(--ink); }

/* ============ 标签 ============ */
/* 列表已统一成表格（见文末「设计规范」），这里的 pill 仍被表格与抽屉复用 */
.pill {
  padding: 1px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  flex: none;
}

.pill.pub { background: var(--green-soft); color: var(--green-d); }
.pill.draft { background: var(--amber-bg); color: var(--amber); }
.pill.arch { background: #F0F2F1; color: var(--sub); }
.pill.cat { background: var(--blue-bg); color: var(--blue); }
.pill.pin { background: #FDEDEB; color: var(--red); }

.empty {
  padding: 54px 20px;
  text-align: center;
  border: 1px dashed #D7E5DC;
  border-radius: var(--radius);
  background: #FBFDFC;
  color: var(--sub);
  font-size: 13px;
}

.empty b { display: block; margin-bottom: 6px; color: var(--ink); font-size: 15px; }

/* ============ 编辑器 ============ */
.editor {
  display: grid;
  /* 右侧预览栏跟随视口：窄屏 340px，超宽屏最多 460px */
  grid-template-columns: minmax(0, 1fr) clamp(340px, 26vw, 460px);
  gap: 18px;
  align-items: start;
}

.ed-left { min-width: 0; }

.md-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.md-b {
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #F5F9F6;
  color: var(--body);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.md-b:hover { background: var(--green-soft); color: var(--green-d); }

.md-count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--faint);
}

.md-input {
  width: 100%;
  min-height: 460px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #FCFEFD;
  color: var(--ink);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.85;
  resize: vertical;
}

.md-input:focus {
  outline: none;
  border-color: #9FD4B5;
  box-shadow: 0 0 0 3px rgba(47, 163, 92, 0.1);
}

.cover-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cover-box {
  width: 132px;
  height: 82px;
  border: 1px dashed #D3E3DA;
  border-radius: 9px;
  background: #FAFDFB center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--faint);
  overflow: hidden;
}

.cover-box.qr { width: 96px; height: 96px; }
.cover-box.has { border-style: solid; border-color: var(--line); }
.cover-box.has span { display: none; }

.cover-btns { display: flex; flex-direction: column; gap: 6px; }

/* 手机预览 */
.ed-right { position: sticky; top: 22px; }

.preview-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.ph-hint { font-weight: 400; font-size: 11px; color: var(--faint); }

.phone {
  padding: 10px;
  border-radius: 26px;
  background: #22302A;
  box-shadow: 0 10px 30px rgba(31, 59, 44, 0.16);
}

.phone-in {
  height: 560px;
  overflow-y: auto;
  padding: 20px 17px 30px;
  border-radius: 18px;
  background: #fff;
}

.pv-title {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.45;
  color: #1F3B2C;
  letter-spacing: -0.2px;
}

.pv-meta {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #EEF3F0;
  font-size: 11.5px;
  color: #A3B3AA;
}

.pv-body {
  font-size: 14px;
  line-height: 1.8;
  color: #3A4A42;
}

.pv-body h2 {
  margin: 22px 0 10px;
  padding-left: 9px;
  border-left: 3px solid var(--green);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;
}

.pv-body h3 {
  margin: 18px 0 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}

.pv-body p { margin: 12px 0; text-align: justify; }

.pv-body ul, .pv-body ol { margin: 12px 0; padding-left: 20px; }
.pv-body li { margin: 5px 0; }

.pv-body blockquote {
  margin: 14px 0;
  padding: 10px 13px;
  border-left: 3px solid #A9DDF7;
  border-radius: 0 8px 8px 0;
  background: #F4F9FC;
  color: #5A6B62;
  font-size: 13px;
}

.pv-body img { max-width: 100%; border-radius: 7px; }

.pv-body table {
  width: 100%;
  margin: 14px 0;
  border-collapse: collapse;
  font-size: 12px;
}

.pv-body th, .pv-body td {
  padding: 6px 8px;
  border: 1px solid #E1ECE6;
  text-align: left;
}

.pv-body th { background: #EDF6F0; font-weight: 600; color: var(--ink); }

.pv-body pre {
  margin: 14px 0;
  padding: 11px;
  border-radius: 8px;
  background: #F4F7F5;
  font-size: 12px;
  overflow-x: auto;
}

.pv-body hr { margin: 20px 0; border: none; border-top: 1px solid #E3EDE7; }

/* ============ 品种库 ============ */
.bgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.bcard {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
}

.bcard:hover { border-color: #BFDCCB; transform: translateY(-2px); }

.bcard-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.bcard-n {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.bcard-b {
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--faint);
}

.bcard-m {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 2px 9px;
  border-radius: 20px;
  background: #F3F8F5;
  font-size: 11.5px;
  color: var(--sub);
}

/* ============ 品种编辑 ============ */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 11px;
  background: #fff;
  border: 1px solid var(--line);
  width: fit-content;
}

.tab {
  padding: 7px 15px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--sub);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.tab.on {
  background: var(--green);
  color: #fff;
  font-weight: 600;
}

.tabpane { display: none; }
.tabpane.on { display: block; }

.kpigrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0 16px;
}

.kpifield label { font-size: 12px; color: var(--sub); }

.json-input {
  width: 100%;
  min-height: 520px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #FCFEFD;
  color: var(--ink);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
  resize: vertical;
}

.tbl-block {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.tbl-block:last-child { border-bottom: none; margin-bottom: 0; }

.tbl-h {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 7px;
}

.tbl-h b { font-size: 13.5px; color: var(--ink); }
.tbl-h span { font-size: 11.5px; color: var(--faint); }

.tbl-input {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #FCFEFD;
  color: var(--body);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.75;
  white-space: pre;
  overflow-x: auto;
  resize: vertical;
}

.tbl-input.bad { border-color: #E8A9A2; background: #FFF9F8; }

/* ============ 表格 ============ */
.facts {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.facts td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.facts td:first-child {
  width: 150px;
  color: var(--sub);
}

.facts tr:last-child td { border-bottom: none; }

.yes { color: var(--green-d); font-weight: 600; }
.no { color: var(--red); font-weight: 600; }

.wxbox {
  padding: 13px 15px;
  border-radius: 10px;
  background: #FAFDFB;
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.7;
  color: var(--sub);
}

.wxbox b { color: var(--ink); }

/* ============ toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 18px);
  max-width: 520px;
  padding: 11px 20px;
  border-radius: 10px;
  background: #24352C;
  color: #fff;
  font-size: 13px;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  z-index: 99;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.err { background: #A93B30; }

@media (max-width: 1080px) {
  .editor { grid-template-columns: 1fr; }
  .ed-right { position: static; }
  .phone { display: none; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}

/* ------------------------------ 登录 ------------------------------ */

.login-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(31, 59, 44, 0.38);
  backdrop-filter: blur(6px);
}

.login-mask.on { display: flex; }

.login-card {
  width: 340px;
  padding: 30px 30px 26px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(20, 46, 33, 0.22);
}

.login-logo {
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card h2 {
  margin: 0;
  font-size: 19px;
  color: var(--ink);
}

.login-sub {
  margin: 6px 0 20px;
  font-size: 13px;
  color: var(--sub);
}

.login-field {
  display: block;
  margin-bottom: 14px;
}

.login-field span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--sub);
}

.login-field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font-size: 14px;
  color: var(--ink);
  outline: none;
}

.login-field input:focus {
  border-color: var(--green);
  background: #fff;
}

.login-err {
  min-height: 18px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--red);
}

.login-btn {
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 11px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.login-btn:hover { background: var(--green-d); }

.login-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.logout {
  margin: 10px 14px 16px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--sub);
  font-size: 12px;
  cursor: pointer;
}

.logout:hover {
  color: var(--red);
  border-color: var(--red);
  background: var(--red-bg);
}
/* ============ 小程序用户 ============ */

.uav {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #EDF4F0 center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-d);
  border: 1px solid var(--line);
}

.uav.blank { background: var(--green-soft); }

.uremark {
  color: var(--amber);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 0 4px;
}

.pg-text { font-size: 12px; color: var(--sub); }

.empty.sm { padding: 22px 14px; font-size: 12.5px; }

/* 详情抽屉 */
.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 40, 30, 0.28);
  backdrop-filter: blur(2px);
  display: none;
}

.drawer-mask.on { display: block; }

.drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 92vw;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 32px rgba(24, 60, 40, 0.12);
  display: flex;
  flex-direction: column;
  animation: drawer-in 0.18s ease-out;
}

@keyframes drawer-in {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.dr-h {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.dr-name { font-size: 16px; font-weight: 700; color: var(--ink); }
.dr-sub { margin-top: 3px; font-size: 12px; color: var(--faint); }

.dr-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 28px;
}

.ud-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  padding: 12px 14px;
  background: #FBFDFC;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 14px;
}

.ud-grid > div { display: flex; flex-direction: column; gap: 2px; }
.ud-grid span { font-size: 11.5px; color: var(--faint); }
.ud-grid b { font-size: 13px; color: var(--ink); font-weight: 600; }

.ud-h {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.udlist { display: flex; flex-direction: column; gap: 6px; }

.uditem {
  padding: 9px 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.uditem-t {
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uditem-m {
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--faint);
}

/* ==========================================================================
   设计规范 v1.2（2026-11）
   --------------------------------------------------------------------------
   之前每个页面各写一套：页头有的带描述有的不带，列表有的是卡片有的是行，
   空态文案长短不一，危险操作直接用原生 confirm。这一层把它们收成组件，
   新页面只允许用这里的类，不再自己发明。
   顺序：布局 → 顶栏 → 页头 → 面板 → 表格 → 空态/骨架 → 按钮态 → 确认框
        → 侧栏图标 → 登录页 → 账号安全
   ========================================================================== */

/* ============ 布局 ============ */
.shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.canvas {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ============ 顶栏 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  flex: none;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--faint);
  min-width: 0;
}

.crumb b {
  color: var(--ink);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumb .sep { color: #D2DFD8; }

.tb-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.sess {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-d);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.sess i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 163, 92, 0.16);
}

.sess.warn { background: var(--amber-bg); color: var(--amber); }
.sess.warn i { background: var(--amber); box-shadow: 0 0 0 3px rgba(183, 122, 22, 0.16); }

.acct { position: relative; }

.acct-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 11px 0 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}

.acct-btn:hover { border-color: #C9DCD1; }

.acct-av {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #35B268, #1F8A4B);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.acct-menu {
  position: absolute;
  right: 0;
  top: 40px;
  width: 200px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(20, 46, 33, 0.14);
  display: none;
}

.acct-menu.on { display: block; }

.acct-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--body);
  text-align: left;
  cursor: pointer;
}

.acct-menu button:hover { background: #F3F8F5; }
.acct-menu button.danger { color: var(--red); }
.acct-menu button.danger:hover { background: var(--red-bg); }
.acct-menu .sep { height: 1px; margin: 5px 4px; background: var(--line); }

/* ============ 页头 ============ */
.page-h {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.page-h.row { align-items: flex-end; }

.page-h h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.page-h p {
  margin: 7px 0 0;
  max-width: 780px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--sub);
}

.page-h .h-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--sub);
  cursor: pointer;
}

.page-h .h-back:hover { color: var(--green-d); }

.h-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding-bottom: 2px;
}

/* ============ 面板 ============ */
/* 与旧 .card 并存：编辑器与品种表单继续用 .card，新页面统一用 .panel */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel + .panel { margin-top: 16px; }

.panel-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-h h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

.panel-h .ph-act { flex: none; display: flex; gap: 8px; }

.panel-b { padding: 18px 20px; }
.panel-b.tight { padding: 4px 0; }
.panel-f {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: #FBFDFC;
  font-size: 12px;
  color: var(--faint);
}

/* ============ 统计 ============ */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.stat {
  padding: 15px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat .s-n {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat .s-l {
  margin-top: 5px;
  font-size: 12px;
  color: var(--sub);
}

.stat .s-x {
  margin-top: 3px;
  font-size: 11px;
  color: var(--faint);
}

/* ============ 表格 ============ */
.dg-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dg {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.dg thead th {
  padding: 10px 16px;
  background: #FAFCFB;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--sub);
  text-align: left;
  white-space: nowrap;
}

.dg tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #F2F7F4;
  font-size: 13px;
  color: var(--body);
  vertical-align: middle;
}

.dg tbody tr:last-child td { border-bottom: 0; }
.dg tbody tr.on-row { cursor: pointer; }
.dg tbody tr.on-row:hover { background: #FBFDFC; }
.dg .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dg .nowrap { white-space: nowrap; }
.dg .act { display: flex; gap: 6px; justify-content: flex-end; }

.dg .cell-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dg .cell-t {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dg .cell-s {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dg .cell-cover {
  flex: none;
  width: 44px;
  height: 34px;
  border-radius: 6px;
  background: #EDF4F0 center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--faint);
}

/* ============ 空态 ============ */
.empty {
  padding: 52px 24px;
  text-align: center;
  border: 1px dashed #D7E5DC;
  border-radius: var(--radius);
  background: #FBFDFC;
}

.empty-i {
  font-size: 26px;
  line-height: 1;
  opacity: 0.5;
}

.empty-t {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.empty-s {
  margin: 6px auto 0;
  max-width: 380px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--faint);
}

.empty-act { margin-top: 16px; }

.empty.sm { padding: 22px 14px; }
.empty.sm .empty-t { margin-top: 8px; font-size: 13px; }
.empty.sm .empty-s { font-size: 11.5px; }

/* ============ 骨架 ============ */
.skel {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #EEF4F0 25%, #F7FAF8 37%, #EEF4F0 63%);
  background-size: 400% 100%;
  animation: skel-run 1.4s ease infinite;
}

.skel + .skel { margin-top: 10px; }
.skel.w40 { width: 40%; }
.skel.w60 { width: 60%; }
.skel.w80 { width: 80%; }

@keyframes skel-run {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.skel-box { padding: 18px 20px; }

/* ============ 按钮态 ============ */
.btn.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(47, 163, 92, 0.25);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}

.btn.primary.loading::after {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.btn.danger-solid {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn.danger-solid:hover { background: #A93B30; border-color: #A93B30; }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ============ 确认框 ============ */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 40, 30, 0.34);
  backdrop-filter: blur(3px);
}

.modal-mask.on { display: flex; }

.modal {
  width: 408px;
  max-width: 100%;
  padding: 22px 22px 18px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(16, 38, 26, 0.24);
}

.modal h3 {
  margin: 0;
  font-size: 16px;
  color: var(--ink);
}

.modal p {
  margin: 9px 0 0;
  font-size: 13px;
  line-height: 1.75;
  color: var(--sub);
}

.modal-btns {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* ============ 侧栏图标与分组 ============ */
.navi svg {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--faint);
}

.navi.on svg { color: var(--green-d); }
.navi.on { color: var(--green-d); font-weight: 600; }

.nav-group {
  margin: 18px 0 6px;
  padding: 0 12px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: #B4C4BB;
}

.side-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 12px 10px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--faint);
}

.side-foot .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #D5DFD9;
  flex: none;
}

.side-foot .dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(47, 163, 92, 0.16); }

/* ============ 登录页 ============ */
/* 左半屏实景、右半屏表单，中间用白色面板的大圆角做分界。
   左图只放品牌名，不放功能清单：登录的人已经知道后台能干什么。 */
body.lg-body {
  display: block;
  min-height: 100vh;
  background: #fff;
}

.lg-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 53%) 1fr;
}

/* ---------- 左：养殖场实景 ---------- */
.lg-visual {
  position: relative;
  overflow: hidden;
  background: #CFE6D6;
}

.lg-visual-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 取景偏左：保住母鸡，右侧草坡可以裁掉 */
  object-position: 18% 46%;
}

/* 顶部压暗一档，白字才兜得住天空的高光 */
.lg-visual-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 42, 24, 0.48) 0%, rgba(8, 42, 24, 0.12) 38%, rgba(8, 42, 24, 0) 60%),
    linear-gradient(90deg, rgba(8, 42, 24, 0.24) 0%, rgba(8, 42, 24, 0) 46%);
}

.lg-visual-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(38px, 5vh, 64px) clamp(30px, 4.4vw, 66px);
  color: #fff;
}

.lg-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.lg-mark {
  width: 54px;
  height: 54px;
  display: block;
}

.lg-mark.is-white {
  color: #fff;
  filter: drop-shadow(0 4px 12px rgba(0, 30, 15, 0.3));
}

.lg-brand-name {
  margin: 18px 0 0;
  font-size: clamp(27px, 2.7vw, 38px);
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 2px 16px rgba(0, 34, 18, 0.38);
}

.lg-brand-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 13.5px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 8px rgba(0, 34, 18, 0.42);
}

.lg-brand-rule i {
  width: 26px;
  height: 1px;
  background: rgba(255, 255, 255, 0.62);
}

.lg-brand-foot {
  font-size: 12px;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.84);
  text-shadow: 0 1px 8px rgba(0, 34, 18, 0.6);
}

/* ---------- 右：白色表单面板 ---------- */
.lg-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -64px;
  padding: 56px 48px;
  border-radius: 64px 0 0 64px;
  background: #fff;
  box-shadow: -20px 0 54px rgba(12, 48, 28, 0.12);
}

.lg-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 190px;
  pointer-events: none;
}

.lg-fence {
  position: absolute;
  right: 26px;
  bottom: 12px;
  width: 196px;
  height: auto;
  color: #CDE8D8;
  pointer-events: none;
}

.lg-form {
  position: relative;
  width: 100%;
  max-width: 392px;
  /* 底部留出波浪的位置，整块略往上提，视觉重心才在中间偏上 */
  margin-bottom: 40px;
}

.lg-head {
  margin-bottom: 24px;
  text-align: center;
}

.lg-logo {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(160deg, #38A963 0%, #217B47 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(47, 163, 92, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.lg-logo svg {
  width: 44px;
  height: 44px;
}

.lg-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink);
}

.lg-slogan {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 9px;
  font-size: 11.5px;
  letter-spacing: 2.6px;
  color: #9AAFA3;
}

.lg-slogan i {
  width: 22px;
  height: 1px;
  background: #DCE8E1;
}

.lg-tabs {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-bottom: 20px;
  border-bottom: 1px solid #EDF3EF;
}

.lg-tab {
  position: relative;
  padding: 0 2px 11px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 14.5px;
  color: #96A79D;
  cursor: default;
}

.lg-tab.on {
  font-weight: 600;
  color: var(--green-d);
}

.lg-tab.on::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 3px;
  background: var(--green);
}

.lg-field { position: relative; margin-bottom: 14px; }

/* 图标用固定上偏移而不是 50%：大写锁定提示出现时输入框位置不动 */
.lg-ico {
  position: absolute;
  left: 15px;
  top: 24px;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #A9BBB0;
  pointer-events: none;
  transition: color 0.15s;
}

.lg-input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  border: 1px solid #E3ECE7;
  border-radius: 10px;
  background: #FBFDFB;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.lg-input::placeholder { color: #ADBCB3; }

.lg-input:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 163, 92, 0.12);
}

.lg-field:focus-within .lg-ico { color: var(--green); }

.lg-input.has-err { border-color: #E0A9A2; background: #FFFCFC; }
.lg-input.has-err:focus { box-shadow: 0 0 0 3px rgba(192, 72, 60, 0.12); }

.lg-input.has-eye { padding-right: 46px; }

.lg-eye {
  position: absolute;
  right: 6px;
  top: 7px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #A9BBB0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lg-eye:hover { background: #F1F8F3; color: var(--body); }

.lg-eye svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.6; }

.lg-cap {
  display: none;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--amber);
}

.lg-cap.on { display: block; }

.lg-err {
  display: none;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #F1CFCA;
  border-radius: 10px;
  background: var(--red-bg);
  font-size: 12.5px;
  line-height: 1.65;
  color: #A93B30;
}

.lg-err.on { display: flex; }

.lg-err b { flex: none; font-size: 13px; }

.lg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 0;
}

.lg-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--sub);
  cursor: pointer;
  user-select: none;
}

.lg-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--green);
  cursor: pointer;
}

.lg-link {
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--sub);
  cursor: pointer;
}

.lg-link:hover { color: var(--green-d); }

/* 忘记密码的就地说明：用展开而不是气泡，否则一定压住下面那个全宽按钮 */
.lg-forgot {
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid #E4F0E8;
  border-radius: 10px;
  background: #F6FBF8;
  font-size: 12px;
  line-height: 1.75;
  color: var(--sub);
}

.lg-forgot[hidden] { display: none; }

.lg-forgot b {
  display: block;
  margin-bottom: 3px;
  font-size: 12.5px;
  color: var(--body);
}

.lg-forgot p { margin: 0; }

.lg-forgot code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #E9F4EE;
  font-size: 11.5px;
  color: var(--green-d);
}

.lg-hint {
  margin-top: 10px;
  font-size: 12px;
  text-align: right;
  color: var(--faint);
}

.lg-hint:empty { display: none; }

.lg-submit {
  position: relative;
  width: 100%;
  height: 50px;
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 25px;
  background: linear-gradient(96deg, #35A25E 0%, #58BE7C 100%);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(47, 163, 92, 0.28);
  transition: filter 0.15s, box-shadow 0.15s, transform 0.12s;
}

.lg-submit:hover:not(:disabled) {
  filter: brightness(1.04);
  box-shadow: 0 12px 26px rgba(47, 163, 92, 0.34);
}

.lg-submit:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 6px 14px rgba(47, 163, 92, 0.26);
}

.lg-submit:disabled {
  background: #B7DCC6;
  box-shadow: none;
  cursor: not-allowed;
}

.lg-arrow {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s;
}

.lg-submit:hover:not(:disabled) .lg-arrow { transform: translateX(3px); }

/* 窄屏：左图收窄；再窄就整块藏掉，只留表单 */
@media (max-width: 1180px) {
  .lg-page { grid-template-columns: minmax(300px, 46%) 1fr; }
  .lg-panel { padding: 48px 32px; }
}

@media (max-width: 880px) {
  .lg-page { grid-template-columns: 1fr; }
  .lg-visual { display: none; }
  .lg-panel {
    margin-left: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 44px 24px;
  }
}

/* 矮屏笔记本（1440×768 之类）：压缩头部，保证按钮不被挤到折叠线以下 */
@media (max-height: 760px) {
  .lg-form { max-width: 372px; }
  .lg-head { margin-bottom: 18px; }
  .lg-logo { width: 52px; height: 52px; margin-bottom: 10px; }
  .lg-logo svg { width: 27px; height: 27px; }
  .lg-title { font-size: 20px; }
  .lg-input { height: 46px; }
  .lg-ico { top: 23px; }
  .lg-submit { height: 48px; margin-top: 14px; }
}

/* ============ 账号安全 ============ */
.sec-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 16px;
  align-items: start;
}

.pw-meter {
  display: flex;
  gap: 4px;
  margin-top: 9px;
}

.pw-meter i {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #E7EFEA;
  transition: background 0.2s;
}

.pw-meter i.bad { background: var(--red); }
.pw-meter i.mid { background: var(--amber); }
.pw-meter i.ok { background: var(--green); }

.pw-rules {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--faint);
}

.pw-rules li {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
}

.pw-rules li::before {
  content: '';
  width: 12px;
  height: 12px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid #D7E3DB;
}

.pw-rules li.ok { color: var(--green-d); }
.pw-rules li.ok::before {
  border-color: var(--green);
  background: var(--green) radial-gradient(circle, #fff 40%, transparent 42%);
}

.sess-list { margin: 0; padding: 0; list-style: none; }

.sess-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #F2F7F4;
}

.sess-item:last-child { border-bottom: 0; }

.sess-ico {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green-d);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sess-ico svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.6; }

.sess-main { flex: 1; min-width: 0; }

.sess-t {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.sess-t .pill { font-size: 10px; }

/* 每段事实各自 nowrap，整体按段换行：绝对不能在时间戳中间折断（break-all 会把
   "2026-11-09 12:18:08" 劈成 "12:18:" + "08"，看着像数据错了） */
.sess-m {
  display: flex;
  flex-wrap: wrap;
  gap: 1px 12px;
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--faint);
}

.sess-m i {
  font-style: normal;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* 设备 UA 太长且无空格可断，独占一行用省略号收掉，完整内容放 title */
.sess-m .sess-ua {
  flex: 0 0 100%;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sess-act { flex: none; }

/* ============ 通用排版小件 ============ */
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.kv {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px 14px;
  font-size: 13px;
}

.kv dt { color: var(--faint); }
.kv dd { margin: 0; color: var(--body); }

.row-btns { display: flex; gap: 8px; margin-top: 16px; }

.tip {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #F5FAF7;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--sub);
}

/* 工具栏右侧的计数文案，放不下时先收起来 */
.toolbar-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}

/* ============ 问号提示 ============ */
/* 说明性文字不再铺在页面上，改成标题旁边一个 15px 的小问号，悬停或聚焦才展开。
   气泡本体在 body 下的 #hintPop（见 hint.js）：面板都有 overflow:hidden，
   用 ::after 画的箭头气泡会被裁掉。 */
.q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid #CBD8D0;
  border-radius: 50%;
  background: #fff;
  color: #86988E;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  vertical-align: 2px;
  cursor: help;
  transition: color .15s, border-color .15s, background .15s;
}

.q:hover,
.q:focus-visible {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-d);
  outline: none;
}

/* 深色块（登录页品牌区）上的问号 */
.q.on-dark {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}

.q.on-dark:hover,
.q.on-dark:focus-visible {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

#hintPop {
  position: fixed;
  z-index: 90;
  left: 0;
  top: 0;
  max-width: 320px;
  padding: 9px 12px;
  border-radius: 9px;
  background: #1E2A24;
  color: #E6F0E9;
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-line;
  word-break: break-word;
  box-shadow: 0 10px 26px rgba(16, 34, 24, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-3px);
  transition: opacity .12s ease, transform .12s ease;
  pointer-events: none;
}

#hintPop.on {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#hintPop b {
  display: block;
  margin-bottom: 2px;
  font-size: 12.5px;
  color: #fff;
}

/* 品种编辑：标签栏末尾的问号，内容随当前标签切换 */
.tabs-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.tabs-row .tabs { margin-bottom: 0; }

.tabs-row .q { margin-left: 0; }

/* 概览里的公众号状态：一行标签，不再是一段话 */
.wx-state {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--body);
}

.wx-appid {
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

/* 账号安全页：口令来源这种纯信息压成一行小字，不再占一个面板 */
.src-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -2px 0 14px;
  font-size: 12px;
  color: var(--faint);
}

/* 「最近修改 2026-11-09 12:26」—— 改完密码能在页面上确认落地，不用靠猜 */
.src-note i {
  font-style: normal;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.src-note code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-2, #F4F2ED);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--ink);
}

/* ============ 折叠的参考说明 ============ */
/* 设置页那些「AppID 在哪拿」「资质能做到哪一步」平时用不上，
   默认收起，避免把两个真正要填的表单挤到看不见 */
details.ref > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

details.ref > summary::-webkit-details-marker { display: none; }

details.ref > summary::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--faint);
  border-bottom: 1.5px solid var(--faint);
  transform: rotate(-45deg);
  transition: transform .16s;
}

details.ref[open] > summary::before { transform: rotate(45deg); }

details.ref > summary:hover { color: var(--ink); }

details.ref[open] > summary { border-bottom: 1px solid var(--line); }

details.ref > summary::after {
  content: '展开';
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--faint);
}

details.ref[open] > summary::after { content: '收起'; }

.ref-h {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.ref-h + .facts, .ref-h + .steps, .ref-h + .tip { margin-top: 0; }

.panel-b > .ref-h ~ .ref-h { margin-top: 22px; }

/* ============================================================
   大屏适配（2K / 4K / 5K）
   主区不再写死 1280px，这里只按屏幕宽度补一点留白与卡片密度，
   避免超宽屏上内容又小又挤在左边。
   ============================================================ */
@media (min-width: 1500px) {
  .side { width: 240px; padding: 26px 18px 20px; }
  .card { padding: 22px 26px; }
  .stat { padding: 22px 24px; }
  .s-n { font-size: 30px; }
  .bgrid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .kpigrid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .md-input { min-height: 620px; }
  .json-input { min-height: 620px; }
  .phone-in { height: 660px; }
  .ed-right { top: 34px; }
}

/* 5K 全屏：进一步放宽，正文段落仍由 .page-h p 的 max-width 控制可读行宽 */
@media (min-width: 2100px) {
  .bgrid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
  .kpigrid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

/* ============================================================
   文章编辑器：状态行
   以前页头并排放三个按钮（保存 / 推公众号草稿 / 发布并同步），
   用户看不出先后。现在页头只留「保存草稿 + 发布到小程序」，
   状态用一句话写在标题下面，主按钮文案随状态变。
   ============================================================ */
#view-editor .page-h { align-items: flex-start; }

.ed-state {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 7px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--sub);
}

.ed-state .pill { flex: none; }

.ed-state-note { min-width: 0; }

/* 编辑器里的置顶勾选 */
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 12px;
  font-size: 13px;
  color: var(--body);
  cursor: pointer;
}

.check-row input { width: 15px; height: 15px; accent-color: var(--green); cursor: pointer; }

/* 状态行里的阅读数：和说明文字之间拉开一点，弱化处理 */
.ed-state-read {
  margin-left: 4px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
}
