/* ============================================================
   翡翠山别墅 · 投票覆盖地图 / 志愿者登记
   视觉语言：公告栏 · 档案卡（暖白纸底 + 深墨绿 + 等宽数字）
   ============================================================ */
:root {
  --paper: #f6f4ef;
  --card: #fffefb;
  --ink: #17251e;
  --ink2: #4c5b53;
  --dim: #8d9a93;
  --line: #e1e5dd;
  --line2: #cfd6cc;
  --green: #1c6b48;
  --green-mid: #3f8a63;
  --green-soft: #a8c9b6;
  --green-wash: #e8f1ea;
  --gray-fill: #e9ebe6;
  --amber: #a8722a;
  --red: #b3453a;
  --radius: 3px;
  --shadow: 0 1px 2px rgba(23, 37, 30, .05), 0 6px 18px rgba(23, 37, 30, .045);
  --font-cn: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
  --font-display: "KaiTi", "楷体", "STKaiti", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-cn);
  font-size: 15px;
  line-height: 1.6;
  padding-bottom: 56px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/><feColorMatrix type='saturate' values='0'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='0.03'/></svg>");
}

.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* ---------- 页头 ---------- */
.mast {
  background: linear-gradient(180deg, #fffefb 0%, #f6f4ef 100%);
  border-bottom: 3px double var(--line2);
  padding: 26px 0 20px;
  margin-bottom: 20px;
}
.brand {
  font-size: 11.5px; letter-spacing: .34em; font-weight: 700;
  color: var(--green); margin-bottom: 8px;
}
h1 {
  font-family: var(--font-display);
  font-size: 34px; line-height: 1.15; letter-spacing: .05em; font-weight: 700;
}
h1 em { font-style: normal; color: var(--green); }
.mast .sub { color: var(--ink2); font-size: 13.5px; margin-top: 8px; }

.topnav { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.topnav a {
  font-size: 13.5px; text-decoration: none; color: var(--ink2);
  border: 1px solid var(--line); background: var(--card);
  padding: 7px 14px; border-radius: 999px;
}
.topnav a.on { background: var(--green); color: #fff; border-color: var(--green); }

/* ---------- 进度 ---------- */
.prog { margin-top: 18px; }
.prog-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.prog-label { flex: 0 0 96px; font-size: 13px; color: var(--ink2); line-height: 1.25; }
.prog-label small { display: block; font-size: 10.5px; color: var(--dim); }
.bar {
  flex: 1; height: 12px; background: var(--gray-fill);
  border-radius: 999px; position: relative;
}
.bar > i { display: block; height: 100%; border-radius: 999px; transition: width .5s ease; }
.bar > i.g { background: var(--green); }
.bar > i.g2 { background: var(--green-soft); }
.bar > i.r { background: #cbcdc4; }
/* 2/3 门槛标记 */
.bar .thr {
  position: absolute; top: -5px; bottom: -5px; width: 0;
  border-left: 2px dashed var(--amber); pointer-events: none;
}
.bar .thr::before {
  content: ''; position: absolute; top: -6px; left: -4px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 6px solid var(--amber);
}
.prog-val { flex: 0 0 auto; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink2); }
.prog-note { font-size: 12.5px; color: var(--ink2); line-height: 1.75; margin-top: 10px; }
.prog-note b { color: var(--amber); font-weight: 700; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-bottom: 16px;
}
.card h2 {
  font-size: 16px; letter-spacing: .02em; margin-bottom: 12px;
  padding-bottom: 9px; border-bottom: 1px solid var(--line);
}

/* ---------- 期号切换 ---------- */
.tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 2px solid var(--line2); }
.tabs button {
  flex: 1; appearance: none; background: none; border: 0; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 700; color: var(--dim);
  padding: 11px 8px; border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tabs button.on { color: var(--green); border-bottom-color: var(--green); }
.tabs button span { display: block; font-size: 11.5px; font-weight: 400; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ---------- 地图 ---------- */
.phase-note { font-size: 13px; color: var(--dim); margin-bottom: 12px; }
.buildings { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }

.bld {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 9px 9px 10px;
}
.bld-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.bld-no { font-size: 15px; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; }
.bld-no small { font-size: 10.5px; font-weight: 400; color: var(--dim); margin-left: 1px; }
.bld-cnt { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }

.units { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 5px; }
.u {
  appearance: none; border: 1px solid transparent; border-radius: var(--radius);
  font-family: inherit; font-size: 14px; font-weight: 700;
  font-variant-numeric: tabular-nums; padding: 7px 2px; cursor: pointer;
  background: var(--gray-fill); color: #9aa39c;
  transition: transform .08s ease, filter .12s ease;
}
.u.hi { background: var(--green); color: #fff; }
.u.mid { background: var(--green-soft); color: #14392a; }
.u:active { transform: scale(.94); }
.u:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }

/* ---------- 图例 ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink2); margin-top: 4px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.sw { width: 15px; height: 15px; border-radius: 2px; border: 1px solid var(--line); }

/* ---------- 搜索 ---------- */
.search { display: flex; gap: 8px; }
.search input {
  flex: 1; font-family: inherit; font-size: 16px; padding: 12px 14px;
  border: 1px solid var(--line2); border-radius: var(--radius);
  background: #fff; color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-wash); }
.btn {
  appearance: none; border: 1px solid var(--green); background: var(--green); color: #fff;
  font-family: inherit; font-size: 15px; font-weight: 700;
  padding: 12px 18px; border-radius: var(--radius); cursor: pointer;
}
.btn.ghost { background: var(--card); color: var(--ink2); border-color: var(--line2); font-weight: 400; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- 结果 ---------- */
.result { margin-top: 12px; }
.line {
  border: 1px solid var(--line); border-left: 4px solid var(--green);
  border-radius: var(--radius); padding: 12px 14px; background: var(--card); margin-bottom: 9px;
}
.line.no { border-left-color: var(--line2); }
.line .t { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.line .t small { font-size: 12.5px; font-weight: 400; color: var(--dim); margin-left: 8px; }
.line .d { font-size: 13px; color: var(--ink2); margin-top: 5px; }
.tag {
  display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 999px;
  background: var(--green-wash); color: var(--green); margin-right: 6px; font-weight: 700;
}
.tag.gray { background: var(--gray-fill); color: var(--ink2); font-weight: 400; }
.tag.amber { background: #f7efe1; color: var(--amber); }

/* ---------- 流水 ---------- */
ul.log { list-style: none; }
ul.log li {
  display: flex; gap: 10px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px;
}
ul.log li:last-child { border-bottom: 0; }
ul.log .who { color: var(--dim); font-size: 12px; margin-left: auto; white-space: nowrap; }
ul.log .rm { font-weight: 800; font-variant-numeric: tabular-nums; }
ul.log .undo {
  appearance: none; border: 0; background: none; color: var(--red);
  font-family: inherit; font-size: 12px; cursor: pointer; padding: 2px 4px;
}

/* ---------- 状态提示 ---------- */
.msg { font-size: 13.5px; padding: 10px 12px; border-radius: var(--radius); margin-top: 10px; }
.msg.ok { background: var(--green-wash); color: var(--green); }
.msg.err { background: #fbeceb; color: var(--red); }
.msg.info { background: var(--gray-fill); color: var(--ink2); }

/* ---- 快速登记投票 ---- */
.card h2 span { font-size: 12.5px; color: var(--dim); font-weight: 400; margin-left: 8px; }
.qrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.qf { display: flex; flex-direction: column; gap: 6px; flex: 1 1 0; min-width: 104px; }
.qf > span { font-size: 12.5px; color: var(--dim); font-weight: 600; }
.qf select {
  padding: 10px 12px; width: 100%; cursor: pointer;
  border: 1px solid var(--line2); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
  font-family: inherit; font-size: 15px;
}
.qf select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-wash); }
.qrow .btn { flex: 0 0 auto; }
.qinfo { margin-top: 14px; font-size: 14px; line-height: 1.7; color: var(--ink2); min-height: 22px; }
.qinfo b { color: var(--green); }
.qrecent { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--dim); }
.qrecent span { color: var(--green); }

/* ---------- 快速登记：投票截图上传（非必须） ---------- */
.qimg { margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line); }
.qimg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qimg-add {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 13px; border: 1px solid var(--line2); border-radius: 8px;
  background: #fff; color: var(--green); font-size: 13.5px; font-weight: 600;
  transition: border-color .15s, background .15s;
}
.qimg-add:hover { border-color: var(--green); background: #f4f8f5; }
.qimg-tip { font-size: 12.5px; color: var(--dim); }
.qthumbs { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 10px; }
.qthumbs:empty { margin-top: 0; }
.qthumb { position: relative; width: 74px; height: 74px; border-radius: 9px; overflow: hidden;
          border: 1px solid var(--line2); background: #f2f4f0; }
.qthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 删除按钮做小一点但点得到（触屏 44px 是理想值，这里用伪元素把点击区放大） */
.qthumb .qx {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0; line-height: 18px;
  border: 0; border-radius: 50%; background: rgba(24,35,29,.66); color: #fff;
  font-size: 15px; cursor: pointer;
}
.qthumb .qx::after { content: ''; position: absolute; inset: -8px; }
.qthumb .qx:hover { background: #a4574c; }
.qimg .msg { margin-top: 10px; }
.qimg .msg .mini { margin-left: 8px; }

/* 隐私提示条：说明本页不显示业主姓名 */
.qnotice { margin-top: 10px; font-size: 12.5px; line-height: 1.6; color: var(--dim); background: #faf7ef; border: 1px solid #eadfc4; border-radius: 8px; padding: 8px 10px; }
.qnotice b { color: var(--ink); }
@media (max-width: 560px) {
  .qf { flex: 1 1 44%; }
  .qrow .btn { flex: 1 1 100%; margin-top: 4px; }
}
.empty { color: var(--dim); font-size: 13.5px; padding: 14px 0; text-align: center; }

/* ---------- 悬浮详情 ---------- */
#tip {
  position: fixed; z-index: 50; display: none; pointer-events: none;
  background: #17251e; color: #f4f6f3; font-size: 12.5px; line-height: 1.55;
  padding: 8px 11px; border-radius: var(--radius); max-width: 240px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
}
#tip b { color: #a8e0c0; }

/* ---------- 登录 ---------- */
.gate { max-width: 420px; margin: 6vh auto 0; }
.gate .lock { text-align: center; margin-bottom: 18px; }
.gate .lock .ic {
  width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 50%;
  background: var(--green-wash); display: flex; align-items: center; justify-content: center;
}
.gate .lock h2 { border: 0; padding: 0; font-family: var(--font-display); font-size: 25px; letter-spacing: .06em; }
.gate .lock p { color: var(--dim); font-size: 13px; margin-top: 6px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--ink2); margin-bottom: 5px; }
.field input {
  width: 100%; font-family: inherit; font-size: 16px; padding: 12px 14px;
  border: 1px solid var(--line2); border-radius: var(--radius);
  background: #fff; color: var(--ink); -webkit-appearance: none; appearance: none;
}
.field input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-wash); }
.remember { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink2); margin: 12px 0 16px; }
.remember input { width: 16px; height: 16px; }

.who-am-i { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink2); }
.who-am-i b { color: var(--ink); }

/* ---------- 页脚 ---------- */
footer {
  max-width: 880px; margin: 26px auto 0; padding: 16px;
  border-top: 3px double var(--line2);
  font-size: 12px; color: var(--dim); line-height: 1.75;
}
footer b { color: var(--amber); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media (max-width: 420px) {
  h1 { font-size: 29px; }
  .buildings { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); }
  .prog-label { flex-basis: 80px; font-size: 12.5px; }
}
