:root {
  --orange: #ff7a00;
  --orange-dark: #e86a00;
  --purple: #7b5cff;
  --text: #333;
  --muted: #888;
  --bg: #f5f5f5;
  --card: #fff;
  --border: #eee;
  --notice: #fff3cd;
  --nav-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  padding-bottom: calc(var(--nav-h) + 70px + var(--safe-bottom));
}

.notice-bar {
  background: var(--notice);
  color: #b36b00;
  font-size: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}
.notice-bar .marquee {
  overflow: hidden;
  flex: 1;
}
.notice-bar .marquee span {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 18s linear infinite;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.star-card {
  margin: 12px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}
.star-card .star-title {
  color: #e53935;
  font-weight: 700;
  padding: 10px 12px 6px;
  font-size: 15px;
}
.star-card .star-img-wrap {
  position: relative;
  margin: 0 12px;
  border-radius: 6px;
  overflow: hidden;
  background: #eee;
  min-height: 140px;
}
.star-card .star-img-wrap img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.badge-special {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 64px;
  background: linear-gradient(180deg, #ffd54f, #ff8a00);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 6px 4px;
  font-size: 11px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.badge-special .no1 { font-size: 16px; font-weight: 800; }
.badge-special .stars { color: #fff59d; letter-spacing: 1px; }
.badge-special .btn-enter {
  margin-top: 4px;
  background: #e53935;
  border: none;
  color: #fff;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 10px;
  display: inline-block;
}

.search-box {
  margin: 12px;
  display: flex;
  gap: 8px;
}
.search-box input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 14px;
  outline: none;
}
.search-box button {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0 16px;
}

.section-title {
  text-align: center;
  color: var(--orange);
  font-weight: 700;
  margin: 16px 0 8px;
  position: relative;
}
.section-title::before,
.section-title::after {
  content: "";
  display: inline-block;
  width: 40px;
  height: 1px;
  background: #ddd;
  vertical-align: middle;
  margin: 0 8px;
}

.player-list { padding: 0 12px 12px; }
.player-item {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.player-item .avatar {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: #eee;
  flex-shrink: 0;
}
.player-item .meta { flex: 1; min-width: 0; }
.player-item .meta .name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-item .meta .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.player-item .votes {
  color: var(--orange);
  font-weight: 700;
  font-size: 16px;
  text-align: right;
}
.player-item .vote-btn {
  display: block;
  margin-top: 4px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 4px 12px;
  font-size: 12px;
}

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  z-index: 100;
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #999;
  gap: 2px;
}
.bottom-nav a.active { color: var(--orange); }
.bottom-nav .icon { font-size: 20px; line-height: 1; }

.action-bar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--nav-h) + var(--safe-bottom));
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 12px;
  z-index: 99;
}
.action-bar .btn-outline {
  border: 1px solid var(--purple);
  color: var(--purple);
  background: #fff;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
}
.action-bar .btn-boost {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #9b7bff, #6a4cff);
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(106,76,255,.4);
  margin-top: -18px;
}

.info-card {
  margin: 12px;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.info-card h3 { color: var(--orange); margin: 0 0 8px; font-size: 15px; }
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  text-align: center;
  margin: 12px;
  background: #fffaf3;
  border-radius: 8px;
  padding: 12px 0;
}
.stats-row .num { color: var(--orange); font-size: 20px; font-weight: 700; }
.stats-row .label { color: var(--muted); font-size: 12px; margin-top: 4px; }

.rank-header {
  margin: 12px;
  background: var(--orange);
  color: #fff;
  text-align: center;
  padding: 10px;
  border-radius: 6px;
  font-weight: 700;
}
.rank-table { margin: 0 12px; }
.rank-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 10px;
}
.rank-row .rank-no {
  width: 28px;
  text-align: center;
  font-weight: 700;
}
.rank-row .rank-no.top1 { color: #f5a623; }
.rank-row .rank-no.top2 { color: #9e9e9e; }
.rank-row .rank-no.top3 { color: #cd7f32; }
.rank-row .avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; background: #eee;
}
.rank-row .name { flex: 1; }
.rank-row .votes { color: var(--orange); font-weight: 700; }

.form-card {
  margin: 12px;
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #eee;
}
.form-card label {
  display: block;
  margin: 10px 0 4px;
  font-weight: 600;
}
.form-card input, .form-card textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  font-size: 14px;
}
.form-card .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.btn-submit {
  display: block;
  width: calc(100% - 24px);
  margin: 16px 12px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 12px;
  font-size: 16px;
  font-weight: 700;
}
.upload-box {
  border: 1px dashed #ccc;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  color: #999;
  position: relative;
  overflow: hidden;
  min-height: 72px;
  display: block;
  box-sizing: border-box;
}
.upload-box input[type=file] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  font-size: 100px; /* 扩大可点区域，兼容部分 WebView */
}
.upload-preview {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.upload-preview.show { display: grid; }
.upload-preview .thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  background: #f3f3f3;
}
.upload-preview .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.upload-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  min-height: 18px;
}

.content-html {
  padding: 12px 16px 24px;
  line-height: 1.7;
}
.content-html h3 {
  text-align: center;
  margin: 20px 0 10px;
}
.flash {
  margin: 8px 12px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}
.flash.success { background: #e8f5e9; color: #2e7d32; }
.flash.error { background: #ffebee; color: #c62828; }

.modal-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: 80%;
  max-width: 320px;
  text-align: center;
}
.modal h4 { margin: 0 0 8px; }
.modal p { color: #666; font-size: 13px; }
.modal button {
  margin-top: 12px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 24px;
}
.gift-modal { max-width: 360px; width: 90%; }
.gift-packages {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 4px;
}
.gift-pkg {
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fafafa;
  padding: 10px 6px;
  cursor: pointer;
  color: #333;
  margin: 0 !important;
}
.gift-pkg.active {
  border-color: var(--orange);
  background: #fff7ef;
  box-shadow: 0 0 0 1px var(--orange);
}
.gift-pkg .gift-votes {
  color: var(--orange);
  font-weight: 700;
  font-size: 16px;
}
.gift-pkg .gift-yuan { font-size: 13px; margin-top: 2px; }
.gift-pkg .gift-label { font-size: 11px; color: #999; margin-top: 2px; }
.gift-qr-wrap { margin-top: 12px; }
.gift-qr-wrap img {
  width: 180px;
  height: 180px;
  margin: 8px auto;
  display: block;
  background: #f5f5f5;
}
.gift-pay-btn:disabled { opacity: .5; }

.placeholder-img {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #ffd54f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  text-align: center;
  padding: 12px;
}

.footer-copy {
  text-align: center;
  color: #aaa;
  font-size: 11px;
  padding: 20px 12px 8px;
  line-height: 1.6;
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 12px;
  align-items: center;
}
.pagination a, .pagination span {
  min-width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  padding: 0 6px;
}
.pagination .current {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}
.pagination select {
  height: 28px;
  border: 1px solid #ddd;
  border-radius: 4px;
}
