/* 巴厘岛行程投票 · 基础样式（用户端 / 管理端共用） */
:root {
  --bg: #000;
  --panel: #14161c;
  --panel-2: #1d2029;
  --text: #f5f7fa;
  --muted: #9aa3b2;
  --line: #2a2f3a;
  --want: #ff2e63;
  --skip: #6b7280;
  --accent: #22c55e;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

.screen { display: none; }
.screen.on { display: block; }

/* ================= 名字输入 ================= */
.name-wrap {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding: 28px 24px calc(28px + var(--safe-b));
}
.name-wrap h1 { font-size: 26px; margin: 0 0 10px; }
.name-wrap p { color: var(--muted); font-size: 15px; line-height: 1.7; margin: 0 0 28px; }
.name-wrap input {
  width: 100%; padding: 18px 16px; font-size: 20px; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; outline: none;
}
.name-wrap input:focus { border-color: #4b5563; }
.name-wrap .go {
  margin-top: 16px; width: 100%; padding: 18px; font-size: 19px; font-weight: 700;
  color: #fff; background: var(--accent); border: 0; border-radius: 14px;
}
.name-wrap .go:disabled { background: #2c313c; color: #6b7280; }
.name-wrap .err { color: #ff8080; font-size: 14px; min-height: 20px; margin-top: 10px; }

/* ================= 首页 ================= */
.home { padding: calc(20px + var(--safe-t)) 18px calc(30px + var(--safe-b)); max-width: 620px; margin: 0 auto; }
.home .hi { font-size: 24px; font-weight: 700; margin: 8px 0 4px; }
.home .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

.entry {
  display: block; width: 100%; text-align: left; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px;
}
.entry .t { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.entry .meta { font-size: 14px; color: var(--muted); display: flex; justify-content: space-between; }
.entry .prog { height: 6px; border-radius: 6px; background: #262b35; margin-top: 12px; overflow: hidden; }
.entry .prog > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.entry .cta { margin-top: 12px; font-size: 14px; color: #7fb0ff; }

.btn-line {
  display: block; width: 100%; margin-top: 6px; padding: 16px; font-size: 16px; font-weight: 600;
  color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px;
}

/* 我的选择列表 */
.mylist { margin-top: 8px; }
.mylist .row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line);
}
.mylist .row img { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; background: #222; flex: 0 0 auto; }
.mylist .row .n { flex: 1; font-size: 15px; }
.mylist .row .n small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.mylist .row .v { font-size: 13px; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.v-want { background: rgba(255,46,99,.16); color: #ff7d9e; }
.v-skip { background: rgba(107,114,128,.18); color: #b6bcc7; }

/* ================= 抖音式投票页 ================= */
.vote { position: fixed; inset: 0; background: #000; overflow: hidden; }

.stage { position: absolute; inset: 0; background: #000; }
.track { display: flex; height: 100%; transition: transform .3s ease; will-change: transform; }
/* contain = 完整显示整张照片，绝不裁切。
   竖图上下留白、横图左右留白，横图会自动按屏幕宽度铺满。 */
.track img {
  width: 100%; height: 100%; flex: 0 0 100%; object-fit: contain; object-position: center;
  display: block; background: #000;
}

.shade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 34%;
  background: linear-gradient(to top, rgba(0,0,0,.86) 18%, rgba(0,0,0,.42) 55%, transparent);
  pointer-events: none;
}

.topbar {
  position: absolute; top: 0; left: 0; right: 0;
  padding: calc(12px + var(--safe-t)) 16px 12px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0,0,0,.6), transparent);
}
.icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.4); color: #fff; font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px);
}
.counter { font-size: 15px; color: #fff; background: rgba(0,0,0,.42); padding: 6px 12px; border-radius: 20px; }

/* 名字 —— 老人也要看得清 */
.caption {
  position: absolute; left: 18px; right: 96px; bottom: calc(30px + var(--safe-b));
  pointer-events: none;
}
.caption .name { font-size: 32px; font-weight: 800; line-height: 1.25; text-shadow: 0 2px 12px rgba(0,0,0,.8); }
.caption .name-en { font-size: 17px; font-weight: 500; color: #d6dbe4; margin-top: 6px; text-shadow: 0 2px 10px rgba(0,0,0,.8); }
/* 所在地区：紧跟在中文地名后面的小字 */
.caption .name .region {
  font-size: 17px; font-weight: 600; color: #b9c1cd; margin-left: 10px;
  text-shadow: 0 2px 10px rgba(0,0,0,.8); white-space: nowrap;
}

/* 右侧操作 */
.rail {
  position: absolute; right: 12px; bottom: calc(34px + var(--safe-b));
  display: flex; flex-direction: column; gap: 20px; align-items: center;
}
.rail button { border: 0; background: none; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rail .circ {
  width: 62px; height: 62px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: rgba(0,0,0,.42); backdrop-filter: blur(6px); border: 2px solid rgba(255,255,255,.18);
  transition: transform .12s ease;
}
.rail button:active .circ { transform: scale(.9); }
.rail .lbl { font-size: 13px; color: #e6eaf0; text-shadow: 0 1px 6px rgba(0,0,0,.9); }
.rail .want .circ { border-color: rgba(255,46,99,.55); }
.rail .want.done .circ { background: var(--want); border-color: var(--want); }
.rail .skip.done .circ { background: #4b5563; border-color: #4b5563; }

.imgdots { position: absolute; bottom: calc(14px + var(--safe-b)); left: 0; right: 0; display: flex; gap: 6px; justify-content: center; }
.imgdots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.42); }
.imgdots i.on { background: #fff; width: 16px; border-radius: 3px; }

/* 大图翻页按钮与张数徽标（管理端使用；用户端靠滑动） */
.nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.48); color: #fff; font-size: 26px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; backdrop-filter: blur(6px); z-index: 20;
}
.nav-btn.prev { left: 10px; }
.nav-btn.next { right: 10px; }
.nav-btn:active { background: rgba(0,0,0,.75); }

.img-count {
  position: absolute; top: 10px; right: 10px;
  font-size: 12px; padding: 4px 10px; border-radius: 20px;
  background: rgba(0,0,0,.55); color: #fff; white-space: nowrap;
}

/* 空状态 */
.finished { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 30px; text-align: center; }
.finished h2 { font-size: 23px; margin: 0; }
.finished p { color: var(--muted); font-size: 15px; margin: 0; }

/* ================= 详情弹窗 ================= */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.sheet-mask.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-height: 88vh; background: var(--panel); border-radius: 20px 20px 0 0;
  transform: translateY(100%); transition: transform .28s ease;
  display: flex; flex-direction: column; max-width: 620px; margin: 0 auto;
}
.sheet.on { transform: translateY(0); }
.sheet .grip { width: 40px; height: 4px; border-radius: 4px; background: #3a4150; margin: 10px auto 0; flex: 0 0 auto; }
.sheet .head { padding: 12px 18px 8px; display: flex; align-items: flex-start; gap: 12px; flex: 0 0 auto; }
.sheet .head h2 { font-size: 21px; margin: 0; flex: 1; line-height: 1.3; }
.sheet .head .en { font-size: 13px; color: var(--muted); margin-top: 4px; }
.sheet .x { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--panel-2); color: #fff; font-size: 20px; flex: 0 0 auto; }
.sheet .scroll { overflow-y: auto; padding: 4px 18px calc(24px + var(--safe-b)); -webkit-overflow-scrolling: touch; }

.audiobar {
  display: flex; align-items: center; gap: 10px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0 16px;
}
.audiobar button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 18px; flex: 0 0 auto; }
.audiobar .st { font-size: 14px; color: var(--muted); }

.sheet h3 { font-size: 14px; color: var(--muted); margin: 18px 0 8px; font-weight: 600; letter-spacing: .4px; }
.sheet .intro { font-size: 17px; line-height: 1.85; color: #e2e7ee; margin: 0; }
.plist { margin: 0; padding: 0; list-style: none; }
.plist li { font-size: 15px; line-height: 1.6; padding: 8px 0 8px 24px; position: relative; color: #dbe1ea; }
.plist.good li::before { content: "✓"; position: absolute; left: 2px; color: var(--accent); font-weight: 700; }
.plist.bad li::before { content: "!"; position: absolute; left: 4px; color: #f0a020; font-weight: 700; }
.verdict { background: var(--panel-2); border-left: 3px solid var(--accent); border-radius: 10px; padding: 12px 14px; font-size: 16px; line-height: 1.7; color: #e6ebf2; }

/* ================= 管理端 ================= */
.admin { padding: calc(18px + var(--safe-t)) 16px calc(40px + var(--safe-b)); max-width: 900px; margin: 0 auto; }
.admin h1 { font-size: 22px; margin: 6px 0 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kpi b { display: block; font-size: 22px; }
.kpi small { color: var(--muted); font-size: 12px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters select, .filters input {
  padding: 10px 12px; font-size: 15px; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px; outline: none;
}
.filters input { flex: 1; min-width: 130px; }

.plist-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.plist-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 8px 6px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); }
.plist-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.plist-table tr.dead td { opacity: .42; }
.plist-table img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: #222; }

/* 地址标签：地区 + 详细地址 */
.addr-tag {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  margin: 3px 0 4px; padding: 3px 8px; width: fit-content; max-width: 220px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel-2); color: #b9c1cd; font-size: 12px; line-height: 1.5;
}
.addr-tag .pin { color: #86efac; font-size: 12px; }
.addr-tag .rg { color: #d6dbe4; font-weight: 600; white-space: nowrap; }
.addr-tag .addr-text {
  color: #8b93a1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1 1 auto; min-width: 0;
}
.addr-tag .addr-text.none { color: #7a828f; font-style: italic; flex: 0 0 auto; }
.addr-tag .lvl {
  color: #b28b3f; border: 1px solid #4a3a1d; background: #2a2113;
  border-radius: 6px; padding: 0 5px; font-size: 11px; white-space: nowrap;
  flex: 0 0 auto;
}
.addr-tag.lv-none { border-style: dashed; }
.addr-tag.lv-none .pin { color: #7a828f; }
.num-want { color: #ff7d9e; font-weight: 700; }
.num-skip { color: #b6bcc7; }
.voters { font-size: 12px; color: var(--muted); line-height: 1.5; }

.mini { padding: 7px 11px; font-size: 13px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); }
.mini.danger { border-color: #5a2b2b; background: #2a1a1a; color: #ff9b9b; }
.mini.ok { border-color: #2b5a3a; background: #16301f; color: #86efac; }

/* 审核模式下的照片条 */
.review-strip { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; scroll-behavior: smooth; }
.review-strip .ph { position: relative; flex: 0 0 auto; cursor: pointer; }
.review-strip .ph img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; display: block; background: #222; }
.review-strip .ph.off img { opacity: .3; filter: grayscale(1); }
.review-strip .ph button {
  position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%;
  border: 0; font-size: 14px; line-height: 1; color: #fff; background: #b91c1c;
}
.review-strip .ph.off button { background: #374151; }
/* 当前正在大图里显示的那张 */
.review-strip .ph.cur img { outline: 3px solid var(--accent); outline-offset: 1px; }
.review-strip .ph.cur.off img { outline-color: #6b7280; }

.hidden-badge {
  position: absolute; left: 50%; top: 14%; transform: translateX(-50%);
  background: rgba(185,28,28,.92); color: #fff; font-size: 13px;
  padding: 7px 15px; border-radius: 20px; z-index: 21; white-space: nowrap;
}

.adminbar {
  position: absolute; left: 0; right: 0; top: calc(58px + var(--safe-t));
  display: flex; gap: 8px; padding: 0 14px; flex-wrap: wrap; z-index: 40;
}
.adminbar button {
  padding: 9px 13px; font-size: 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.22);
  background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(6px);
}
.adminbar button.danger { border-color: #7f1d1d; background: rgba(127,29,29,.72); }
