/* vote-site · 前台样式（复刻竞品 Loft Photography Competition 门面：白卡 16px 圆角软影、
   蓝紫渐变公告头、#e6475e 投票钮、k/w/亿票数格式）2026-10-02 zcode
   2026-10-03 owner 令：整站按时段自动明暗（18:00-06:00 暗色）——颜色全部走变量，
   html[data-theme=dark] 覆盖一组；JS 每 5 分钟复查翻面 */
* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --accent: #e6475e;
  --ok: #16a34a;
  --ink: #1f2937;
  --ink-2: #374151;
  --muted: #6b7280;
  --ghost-ink: #4b5563;
  --bg: #f5f7fb;
  --surface: #fff;
  --surface-2: #f5f7fb;
  --placeholder: #e5e7eb;
  --close-bg: #f3f4f6;
  --line: rgba(0, 0, 0, .06);
  --line-2: rgba(0, 0, 0, .12);
  --line-3: rgba(0, 0, 0, .05);
  --stat-bg: rgba(29, 78, 216, .07);
  --stat-ink: #1d4ed8;
  --stat-line: rgba(29, 78, 216, .18);
  --card-radius: 16px;
  --card-shadow: 0 6px 24px rgba(0, 0, 0, .06);
  --modal-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --ok: #3fd98a;
  --ink: #e6eaf3;
  --ink-2: #c3cad9;
  --muted: #8f98ad;
  --ghost-ink: #aab3c7;
  --bg: #0e1320;
  --surface: #161c2c;
  --surface-2: #1f2739;
  --placeholder: #232a3d;
  --close-bg: #232c42;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --line-3: rgba(255, 255, 255, .07);
  --stat-bg: rgba(96, 165, 250, .12);
  --stat-ink: #7fb0ff;
  --stat-line: rgba(96, 165, 250, .25);
  --card-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --modal-shadow: 0 24px 80px rgba(0, 0, 0, .6);
}
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  transition: background-color .35s ease, color .35s ease; }
#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---- 顶部横幅（渐变头，明暗通用）+ 品牌 logo（2026-10-03 owner 令：站名 OBSCURA+光圈 logo） ---- */
.hero { background: linear-gradient(135deg, #1d4ed8, #6d28d9); color: #fff; }
.hero-inner { max-width: 980px; margin: 0 auto; padding: 24px 16px 20px; text-align: center; }
.hero .brand-logo { display: flex; justify-content: center; margin-bottom: 10px; }
.hero .brand-logo img { width: 58px; height: 58px; border-radius: 14px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .12);
  background: #0b1430; }
.hero .title { font-size: 26px; font-weight: 800; letter-spacing: 6px; text-indent: 6px; }
.hero .subtitle { margin-top: 4px; font-size: 13px; opacity: .85; letter-spacing: .5px; }
.hero-meta { margin-top: 12px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap;
  min-width: 0; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--ink);
  transition: background-color .35s ease, color .35s ease; }
.pill.light { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.num { font-weight: 800; }

/* ---- 公告 ---- */
.notice { max-width: 980px; margin: 14px auto 0; width: calc(100% - 24px); border-radius: var(--card-radius);
  overflow: hidden; background: var(--surface); box-shadow: var(--card-shadow);
  transition: background-color .35s ease; }
.notice-header { padding: 20px 24px 12px; background: linear-gradient(135deg, #1d4ed8, #6d28d9); color: #fff; }
.notice-header .title { font-weight: 800; font-size: 17px; }
.notice-header .subtitle { font-size: 12px; opacity: .85; margin-top: 2px; }
.notice-body { padding: 14px 24px 18px; font-size: 13px; line-height: 1.9; color: var(--ink-2); white-space: pre-line; }

/* ---- 主体 ---- */
.wrap { max-width: 980px; width: 100%; margin: 0 auto; padding: 14px 12px 40px; }
/* 单行工具栏（owner 2026-10-03 追令：搜索框与 Awards & Rules 保持一行，国家下拉已撤） */
.toolbar { display: flex; align-items: center; justify-content: flex-start; flex-wrap: nowrap; gap: 8px; margin-bottom: 12px; }
.toolbar .ghost-btn { flex: none; }
.ghost-btn { border: 1px solid var(--line-2); background: var(--surface); color: var(--ghost-ink); font-size: 12px;
  padding: 7px 12px; border-radius: 999px; cursor: pointer; box-shadow: var(--card-shadow);
  transition: background-color .35s ease, color .2s ease, border-color .2s ease; }
.ghost-btn:hover { color: var(--accent); border-color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.card { background: var(--surface); border-radius: var(--card-radius); overflow: hidden; box-shadow: var(--card-shadow);
  position: relative; cursor: pointer;
  transition: transform .15s ease, background-color .35s ease; }
.card:active { transform: scale(.985); }
.card .rank { position: absolute; z-index: 2; top: 10px; left: 10px; background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
/* 2026-10-02 owner：全员赛事认证——卡片右上角认证徽章（10-03 owner 令改绿色） */
.card .verified { position: absolute; z-index: 2; top: 10px; right: 10px;
  background: linear-gradient(180deg, #22c55e, #16a34a); color: #fff;
  font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; letter-spacing: .2px;
  box-shadow: 0 2px 10px rgba(34, 197, 94, .45); backdrop-filter: blur(3px); }
.cover-wrap { position: relative; aspect-ratio: 3 / 4; background: var(--placeholder); }
.cover { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.card .body { padding: 10px 12px 12px; }
.card .title { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .origin { margin-top: 1px; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .sub { margin-top: 2px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-votes { font-weight: 600; }
.metrics { min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.vote-btn { border: 0; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px;
  padding: 8px 18px; border-radius: 999px; cursor: pointer; box-shadow: 0 6px 18px rgba(230, 71, 94, .35); }
.vote-btn:active { transform: scale(.96); }
.vote-btn:disabled { opacity: .55; }
.vote-btn.big { padding: 10px 28px; font-size: 15px; }

/* ---- 滚动自动加载哨兵（2026-10-02 owner 令：弃分页） ---- */
.sentinel { height: 8px; }
.sentinel[hidden] { display: none; }

/* ---- 详情弹层（2026-10-02 owner 令：屏幕中心弹出，不再底部上滑） ---- */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 12px; }
/* 2026-10-02 修复：display:flex 会顶掉 hidden 属性的 UA display:none —— 弹层曾因此常显（owner 报障）*/
.modal[hidden] { display: none; }
.modal-mask { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .5); animation: maskIn .18s ease-out; }
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card { position: relative; z-index: 1; background: var(--surface); width: min(560px, 100%); max-height: 88vh;
  overflow: auto; border-radius: var(--card-radius); padding: 0 16px 20px;
  box-shadow: var(--modal-shadow); animation: modalIn .26s cubic-bezier(.2, .9, .3, 1.2); }
/* 2026-10-03 修复：详情卡顶 padding 与 dwell 负 margin 的自抵消写法会让 sticky 钉位（Chrome 钉在
   内容区顶）把条下顶 16px 压住 No. 行——顶 padding 归零由 dwell 自带 padding 提供，流内=钉位 */
@keyframes modalIn { from { opacity: 0; transform: translateY(26px) scale(.92); } to { opacity: 1; transform: none; } }
.modal-close { position: absolute; z-index: 4; top: 8px; right: 10px; border: 0; background: var(--close-bg); color: var(--ink-2);
  width: 32px; height: 32px; border-radius: 999px; font-size: 18px; cursor: pointer;
  transition: background-color .35s ease, color .35s ease; }
.detail-head { padding: 4px 6px 10px; }
.detail-no { font-size: 12px; font-weight: 800; color: var(--accent); }
.detail-title { font-size: 18px; font-weight: 800; margin-top: 2px; }
.detail-origin { font-size: 12px; color: var(--muted); margin-top: 2px; }
.detail-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.detail-stats[hidden] { display: none; }
.detail-stats .pill.stat { display: inline-flex; align-items: baseline; gap: 5px; padding: 6px 12px;
  background: var(--stat-bg); color: var(--stat-ink);
  box-shadow: inset 0 0 0 1px var(--stat-line); }
.detail-stats .stat-ico { font-size: 14px; line-height: 1; }
.detail-stats .stat-word { font-size: 11px; font-weight: 700; opacity: .75; letter-spacing: .3px; }
.detail-stats .pill.stat .num { font-size: 16px; }
.detail-stats .stat-unit { font-size: 11px; opacity: .75; font-weight: 600; }
/* 国旗图片化：Windows 无国旗 emoji 字体，改用本地 twemoji SVG */
img.flag { width: 17px; height: 13px; object-fit: cover; border-radius: 2px; vertical-align: -2px;
  display: inline-block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.detail-bio { margin-top: 8px; font-size: 13px; line-height: 1.7; color: var(--ink-2);
  background: var(--surface-2); border-radius: 10px; padding: 10px 12px;
  transition: background-color .35s ease, color .35s ease; }
.detail-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.photo-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: var(--placeholder); display: block; }
.detail-foot { margin-top: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- 挂机倒计时进度条（2026-10-02 owner 令：要明显）——吸顶常驻 ---- */
.dwell { position: sticky; top: 0; z-index: 3; background: var(--surface);
  margin: 0 -16px 8px; padding: 14px 16px 8px;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  border-bottom: 1px solid var(--line-3);
  box-shadow: 0 10px 16px -10px rgba(0, 0, 0, .4);
  transition: background-color .35s ease; }
.dwell[hidden] { display: none; }
.dwell-head { display: flex; align-items: baseline; gap: 5px; margin-bottom: 5px; }
.dwell-label { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .2px; }
.dwell .num { font-size: 17px; color: var(--accent); }
.dwell-unit { font-size: 12px; font-weight: 700; color: var(--accent); }
.dwell-track { height: 12px; border-radius: 999px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; transition: background-color .35s ease; }
.dwell-fill { height: 100%; width: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #e6475e, #f59e0b);
  box-shadow: 0 0 10px rgba(230, 71, 94, .45);
  transition: width 1s linear; }
.dwell-fill.no-trans { transition: none; }
.dwell-fill.burst { animation: burst .5s ease-out; }
@keyframes burst { 0% { box-shadow: 0 0 0 rgba(34, 197, 94, 0); }
  30% { box-shadow: 0 0 18px rgba(34, 197, 94, .9); background: linear-gradient(90deg, #22c55e, #16a34a); }
  100% { box-shadow: 0 0 10px rgba(230, 71, 94, .45); } }

/* ---- 挂机满一轮（2026-10-11 起 10 分钟） +1 动效 ---- */
.votes-pill { position: relative; }
.plus-one { position: absolute; left: 50%; top: -4px; transform: translateX(-50%);
  font-size: 17px; font-weight: 800; color: var(--ok); text-shadow: 0 2px 8px rgba(34, 197, 94, .35);
  pointer-events: none; animation: plusFloat 1.25s ease-out forwards; }
@keyframes plusFloat {
  0% { opacity: 0; transform: translateX(-50%) translateY(4px) scale(.5); }
  18% { opacity: 1; transform: translateX(-50%) translateY(-4px) scale(1.25); }
  55% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-36px) scale(1); } }
.pill.bump { animation: bump .55s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.28); background: rgba(34, 197, 94, .14);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .4); } 100% { transform: scale(1); } }

/* ---- 大图查看 lightbox（2026-10-02 owner 令：照片可看大图/左右切换/点击放大） ---- */
.lightbox { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  touch-action: none; animation: maskIn .18s ease-out; }
.lightbox[hidden] { display: none; }   /* 同 .modal 教训：显式 display 会废掉 hidden */
.lb-mask { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .92); }
.lb-img { position: relative; z-index: 1; max-width: 100vw; max-height: 100vh; object-fit: contain;
  animation: modalIn .2s ease-out; cursor: zoom-in; user-select: none;
  transition: transform .18s ease-out; will-change: transform; }
.lb-img.zoomed { cursor: zoom-out; transform: scale(2.2); }
.lb-btn { position: absolute; z-index: 2; border: 0; width: 46px; height: 46px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px);
  transition: background .15s; }
.lb-btn:hover { background: rgba(255, 255, 255, .3); }
.lb-btn:active { transform: scale(.94); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 10px; top: 50%; margin-top: -23px; }
.lb-next { right: 10px; top: 50%; margin-top: -23px; }
.lb-counter { position: absolute; z-index: 2; top: 18px; left: 16px; color: #fff; font-size: 13px;
  font-weight: 700; font-variant-numeric: tabular-nums; background: rgba(0, 0, 0, .4);
  padding: 5px 12px; border-radius: 999px; }
.lb-hint { position: absolute; z-index: 2; bottom: 14px; left: 0; right: 0; text-align: center;
  color: rgba(255, 255, 255, .55); font-size: 12px; pointer-events: none; }

/* ---- toast ---- */
.toast { position: fixed; left: 50%; bottom: 12%; transform: translateX(-50%); z-index: 99;
  background: rgba(17, 17, 17, .9); color: #fff; font-size: 13px; padding: 10px 18px; border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }

/* ---- 搜索（2026-10-03 owner 令；国家下拉当轮追令撤除）---- */
.search-box { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 7px;
  background: var(--surface); border-radius: 999px; padding: 0 12px;
  box-shadow: var(--card-shadow), inset 0 0 0 1px var(--line);
  transition: box-shadow .2s ease, background-color .35s ease; }
.search-box:focus-within { box-shadow: var(--card-shadow), inset 0 0 0 1.5px var(--accent); }
.search-ico { color: var(--muted); flex: none; }
#search { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 13px; padding: 10px 0; }
#search::placeholder { color: var(--muted); }
.search-clear { border: 0; background: var(--close-bg); color: var(--ink-2); width: 20px; height: 20px;
  border-radius: 999px; font-size: 13px; line-height: 1; cursor: pointer; flex: none;
  display: flex; align-items: center; justify-content: center;
  transition: background-color .35s ease, color .35s ease; }
.result-line { margin: -2px 4px 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.result-line[hidden] { display: none; }
.empty { text-align: center; padding: 46px 16px 30px; }
.empty[hidden] { display: none; }
.empty-ico { font-size: 34px; opacity: .6; }
.empty-title { margin-top: 8px; font-size: 15px; font-weight: 700; color: var(--ink-2); }
.empty-sub { margin-top: 4px; font-size: 12px; color: var(--muted); }

/* ---- 前三名奖励弹窗（2026-10-03 owner 令：打开即弹；追令=只展示奖励档位不展示选手）---- */
.prize-modal { z-index: 60; }
.prize-card { width: min(430px, 100%); text-align: center; padding: 24px 18px 20px; }
.prize-head .prize-trophy { font-size: 42px; line-height: 1; filter: drop-shadow(0 4px 14px rgba(245, 158, 11, .5)); }
.prize-title { font-size: 21px; font-weight: 800; margin-top: 8px; letter-spacing: .3px; }
.prize-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.prize-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.prize-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.prize-row.p1 { background: linear-gradient(135deg, rgba(245, 158, 11, .14), rgba(245, 158, 11, 0) 64%), var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .55); }
.prize-row.p2 { background: linear-gradient(135deg, rgba(148, 163, 184, .14), rgba(148, 163, 184, 0) 64%), var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .5); }
.prize-row.p3 { background: linear-gradient(135deg, rgba(195, 112, 58, .14), rgba(195, 112, 58, 0) 64%), var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(195, 112, 58, .5); }
.prize-medal { font-size: 26px; flex: none; width: 36px; text-align: center; }
.prize-place { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.prize-amount { flex: none; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fbbf24, #d97706);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.prize-ok { margin-top: 14px; min-width: 180px; }

/* ---- 阿拉伯语 / RTL（2026-10-21）----
   语言与方向由 index.html 首屏脚本按设备语言定到 <html lang dir>；这里只做阿语字体、去掉会拆开
   连写的字距、镜像角落控件与灯箱左右键，不改站点的明暗/卡片体系。 */
html[lang="ar"] body {
  font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", "Traditional Arabic", Arial, sans-serif;
}
/* 阿语首屏遮罩：等 app.js 套完静态翻译再显示（index.html 内有 3s 兜底与 noscript 放行） */
html[lang="ar"].i18n-pending body { visibility: hidden; }
html[dir="rtl"] .hero .title { letter-spacing: 0; text-indent: 0; }
html[dir="rtl"] .hero .subtitle,
html[dir="rtl"] .card .verified,
html[dir="rtl"] .detail-stats .stat-word,
html[dir="rtl"] .prize-title,
html[dir="rtl"] .dwell-label { letter-spacing: 0; }
html[dir="rtl"] .card .rank { left: auto; right: 10px; }
html[dir="rtl"] .card .verified { right: auto; left: 10px; }
html[dir="rtl"] .modal-close { right: auto; left: 10px; }
html[dir="rtl"] .lb-close { right: auto; left: 12px; }
html[dir="rtl"] .lb-prev { left: auto; right: 10px; }
html[dir="rtl"] .lb-next { right: auto; left: 10px; }
html[dir="rtl"] .lb-counter { left: auto; right: 16px; }
html[dir="rtl"] .prize-list { text-align: right; }
html[dir="rtl"] .dwell-fill { background: linear-gradient(270deg, #e6475e, #f59e0b); }
.toast { max-width: calc(100vw - 32px); text-align: center; line-height: 1.5; }
