/* 船形村 · 村务管理平台 —— 静态原型样式
   设计基准：1440 宽 PC 后台，政务蓝体系 */

:root {
  --blue: #1F5FD0;
  --blue-2: #2F6BE0;
  --blue-3: #5B8DEF;
  --blue-4: #7BA4F5;
  --blue-5: #9BBBF8;
  --blue-bg: #EEF4FF;
  --navy: #17263C;
  --navy-active: #243D5C;
  --navy-line: #4C8DFF;
  --bg: #F4F6F9;
  --line: #E6EAF0;
  --line-2: #F0F3F7;
  --ink: #1A2333;
  --ink-2: #4A5468;
  --ink-3: #6B7686;
  --ink-4: #8A95A6;
  --ink-5: #71829B;
  --warn-bg: #FFF7E8;
  --warn-ink: #A66A00;
  --green: #17A673;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button, input, select { font-family: inherit; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  padding-bottom: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 16px;
  color: #fff;
}

.brand-logo {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--blue-2);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  flex: 0 0 26px;
}

.brand-name { font-size: 14px; font-weight: 600; letter-spacing: .2px; }

.nav-group {
  padding: 14px 20px 6px;
  font-size: 11px;
  color: var(--ink-5);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 20px;
  font-size: 14px;
  color: #A9B7CC;
  cursor: pointer;
  transition: background .15s;
}

.nav-item:hover { background: #1D3049; color: #E6EDF7; }

.nav-item.active {
  background: var(--navy-active);
  color: #fff;
  font-weight: 500;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--navy-line);
}

.nav-item.pending { color: #8C9CB2; }
.nav-item.pending::after {
  content: "规划中";
  margin-left: auto;
  font-size: 10px;
  color: #6F8199;
  background: #21344C;
  padding: 2px 6px;
  border-radius: 3px;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  flex: 0 0 56px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.crumb { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.menu-btn {
  display: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1;
}

.content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.page-title { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: .2px; }
.page-sub { margin: 6px 0 0; font-size: 12px; color: var(--ink-4); line-height: 1.6; }
.page-head { display: flex; flex-direction: column; }

/* ---------- 通用组件 ---------- */
.select {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: var(--ink);
  outline: none;
}

.btn {
  height: 34px;
  padding: 0 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1A52B8; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--blue); }
.btn-ghost:hover { border-color: #C7D8F5; }

.avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 12px;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 18px 20px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title { margin: 0; font-size: 15px; font-weight: 600; }
.card-note { font-size: 11px; color: var(--ink-4); }
.card-sub { margin: 2px 0 0; font-size: 11px; color: var(--ink-4); }

.tipbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--blue-bg);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--blue);
  line-height: 1.6;
}

.tipbar.warn { background: var(--warn-bg); color: var(--warn-ink); font-size: 12px; }

.tag {
  background: #fff;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--blue);
  white-space: nowrap;
}

/* KPI */
.kpi-grid { display: grid; gap: 16px; }
.kpi-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-5 { grid-template-columns: repeat(5, 1fr); }

.kpi {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 112px;
}

.kpi-label { font-size: 13px; color: var(--ink-3); }
.kpi-value { font-size: 28px; font-weight: 600; letter-spacing: .5px; }
.kpi-value small { font-size: 14px; font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.kpi-note { font-size: 11px; color: var(--ink-4); }
.accent { color: var(--blue); }

/* 表格 */
.table-card { background: #fff; border-radius: 10px; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th {
  background: #F4F6F9;
  color: var(--ink-3);
  font-weight: 500;
  text-align: left;
  padding: 12px 10px;
  white-space: nowrap;
}
thead th:first-child, tbody td:first-child { padding-left: 16px; }
thead th:last-child, tbody td:last-child { padding-right: 16px; }
tbody td { padding: 12px 10px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); vertical-align: middle; }
tbody tr:nth-child(even) { background: #FAFBFD; }
tbody tr:hover { background: #F7FAFF; }
.name { color: var(--ink); font-weight: 500; }
.mono { font-family: "JetBrains Mono", Consolas, "Courier New", monospace; letter-spacing: -.2px; }
.blue { color: var(--blue); }
.amber { color: var(--warn-ink); }
.muted { color: var(--ink-4); }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--ink-3);
  background: #fff;
  border-top: 1px solid var(--line-2);
  flex-wrap: wrap;
}

.pager-right { display: flex; align-items: center; gap: 8px; color: var(--blue); }
.page-dot {
  min-width: 24px;
  height: 24px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 12px;
  background: #fff;
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.page-dot.on { background: var(--blue); color: #fff; border-color: var(--blue); }

/* 筛选栏 */
.filter {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 10px;
  padding: 14px 18px;
  flex-wrap: wrap;
}

.field {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--bg);
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.field .arrow { color: var(--ink-4); font-size: 11px; }
.field.check { color: var(--blue); }

.search {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--bg);
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-4);
  flex: 1;
  min-width: 180px;
}

/* 双栏 */
.two-col { display: grid; grid-template-columns: 1fr 400px; gap: 16px; align-items: start; }
.two-col-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

/* 分布列表 */
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.dist-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-2);
  padding: 5px 0;
}
.dist-row span:first-child { color: var(--ink-3); font-family: "JetBrains Mono", Consolas, monospace; }

/* 进度条 */
.bar-line { margin-top: 4px; }
.bar-track { height: 6px; background: #EEF2F7; border-radius: 3px; overflow: hidden; }
.bar-fill { height: 6px; border-radius: 3px; background: var(--blue-2); }
.bar-title { font-size: 12px; color: var(--ink-2); display: flex; justify-content: space-between; }
.spacer { display: flex; flex-direction: column; gap: 10px; }

/* 标签切换 */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  padding: 10px 16px;
  border-radius: 6px;
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
}
.tab.on { background: var(--blue); color: #fff; font-weight: 500; }
.tab.add { color: var(--blue); }

/* 卡片内三行说明 */
.rule-list { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink-2); line-height: 1.7; }

/* 授权开关 */
.sw { position: relative; display: inline-block; width: 34px; height: 19px; vertical-align: middle; }
.sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.sw .knob { position: absolute; inset: 0; background: #C6CFDC; border-radius: 20px; transition: background .18s; }
.sw .knob::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 15px;
  height: 15px;
  background: #fff;
  border-radius: 50%;
  transition: transform .18s;
  box-shadow: 0 1px 2px rgba(23, 38, 60, .25);
}
.sw input:checked + .knob { background: var(--blue); }
.sw input:checked + .knob::after { transform: translateX(15px); }
.sw input:disabled { cursor: not-allowed; }
.sw input:disabled + .knob { opacity: .55; }

/* 图例 */
.legend { display: flex; flex-direction: column; gap: 10px; font-size: 12px; color: var(--ink-2); }
.legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; }

/* ---------- 登录页 ---------- */
.login-wrap { display: flex; min-height: 100vh; }
.login-brand {
  flex: 1.15;
  background: linear-gradient(150deg, #17263C 0%, #1C3A63 55%, #1F5FD0 130%);
  color: #fff;
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-brand::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -140px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(76, 141, 255, .18);
}
.login-brand h1 { font-size: 30px; line-height: 1.4; margin: 0 0 16px; font-weight: 600; }
.login-brand p { font-size: 14px; color: #C4D2E6; line-height: 1.9; margin: 0; max-width: 380px; }
.login-brand .kicker { font-size: 12px; letter-spacing: 3px; color: #7FA9E8; margin-bottom: 24px; }
.login-brand .foot { font-size: 12px; color: #7B8CA6; position: relative; z-index: 1; }
.login-panel {
  flex: 1;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 72px;
  gap: 20px;
}
.login-panel h2 { font-size: 22px; margin: 0; }
.login-panel .sub { font-size: 12px; color: var(--ink-4); margin: 0; }
.form-item { display: flex; flex-direction: column; gap: 8px; }
.form-item label { font-size: 13px; color: var(--ink-2); }
.input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
  width: 100%;
}
.input:focus { border-color: var(--blue-2); }
.captcha-row { display: flex; gap: 12px; }
.captcha {
  width: 108px;
  flex: 0 0 108px;
  height: 42px;
  border-radius: 6px;
  background: linear-gradient(105deg, #DCE9FF, #F3F8FF);
  display: grid;
  place-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 18px;
  letter-spacing: 4px;
  color: #1C3A63;
  font-weight: 600;
  user-select: none;
}
.login-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--ink-3); }
.btn-block { width: 100%; height: 44px; font-size: 15px; }
.qr-card {
  margin-top: 8px;
  border: 1px dashed #C7D8F5;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FAFCFF;
}
.qr-box {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--ink-4);
  text-align: center;
  line-height: 1.3;
  flex: 0 0 64px;
}
.qr-text { font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.qr-text strong { display: block; color: var(--ink); font-size: 13px; margin-bottom: 2px; }
.login-hint { font-size: 11px; color: var(--ink-4); line-height: 1.7; }

/* ---------- 手机端 ---------- */
.m-body { background: #EDF1F7; display: flex; justify-content: center; }
.phone {
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  background: #F4F6F9;
  display: flex;
  flex-direction: column;
  position: relative;
}
.m-status { height: 24px; }
.m-head {
  background: linear-gradient(140deg, #1F5FD0, #2F6BE0);
  color: #fff;
  padding: 14px 18px 22px;
}
.m-head .row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.m-head h1 { font-size: 18px; margin: 14px 0 4px; font-weight: 600; }
.m-head .sub { font-size: 12px; color: #CFE0FF; }
.m-content { padding: 12px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.m-card { background: #fff; border-radius: 10px; padding: 14px; }
.m-card-title { font-size: 13px; font-weight: 600; margin: 0 0 10px; }
.m-score { display: flex; align-items: flex-end; gap: 8px; }
.m-score b { font-size: 40px; line-height: 1; color: var(--blue); font-weight: 600; }
.m-score span { font-size: 13px; color: var(--ink-3); padding-bottom: 4px; }
.m-tag { display: inline-block; background: #E9F7F1; color: #17A673; border-radius: 4px; padding: 2px 8px; font-size: 11px; }
.m-line { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); padding: 8px 0; border-bottom: 1px solid #F0F3F7; }
.m-line:last-child { border-bottom: none; }
.m-tabbar {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 8px 0 10px;
}
.m-tab { text-align: center; font-size: 11px; color: var(--ink-4); }
.m-tab.on { color: var(--blue); font-weight: 500; }
.m-tab i { display: block; font-size: 16px; font-style: normal; margin-bottom: 2px; }

/* ---------- 提示浮层 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(23, 38, 60, .94);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: all .22s;
  z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .kpi-4 { grid-template-columns: repeat(2, 1fr); }
  .kpi-5 { grid-template-columns: repeat(3, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    z-index: 60;
    transition: left .22s;
    overflow-y: auto;
  }
  .sidebar.open { left: 0; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .content { padding: 16px; }
  .kpi-4, .kpi-5 { grid-template-columns: repeat(2, 1fr); }
  .two-col-even { grid-template-columns: 1fr; }
  .cols-2 { grid-template-columns: 1fr; gap: 0; }
  .login-wrap { flex-direction: column; }
  .login-brand { padding: 32px 24px; flex: none; }
  .login-brand h1 { font-size: 22px; }
  .login-brand .foot { display: none; }
  .login-panel { padding: 28px 24px 40px; }
  .page-title { font-size: 19px; }
}
