/*
 * 前台主题：中国红（参考「投票系统前台显示截图」）
 * 加载顺序在 h5.css 之后，只做覆盖，不动结构。
 */
body.theme-festival {
    --primary: #e60012;
    --bg: #fff6f4;
    --card: #ffffff;
    --text: #241a1b;
    --muted: #9a8a8c;
    --line: #f2dede;
    background: var(--bg);
    color: var(--text);
}

/* ============ 顶部海报 ============ */
body.theme-festival .hero {
    background: #fff;
}
body.theme-festival .hero-slide {
    /* 与后台提示的 750×340 横幅比例一致，避免文字被裁切 */
    aspect-ratio: 750 / 340;
    max-height: 46vh;
    background-color: #f3e9e9;
    background-size: 100% 100% !important;
    background-repeat: no-repeat;
}
body.theme-festival .hero-overlay {
    background: linear-gradient(transparent, rgba(120, 8, 10, .82));
    padding: 46px 18px 16px;
}
body.theme-festival .hero-title {
    font-size: 21px;
    letter-spacing: 1px;
}
body.theme-festival .hero-status {
    top: auto;
    bottom: 64px;
    right: 50%;
    transform: translateX(50%);
    background: rgba(255, 255, 255, .92);
    color: #d40000;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(120, 8, 10, .25);
}

/* ============ 数据丝带 ============ */
body.theme-festival .stats {
    display: flex;
    margin: -16px 14px 0;
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg, #ff2d2d, #cf0000);
    clip-path: polygon(4% 0, 96% 0, 100% 50%, 96% 100%, 4% 100%, 0 50%);
    border-radius: 0;
    box-shadow: 0 6px 16px rgba(207, 0, 0, .22);
    padding: 12px 18px;
}
body.theme-festival .stats .item {
    flex: 1;
    text-align: center;
    position: relative;
}
body.theme-festival .stats .item + .item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 16%;
    height: 68%;
    border-left: 1px dashed rgba(255, 255, 255, .35);
}
body.theme-festival .stats .num {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: .5px;
}
body.theme-festival .stats .lbl {
    color: rgba(255, 255, 255, .88);
    font-size: 12px;
    margin-top: 2px;
}

/* ============ 活动标题区 ============ */
body.theme-festival .act-head {
    text-align: center;
    padding: 16px 18px 4px;
    background: #fff;
    border-bottom: 1px solid #fbe9e9;
}
body.theme-festival .status-tag {
    display: inline-block;
    background: #fbe0e2;
    color: #d40000;
    font-size: 13px;
    border-radius: 6px;
    padding: 5px 16px;
    letter-spacing: 1px;
}
body.theme-festival .status-tag.live {
    background: #ffe9e9;
    color: #d40000;
}
body.theme-festival .act-title {
    font-size: 20px;
    font-weight: 700;
    color: #1d1718;
    margin: 10px 0 4px;
    line-height: 1.4;
}
body.theme-festival .act-sub {
    font-size: 13px;
    color: var(--muted);
    padding-bottom: 8px;
}

/* ============ 丝带小标题 ============ */
body.theme-festival .ribbon {
    display: flex;
    justify-content: center;
    margin: 22px 0 14px;
}
body.theme-festival .ribbon > span {
    display: inline-block;
    min-width: 180px;
    text-align: center;
    background: linear-gradient(180deg, #ff3131, #cf0000);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 3px;
    padding: 8px 26px;
    clip-path: polygon(6% 0, 94% 0, 100% 50%, 94% 100%, 6% 100%, 0 50%);
    box-shadow: 0 4px 12px rgba(207, 0, 0, .22);
}
body.theme-festival .ribbon > span .cnt {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    opacity: .85;
    margin-left: 4px;
}
body.theme-festival .section-title {
    padding: 4px 14px 0;
}
body.theme-festival .section-title h2 {
    font-size: 16px;
    margin: 0;
}

/* ============ 搜索框 ============ */
body.theme-festival .search-bar {
    margin: 12px 14px;
    padding: 0;
    display: flex;
    background: #fff;
    border: 1px solid #efdcdc;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(180, 60, 60, .06);
}
body.theme-festival .search-bar input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    padding: 12px 14px;
    border-radius: 0;
}
body.theme-festival .search-bar input::placeholder {
    color: #bca9aa;
}
body.theme-festival .search-bar button {
    border: 0;
    background: linear-gradient(180deg, #ff2d2d, #d40000);
    color: #fff;
    font-size: 15px;
    letter-spacing: 2px;
    padding: 0 26px;
    border-radius: 0;
}

/* ============ 公告 ============ */
body.theme-festival .notice {
    margin: 0 14px;
    background: #fff;
    border: 1px solid #fbe3e3;
    border-radius: 8px;
    color: #6b5657;
    padding: 9px 12px;
    box-shadow: 0 2px 8px rgba(180, 60, 60, .04);
}
body.theme-festival .notice .ico {
    filter: none;
    font-size: 15px;
}
body.theme-festival .notice .track span {
    font-size: 13px;
}

/* ============ 快捷入口 ============ */
body.theme-festival .quick {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 12px 14px;
    padding: 0;
    background: transparent;
}
body.theme-festival .quick a {
    background: #fff;
    border: 1px solid #f6e3e3;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(180, 60, 60, .06);
    color: #3a2c2d;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 4px;
    min-height: 74px;
}
body.theme-festival .quick a .ico {
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 20px;
    border-radius: 9px;
    background: #fff0f0;
    color: #e60012;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
body.theme-festival .quick a.primary {
    background: linear-gradient(180deg, #ff3b30, #e00000);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 14px rgba(224, 0, 0, .28);
}
body.theme-festival .quick a.primary .ico {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

/* ============ 分组 / 排序 chips ============ */
body.theme-festival .tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 14px 10px;
    background: transparent;
    border: 0;
    scrollbar-width: none;
}
body.theme-festival .tabs::-webkit-scrollbar { display: none; }
body.theme-festival .tabs button {
    flex: 0 0 auto;
    border: 1px solid #f3dede;
    background: #faf1f1;
    color: #8a7476;
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 13px;
}
body.theme-festival .tabs button.on {
    background: linear-gradient(180deg, #ff2d2d, #d40000);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 3px 10px rgba(212, 0, 0, .22);
}

/* ============ 作品卡片 ============ */
body.theme-festival .works {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 12px 6px;
}
body.theme-festival .work-card {
    background: #fff;
    border: 1px solid #f7e5e5;
    border-radius: 9px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(150, 50, 50, .05);
}
body.theme-festival .work-card .cover {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1.22;
    background: #f4ecec center/cover no-repeat;
}
body.theme-festival .work-card .no {
    position: absolute;
    left: 6px;
    top: 6px;
    background: rgba(0, 0, 0, .42);
    color: #fff;
    font-size: 12px;
    border-radius: 3px;
    padding: 2px 7px;
    backdrop-filter: blur(2px);
}
body.theme-festival .work-card .body {
    padding: 8px 10px 10px;
}
body.theme-festival .work-card .name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    max-height: 2.8em;
    overflow: hidden;
}
body.theme-festival .work-card .meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}
body.theme-festival .work-card .votes {
    color: #d40000;
    font-size: 13px;
    font-weight: 600;
}
body.theme-festival .vote-btn {
    border: 0;
    background: linear-gradient(180deg, #ff3b30, #d40000);
    color: #fff;
    font-size: 12px;
    border-radius: 999px;
    padding: 5px 14px;
    box-shadow: 0 3px 8px rgba(212, 0, 0, .25);
}
body.theme-festival .vote-btn:disabled {
    opacity: .6;
}

/* ============ 内容面板 ============ */
body.theme-festival .panel {
    background: #fff;
    border: 1px solid #f7e5e5;
    border-radius: 10px;
    margin: 12px;
    padding: 14px 16px;
    box-shadow: 0 3px 10px rgba(150, 50, 50, .05);
}
body.theme-festival .panel h3 {
    font-size: 15px;
    margin: 0 0 8px;
    color: #1d1718;
}
body.theme-festival .panel .rules {
    color: #5a4a4b;
    font-size: 14px;
    line-height: 1.9;
}
body.theme-festival .muted { color: var(--muted); }
body.theme-festival .empty {
    text-align: center;
    color: #b7a3a4;
    padding: 26px 16px;
    font-size: 14px;
}
body.theme-festival .footer {
    text-align: center;
    color: #b7a3a4;
    font-size: 12px;
    line-height: 1.9;
    padding: 18px 20px;
}

/* ============ 底部导航 ============ */
body.theme-festival .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    background: #fff;
    border-top: 1px solid #f3e2e2;
    box-shadow: 0 -4px 14px rgba(150, 50, 50, .06);
    padding-bottom: env(safe-area-inset-bottom);
}
body.theme-festival .tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 7px 0 6px;
    color: #8c7a7c;
    font-size: 11px;
}
body.theme-festival .tabbar a .ico {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    border-radius: 6px;
    object-fit: cover;
}
body.theme-festival .tabbar a.on {
    color: #e60012;
    font-weight: 600;
}

/* ============ 登录弹层 / 表单 ============ */
body.theme-festival .mask {
    background: rgba(30, 10, 12, .55);
}
body.theme-festival .sheet {
    background: #fff;
    border-radius: 16px 16px 0 0;
    color: var(--text);
    box-shadow: 0 -10px 30px rgba(60, 10, 12, .18);
}
body.theme-festival .sheet h3 {
    color: #1d1718;
}
body.theme-festival .field label {
    color: #6b5657;
}
body.theme-festival .field input,
body.theme-festival .field textarea,
body.theme-festival .field select,
body.theme-festival .sheet input {
    background: #faf5f5 !important;
    border: 1px solid #efdcdc !important;
    color: var(--text) !important;
    border-radius: 10px !important;
}
body.theme-festival .sheet .muted {
    color: var(--muted);
}
body.theme-festival .sheet button,
body.theme-festival .btn,
body.theme-festival .submit-btn {
    background: linear-gradient(180deg, #ff3b30, #d40000);
    color: #fff;
    border: 0;
    border-radius: 999px;
}
body.theme-festival .devlink {
    border-top: 1px dashed #f0dcdc;
    color: #b4999b;
}

/* 主按钮统一红色胶囊（详情页投一票 / 我的 / 报名提交 / 加载更多） */
body.theme-festival .primary,
body.theme-festival .button.primary,
body.theme-festival #btnGoLogin,
body.theme-festival #btnLogin,
body.theme-festival #btnBuy,
body.theme-festival .submit-btn,
body.theme-festival #btnMore,
body.theme-festival #btnDevLogin {
    background: linear-gradient(180deg, #ff3b30, #d40000);
    color: #fff;
    border: 0;
    border-radius: 999px;
    font-weight: 600;
    padding: 11px 22px;
    box-shadow: 0 6px 16px rgba(212, 0, 0, .25);
}
body.theme-festival .ghost {
    background: #fff;
    color: #d40000;
    border: 1px solid #f3c9c9;
    border-radius: 999px;
    padding: 10px 20px;
    font-weight: 500;
}
body.theme-festival button.del {
    background: #fff;
    color: #a33;
    border: 1px solid #f3c9c9;
    border-radius: 999px;
}
body.theme-festival .vote-num,
body.theme-festival .vote-num small {
    color: #d40000;
}
body.theme-festival .work-head .num b,
body.theme-festival .work-head .num {
    color: #d40000;
}

/* ============ 作品详情 ============ */
body.theme-festival .work-head {
    background: #fff;
    color: var(--text);
    padding: 14px 16px;
    border-bottom: 1px solid #fbe9e9;
}
body.theme-festival .work-head .page-head h1,
body.theme-festival .page-head h1 {
    color: #1d1718;
    font-size: 19px;
}
body.theme-festival .page-head {
    background: #fff;
    color: var(--text);
    border-bottom: 1px solid #fbe9e9;
}
body.theme-festival .back {
    color: #8c7a7c;
}
body.theme-festival .media-box {
    background: #111;
}
body.theme-festival .work-head .num,
body.theme-festival .work-head .num .lbl {
    color: #7b6466;
}
body.theme-festival .work-head .num b {
    color: #d40000;
}
body.theme-festival .thumb-tag {
    background: rgba(230, 0, 18, .85);
    color: #fff;
}
body.theme-festival .avatar,
body.theme-festival .avatar-big {
    border-color: #fff;
    box-shadow: 0 2px 8px rgba(120, 20, 20, .18);
}

/* ============ 排行榜 ============ */
body.theme-festival .podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    padding: 24px 14px 16px;
    background: linear-gradient(180deg, #fff1f1, #fff);
    border-bottom: 1px solid #fbe9e9;
}
body.theme-festival .podium .slot {
    flex: 1;
    max-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #3a2c2d;
}
body.theme-festival .podium .crown {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 6px;
}
body.theme-festival .podium .avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f4e7e7 center/cover no-repeat;
    border: 3px solid #fff;
    box-shadow: 0 4px 14px rgba(150, 40, 40, .2);
}
body.theme-festival .podium .top1 .avatar {
    width: 76px;
    height: 76px;
    border-color: #ffd66b;
}
body.theme-festival .podium .top2 .avatar { border-color: #d9dde6; }
body.theme-festival .podium .top3 .avatar { border-color: #eac09a; }
body.theme-festival .podium .nm {
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
body.theme-festival .podium .vv {
    color: #d40000;
    font-size: 13px;
    font-weight: 700;
    margin-top: 2px;
}
body.theme-festival .rank-list {
    padding: 12px;
}
body.theme-festival .rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(180deg, #fff2f2, #ffe3e3);
    border: 1px solid #fbdada;
    border-radius: 10px;
    margin: 0 0 10px;
    padding: 11px 14px;
    color: var(--text);
    text-decoration: none;
}
body.theme-festival .rank-item .rk {
    width: 22px;
    text-align: center;
    color: #d40000;
    font-weight: 700;
}
body.theme-festival .rank-item .av {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f3e7e7 center/cover no-repeat;
    flex: none;
}
body.theme-festival .rank-item .nm {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}
body.theme-festival .rank-item .vv {
    color: #d40000;
    font-weight: 600;
    font-size: 14px;
}

/* ============ 报名 / 我的 / 钻石 ============ */
body.theme-festival .upload-box {
    background: #faf5f5;
    border: 1px dashed #edd6d6;
    color: #b4999b;
}
body.theme-festival .uploaded {
    background: #faf5f5;
    border: 1px solid #f0dcdc;
}
body.theme-festival .card-grid {
    padding: 12px 14px;
}
body.theme-festival .card-item {
    background: #fff;
    border: 1px solid #f7e5e5;
    color: var(--text);
    box-shadow: 0 3px 10px rgba(150, 50, 50, .05);
}
body.theme-festival .card-item .arr {
    color: #d6b6b8;
}
body.theme-festival .diamond-bar {
    background: #fff;
    border: 1px solid #f7e5e5;
    color: var(--text);
}
body.theme-festival .diamond-bar b {
    color: #d40000;
}
body.theme-festival .pack-grid {
    padding: 0;
}
body.theme-festival .pack-item {
    background: #fff;
    border: 1px solid #f0dcdc;
    color: var(--text);
}
body.theme-festival .pack-item.on {
    border-color: #e60012;
    background: #fff2f2;
}
body.theme-festival .ledger-item {
    border-bottom: 1px solid #f7e5e5;
    color: var(--text);
}
body.theme-festival .ledger-item .plus {
    color: #d40000;
}
body.theme-festival .ledger-item .minus {
    color: #7b6466;
}
body.theme-festival .my-work {
    background: #fff;
    border: 1px solid #f7e5e5;
}
body.theme-festival .gift-grid {
    padding: 10px 12px;
}
body.theme-festival .gift-item {
    background: #fff;
    border: 1px solid #f7e5e5;
    color: var(--text);
    box-shadow: 0 3px 10px rgba(150, 50, 50, .05);
}
body.theme-festival .gift-item .g-name {
    color: #3a2c2d;
}
body.theme-festival .gift-item .g-meta {
    color: #8a7476;
}
body.theme-festival .gift-senders {
    background: #fff8f8;
    border-top: 1px solid #fbe9e9;
}
body.theme-festival .reject {
    color: #d40000;
}

/* 不遮挡底部导航 */
body.theme-festival {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
}
