:root {
  --paper: #f2ece1;
  --paper-2: #f7f2e8;
  --card: #fffdf8;
  --ink: #223027;
  --ink-soft: #5e685d;
  --muted: #989b90;
  --line: #e7dfd1;
  --line-strong: #d8cdbb;
  --green: #244b37;
  --green-2: #35624a;
  --green-soft: #e2eadc;
  --orange: #e3683f;
  --orange-soft: #f7e0d3;
  --gold: #e3b85b;
  --gold-soft: #f4e8c9;
  --danger: #b8543d;
  --shadow: 0 16px 40px rgba(43, 49, 39, 0.06);
  --radius: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- login ---------- */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  background: var(--paper);
}

.login-brand {
  position: relative;
  overflow: hidden;
  padding: 52px 64px;
  background:
    radial-gradient(circle at 82% 18%, rgba(231, 185, 94, 0.22), transparent 24%),
    radial-gradient(circle at 15% 95%, rgba(122, 153, 121, 0.25), transparent 32%),
    linear-gradient(140deg, #315c45 0%, #224632 56%, #193628 100%);
  color: #faf6eb;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-brand::before {
  content: "";
  position: absolute;
  right: -160px;
  top: -160px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(249, 241, 220, 0.14);
  border-radius: 50%;
  box-shadow: 0 0 0 56px rgba(249, 241, 220, 0.035), 0 0 0 112px rgba(249, 241, 220, 0.022);
}
.login-brand::after {
  content: "邻";
  position: absolute;
  right: 56px;
  bottom: -64px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 300px;
  line-height: 1;
  color: rgba(249, 244, 232, 0.035);
  pointer-events: none;
}
.brand-line { position: relative; z-index: 2; display: flex; align-items: center; gap: 16px; }
.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  background: #f4e7c4;
  color: #224632;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Songti SC", "STSong", serif;
  font-size: 30px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}
.brand-mark.small { width: 38px; height: 38px; border-radius: 12px; font-size: 21px; }
.brand-name {
  font-family: "Songti SC", "STSong", serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 3px;
}
.brand-en {
  margin-top: 5px;
  font-family: "Avenir Next", sans-serif;
  font-size: 10px;
  letter-spacing: 2.5px;
  color: rgba(250, 246, 235, 0.58);
}
.login-copy { position: relative; z-index: 2; max-width: 620px; margin: 48px 0 40px; }
.eyebrow {
  margin: 0 0 22px;
  font-family: "Avenir Next", sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  color: rgba(250, 246, 235, 0.5);
}
.login-copy h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(36px, 4.2vw, 62px);
  line-height: 1.26;
  font-weight: 700;
  letter-spacing: 1px;
}
.login-copy h1 em {
  font-style: normal;
  color: #edc575;
}
.login-desc {
  margin: 24px 0 0;
  max-width: 470px;
  font-size: 15px;
  line-height: 1.9;
  color: rgba(250, 246, 235, 0.62);
}
.module-pills { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 9px; max-width: 580px; }
.module-pills span {
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid rgba(247, 236, 208, 0.2);
  background: rgba(248, 241, 224, 0.06);
  color: rgba(250, 246, 235, 0.7);
  font-size: 12px;
  letter-spacing: 0.5px;
}
.login-foot {
  position: relative;
  z-index: 2;
  margin-top: 36px;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(250, 246, 235, 0.38);
}
.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 56px;
  position: relative;
}
.login-box { width: 100%; max-width: 380px; }
.login-kicker {
  font-family: "Avenir Next", sans-serif;
  font-size: 10px;
  letter-spacing: 2.4px;
  color: #a38f6d;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.login-box h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 38px;
  letter-spacing: 1px;
}
.login-sub { margin: 10px 0 34px; color: var(--muted); font-size: 13px; }
.field-label {
  display: block;
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.5px;
}
.field {
  width: 100%;
  height: 48px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: #fffdf8;
  padding: 0 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.field:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(53, 98, 74, 0.1);
}
.form-error { min-height: 20px; margin-top: 10px; color: var(--danger); font-size: 12px; }
.login-btn {
  width: 100%;
  height: 50px;
  margin-top: 12px;
  border: 0;
  border-radius: 13px;
  background: var(--green);
  color: #fbf7ec;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  box-shadow: 0 14px 28px rgba(36, 75, 55, 0.2);
  transition: transform 0.18s ease, background 0.18s ease;
}
.login-btn:hover { background: var(--green-2); transform: translateY(-1px); }
.login-btn:disabled { opacity: 0.65; cursor: wait; transform: none; }
.login-hint { margin: 24px 0 0; color: #a6a195; font-size: 11px; line-height: 1.7; }
.login-hint code { background: #eee7da; padding: 2px 5px; border-radius: 4px; color: #7d6a4d; }
.login-legal { position: absolute; bottom: 26px; color: #aaa496; font-size: 10px; }

/* ---------- app shell ---------- */
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: 246px;
  flex: 0 0 246px;
  min-height: 100vh;
  background: #1f3a2c;
  color: #f5f0e2;
  padding: 28px 18px 22px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 30px; }
.side-name { font-family: "Songti SC", "STSong", serif; font-size: 22px; font-weight: 700; letter-spacing: 2px; }
.side-en { margin-top: 3px; font-family: "Avenir Next", sans-serif; font-size: 8px; letter-spacing: 1.8px; color: rgba(245, 240, 226, 0.4); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  color: rgba(245, 240, 226, 0.62);
  font-size: 13px;
  border: 1px solid transparent;
  text-align: left;
  background: transparent;
  transition: background 0.16s ease, color 0.16s ease;
}
.nav-item:hover { color: #f7f2e4; background: rgba(255, 255, 255, 0.05); }
.nav-item.active {
  color: #1f3a2c;
  background: #f2e6c8;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.nav-mark {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
}
.nav-item.active .nav-mark { background: rgba(31, 58, 44, 0.1); }
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--orange);
  color: #fff8ed;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-item.active .nav-badge { background: var(--orange); color: #fff; }
.side-bottom { margin-top: auto; padding: 22px 10px 0; border-top: 1px solid rgba(247, 242, 228, 0.09); }
.side-community { font-size: 12px; color: #e8d8ad; letter-spacing: 0.5px; }
.side-note { margin-top: 8px; font-size: 10px; line-height: 1.7; color: rgba(245, 240, 226, 0.35); }
.logout-btn {
  margin-top: 16px;
  width: 100%;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(247, 242, 228, 0.14);
  background: transparent;
  color: rgba(245, 240, 226, 0.6);
  font-size: 11px;
}
.logout-btn:hover { color: #f7f2e4; background: rgba(255, 255, 255, 0.05); }
.workspace { flex: 1; min-width: 0; }
.topbar {
  height: 82px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 242, 232, 0.86);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title {
  font-family: "Songti SC", "STSong", serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
}
.topbar-sub { margin-top: 4px; color: var(--muted); font-size: 11px; }
.topbar-right { display: flex; align-items: center; gap: 9px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #5f9d72; box-shadow: 0 0 0 4px rgba(95, 157, 114, 0.12); }
.live-text { font-size: 11px; color: #858c81; margin-right: 12px; }
.admin-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 5px 12px 5px 5px;
  font-size: 12px;
  color: var(--ink-soft);
}
.admin-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e8dfc8;
  color: #77603b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}
.view { padding: 30px 36px 56px; max-width: 1500px; margin: 0 auto; }
.loading { padding: 70px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- shared components ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; gap: 20px; }
.page-head h1 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 30px; letter-spacing: 1px; }
.page-head p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.btn {
  height: 36px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fffdf8;
  color: var(--ink-soft);
  font-size: 12px;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.btn:hover { background: #f6f0e4; }
.btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fbf7ec;
  box-shadow: 0 8px 18px rgba(36, 75, 55, 0.14);
}
.btn.primary:hover { background: var(--green-2); }
.btn.orange { background: var(--orange); border-color: var(--orange); color: #fff8ed; }
.btn.small { height: 28px; padding: 0 10px; font-size: 11px; border-radius: 8px; }
.btn.danger { color: var(--danger); border-color: #e7c9c0; background: #fff9f5; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f0e9dd;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.card-sub { margin-top: 3px; font-size: 11px; color: var(--muted); font-weight: 400; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.2;
  color: var(--ink-soft);
  background: #f0e9dd;
  white-space: nowrap;
}
.chip.green { color: #4d7357; background: var(--green-soft); }
.chip.orange { color: #a85a39; background: var(--orange-soft); }
.chip.gold { color: #8e6c30; background: var(--gold-soft); }
.chip.red { color: #a94f3b; background: #f6dfd8; }
.chip.gray { color: #8d8a80; background: #efebe2; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-right: 5px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th {
  text-align: left;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.6px;
  color: #9a968a;
  padding: 11px 14px;
  border-bottom: 1px solid #ede6d9;
  background: #fbf7ef;
  white-space: nowrap;
}
tbody td { padding: 13px 14px; border-bottom: 1px solid #f1ebdf; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fdfaf3; }
.cell-title { font-weight: 600; color: var(--ink); max-width: 280px; }
.cell-sub { margin-top: 3px; color: var(--muted); font-size: 10px; }
.thumb { width: 46px; height: 38px; border-radius: 9px; object-fit: cover; background: #eee7da; }
.thumb-placeholder { width: 46px; height: 38px; border-radius: 9px; background: #eee7da; display: flex; align-items: center; justify-content: center; color: #b1aa9c; font-size: 10px; }
.row-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.inline-select {
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fffdf8;
  color: var(--ink-soft);
  font-size: 11px;
  padding: 0 8px;
  outline: none;
}
.empty-row { padding: 48px 0; text-align: center; color: var(--muted); font-size: 12px; }
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .field { height: 38px; width: 240px; font-size: 12px; border-radius: 10px; }
.segmented { display: flex; gap: 3px; background: #eae2d4; border-radius: 10px; padding: 3px; }
.segmented button {
  border: 0;
  background: transparent;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  color: #8b887c;
  font-size: 11px;
}
.segmented button.active { background: #fffdf8; color: var(--ink); font-weight: 600; box-shadow: 0 3px 9px rgba(45, 47, 39, 0.07); }
.muted { color: var(--muted); }
.mono { font-family: "SF Mono", Menlo, monospace; font-size: 10px; color: #8b887c; }
.num { font-family: "Avenir Next", "DIN Alternate", sans-serif; letter-spacing: -0.3px; }
.divider { height: 1px; background: var(--line); }

/* ---------- dashboard ---------- */
.welcome-strip {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 28px 30px;
  background: linear-gradient(120deg, #2b543f, #386b50);
  color: #faf6eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  box-shadow: 0 18px 36px rgba(36, 75, 55, 0.2);
}
.welcome-strip::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -60px;
  top: -120px;
  border-radius: 50%;
  border: 1px solid rgba(248, 240, 218, 0.18);
  box-shadow: 0 0 0 36px rgba(248, 240, 218, 0.045), 0 0 0 72px rgba(248, 240, 218, 0.025);
}
.welcome-strip h2 { margin: 0; font-family: "Songti SC", "STSong", serif; font-size: 26px; font-weight: 700; letter-spacing: 1px; }
.welcome-strip p { margin: 9px 0 0; font-size: 12px; color: rgba(250, 246, 235, 0.62); }
.welcome-tag {
  position: relative;
  z-index: 2;
  padding: 9px 14px;
  border-radius: 99px;
  border: 1px solid rgba(248, 240, 218, 0.22);
  background: rgba(248, 240, 218, 0.07);
  font-size: 11px;
  color: rgba(250, 246, 235, 0.72);
  white-space: nowrap;
}
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
  position: relative;
  padding: 20px 20px 18px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -18px;
  top: -28px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(227, 184, 91, 0.1);
}
.stat-label { font-size: 11px; color: var(--muted); }
.stat-value { margin-top: 12px; font-family: "Avenir Next", "DIN Alternate", sans-serif; font-size: 31px; font-weight: 600; letter-spacing: -0.5px; line-height: 1; }
.stat-value small { font-family: -apple-system, "PingFang SC", sans-serif; font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 3px; }
.stat-meta { margin-top: 10px; font-size: 10px; color: #a19d91; display: flex; align-items: center; gap: 5px; }
.stat-meta .up { color: #5d8e69; }
.stat-card.alert { background: #fff8ed; border-color: #ead6b8; }
.stat-card.alert .stat-value { color: #b16036; }
.dash-grid { display: grid; grid-template-columns: 1.42fr 1fr; gap: 20px; }
.dash-stack { display: flex; flex-direction: column; gap: 20px; }
.chart-card { padding: 20px 22px 16px; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; }
.chart-title { font-size: 13px; font-weight: 600; }
.chart-legend { font-size: 10px; color: var(--muted); }
.chart { display: flex; align-items: flex-end; gap: 14px; height: 140px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%;
  max-width: 34px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #4e7c60, #2b543f);
  min-height: 4px;
  transition: height 0.4s ease;
}
.bar.soft { background: #e8dfc9; }
.bar-label { font-family: "Avenir Next", sans-serif; font-size: 9px; color: #a29d91; white-space: nowrap; }
.bar-value { font-family: "Avenir Next", sans-serif; font-size: 10px; color: #7f867b; }
.pending-list { padding: 4px 20px 10px; }
.pending-item { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px dashed #eee6d8; }
.pending-item:last-child { border-bottom: none; }
.pending-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--gold-soft); color: #8f6c2e; display: flex; align-items: center; justify-content: center; font-size: 12px; flex: 0 0 auto; }
.pending-main { flex: 1; min-width: 0; }
.pending-title { font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending-sub { margin-top: 3px; font-size: 10px; color: var(--muted); }
.pending-count { font-family: "Avenir Next", sans-serif; font-size: 16px; color: #b16036; }
.module-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 16px 18px 18px; }
.module-card { border-radius: 12px; padding: 12px 10px; background: #f7f2e8; border: 1px solid #ede5d7; }
.module-name { font-size: 11px; color: var(--ink-soft); }
.module-status { margin-top: 7px; display: flex; align-items: center; gap: 5px; font-size: 10px; color: #5f8b6a; }
.module-status.off { color: #a49f92; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.recent-orders { margin-top: 0; }

/* ---------- settings ---------- */
.settings-layout { display: grid; grid-template-columns: 1.45fr 0.75fr; gap: 20px; align-items: start; }
.form-card { padding: 22px; }
.form-section + .form-section { margin-top: 22px; padding-top: 22px; border-top: 1px solid #f0e9dd; }
.form-section-title { font-family: "Songti SC", "STSong", serif; font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.form-section-sub { font-size: 11px; color: var(--muted); margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-group { min-width: 0; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: block; font-size: 11px; font-weight: 600; color: var(--ink-soft); margin-bottom: 7px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fffdf8;
  padding: 0 12px;
  color: var(--ink);
  outline: none;
  font-size: 12px;
}
.form-group textarea { height: 74px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(53, 98, 74, 0.09); }
.form-group .hint { margin-top: 5px; font-size: 10px; color: #a6a195; line-height: 1.5; }
.toggle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 11px;
  background: #f8f3e9;
  border: 1px solid #eee6d8;
  font-size: 11px;
  color: var(--ink-soft);
}
.switch { position: relative; width: 34px; height: 20px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 2; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #d8cfbf; transition: background 0.18s ease; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fffdf8; box-shadow: 0 1px 3px rgba(0,0,0,0.16); transition: transform 0.18s ease; }
.switch input:checked + span { background: var(--green-2); }
.switch input:checked + span::after { transform: translateX(14px); }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.save-note { margin-right: auto; font-size: 10px; color: var(--muted); }
.side-card { padding: 20px; }
.side-card + .side-card { margin-top: 20px; }
.side-card h3 { margin: 0 0 4px; font-family: "Songti SC", "STSong", serif; font-size: 17px; }
.side-card p { margin: 0 0 14px; font-size: 11px; color: var(--muted); line-height: 1.6; }
.rule-list { display: flex; flex-direction: column; gap: 10px; }
.rule-item { display: flex; gap: 9px; font-size: 11px; color: var(--ink-soft); line-height: 1.6; }
.rule-item .rule-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 5px; background: var(--gold); flex: 0 0 auto; }
.rule-item b { font-weight: 600; }
.pw-grid { display: flex; flex-direction: column; gap: 10px; }
.pw-grid .field { height: 38px; font-size: 12px; }

/* ---------- notices ---------- */
.notice-list { padding: 6px 20px 10px; }
.notice-item { display: flex; gap: 13px; padding: 15px 0; border-bottom: 1px dashed #eee6d8; align-items: flex-start; }
.notice-item:last-child { border-bottom: none; }
.notice-mark { width: 34px; height: 34px; border-radius: 10px; background: #f2e7cc; color: #91712f; display: flex; align-items: center; justify-content: center; font-size: 12px; flex: 0 0 auto; }
.notice-main { flex: 1; min-width: 0; }
.notice-title { font-size: 12px; font-weight: 600; color: var(--ink); }
.notice-body { margin-top: 4px; font-size: 11px; line-height: 1.6; color: var(--muted); }
.notice-meta { margin-top: 6px; font-size: 10px; color: #aaa496; }
.notice-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.add-notice {
  margin: 4px 20px 20px;
  padding: 16px;
  border-radius: 14px;
  background: #f8f3e9;
  border: 1px dashed #d8ccb8;
  display: grid;
  gap: 10px;
}
.add-notice .field, .add-notice textarea { background: #fffdf8; }
.add-notice textarea { min-height: 60px; height: 60px; }
.add-notice-foot { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- finance ---------- */
.finance-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.finance-summary .stat-card { padding: 18px 20px; }

/* ---------- toast / modal ---------- */
.toast {
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  background: #1f3a2c;
  color: #fbf7ec;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 12px;
  box-shadow: 0 14px 30px rgba(20, 34, 25, 0.28);
}
.toast.error { background: #8f4337; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 44vh; padding: 36px; }
  .login-copy { margin: 30px 0; }
  .login-copy h1 { font-size: 38px; }
  .login-panel { padding: 40px 28px 60px; }
  .sidebar { width: 76px; flex-basis: 76px; padding: 20px 10px; }
  .side-brand { padding: 0 0 20px; justify-content: center; }
  .side-brand-copy, .side-bottom, .nav-item span:not(.nav-mark), .nav-badge { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .nav-mark { width: 34px; height: 34px; flex-basis: 34px; font-size: 14px; }
  .topbar { padding: 0 20px; height: 72px; }
  .view { padding: 22px 20px 46px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .toggle-grid { grid-template-columns: 1fr; }
  .finance-summary { grid-template-columns: 1fr; }
  .welcome-strip { padding: 22px; }
  .welcome-tag { display: none; }
}
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-shell { grid-template-columns: 1fr; background: var(--paper); }
  .login-panel { min-height: 100vh; }
  .module-grid { grid-template-columns: 1fr 1fr; }
  .topbar-right .live-text, .topbar-right .live-dot { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .head-actions { width: 100%; }
  .filter-bar .field { width: 100%; }
}

/* ---------- 3km service circle ---------- */
.topbar-left { min-width: 0; }
.community-line { display: flex; align-items: center; gap: 10px; }
.community-select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: "Songti SC", "STSong", serif;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 0 22px 0 0;
  cursor: pointer;
  outline: none;
  background-image: linear-gradient(45deg, transparent 50%, #7b8277 50%), linear-gradient(135deg, #7b8277 50%, transparent 50%);
  background-position: calc(100% - 8px) 12px, calc(100% - 3px) 12px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  max-width: 280px;
}
.community-select option { font-family: -apple-system, "PingFang SC", sans-serif; font-size: 13px; color: #223027; }
.radius-chip {
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--gold-soft);
  color: #8b6a2e;
  font-size: 10px;
  white-space: nowrap;
}
.network-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 15px;
  align-items: center;
}
.network-strip-label { font-size: 10px; color: var(--muted); letter-spacing: 0.5px; margin-right: 2px; }
.network-pill {
  border: 1px solid #d8cdb8;
  background: #fbf6ea;
  color: #6b6f63;
  border-radius: 99px;
  padding: 5px 10px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.network-pill.current { border-color: #b8ccb4; background: #e8efe2; color: #42634a; font-weight: 600; }
.network-pill .pill-dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.network-summary { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.network-summary strong { font-family: "Avenir Next", sans-serif; font-size: 18px; color: #42503f; }
.network-summary span { font-size: 10px; color: var(--muted); }
.community-list { display: flex; flex-direction: column; gap: 0; padding: 4px 20px 8px; }
.community-row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px dashed #eee6d8; }
.community-row:last-child { border-bottom: none; }
.community-avatar {
  width: 42px; height: 42px; border-radius: 13px; flex: 0 0 auto;
  background: #e7dfc9; color: #80673b; display: flex; align-items: center; justify-content: center;
  font-family: "Songti SC", "STSong", serif; font-size: 17px; font-weight: 700;
}
.community-main { flex: 1; min-width: 0; }
.community-name-line { display: flex; align-items: center; gap: 8px; }
.community-name { font-family: "Songti SC", "STSong", serif; font-size: 16px; font-weight: 700; }
.community-meta { margin-top: 4px; font-size: 10px; color: var(--muted); }
.community-stats { display: flex; gap: 14px; flex: 0 0 auto; }
.community-stat { text-align: right; }
.community-stat b { display: block; font-family: "Avenir Next", sans-serif; font-size: 15px; color: #465345; }
.community-stat span { font-size: 9px; color: var(--muted); }
.community-action { flex: 0 0 auto; }
.community-form-grid { display: grid; grid-template-columns: 1.2fr 1.5fr 0.7fr 0.7fr; gap: 10px; align-items: end; }
.community-form-grid .form-group label { margin-bottom: 5px; }
.community-form-grid .field, .community-form-grid input { height: 38px; font-size: 12px; }
.community-form-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.community-form-foot .hint { font-size: 10px; color: var(--muted); }
.trial-banner {
  border-radius: 14px; background: #f3e8cf; border: 1px solid #e8d7b4;
  padding: 12px 14px; font-size: 11px; color: #826b42; line-height: 1.6;
}
@media (max-width: 900px) {
  .community-stats { display: none; }
  .community-form-grid { grid-template-columns: 1fr 1fr; }
  .community-select { font-size: 19px; max-width: 180px; }
}
@media (max-width: 560px) {
  .community-form-grid { grid-template-columns: 1fr; }
  .radius-chip { display: none; }
}

.notice-main { position: relative; }
.notice-thumb { width: 100%; max-width: 340px; height: 120px; object-fit: cover; border-radius: 10px; margin-bottom: 8px; display: block; }
.upload-label { font-size: 11px; color: var(--ink-soft); }
.upload-field { height: 38px; padding: 8px; font-size: 11px; background: #fffdf8; }
.notice-preview img { width: 100%; max-width: 340px; height: 120px; object-fit: cover; border-radius: 10px; margin-top: 8px; display: block; }

/* ---------- map picker ---------- */
.map-pick-btn { width: 100%; height: 38px; font-size: 12px; }
.coord-line { margin-top: 8px; font-size: 10px; color: var(--muted); }
.map-modal { position: fixed; inset: 0; z-index: 1200; background: rgba(20, 28, 22, 0.5); display: flex; align-items: center; justify-content: center; padding: 24px; }
.map-dialog { width: min(820px, 100%); max-height: calc(100vh - 40px); background: #fffdf8; border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.28); overflow-y: auto; }
.map-dialog-head { padding: 18px 20px 14px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid #eee6d8; }
.map-title { font-family: "Songti SC", serif; font-size: 21px; font-weight: 700; }
.map-sub { margin-top: 5px; font-size: 11px; color: var(--muted); }
.map-close { border: 0; background: #f0e9dd; color: #6d746a; width: 30px; height: 30px; border-radius: 9px; font-size: 20px; line-height: 1; }
.community-map { height: 380px; width: 100%; background: #e8eadf; }
.map-picked { padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: #7c7f73; background: #fbf7ef; }
.map-actions { padding: 14px 20px 18px; display: flex; justify-content: flex-end; gap: 10px; }
.leaflet-container { font-family: -apple-system, "PingFang SC", sans-serif; }
.map-head-actions { display: flex; align-items: center; gap: 8px; }
.map-locate { border: 1px solid #d8cdbb; background: #fbf6ea; color: #5d6b5a; height: 32px; padding: 0 11px; border-radius: 9px; font-size: 11px; white-space: nowrap; }
.map-locate:hover { background: #f1e9d9; }

/* ---------- merged community tabs ---------- */
.sub-tabs { display: inline-flex; gap: 6px; padding: 5px; margin: 4px 0 18px; border-radius: 12px; background: #ece4d7; }
.sub-tab { border: 0; background: transparent; color: #7c7f73; font-size: 12px; padding: 8px 14px; border-radius: 9px; }
.sub-tab.active { background: #fffdf8; color: #2b543f; font-weight: 600; box-shadow: 0 2px 8px rgba(45,50,40,.08); }

/* ---------- map search ---------- */
.map-search-wrap { position: relative; z-index: 5; padding: 10px 20px; background: #fbf7ef; border-bottom: 1px solid #eee6d8; }
.map-search-bar { display: flex; gap: 8px; }
.map-search-bar input { flex: 1; height: 36px; border: 1px solid #ddd2c1; border-radius: 9px; background: #fffdf8; padding: 0 12px; font-size: 12px; color: #303b32; outline: none; }
.map-search-bar input:focus { border-color: #2b543f; box-shadow: 0 0 0 3px rgba(43,84,63,.08); }
.map-search-bar button { height: 36px; padding: 0 18px; border: 0; border-radius: 9px; background: #2b543f; color: #fffdf8; font-size: 12px; }
.map-search-results { position: static; margin-top: 8px; max-height: 210px; overflow-y: auto; border-radius: 10px; background: #fffdf8; border: 1px solid #ddd2c1; box-shadow: 0 10px 24px rgba(40,47,38,.1); }
.map-search-results:empty { display: none; }
.map-result { width: 100%; border: 0; border-bottom: 1px solid #f1eade; background: transparent; text-align: left; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.map-result:last-child { border-bottom: 0; }
.map-result:hover { background: #f3f6ef; }
.map-result b { font-size: 12px; color: #303b32; }
.map-result span { font-size: 10px; color: #9a9b91; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-search-tip { padding: 10px 12px; font-size: 11px; color: #9a9b91; }
.community-actions { display: flex; gap: 6px; flex: 0 0 auto; align-items: center; }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; border: 1px solid #e7dfd1; background: #ece3cf; }
.user-avatar-fallback { display: flex; align-items: center; justify-content: center; font-family: "Songti SC", serif; font-size: 14px; font-weight: 700; color: #7a653e; }
.role-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.user-modal { position: fixed; inset: 0; z-index: 1300; background: rgba(20,28,22,.5); display: flex; align-items: center; justify-content: center; padding: 24px; }
.user-dialog { width: min(620px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; background: #fffdf8; border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.user-dialog-head { padding: 18px 20px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid #eee6d8; }
.user-dialog-title { font-family: "Songti SC", serif; font-size: 20px; font-weight: 700; }
.user-dialog-sub { margin-top: 4px; font-size: 10px; color: var(--muted); font-family: monospace; }
.user-avatar.large { width: 46px; height: 46px; }
.user-dialog-body { padding: 6px 20px 4px; }
.user-roles-block { margin-top: 18px; padding: 14px; border-radius: 12px; background: #faf5ea; border: 1px solid #eee3d1; }
.form-group-label { font-size: 11px; font-weight: 600; color: #4b554b; margin-bottom: 9px; }
.role-check-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.role-check { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #5d665c; background: #fffdf8; border: 1px solid #e7dfd1; border-radius: 8px; padding: 7px 8px; }
.role-check input { accent-color: #2b543f; }
.user-dialog-actions { padding: 16px 20px 20px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid #eee6d8; }
