:root {
  --ink: #0b1220;
  --navy: #1a3d66;
  --deep: #071422;
  --mist: #eef0f3;
  --card: #ffffff;
  --line: rgba(11, 18, 32, 0.07);
  --terracotta: #c45c4a;
  --jade: #2f6b5a;
  --gold: #b8956a;
  --text: #12141a;
  --muted: #6e7380;
  --faint: #9aa0ab;
  --r: 20px;
  --font: -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "STSong", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--mist);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input, select, textarea { font-family: inherit; }

.topbar {
  background: var(--deep);
  color: #edf1f6;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup img { width: 36px; height: 36px; border-radius: 8px; display: block; }
.brand {
  font-family: var(--serif);
  letter-spacing: 0.2em;
  font-size: 20px;
}
.login-mark { width: 72px; height: 72px; border-radius: 16px; display: block; margin-bottom: 16px; }
.login-body { background: var(--mist); }
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr);
}
.login-aside {
  background: var(--deep);
  color: #edf1f6;
  padding: 72px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-aside img { width: 64px; height: 64px; border-radius: 16px; }
.login-kicker {
  margin: 28px 0 0;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: rgba(237, 241, 246, 0.48);
}
.login-aside h1 {
  margin: 10px 0 48px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 40px;
  letter-spacing: 0.22em;
}
.login-aside ol { list-style: none; margin: 0; padding: 0; }
.login-aside li {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
  letter-spacing: 0.08em;
  color: rgba(237, 241, 246, 0.84);
}
.login-aside li span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(237, 241, 246, 0.35);
  display: grid;
  place-items: center;
  font-size: 12px;
  flex: none;
}
.login-panel {
  width: min(440px, calc(100% - 48px));
  margin: auto;
  background: #fff;
  border-radius: 24px;
  padding: 36px 32px 28px;
}
.login-panel h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
#wx-qr {
  min-height: 0;
  margin: 8px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
#wx-qr:empty { margin: 0; }
#panel-wx.is-open h2 { display: none; }
#wx-qr iframe {
  display: block;
  width: 300px;
  height: 300px;
  border: 0;
  overflow: hidden;
}
#panel-wx.is-open #use-sms {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
#wx-qr img { width: 220px; height: 220px; }
.login-hint { text-align: center; min-height: 0; margin: 0; }
.login-hint:empty { display: none; }
#wx-lead[hidden] { display: none; }
.text-link {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px 0 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  letter-spacing: 0.06em;
  cursor: pointer;
  font-size: 13px;
}
.code-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.code-row input { width: 100%; }
.code-row .btn { height: 42px; white-space: nowrap; }
.sms-actions { margin-top: 18px; }
.sms-actions .btn { width: 100%; height: 44px; border-radius: 22px; }
@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-aside { padding: 40px 24px 28px; }
  .login-aside h1 { margin-bottom: 24px; font-size: 32px; }
  .login-aside ol { display: flex; gap: 16px; flex-wrap: wrap; }
  .login-aside li { margin: 0; }
  .login-panel { margin: 24px auto 40px; }
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(237, 241, 246, 0.42);
}
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a, .nav button {
  color: rgba(237, 241, 246, 0.72);
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
}
.nav a.is-on, .nav button.is-on { background: rgba(255,255,255,0.1); color: #fff; }
.who { font-size: 13px; color: rgba(237, 241, 246, 0.56); }
.account { position: relative; flex: none; }
.avatar {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.account-menu {
  position: absolute;
  right: 0;
  top: 46px;
  width: 188px;
  padding: 14px 16px 6px;
  background: #fff;
  color: var(--text);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(7, 20, 34, 0.16);
  z-index: 30;
}
.account-menu[hidden] { display: none; }
.account-name { font-size: 16px; letter-spacing: 0.08em; }
.account-role { margin: 4px 0 8px; color: var(--muted); font-size: 12px; letter-spacing: 0.06em; }
.account-menu button {
  width: 100%;
  margin: 0;
  padding: 12px 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 24px 80px; }
.page-title { font-size: 26px; letter-spacing: 0.08em; margin: 0 0 6px; }
.page-sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }

.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid > * { min-width: 0; }
@media (max-width: 860px) {
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
}

.toolbar { margin-bottom: 16px; }
.toolbar .search { flex: 1; min-width: 180px; max-width: 360px; }
.btn.file { margin: 0; cursor: pointer; }
.member-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}
.member-form { position: sticky; top: 16px; }
.member-list { margin: 0 -8px; }
.member-row {
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.member-row + .member-row { border-top: 1px solid var(--line); border-radius: 0; }
.member-row.is-on,
.member-row:hover { background: rgba(7, 20, 34, 0.04); border-radius: 12px; }
.member-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.member-name { font-size: 15px; letter-spacing: 0.04em; }
.member-role { color: var(--muted); font-size: 12px; }
.member-phone {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.member-unit {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.member-ids {
  margin-top: 2px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
}
#fopenid, #funionid { color: var(--muted); }
@media (max-width: 860px) {
  .member-board { grid-template-columns: 1fr; }
  .member-form { position: static; }
}

.card {
  background: var(--card);
  border-radius: var(--r);
  padding: 20px;
}
.card h3 { margin: 0 0 12px; font-size: 16px; }
.map-pick { position: relative; margin: 8px 0 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #eef0f3; }
.map-search { display: flex; gap: 8px; padding: 8px; background: #fff; border-bottom: 1px solid var(--line); }
.map-search input { flex: 1; margin: 0; }
.map-list { position: absolute; left: 8px; right: 8px; top: 56px; z-index: 1002; max-height: 220px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(11,18,32,.12); }
.map-list button { display: block; width: 100%; padding: 8px 12px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.map-list button:hover { background: var(--mist); }
.map-list b { display: block; font-size: 14px; }
.map-list span, .map-list p { font-size: 12px; color: var(--muted); }
.map-list p { margin: 10px 12px; }
.map-canvas { height: 320px; display: flex; align-items: center; justify-content: center; }
.map-canvas.ready { display: block; }
.muted { color: var(--muted); font-size: 13px; }
.stat b { display: block; font-size: 28px; letter-spacing: -0.03em; }
.stat span { color: var(--muted); font-size: 12px; letter-spacing: 0.08em; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 18px;
  background: var(--deep);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(11, 18, 32, 0.16);
}
.btn.warn { background: var(--terracotta); }
.btn.warn:hover { filter: brightness(0.95); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head .page-sub { margin-bottom: 0; }
.act-board { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.act-side { position: sticky; top: 16px; padding: 16px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.act-filter { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--mist); }
.act-filter button {
  flex: 1;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.act-filter button.is-on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(7, 20, 34, 0.08); }
.act-search { margin: 12px 0 8px; max-width: none; }
.act-list { overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.act-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 10px;
  margin: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.act-item + .act-item { margin-top: 2px; }
.act-item:hover { background: rgba(7, 20, 34, 0.04); }
.act-item.is-on { background: var(--deep); color: #fff; }
.act-item.is-on .act-meta, .act-item.is-on .act-date small { color: rgba(255, 255, 255, 0.62); }
.act-date {
  width: 44px;
  flex: none;
  text-align: center;
  line-height: 1.1;
  border-right: 1px solid var(--line);
  padding-right: 10px;
}
.act-item.is-on .act-date { border-right-color: rgba(255, 255, 255, 0.16); }
.act-date b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.act-date small { font-size: 11px; color: var(--faint); }
.act-body { flex: 1; min-width: 0; }
.act-title { display: block; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-meta { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-state { flex: none; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.act-state.open { background: rgba(47, 107, 90, 0.12); color: var(--jade); }
.act-state.upcoming { background: rgba(184, 149, 106, 0.16); color: #8a6d3e; }
.act-state.done { background: rgba(11, 18, 32, 0.06); color: var(--muted); }
.act-item.is-on .act-state { background: rgba(255, 255, 255, 0.14); color: #fff; }
.act-empty { padding: 24px 0; text-align: center; }

.act-main { padding: 24px 28px 28px; }
.act-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.act-head h3 { margin: 4px 0 0; font-size: 20px; letter-spacing: 0.04em; }
.act-kicker { font-size: 12px; color: var(--faint); letter-spacing: 0.08em; }
.act-tabs { display: flex; gap: 24px; margin: 20px 0 8px; border-bottom: 1px solid var(--line); }
.act-tabs button {
  padding: 10px 0;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}
.act-tabs button.is-on { color: var(--text); font-weight: 600; border-bottom-color: var(--deep); }
.act-pane { display: none; padding-top: 8px; }
.act-pane.is-on { display: block; }
.act-lock {
  margin: 8px 0 4px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(184, 149, 106, 0.12);
  color: #6b5533;
  font-size: 13px;
}
.check-row { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; color: var(--text); font-size: 14px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin: 0; }
.check-row small { display: block; margin-top: 2px; font-size: 12px; color: var(--faint); }
.act-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.pane-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pane-row h4, .act-pane h4 { margin: 12px 0 4px; font-size: 15px; }
.need-act { padding: 40px 0; text-align: center; }
.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding: 16px 18px;
  border: 1px solid rgba(196, 92, 74, 0.28);
  border-radius: 16px;
  background: rgba(196, 92, 74, 0.04);
}
.danger-zone b { font-size: 14px; color: var(--terracotta); }
.danger-zone p { margin: 4px 0 0; }
.danger-zone .btn { flex: none; }
@media (max-width: 860px) {
  .act-board { grid-template-columns: 1fr; }
  .act-side { position: static; max-height: none; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .danger-zone { flex-direction: column; align-items: flex-start; }
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }

label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 6px; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(11, 18, 32, 0.12);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
}
textarea { min-height: 220px; resize: vertical; line-height: 1.7; }
textarea.field-short { min-height: 72px; line-height: 1.55; }
.search { max-width: 280px; }

.chip {
  display: inline-block;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(196, 92, 74, 0.1);
  color: var(--terracotta);
}
.chip.jade { background: rgba(47, 107, 90, 0.1); color: var(--jade); }
.chip.gold { background: rgba(184, 149, 106, 0.16); color: #8a6d3e; }
.chip.off { background: rgba(196, 92, 74, 0.12); color: var(--terracotta); }

.toast {
  position: fixed;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  background: var(--deep);
  color: #fff;
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 13px;
  max-width: min(360px, calc(100% - 48px));
  text-align: center;
  display: none;
  z-index: 20;
}
.toast.show { display: block; }

.gate, .login-card {
  max-width: 420px;
  margin: 12vh auto;
}
.login-hero {
  background: var(--deep);
  color: #edf1f6;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.login-card { width: 100%; }
.hero-name {
  font-family: var(--serif);
  letter-spacing: 0.2em;
  font-size: 28px;
  margin: 8px 0 20px;
}

.hidden { display: none !important; }
.panel { display: none; }
.panel.is-on { display: block; }

.todo { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.todo.is-on { background: rgba(0,0,0,0.03); }
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.photo-grid figure { margin: 0; width: 140px; position: relative; }
.photo-grid img { width: 140px; height: 100px; object-fit: cover; border-radius: 10px; display: block; background: #eee; }
.photo-grid figure.is-cover img { box-shadow: inset 0 0 0 2px var(--deep); }
.cover-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--deep);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.act-cover { width: 48px; height: 36px; object-fit: cover; border-radius: 8px; flex: none; }
.photo-grid button, .file-row button { margin-top: 4px; }
.file-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.count { font-size: 12px; color: var(--faint); }
.error { color: var(--terracotta); font-size: 13px; }
.ok { color: var(--jade); }
.file-row { font-size: 12px; color: var(--muted); margin-top: 8px; }
.file-row textarea { width: 100%; }

.btn[hidden], .op-item[hidden] { display: none; }
.op-tabs { max-width: 420px; margin-bottom: 16px; }
.op-pane { display: none; }
.op-pane.is-on { display: block; }
.op-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  padding: 16px 20px;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.15s ease;
}
.op-item:hover { box-shadow: 0 4px 16px rgba(7, 20, 34, 0.08); }
.op-item-main { min-width: 0; }
.op-item-main b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-item-main .muted { display: block; margin-top: 4px; }
.op-item-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.op-back { display: inline-block; margin-bottom: 12px; color: var(--muted); font-size: 13px; text-decoration: none; }
.op-back:hover { color: var(--text); }
.op-card { padding: 24px 28px 28px; }
.op-card h3 { margin: 4px 0 12px; font-size: 20px; }
.op-card h4 { margin: 20px 0 4px; font-size: 15px; }
.op-body { margin: 12px 0; font-size: 14px; line-height: 1.9; white-space: pre-wrap; color: var(--text); }
.op-detail { margin: 0 0 12px; padding: 0 0 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.op-detail summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
.op-detail .op-body { max-height: 360px; overflow-y: auto; padding: 12px 16px; border-radius: 12px; background: var(--mist); }
.op-files a { margin-right: 8px; }
.warn-text { color: var(--terracotta); }
