/* 主界面样式：地图 + 分类 + 点位，暖纸 / 深绿 / 朱砂。 */

.proto {
  position: fixed;
  inset: 0;
  overflow: hidden;
  color: #18231f;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --paper: #f7f6f0;
  --paper-strong: #fffefa;
  --ink: #18231f;
  --muted: #68716c;
  --line: #d9ddd7;
  --forest: #28584b;
  --forest-soft: #e4eee9;
  --cinnabar: #c74b38;
  --gold: #c58b2e;
  --aqua: #197d84;
  --shadow: 0 18px 48px rgba(29, 44, 37, 0.16);
  --switcher-space: 14px;
  --radius: 8px;
}

.proto * { box-sizing: border-box; }
.proto button,
.proto input,
.proto select,
.proto textarea { font: inherit; color: inherit; }
.proto button { cursor: pointer; }
.proto .map {
  position: absolute;
  inset: 0;
  z-index: 0; /* 建立独立层叠上下文，避免 Leaflet pane 自带的 z-index 盖住界面外壳 */
  background: #dce7e0;
}
.proto .leaflet-container { background: #dce7e0; font: inherit; }

.proto .brand {
  font-family: "STSong", "SimSun", "STKaiti", serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
}
.proto .brand span {
  font-family: system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 0;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 99px;
  background: var(--cinnabar);
  color: #fff;
  vertical-align: middle;
}

.proto .search {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-strong);
  outline: none;
}
.proto .search:focus { border-color: var(--forest); box-shadow: 0 0 0 3px var(--forest-soft); }

.proto .add {
  height: 40px;
  padding: 0 14px;
  border: none;
  border-radius: 6px;
  background: var(--forest);
  color: #fff;
  white-space: nowrap;
}
.proto .add:hover { background: #1f4a3e; }

.proto .chip {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 254, 250, 0.94);
  white-space: nowrap;
}
.proto .chip::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--chip);
}
.proto .chip.active {
  border-color: var(--chip);
  background: var(--chip);
  color: #fff;
}
.proto .chip.active::before { background: #fff; }

.proto .photos { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.proto .photos.wide .photo { width: 116px; height: 84px; }
.proto .photos.empty {
  display: grid; place-items: center;
  height: 72px; border: 1px dashed var(--line); border-radius: 6px;
  color: var(--muted); font-size: 12px;
}
.proto .photo {
  position: relative;
  flex: 0 0 auto;
  width: 92px; height: 68px;
  border-radius: 6px;
  background: linear-gradient(135deg, hsl(var(--hue) 55% 72%), hsl(calc(var(--hue) + 42) 46% 50%));
}
.proto .photo span {
  position: absolute; left: 5px; bottom: 4px;
  font-size: 10px; color: rgba(255, 255, 255, 0.92);
}

/* 真实帖子图片：有照片时替换占位渐变块 */
.proto .photos.real { gap: 4px; }
.proto .photos.real .photo { width: 116px; height: 84px; overflow: hidden; background: var(--paper); }
.proto .photos.real img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proto .photos.real .photo em {
  position: absolute; right: 4px; bottom: 4px;
  font-style: normal; font-size: 10px; padding: 1px 5px;
  border-radius: 99px; background: rgba(24, 35, 31, 0.62); color: #fff;
}

/* 同一地点的帖子 */
.proto .place-posts { display: grid; gap: 6px; margin-top: 12px; }
.proto .place-posts h3 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--muted); }
.proto .place-posts .post-line {
  display: grid; gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper);
  color: inherit; text-decoration: none;
}
.proto .place-posts .post-line:hover { border-color: var(--forest); }
.proto .place-posts .post-line strong { font-size: 13px; }
.proto .place-posts .post-line small { font-size: 11px; color: var(--muted); }
.proto .place-posts .post-more { font-size: 12px; color: var(--forest); text-decoration: none; }
.proto .place-posts .muted { margin: 0; font-size: 12px; color: var(--muted); }
.proto .card-actions .action-link {
  display: inline-flex; align-items: center;
  height: 30px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--paper-strong); color: var(--forest);
  font-size: 12px; text-decoration: none;
}
.proto .card-actions .action-link:hover { border-color: var(--forest); background: var(--forest-soft); }

/* 落点表单里的行政区一栏 */
.proto .drop-area { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }

.proto .card-head { display: flex; align-items: center; gap: 8px; padding-right: 30px; font-size: 12px; color: var(--muted); }
.proto .card-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-strong);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}
.proto .card-close:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.proto .card-head .cat {
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--chip);
  color: #fff;
}
.proto .card-head .grade { color: var(--c, var(--gold)); font-weight: 600; }

.proto .grade-legend {
  position: absolute;
  z-index: 620;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 254, 250, 0.96);
  box-shadow: 0 8px 20px rgba(31, 47, 39, 0.12);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.proto .grade-legend > span { opacity: 0.8; }
.proto .grade-legend b { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink); }
.proto .grade-legend b::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.proto .grade-legend i { font-style: normal; opacity: 0.72; }

.proto-a .grade-legend { left: 14px; bottom: calc(var(--switcher-space) + 14px); }
.proto-b .grade-legend { left: 372px; bottom: calc(var(--switcher-space) + 14px); }
.proto-c .grade-legend { left: 14px; top: 84px; }
.proto .card-head .who { margin-left: auto; }
.proto h2 { margin: 8px 0 2px; font-size: 19px; }
.proto .addr { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.proto .note { margin: 10px 0 0; font-size: 13px; line-height: 1.6; }
.proto .card-actions { display: flex; gap: 8px; margin-top: 12px; }
.proto .card-actions button {
  flex: 1;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-strong);
}
.proto .card-actions button:hover { border-color: var(--forest); }
.proto .card-actions .danger { color: var(--cinnabar); border-color: rgba(199, 75, 56, 0.35); }

.proto .drop-head { display: flex; align-items: center; justify-content: space-between; }
.proto .drop-head button { border: none; background: none; color: var(--muted); }
.proto .coords { margin: 6px 0; font-size: 12px; color: var(--aqua); }
.proto .drop-head + .coords { margin-top: 4px; }
.proto .a-drop input,
.proto .a-drop select,
.proto .a-drop textarea,
.proto .b-drop input,
.proto .b-drop select,
.proto .b-drop textarea,
.proto .c-drop input,
.proto .c-drop select,
.proto .c-drop textarea {
  width: 100%;
  margin-bottom: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-strong);
  outline: none;
}
.proto .a-drop textarea,
.proto .b-drop textarea,
.proto .c-drop textarea { resize: vertical; }
.proto .drop-actions { display: flex; justify-content: flex-end; }
.proto .drop-actions .primary {
  height: 36px; padding: 0 18px;
  border: none; border-radius: 6px;
  background: var(--cinnabar); color: #fff;
}
.proto .drop-actions .primary:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---- A 底图优先 ---- */
.proto-a .a-top {
  position: absolute;
  z-index: 600;
  top: 14px; left: 14px; right: 14px;
  display: grid;
  grid-template-columns: auto minmax(200px, 520px) auto;
  align-items: center;
  gap: 14px;
  padding: 8px 10px;
  border: 1px solid rgba(39, 66, 54, 0.14);
  border-top: 2px solid rgba(199, 75, 56, 0.85);
  border-radius: var(--radius);
  background: rgba(250, 249, 244, 0.96);
  box-shadow: 0 10px 30px rgba(31, 47, 39, 0.14);
  backdrop-filter: blur(18px);
}
.proto-a .a-chips {
  position: absolute;
  z-index: 550;
  top: 76px; left: 14px; right: 14px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.proto-a .a-meta {
  position: absolute;
  z-index: 550;
  top: 122px; left: 20px;
  font-size: 12px;
  color: var(--muted);
}
.proto-a .a-card,
.proto-a .a-drop {
  position: absolute;
  z-index: 700;
  left: 50%;
  bottom: calc(var(--switcher-space) + 14px);
  transform: translateX(-50%);
  width: min(420px, calc(100% - 28px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 254, 250, 0.98);
  box-shadow: var(--shadow);
  max-height: min(52vh, 480px);
  overflow: auto;
}

/* ---- B 左栏目录 ---- */
.proto-b { display: grid; grid-template-columns: 356px 1fr; }
.proto-b .b-rail {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.proto-b .b-head { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; }
.proto-b .b-head .brand { grid-column: 1; }
.proto-b .b-head .search { grid-column: 1 / -1; }
.proto-b .b-head .add { grid-column: 1 / -1; }
.proto-b .b-cats { display: flex; flex-direction: column; gap: 2px; }
.proto-b .rail-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: none;
  text-align: left;
}
.proto-b .rail-item i { width: 8px; height: 8px; border-radius: 50%; background: var(--chip); }
.proto-b .rail-item em { font-style: normal; font-size: 12px; color: var(--muted); }
.proto-b .rail-item.active { background: var(--forest-soft); color: var(--forest); font-weight: 600; }
.proto-b .b-list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.proto-b .list-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  text-align: left;
}
.proto-b .list-row:hover { background: var(--paper-strong); border-color: var(--line); }
.proto-b .list-row.active { border-color: var(--forest); background: var(--paper-strong); }
.proto-b .thumb {
  width: 44px; height: 36px; border-radius: 6px;
  background: linear-gradient(135deg, hsl(var(--hue) 55% 72%), hsl(calc(var(--hue) + 42) 46% 50%));
}
.proto-b .row-text { display: flex; flex-direction: column; min-width: 0; }
.proto-b .row-text strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proto-b .row-text small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proto-b .list-row em {
  font-style: normal; font-size: 11px; color: #fff;
  background: var(--chip); padding: 2px 7px; border-radius: 99px;
}
.proto-b .list-more { margin: 8px 0; font-size: 12px; color: var(--muted); text-align: center; }
.proto-b .b-detail,
.proto-b .b-drop {
  position: absolute;
  z-index: 700;
  left: 372px;
  bottom: calc(var(--switcher-space) + 14px);
  width: min(380px, calc(100% - 396px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 254, 250, 0.98);
  box-shadow: var(--shadow);
  max-height: min(60vh, 520px);
  overflow: auto;
}

/* ---- C 胶片条 ---- */
.proto-c .c-top {
  position: absolute;
  z-index: 600;
  top: 14px; left: 14px; right: 88px;
  display: grid;
  grid-template-columns: auto minmax(160px, 420px) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(39, 66, 54, 0.14);
  border-radius: var(--radius);
  background: rgba(250, 249, 244, 0.96);
  box-shadow: 0 10px 30px rgba(31, 47, 39, 0.14);
  backdrop-filter: blur(18px);
}
.proto-c .c-rail {
  position: absolute;
  z-index: 600;
  top: 96px; right: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.proto-c .rail-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 254, 250, 0.96);
  font-size: 12px;
}
.proto-c .rail-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--chip); }
.proto-c .rail-pill.active { background: var(--chip); border-color: var(--chip); color: #fff; }
.proto-c .rail-pill.active i { background: #fff; }
.proto-c .c-strip {
  position: absolute;
  z-index: 600;
  left: 0; right: 0;
  bottom: var(--switcher-space);
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  overflow-x: auto;
  background: linear-gradient(to top, rgba(24, 35, 31, 0.72), rgba(24, 35, 31, 0));
}
.proto-c .film {
  flex: 0 0 auto;
  width: 178px;
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 254, 250, 0.96);
  text-align: left;
}
.proto-c .film.active { outline: 2px solid var(--cinnabar); }
.proto-c .film-photo {
  position: relative;
  height: 92px;
  border-radius: 6px;
  background: linear-gradient(135deg, hsl(var(--hue) 55% 72%), hsl(calc(var(--hue) + 42) 46% 50%));
}
.proto-c .film-photo em {
  position: absolute; right: 6px; top: 6px;
  font-style: normal; font-size: 10px;
  padding: 1px 6px; border-radius: 99px;
  background: rgba(24, 35, 31, 0.62); color: #fff;
}
.proto-c .film strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proto-c .film small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proto-c .c-caption {
  position: absolute;
  z-index: 610;
  left: 14px;
  bottom: calc(var(--switcher-space) + 150px);
  width: min(340px, calc(100% - 28px));
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(24, 35, 31, 0.82);
  color: #f4f2ea;
}
.proto-c .c-caption p { margin: 6px 0; font-size: 13px; line-height: 1.6; }
.proto-c .c-caption span { font-size: 11px; opacity: 0.72; }
.proto-c .c-drop {
  position: absolute;
  z-index: 800;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(400px, calc(100% - 28px));
  padding: 16px;
  border-radius: 12px;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}

/* ---- 远端地点搜索候选 ---- */
.proto .search-results {
  position: absolute;
  z-index: 900;
  display: grid;
  gap: 4px;
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 254, 250, 0.99);
  box-shadow: var(--shadow);
}
.proto .search-results[hidden] { display: none; }
.proto .search-results .search-hint { margin: 6px 8px; font-size: 12px; color: var(--muted); }
.proto .search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  text-align: left;
}
.proto .search-result:hover { border-color: var(--forest); background: var(--forest-soft); }
.proto .search-result span { display: grid; gap: 2px; min-width: 0; }
.proto .search-result strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proto .search-result small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proto .search-result em {
  font-style: normal;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--forest);
  color: #fff;
}

/* ---- 行政区面包屑与边界提示 ---- */
.proto-crumbs { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.proto-crumbs button {
  height: 24px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 99px;
  background: none;
  color: var(--forest);
  font-size: 12px;
}
.proto-crumbs button:hover { background: var(--forest-soft); }
.proto-crumbs button.current {
  border-color: var(--line);
  background: var(--paper-strong);
  color: var(--ink);
  font-weight: 600;
}
.proto-crumbs i { font-style: normal; color: var(--muted); }
.proto-crumbs-row { grid-column: 1 / -1; padding-top: 2px; }
.proto-a .a-meta { display: flex; align-items: center; gap: 8px; }
.proto-a .a-meta .meta-count { color: var(--muted); }
.proto-b .proto-crumbs-row { padding: 0 0 2px; }
.proto-c .c-top { grid-template-columns: auto minmax(160px, 420px) auto; }
.proto-c .c-top .proto-crumbs-row { grid-column: 1 / -1; }
.boundary-tooltip {
  padding: 4px 8px;
  border: none;
  border-radius: 6px;
  background: rgba(24, 35, 31, 0.92);
  color: #f4f2ea;
  font-size: 12px;
  box-shadow: 0 6px 18px rgba(31, 47, 39, 0.25);
}
.boundary-tooltip::before { display: none; }

/* ---- 浮条 / 横幅 / 提示 ---- */
/* 布局选择器：贴在右侧边缘的竖向标签，点开向左展开三个选项 */
.layout-picker {
  position: fixed;
  z-index: 3000;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  font-size: 12px;
}
.layout-picker .picker-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  border: 1px solid rgba(39, 66, 54, 0.16);
  border-right: none;
  border-radius: 10px 0 0 10px;
  background: rgba(255, 254, 250, 0.96);
  box-shadow: -6px 0 18px rgba(31, 47, 39, 0.1);
  color: var(--forest);
  writing-mode: vertical-rl;
  letter-spacing: 2px;
}
.layout-picker .picker-toggle span { font-size: 10px; color: var(--muted); }
.layout-picker .picker-toggle em { font-style: normal; font-weight: 600; }
.layout-picker .picker-body {
  display: none;
  width: 212px;
  padding: 12px;
  border: 1px solid rgba(39, 66, 54, 0.16);
  border-right: none;
  border-radius: 12px 0 0 12px;
  background: rgba(255, 254, 250, 0.98);
  box-shadow: -10px 0 30px rgba(31, 47, 39, 0.14);
}
.layout-picker[data-open="true"] .picker-body { display: block; }
.layout-picker .picker-body p { margin: 0 0 8px; font-size: 11px; color: var(--muted); }
.layout-picker .picker-option {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  text-align: left;
}
.layout-picker .picker-option strong { display: block; font-size: 13px; }
.layout-picker .picker-option small { color: var(--muted); font-size: 11px; }
.layout-picker .picker-option:hover { border-color: var(--forest); }
.layout-picker .picker-option.active { border-color: var(--forest); background: var(--forest-soft); }
.layout-picker .picker-option.active strong { color: var(--forest); }
.layout-picker .picker-state { display: block; margin-top: 4px; font-size: 10px; color: var(--muted); }

.proto-banner {
  position: fixed;
  z-index: 2500;
  top: 12px; left: 12px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(199, 75, 56, 0.92);
  color: #fff;
  font-size: 11px;
}

.proto-toast {
  position: fixed;
  z-index: 3100;
  left: 50%;
  top: 14px;
  transform: translateX(-50%) translateY(-8px);
  max-width: min(520px, calc(100% - 24px));
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(24, 35, 31, 0.92);
  color: #f4f2ea;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.proto-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 820px) {
  .proto-b { display: block; }
  .proto-b .b-rail {
    position: absolute;
    top: 0; left: 0; right: 0;
    max-height: 50vh;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .proto-b .b-detail,
  .proto-b .b-drop {
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
  }
  .proto-a .a-top { grid-template-columns: auto 1fr; }
  .proto-a .a-top .add { grid-column: 1 / -1; }
  .proto-a .a-chips { top: 132px; }
  .proto-a .a-meta { top: 176px; }
  .proto-b .grade-legend { left: 14px; top: calc(50vh + 12px); bottom: auto; }
  .proto-c .grade-legend { left: 14px; top: 150px; }
  .proto .grade-legend i { display: none; }
  .proto-c .c-top { right: 14px; grid-template-columns: auto 1fr; }
  .proto-c .c-top .add { grid-column: 1 / -1; }
  .proto-c .c-rail { top: auto; bottom: calc(var(--switcher-space) + 168px); right: 10px; }
  .proto-c .rail-pill span { display: none; }
  .proto-c .rail-pill { padding: 0 8px; }
  .layout-picker .picker-body { width: 178px; }
  .layout-picker .picker-toggle { padding: 8px 5px; }
  .proto-actions { right: 10px; gap: 4px; }
  .proto-action { padding: 0 10px; }
  .proto-drawer { width: 100vw; }
}

/* ---- 全站入口 + 个人中心抽屉（挂在 body 上，自带令牌） ---- */
.proto-actions,
.proto-drawer {
  --paper: #f7f6f0;
  --paper-strong: #fffefa;
  --ink: #18231f;
  --muted: #68716c;
  --line: #d9ddd7;
  --forest: #28584b;
  --forest-soft: #e4eee9;
  --cinnabar: #c74b38;
  --shadow: 0 18px 48px rgba(29, 44, 37, 0.16);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 13px;
}
.proto-actions button,
.proto-actions a,
.proto-drawer button,
.proto-drawer input,
.proto-drawer select {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}
.proto-drawer input { cursor: text; }

/* 帖子 / 发帖 / 个人：默认贴右下角（A、B 布局下方留白），C 布局让开底部胶片条 */
.proto-actions {
  position: fixed;
  z-index: 3200;
  right: 14px;
  bottom: calc(var(--switcher-space, 14px) + 8px);
  display: flex;
  gap: 6px;
}
.proto-actions[data-variant="C"] { bottom: auto; top: 14px; }
.proto-action {
  height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(39, 66, 54, 0.16);
  border-radius: 99px;
  background: rgba(255, 254, 250, 0.96);
  box-shadow: 0 6px 18px rgba(31, 47, 39, 0.12);
  color: var(--forest);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.proto-action:hover { border-color: var(--forest); background: var(--forest-soft); }
.proto-action.primary { background: var(--forest); border-color: var(--forest); color: #fff; }

/* 个人中心：右侧悬浮抽屉 */
.proto-drawer {
  position: fixed;
  z-index: 4000;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  display: flex;
  flex-direction: column;
  background: rgba(255, 254, 250, 0.99);
  box-shadow: -18px 0 48px rgba(31, 47, 39, 0.18);
  transform: translateX(103%);
  transition: transform 0.22s ease;
}
.proto-drawer[data-open="true"] { transform: translateX(0); }
.proto-drawer .drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  border-top: 2px solid rgba(199, 75, 56, 0.85);
  background: var(--paper);
}
.proto-drawer .drawer-head div { display: flex; flex-direction: column; }
.proto-drawer .drawer-head span { font-size: 10px; letter-spacing: 2px; color: var(--muted); }
.proto-drawer .drawer-head strong { font-size: 17px; }
.proto-drawer .drawer-head button {
  width: 30px; height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-strong);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}
.proto-drawer .drawer-body {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}
.proto-drawer .drawer-profile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--forest-soft);
}
.proto-drawer .drawer-profile strong { font-size: 15px; color: var(--forest); }
.proto-drawer .drawer-profile span { font-size: 12px; color: var(--muted); }
.proto-drawer .drawer-form,
.proto-drawer .drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-strong);
}
.proto-drawer .drawer-form h3,
.proto-drawer .drawer-section h3 { margin: 0; font-size: 13px; color: var(--muted); letter-spacing: 1px; }
.proto-drawer .drawer-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.proto-drawer .drawer-form input,
.proto-drawer .drawer-form select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.proto-drawer .drawer-form input:focus { border-color: var(--forest); }
.proto-drawer .drawer-form .primary,
.proto-drawer .drawer-form .secondary {
  height: 38px;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
}
.proto-drawer .drawer-form .primary { background: var(--cinnabar); }
.proto-drawer .drawer-form .secondary { background: var(--forest); }
.proto-drawer .drawer-section ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.proto-drawer .drawer-section li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--paper);
}
.proto-drawer .drawer-section li[class="drawer-empty"] { color: var(--muted); font-size: 12px; background: none; }
.proto-drawer .drawer-section li button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  border: none;
  background: none;
  text-align: left;
}
.proto-drawer .drawer-section li strong { font-size: 13px; }
.proto-drawer .drawer-section li small { font-size: 11px; color: var(--muted); }
.proto-drawer .drawer-section li:hover { border-color: var(--forest); }
.proto-drawer .drawer-link { font-size: 12px; color: var(--forest); }
.proto-drawer .drawer-body > .danger {
  height: 38px;
  border: 1px solid rgba(199, 75, 56, 0.35);
  border-radius: 8px;
  background: none;
  color: var(--cinnabar);
  font-weight: 600;
}
.card-actions button.active { border-color: var(--gold); background: rgba(197, 139, 46, 0.12); color: var(--gold); }

/* 个人入口的未读角标与抽屉里的帖子/通知列表 */
.proto-actions .proto-badge {
  min-width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  margin-left: 3px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--cinnabar);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}
.proto-drawer .drawer-posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.proto-drawer .drawer-post {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: inherit;
  text-decoration: none;
}
.proto-drawer .drawer-post:hover { border-color: var(--forest); }
.proto-drawer .drawer-post.unread {
  border-color: rgba(199, 75, 56, 0.45);
  background: rgba(199, 75, 56, 0.05);
}
.proto-drawer .drawer-post strong { font-size: 13px; }
.proto-drawer .drawer-post small { font-size: 11px; color: var(--muted); }

/* ---- 未登录时的居中登录框 ---- */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 4200;
  display: none;
  place-items: center;
  padding: 16px;
  background: rgba(24, 35, 31, 0.36);
  backdrop-filter: blur(3px);
}
.auth-modal[data-open="true"] { display: grid; }
.auth-modal .auth-card {
  position: relative;
  width: min(340px, 100%);
  padding: 22px 20px 16px;
  border: 1px solid var(--line);
  border-top: 2px solid rgba(199, 75, 56, 0.85);
  border-radius: 14px;
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}
.auth-modal .auth-card h2 { margin: 0 0 14px; font-size: 18px; }
.auth-modal .auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper-strong);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}
.auth-modal .auth-form { display: grid; gap: 10px; }
.auth-modal .auth-form[hidden] { display: none; }
.auth-modal .auth-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.auth-modal .auth-form input {
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.auth-modal .auth-form input:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(40, 88, 75, 0.1); }
.auth-modal .auth-submit {
  height: 40px;
  margin-top: 4px;
  border: 1px solid var(--forest);
  border-radius: 9px;
  background: var(--forest);
  color: #fff;
  font-weight: 600;
}
.auth-modal .auth-submit:hover { background: #1f473c; }
.auth-modal .auth-error { margin: 0; font-size: 12px; color: var(--cinnabar); }
.auth-modal .auth-hint { margin: 0; font-size: 12px; color: var(--forest); }
.auth-modal .auth-hint.bad { color: var(--cinnabar); }
.auth-modal .auth-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  font-size: 12px;
}
.auth-modal .auth-switch { border: none; background: none; color: var(--forest); font-size: 12px; }
.auth-modal .auth-switch:hover { text-decoration: underline; }
.auth-modal .auth-link { color: var(--muted); text-decoration: none; }
.auth-modal .auth-link:hover { color: var(--forest); }

