/* ============================================================
 * 92-poll.css —— 投票卡片（统一样式）
 *
 * 为什么单独开一个文件：
 *   `.poll-bar` / `.poll-track` 这些类以前在 4 个 css 文件里各写了一份，
 *   互相打架 —— 其中一份写成 position:absolute; top:0; bottom:0，
 *   结果那根进度条撑满了整行，卡片看起来像一个巨大的绿色方块
 *   （2026-10 用户截图反馈"界面不美观"，就是这个）。
 *   现在统一放这里，并且用 !important 保证它说了算。
 *
 * 设计：
 *   卡片        圆角 + 细边框 + 淡阴影
 *   问题        加粗，一行
 *   选项        文字压在半透明进度条上面（条在背后，不占额外高度）
 *   底部        票数说明在左，操作按钮在右
 * ============================================================ */

.poll-area .poll-box,
.poll-box {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 620px;
  margin: 0 0 8px;
  padding: 12px 14px 10px;
  border: 1px solid var(--line, #e5e8ec);
  border-radius: 12px;
  background: var(--panel, #fff);
  box-shadow: 0 1px 2px rgba(20, 30, 50, .04);
}

/* 问题行 */
.poll-box .poll-q {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text, #2b3440);
  margin: 0 0 8px;
}

/* 选项：相对定位，给背后的进度条当参照 */
.poll-box .poll-opt {
  position: relative;
  overflow: hidden;
  padding: 8px 10px;
  margin: 4px 0;
  border-radius: 8px;
  background: var(--panel-soft, #f6f8fa);
  cursor: pointer;
  transition: background .15s;
}
.poll-box .poll-opt:hover { background: #eef2f7; }
.poll-box .poll-opt.mine { background: var(--brand-soft, #eaf6ee); }

/* ★ 进度条：铺满整行当背景，高度由 inset 决定（不再撑破卡片） */
.poll-box .poll-opt .poll-track {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  height: auto !important;
  margin: 0 !important;
  background: transparent !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  z-index: 0;
}
.poll-box .poll-opt .poll-bar {
  height: 100% !important;
  max-height: 100% !important;
  background: var(--brand-line, #cfe6d6) !important;
  border-radius: 8px !important;
  transition: width .25s ease;
}
.poll-box .poll-opt.mine .poll-bar { background: var(--brand-soft, #bfe3ca) !important; }

/* 文字压在条上面 */
.poll-box .poll-opt .poll-opt-head {
  position: relative;
  z-index: 1;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.5;
}
.poll-box .poll-opt-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.poll-box .poll-opt-num {
  flex: 0 0 auto;
  color: var(--muted, #7b8794);
  font-size: 12px;
  white-space: nowrap;
}

/* 我没有投票权时的提示 */
.poll-box .poll-opt.locked { cursor: not-allowed; opacity: .8; }
.poll-box .poll-locked {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted, #8a94a0);
}

/* 底部：票数 + 操作按钮 */
.poll-box .poll-foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line, #e8ecf0);
  font-size: 12px;
  color: var(--muted, #8a94a0);
}
.poll-box .poll-foot > :first-child { margin-right: auto; }

.poll-box .poll-close {
  flex: 0 0 auto;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid var(--line, #dfe3e8);
  border-radius: 999px;
  background: #fff;
  color: var(--muted, #5b6875);
  cursor: pointer;
  transition: all .15s;
}
.poll-box .poll-close:hover:not(:disabled) {
  border-color: var(--brand, #34a853);
  color: var(--brand, #34a853);
}
.poll-box .poll-close:disabled { opacity: .5; cursor: default; }
.poll-box .poll-close.poll-del { border-color: #f0c9c4; color: #c0392b; }
.poll-box .poll-close.poll-del:hover { background: #fdf3f1; border-color: #e0a49c; }

/* 匿名/多选之类的标记 */
.poll-box .poll-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 11px;
  border-radius: 999px;
  background: var(--panel-soft, #f1f4f8);
  color: var(--muted, #7b8794);
}

/* 投票区本身：不要太占地方 */
.poll-area {
  max-height: 34vh;
  padding: 8px 10px 0;
}

@media (max-width: 560px) {
  .poll-box { padding: 10px 12px 8px; }
  .poll-box .poll-q { font-size: 14px; }
  .poll-area { max-height: 30vh; }
}


/* ============================================================
 * 验证码（注册表单里那张图）
 * ============================================================ */
.captcha-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
  padding: 8px 10px;
  border: 1px solid var(--line, #e5e8ec);
  border-radius: 10px;
  background: var(--panel-soft, #f8f9fb);
}
.captcha-img {
  flex: 0 0 auto;
  width: 132px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #f5f7fa;
  display: flex;
  align-items: center;
  justify-content: center;
}
.captcha-img svg { display: block; }
.captcha-right {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.captcha-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: 1px solid var(--line, #dfe3e8);
  border-radius: 8px;
  background: #fff;
}
.captcha-refresh {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 10px;
  font-size: 12.5px;
  border: 1px solid var(--line, #dfe3e8);
  border-radius: 8px;
  background: #fff;
  color: var(--muted, #5b6875);
  cursor: pointer;
  white-space: nowrap;
}
.captcha-refresh:hover { border-color: var(--brand, #34a853); color: var(--brand, #34a853); }

@media (max-width: 420px) {
  .captcha-box { flex-wrap: wrap; }
  .captcha-img { width: 118px; height: 40px; }
}


/* ============================================================
 * 投票：收起 / 展开（用户反馈"占地方又关不掉"）
 * 三档：
 *   1. 整个投票区一档 —— 顶部的「收起 / 展开」按钮（记在 localStorage）
 *   2. 单张投票一档  —— 问题右边的小按钮；收起后只留一行
 *   3. 已结束的投票  —— 默认就是收起的
 * ============================================================ */

/* 投票区头部 */
.poll-area-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 0;
  font-size: 12px;
  color: var(--muted, #8a94a0);
  flex: 0 0 auto;
}
.poll-area-head.hidden { display: none; }
.poll-area-head .poll-area-toggle {
  margin-left: auto;
  padding: 3px 10px;
  font-size: 12px;
  border: 1px solid var(--line, #dfe3e8);
  border-radius: 999px;
  background: #fff;
  color: var(--muted, #5b6875);
  cursor: pointer;
}
.poll-area-head .poll-area-toggle:hover { border-color: var(--brand, #34a853); color: var(--brand, #34a853); }

/* 整个投票区收起时：只留头部 */
body.polls-collapsed .poll-area { display: none; }

/* 单张投票收起：只剩问题那一行 */
.poll-box.poll-collapsed .poll-opt,
.poll-box.poll-collapsed .poll-foot,
.poll-box.poll-collapsed .poll-tag { display: none; }
.poll-box.poll-collapsed { padding-bottom: 8px; }
.poll-box.poll-collapsed .poll-q { margin-bottom: 0; }

/* 问题右边的小按钮 */
.poll-mini {
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 400;
  vertical-align: middle;
  border: 1px solid var(--line, #e0e4e9);
  border-radius: 999px;
  background: #fff;
  color: var(--muted, #8a94a0);
  cursor: pointer;
}
.poll-mini:hover { border-color: var(--brand, #34a853); color: var(--brand, #34a853); }

/* 整个投票区不要占太多地方（原来 34vh，用户说挡到聊天了） */
.poll-area {
  max-height: 26vh !important;
  padding: 6px 10px 0 !important;
  gap: 6px !important;
}
@media (max-height: 700px) {
  .poll-area { max-height: 20vh !important; }
}
