/* ============================================================
   智睿公众投票系统 www.zhirui.net  H5 前台样式
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", Helvetica, Arial, sans-serif;
  background: #f4f7fb; color: #333; font-size: 14px; line-height: 1.6;
}
a { color: #3b8cff; text-decoration: none; }
img { max-width: 100%; }
.container { max-width: 760px; margin: 0 auto; padding: 0 12px; }
.btn {
  display: inline-block; padding: 8px 18px; border: none; border-radius: 20px;
  background: var(--primary, #3b8cff); color: #fff; font-size: 14px; cursor: pointer;
  text-align: center; transition: opacity .2s;
}
.btn:hover { opacity: .85; }
.btn.block { display: block; width: 100%; padding: 12px; font-size: 16px; }
.btn.ghost { background: #fff; color: var(--primary, #3b8cff); border: 1px solid var(--primary, #3b8cff); }
.btn.gray { background: #c0c4cc; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------- 顶部导航 ---------------- */
.topbar {
  background: var(--primary, #3b8cff); color: #fff; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 50px; }
.brand { font-size: 18px; font-weight: 700; color: #fff; display: flex; align-items: center; }
.brand .logo-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; margin-right: 8px; }
.topbar a { color: #fff; margin-left: 14px; font-size: 13px; }
.topbar a:hover { opacity: .85; }

/* ---------------- 首页 ---------------- */
.hero {
  background: linear-gradient(135deg, var(--primary, #3b8cff), #7cc0ff);
  color: #fff; text-align: center; padding: 46px 16px 40px;
}
.hero h1 { font-size: 26px; margin-bottom: 10px; }
.hero p { opacity: .92; font-size: 14px; margin-bottom: 22px; }
.hero .btn { background: #fff; color: var(--primary, #3b8cff); font-size: 16px; padding: 12px 36px; font-weight: 700; }

.section { background: #fff; border-radius: 12px; padding: 18px 16px; margin: 14px 0; }
.section h2 { font-size: 17px; margin-bottom: 14px; padding-left: 10px; border-left: 4px solid var(--primary, #3b8cff); }

/* 模板宫格 */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpl-card {
  border: 1px solid #eef1f5; border-radius: 10px; overflow: hidden; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.tpl-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.tpl-card .tpl-thumb { height: 72px; display: flex; align-items: center; justify-content: center; font-size: 30px; color: #fff; }
.tpl-card .tpl-name { padding: 8px; text-align: center; font-size: 13px; }
.tpl-tags { margin-bottom: 12px; }
.tpl-tags span {
  display: inline-block; padding: 4px 12px; margin: 0 6px 6px 0; border-radius: 14px;
  background: #f0f3f8; color: #666; font-size: 12px; cursor: pointer;
}
.tpl-tags span.on { background: var(--primary, #3b8cff); color: #fff; }

/* 热门活动 */
.hot-list .hot-item {
  display: flex; align-items: center; padding: 10px 0; border-bottom: 1px dashed #eef1f5;
}
.hot-item:last-child { border-bottom: none; }
.hot-item .rank { width: 30px; font-weight: 700; color: #c0c4cc; font-size: 16px; }
.hot-item .rank.top { color: #ff6b35; }
.hot-item .hot-info { flex: 1; min-width: 0; }
.hot-item .hot-title { font-size: 14px; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-item .hot-meta { font-size: 12px; color: #999; margin-top: 2px; }

/* 平台特性 */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: center; }
.features .feat { padding: 10px 4px; }
.features .feat .ico { font-size: 24px; margin-bottom: 6px; }
.features .feat .t { font-size: 13px; font-weight: 700; }
.features .feat .d { font-size: 11px; color: #999; margin-top: 3px; }

.footer { text-align: center; padding: 22px 12px 30px; color: #999; font-size: 12px; }

/* ---------------- 登录/注册 ---------------- */
.auth-box { max-width: 400px; margin: 30px auto; background: #fff; border-radius: 12px; padding: 26px 22px; }
.auth-box h2 { text-align: center; margin-bottom: 20px; font-size: 20px; }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.form-item input, .form-item select, .form-item textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #dde3ea; border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fafbfc;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  outline: none; border-color: var(--primary, #3b8cff); background: #fff;
}
.form-item .cap-row { display: flex; gap: 8px; }
.form-item .cap-row input { flex: 1; }
.form-item .cap-row img { height: 40px; cursor: pointer; border-radius: 6px; }
.form-tip { text-align: center; font-size: 13px; color: #999; margin-top: 12px; }
.alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.alert.err { background: #fdecec; color: #d03050; border: 1px solid #f8d0d0; }
.alert.ok { background: #e8f8ef; color: #18a058; border: 1px solid #bfe8cf; }

/* ---------------- 投票活动页 ---------------- */
.vote-page { background: var(--bg, #f4f7fb); min-height: 100vh; }
.vote-header { position: relative; color: #fff; padding: 20px 16px; text-align: center; }
.vote-header .vh-bg { position: absolute; inset: 0; background: linear-gradient(160deg, var(--primary, #3b8cff), #7cc0ff); z-index: 0; }
.vote-header > * { position: relative; z-index: 1; }
.vote-header h1 { font-size: 22px; margin-bottom: 6px; }
.vote-header .vh-meta { font-size: 12px; opacity: .9; }
.status-tag {
  display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; margin-left: 6px;
  background: rgba(255,255,255,.25);
}
.status-tag.end { background: rgba(0,0,0,.3); }

.banner-wrap { position: relative; overflow: hidden; }
.banner-list { display: flex; transition: transform .4s ease; }
.banner-item { min-width: 100%; }
.banner-item img { width: 100%; height: 180px; object-fit: cover; display: block; }
.banner-dots { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; }
.banner-dots i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.5); margin: 0 3px; }
.banner-dots i.on { background: #fff; }

.rules-box { background: #fff; border-radius: 12px; margin: 12px; padding: 14px; }
.rules-box h3 { font-size: 15px; margin-bottom: 8px; color: var(--primary, #3b8cff); }
.rules-box .rules-content { font-size: 13px; color: #666; white-space: pre-wrap; word-break: break-all; max-height: 140px; overflow: hidden; transition: max-height .3s; }
.rules-box .rules-content.open { max-height: 2000px; }
.rules-toggle { color: var(--primary, #3b8cff); font-size: 12px; cursor: pointer; margin-top: 6px; display: inline-block; }

/* 选手卡片 */
.group-title { font-size: 16px; font-weight: 700; margin: 16px 12px 8px; padding-left: 10px; border-left: 4px solid var(--primary, #3b8cff); }
.option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 12px; }
.opt-card {
  background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.05);
  position: relative; transition: box-shadow .15s;
}
.opt-card.sel { box-shadow: 0 0 0 2px var(--primary, #3b8cff); }
.opt-card .opt-img { width: 100%; height: 130px; object-fit: cover; display: block; background: #f0f3f8; }
.opt-card .opt-body { padding: 10px; }
.opt-card .opt-name { font-size: 14px; font-weight: 700; }
.opt-card .opt-desc { font-size: 12px; color: #999; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.opt-card .opt-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.opt-card .opt-votes { font-size: 12px; color: #ff6b35; font-weight: 700; }
.opt-card .opt-check {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid #d5dbe3;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px;
}
.opt-card.sel .opt-check { background: var(--primary, #3b8cff); border-color: var(--primary, #3b8cff); }
.opt-card .opt-num { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.45); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.opt-card .opt-tags { position: absolute; top: 8px; right: 8px; background: var(--primary, #3b8cff); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }

/* 图片画廊 */
.gallery { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; }
.gallery img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }

/* 投票操作条 */
.vote-bar {
  position: sticky; bottom: 0; background: #fff; padding: 10px 12px; z-index: 50;
  box-shadow: 0 -2px 10px rgba(0,0,0,.06); display: flex; align-items: center; gap: 10px;
}
.vote-bar .selected-tip { flex: 1; font-size: 13px; color: #666; }

/* 排行 */
.rank-list .rank-row { display: flex; align-items: center; padding: 9px 0; border-bottom: 1px dashed #eef1f5; }
.rank-row .rank { width: 30px; text-align: center; font-weight: 700; color: #c0c4cc; }
.rank-row .rank.r1 { color: #ff6b35; } .rank-row .rank.r2 { color: #ff9a3d; } .rank-row .rank.r3 { color: #4aa3ff; }
.rank-row .rk-img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; margin-right: 10px; background: #f0f3f8; }
.rank-row .rk-name { flex: 1; font-size: 14px; }
.rank-row .rk-votes { font-size: 13px; color: #ff6b35; font-weight: 700; }
.chart-box { width: 100%; height: 240px; margin: 10px 0; }

.tab-bar { display: flex; background: #fff; border-radius: 10px; margin: 12px; overflow: hidden; }
.tab-bar .tab { flex: 1; text-align: center; padding: 10px; font-size: 14px; color: #666; cursor: pointer; }
.tab-bar .tab.on { color: var(--primary, #3b8cff); font-weight: 700; border-bottom: 2px solid var(--primary, #3b8cff); }

/* 会员/报名表单 */
.panel { background: #fff; border-radius: 12px; margin: 12px; padding: 16px; }

/* 弹层 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; display: none; align-items: center; justify-content: center; }
.mask.show { display: flex; }
.dialog { background: #fff; border-radius: 14px; width: 88%; max-width: 420px; padding: 24px 20px; text-align: center; }
.dialog h3 { margin-bottom: 12px; }
.dialog .dialog-actions { margin-top: 18px; display: flex; gap: 10px; justify-content: center; }
.dialog .qrcode { margin: 12px auto; }

/* 文档页 */
.doc-page { max-width: 760px; margin: 0 auto; padding: 0 14px 40px; }
.doc-cover { width: 100%; height: 200px; object-fit: cover; border-radius: 14px; margin: 14px 0; }
.doc-title { font-size: 22px; font-weight: 700; margin: 14px 0 6px; }
.doc-meta { color: #999; font-size: 13px; margin-bottom: 14px; }
.doc-section { background: #fff; border-radius: 12px; padding: 16px; margin: 12px 0; }
.doc-section h3 { font-size: 15px; margin-bottom: 8px; color: var(--primary, #3b8cff); }
.doc-section .content { font-size: 13px; color: #555; white-space: pre-wrap; word-break: break-all; }

/* 工具条 */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input, .toolbar select { padding: 8px 10px; border: 1px solid #dde3ea; border-radius: 8px; font-size: 13px; }
.toolbar .grow { flex: 1; }

/* 空状态 */
.empty { text-align: center; padding: 40px 10px; color: #b0b6bf; }
.empty .e-ico { font-size: 40px; margin-bottom: 10px; }

@media (max-width: 400px) {
  .option-grid { grid-template-columns: 1fr; }
}

/* ---------------- 认证页（登录/注册 统一风格） ---------------- */
.auth-wrap { max-width: 420px; margin: 26px auto 30px; }
.auth-card {
  background: #fff; border-radius: 14px; padding: 28px 26px 24px;
  box-shadow: 0 8px 28px rgba(59,140,255,.10), 0 2px 8px rgba(0,0,0,.04);
  border: 1px solid #eef2f9;
}
.auth-tabs { display: flex; margin: 0 0 22px; border-bottom: 2px solid #eef2f9; }
.auth-tab {
  flex: 1; text-align: center; padding: 10px 0 12px; font-size: 15px; color: #8a93a6;
  cursor: pointer; position: relative; transition: color .2s; font-weight: 500;
}
.auth-tab.on { color: var(--primary, #3B8CFF); font-weight: 700; }
.auth-tab.on::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: -2px; height: 3px;
  border-radius: 3px; background: linear-gradient(90deg, var(--primary,#3B8CFF), #7CC0FF);
}
.auth-tab:hover { color: var(--primary, #3B8CFF); }
.auth-panel { display: none; }
.auth-panel.on { display: block; animation: authIn .25s ease; }
@keyframes authIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.auth-card h2 { text-align: center; font-size: 21px; color: #22314e; margin-bottom: 20px; letter-spacing: 1px; }
.auth-card h2 em { font-style: normal; color: var(--primary,#3B8CFF); }
.auth-sub { text-align: center; font-size: 13px; color: #9aa3b5; margin: 18px 0 0; }
.auth-sub a { color: var(--primary,#3B8CFF); font-weight: 600; }
.auth-qr { display: flex; flex-direction: column; align-items: center; padding: 6px 0 4px; }
.auth-qr .qr-frame {
  width: 168px; height: 168px; border: 1px solid #e8ecf5; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; background: #fff; margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.auth-qr .qr-frame canvas, .auth-qr .qr-frame img { border-radius: 6px; }
.auth-qr .qr-tip { color: #666; font-size: 13px; margin-bottom: 4px; }
.auth-qr .qr-scan { color: #9aa3b5; font-size: 12px; }
.auth-qr .qr-empty { color: #c0c4cc; font-size: 13px; text-align: center; padding: 20px 10px; line-height: 1.7; }
