/* ===========================
   晓白形象投票页 - Sirokami 系列
   =========================== */

:root {
    --red: #D81E44;
    --dark-red: #A51834;
    --black: #121212;
    --dark-gray: #1E1E1E;
    --gold: #D4AF37;
    --light-gold: #F0E68C;
    --bg: #1a1a1a;
    --card-bg: #1E1E1E;
    --text: #e0d6c2;
    --text-dim: #999;
    --accent: #b8860b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

#section-xiaobai.active {
    min-height: 100vh;
    padding: 16px;
}

/* ---- 返回按钮 ---- */
.back-btn {
    position: fixed;
    top: 20px;
    left: 50%; /* 改为居中定位 */
    transform: translateX(-50%); /* 水平居中 */
    margin-left: -800px; /* 微调位置，避免遮挡标题 */
    background: linear-gradient(135deg, var(--red), var(--dark-red));
    color: var(--light-gold);
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 999;
}

.back-btn:hover {
    transform: translateX(-50%) scale(1.05); /* 居中状态下缩放 */
    box-shadow: 0 0 10px rgba(216, 30, 68, 0.6);
}

/* ---- 标题 ---- */
.page-title {
    text-align: center;
    font-size: 2.4rem;
    color: var(--light-gold);
    margin-bottom: 4px;
    letter-spacing: 2px;
}
.page-subtitle {
    text-align: center;
    font-size: 1.05rem;
    color: var(--text-dim);
    margin-bottom: 12px;
}
.highlight {
    color: var(--light-gold);
    font-weight: bold;
}

/* ---- 红金分割线 ---- */
.red-line {
    width: 60%;
    max-width: 500px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--red), var(--gold), var(--red), transparent);
    margin: 24px auto;
    border-radius: 1px;
}

/* ---- 剩余票数 ---- */
.vote-status {
    text-align: center;
    font-size: 1.2rem;
    color: var(--gold);
    padding: 10px 20px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 8px;
    display: inline-block;
    margin: 0 auto;
    width: fit-content;
}

/* ---- 图片网格 ---- */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 8px;
}

.img-card {
    background: var(--card-bg);
    border: 1px solid #333;
    border-radius: 10px;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.img-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.2);
}

.img-card img {
    width: 100%;
    height: 240px;
    object-fit: contain;
    background: #111;
    cursor: pointer;
    transition: opacity .2s;
}
.img-card img:hover { opacity: 0.85; }

.img-name {
    padding: 10px 8px 4px;
    font-size: 0.95rem;
    color: var(--text);
    text-align: center;
}

/* ---- 投票按钮 ---- */
.vote-btn {
    margin: 6px 0 14px;
    padding: 10px 28px;
    background: linear-gradient(135deg, var(--red), var(--dark-red));
    color: var(--light-gold);
    border: none;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    letter-spacing: 1px;
}
.vote-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(216, 30, 68, 0.7);
}
.vote-btn:active { transform: scale(0.95); }
.vote-btn:disabled {
    background: #444;
    color: #777;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.vote-btn.voted {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: #fff;
}

/* ---- 结果区 ---- */
.results-section {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 8px 40px;
}
.results-section h2 {
    text-align: center;
    color: var(--gold);
    font-size: 1.5rem;
    border-bottom: 2px solid var(--red);
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.result-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.result-rank {
    color: var(--gold);
    font-weight: bold;
    min-width: 36px;
    text-align: right;
}

.result-name {
    min-width: 90px;
    color: var(--text);
}

.result-bar-wrap {
    flex: 1;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
}

.result-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--red), var(--gold));
    border-radius: 4px;
    transition: width .4s ease;
    min-width: 2px;
}

.result-count {
    color: var(--text-dim);
    min-width: 40px;
    text-align: right;
    font-size: 0.9rem;
}

/* ===========================
   灯箱
   =========================== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.lightbox.active {
    display: flex;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 28px;
    font-size: 2.5rem;
    color: #999;
    cursor: pointer;
    transition: color .2s;
    z-index: 10;
    line-height: 1;
}
.lightbox-close:hover { color: #fff; }

.lightbox-img {
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 60px rgba(0,0,0,0.5);
    cursor: default;
}

.lightbox-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #666;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .back-btn { top: 60px; }
}