/* ═══════════════════════════════════════════════════════════════
   主题色变量 (默认 = theme1 亮色, .theme2 覆盖)
   变量作用域: .box-office-page (HTML 包裹层, 不污染其他页)
   ═══════════════════════════════════════════════════════════════ */
.box-office-page {
    /* theme1 默认 */
    --bo-card-bg:           rgba(255, 255, 255, 0.9);
    --bo-card-border:       rgba(0, 0, 0, 0.08);
    --bo-card-shadow:       0 2px 8px rgba(0, 0, 0, 0.06);
    --bo-card-hover-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    --bo-card-hover-border: #1d2129;
    --bo-name-color:        #1d2129;            /* 对齐 .theme1 .cor4 */
    --bo-sub-color:         rgb(78, 89, 105);   /* 对齐 .theme1 .cor5 */
    --bo-meta-color:        rgb(78, 89, 105);
    --bo-toolbar-bg:        #f8f9fa;
    --bo-toolbar-border:    rgba(0, 0, 0, 0.06);
    --bo-info-color:        #666;
    --bo-btn-border:        #ddd;
    --bo-btn-bg:            #fff;
    --bo-btn-color:         inherit;
    --bo-placeholder-bg:    #eee;
    --bo-noimg-color:       #aaa;
    --bo-empty-bg:          #fff;
    --bo-empty-color:       #999;
    --bo-movie-result-bg:   #fff;
    --bo-boxinfo-bg-start:  #fff5f0;
    --bo-boxinfo-bg-end:    #fff;
    --bo-summary-border:    #eee;
    --bo-summary-color:     #555;
    --bo-close-bg:          rgba(0, 0, 0, 0.05);
    --bo-close-color:       #999;
    --bo-rank-badge-bg:     rgba(0, 0, 0, 0.5);
}

/* theme2 (暗色玻璃) */
.theme2 .box-office-page {
    --bo-card-bg:           rgba(0, 0, 0, 0.4);
    --bo-card-border:       rgba(255, 255, 255, 0.08);
    --bo-card-shadow:       0 2px 12px rgba(0, 0, 0, 0.3);
    --bo-card-hover-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --bo-card-hover-border: rgba(255, 255, 255, 0.5);
    --bo-name-color:        hsla(0, 0%, 100%, 0.9);    /* 对齐 .theme2 .cor4 */
    --bo-sub-color:         rgb(169, 169, 172);         /* 对齐 .theme2 .cor5 */
    --bo-meta-color:        rgb(169, 169, 172);
    --bo-toolbar-bg:        rgba(0, 0, 0, 0.25);
    --bo-toolbar-border:    rgba(255, 255, 255, 0.08);
    --bo-info-color:        rgba(255, 255, 255, 0.6);
    --bo-btn-border:        rgba(255, 255, 255, 0.15);
    --bo-btn-bg:            rgba(255, 255, 255, 0.05);
    --bo-btn-color:         hsla(0, 0%, 100%, 0.9);
    --bo-placeholder-bg:    rgba(255, 255, 255, 0.08);
    --bo-noimg-color:       rgba(255, 255, 255, 0.4);
    --bo-empty-bg:          rgba(0, 0, 0, 0.2);
    --bo-empty-color:       rgba(255, 255, 255, 0.5);
    --bo-movie-result-bg:   rgba(0, 0, 0, 0.4);
    --bo-boxinfo-bg-start:  rgba(255, 107, 53, 0.1);
    --bo-boxinfo-bg-end:    rgba(0, 0, 0, 0.2);
    --bo-summary-border:    rgba(255, 255, 255, 0.08);
    --bo-summary-color:     rgba(255, 255, 255, 0.7);
    --bo-close-bg:          rgba(255, 255, 255, 0.08);
    --bo-close-color:       rgba(255, 255, 255, 0.6);
    --bo-rank-badge-bg:     rgba(0, 0, 0, 0.7);
}

/* ═══════════════════════════════════════════════════════════════
   顶部 banner 主题色（品牌橙）
   banner 结构、字号等通用样式 已在 style_add.css .page-banner 定义
   ═══════════════════════════════════════════════════════════════ */
.boxoffice-page-banner {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
}

/* ═══════════════════════════════════════════════════════════════
   工具栏 (主题色)
   ═══════════════════════════════════════════════════════════════ */
.bo-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: clamp(10px, 1.5vw, 16px) clamp(12px, 2vw, 20px);
    background: var(--bo-toolbar-bg);
    border: 1px solid var(--bo-toolbar-border);
    border-radius: 8px;
    margin-bottom: 20px;
    transition: background 0.2s, border-color 0.2s;
}
.bo-info {
    display: flex;
    flex: 1 1 auto;        /* v2.5: 弹性占满剩余空间, 不要 space-between */
    min-width: 0;
    gap: clamp(8px, 1.5vw, 20px);
    font-size: 13px;
    color: var(--bo-info-color);
    flex-wrap: wrap;
    transition: opacity 0.2s;
}
.bo-info strong {
    color: #ff6b35;
    font-size: 15px;
    margin: 0 2px;
}

/* ═══════════════════════════════════════════════════════════════
   按钮 (主题色)
   ═══════════════════════════════════════════════════════════════ */
.bo-btn {
    padding: 8px 16px;
    border: 1px solid var(--bo-btn-border);
    background: var(--bo-btn-bg);
    color: var(--bo-btn-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;       /* v2.5.2: 防查询按钮文字被竖排 */
    transition: all .2s;
}
.bo-btn:hover {
    border-color: #ff6b35;
    color: #ff6b35;
}
.bo-btn-primary {
    background: #ff6b35;
    color: #fff;
    border-color: #ff6b35;
}
.bo-btn-primary:hover {
    background: #f7931e;
    color: #fff;
}
.bo-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}
.bo-search {
    margin-left: 0;            /* v2.5: 取消 auto, 换行后不要被推到右 */
    display: flex;
    gap: 6px;
    flex: 0 1 auto;
    transition: all 0.2s;
}
.bo-search input {
    padding: 8px 12px;
    border: 1px solid var(--bo-btn-border);
    background: var(--bo-btn-bg);
    color: var(--bo-btn-color);
    border-radius: 4px;
    font-size: 14px;
    width: clamp(150px, 20vw, 220px);
    transition: all 0.2s;
}
.bo-search input:focus {
    outline: none;
    border-color: #ff6b35;
}

/* ═══════════════════════════════════════════════════════════════
   提示框 (语义化, 不受主题影响)
   ═══════════════════════════════════════════════════════════════ */
.bo-alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}
.bo-alert-info    { background: #e7f3fe; color: #1976d2; border-left: 4px solid #1976d2; }
.bo-alert-success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #2e7d32; }
.bo-alert-error   { background: #ffebee; color: #c62828; border-left: 4px solid #c62828; }
.bo-alert-warning { background: #fff3e0; color: #e65100; border-left: 4px solid #e65100; }

/* ═══════════════════════════════════════════════════════════════
   卡片网格 (主题色 + 间距自适应, 列数不变)
   ═══════════════════════════════════════════════════════════════ */
.bo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: clamp(10px, 1.2vw, 16px);       /* 卡片间距: 自适应 10-16 */
}

.theme1 .bo-card{
    background-color: #fff;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    gap: clamp(10px, 1.2vw, 14px);       /* 卡片内 海报+信息 间距: 自适应 */
    padding: clamp(10px, 1.2vw, 14px);   /* 卡片内边距: 自适应 */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
}
.theme2 .bo-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    gap: clamp(10px, 1.2vw, 14px);       /* 卡片内 海报+信息 间距: 自适应 */
    padding: clamp(10px, 1.2vw, 14px);   /* 卡片内边距: 自适应 */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
    border: 1px solid rgba(63, 63, 63, 0.67);
    filter: drop-shadow(rgba(0, 0, 0, 0.31) 2px 11px 30px);
    backdrop-filter: blur(26.5px);
    background: linear-gradient(273deg, rgba(191, 191, 191, 0.14) 27.08%, rgba(74, 74, 74, 0.13) 100.67%), rgba(0, 0, 0, 0.33);
}



/* 不支持 backdrop-filter 时降级 (Safari < 14 等) */
@supports not (backdrop-filter: blur(1px)) {
    .theme1 .box-office-page .bo-card { background: rgba(255, 255, 255, 0.95); }
    .theme2 .box-office-page .bo-card { background: rgba(20, 20, 20, 0.85); }
}
.bo-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--bo-card-hover-shadow);
    border-color: var(--bo-card-hover-border);
}

/* 排名 (保留品牌色, 主题下都清晰) */
.bo-card-rank {
    position: absolute;
    top: calc(-1 * 0.25rem);
    right: .75rem;
    background: rgb(169,169,172);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 10px;
    border-radius: 0 0 10px 10px;
    min-width: 24px;
    text-align: center;
    z-index: 1;
}
.bo-card-top .bo-card-rank {
    background: #fc4274d4;
}
.bo-card-top:nth-child(2) .bo-card-rank {
    background: #fa6400;
}
.bo-card-top:nth-child(3) .bo-card-rank {
    background: #ffb802;
}

/* 海报 */
.bo-card-poster {
    flex-shrink: 0;
    width: 90px;
    height: 130px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bo-placeholder-bg);
}
.bo-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bo-card-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--bo-noimg-color);
    font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   卡片信息
   - 文字层级严格对齐首页 .time-title / .public-list-subtitle
   - 纵向间距用 margin-top: clamp() 自适应
   ═══════════════════════════════════════════════════════════════ */
.bo-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;        /* 改: 不要 space-between, 紧凑 */
    gap: 2px;                            /* 卡片内子元素之间总间距: 紧 */
}

/* 影片名: 16px / 400 / .cor4 / 单行 22px (v2.4 紧凑) */
.bo-card-name {
    font-size: 16px;
    font-weight: 400;
    line-height: 22px;
    height: 22px;
    color: var(--bo-name-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s;
}

/* 英文名: 13px / .cor5 / 单行 18px (v2.4 紧凑) */
.bo-card-en {
    font-size: 13px;
    color: var(--bo-sub-color);
    line-height: 18px;
    height: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s;
}

/* 累计票房块 (label + value 一行显示) */
.bo-card-box {
    display: flex;
    flex-direction: row;                 /* v2.4 改: 横向布局, label 和 value 一行 */
    align-items: baseline;               /* label 和 value 基线对齐 */
    gap: 6px;                            /* label 和 value 之间间距 */
    flex-wrap: nowrap;
}
.bo-card-label {
    font-size: 13px;
    color: var(--bo-sub-color);
    line-height: 20px;
    flex-shrink: 0;                      /* label 不压缩 */
    transition: color 0.2s;
}
/* 累计票房 value: 保留品牌橙 #ff6b35 (强调元素) */
.bo-card-value {
    font-size: 17px;
    font-weight: 700;
    color: #ff6b35;
    line-height: 22px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;                        /* 允许 value 在父容器不中 flex 压缩 */
}
.theme2 .bo-card-value {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* meta 行 (导演/上映/评分) */
.bo-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 8px;                        /* v2.4 紧凑: 行间距 2, 列间距 8 */
    font-size: 12px;                     /* v2.4 缩小: 13 → 12 */
    color: var(--bo-meta-color);
    line-height: 1.5;
    transition: color 0.2s;
}
.bo-card-rating {
    color: #f7931e !important;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   加载 / 空状态
   ═══════════════════════════════════════════════════════════════ */
.bo-loading, .bo-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--bo-empty-color);
    padding: 40px;
    background: var(--bo-empty-bg);
    border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   单片详情卡片
   ═══════════════════════════════════════════════════════════════ */
.bo-movie-result {
    background: var(--bo-movie-result-bg);
    border: 1px solid var(--bo-card-border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--bo-card-shadow);
    transition: background 0.2s, border-color 0.2s;
}
.bo-movie-card {
    display: flex;
    gap: 20px;
    position: relative;
}
.bo-card-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bo-close-bg);
    color: var(--bo-close-color);
    font-size: 22px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    transition: all .15s;
    z-index: 2;
}
.bo-card-close:hover {
    background: #ff4e4e;
    color: #fff;
    transform: rotate(90deg);
}
.bo-poster {
    width: 160px;
    height: 220px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--bo-placeholder-bg);
}
.bo-movie-info {
    flex: 1;
    min-width: 0;
}
.bo-movie-info h2 {
    margin: 0 0 12px;
    font-size: 22px;
    color: var(--bo-name-color);
    transition: color 0.2s;
}
.bo-id {
    font-size: 12px;
    color: var(--bo-sub-color);
    font-weight: normal;
    margin-left: 8px;
    transition: color 0.2s;
}
.bo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--bo-meta-color);
    transition: color 0.2s;
}
.bo-boxinfo {
    display: flex;
    gap: 24px;
    margin: 16px 0;
    padding: 16px;
    background: linear-gradient(135deg, var(--bo-boxinfo-bg-start) 0%, var(--bo-boxinfo-bg-end) 100%);
    border-radius: 6px;
}
.bo-box-big {
    display: flex;
    flex-direction: column;
}
.bo-label {
    font-size: 12px;
    color: var(--bo-sub-color);
    margin-bottom: 4px;
}
.bo-value {
    font-size: 22px;
    font-weight: 700;
    color: #ff5722;
}
.bo-summary {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--bo-summary-border);
    color: var(--bo-summary-color);
    font-size: 14px;
    line-height: 1.7;
    transition: color 0.2s, border-color 0.2s;
}

/* ═══════════════════════════════════════════════════════════════
   响应式 (列数不变, 只调 padding/font 紧凑度)
   v2.5: toolbar 三档布局
   - 大屏 (>1024px): 1 行, info + 按钮 + 搜索
   - 中间 (769-1024px): 2 行, [info+按钮] 一行 + 搜索全宽一行
   - 小屏 (≤768px): 1 行, 只显示搜索 (info 和 同步按钮隐藏)
   ═══════════════════════════════════════════════════════════════ */

/* 中间断点: 2 行布局 */
@media (max-width: 1024px) and (min-width: 769px) {
    .bo-toolbar { gap: 10px; }
    /* 让 .bo-search 换行后占满整行, 不靠右 */
    .bo-search {
        flex: 1 0 100%;      /* 占满整行 (一行) */
        margin-left: 0;
    }
    .bo-search input { width: 100%; }
    /* v2.5.2: 修复中断点查询按钮文字被竖排 */
    .bo-search #btnQuery {
        flex-shrink: 0;
        min-width: 56px;
        white-space: nowrap;
        padding: 8px 12px;
    }
}

/* 小屏: 1 行, 只显示搜索 */
@media (max-width: 768px) {
    .boxoffice-page-banner { padding: 28px 16px; }
    .boxoffice-page-banner h1 { font-size: 24px; }
    .bo-toolbar { padding: 10px 12px; gap: 8px; }
    /* v2.5: 隐藏 info 和 同步按钮, 只留搜索 */
    .bo-info,
    #btnSync { display: none !important; }
    .bo-search { flex: 1 1 100%; margin-left: 0; }
    .bo-search input { width: 100%; }
    /* v2.5.1: 修复小屏查询按钮文字被竖排 */
    .bo-search #btnQuery {
        flex-shrink: 0;
        width: auto;
        min-width: 56px;
        white-space: nowrap;
        padding: 8px 12px;
    }
    /* 卡片 */
    .bo-movie-card { flex-direction: column; }
    .bo-poster { width: 100%; height: auto; max-height: 320px; }
    .bo-boxinfo { flex-direction: column; gap: 12px; }
    .bo-card { padding: 10px; gap: 10px; }
    .bo-card-poster { width: 75px; height: 110px; }
    .bo-card-name { font-size: 14px; line-height: 20px; height: 20px; }
    .bo-card-en { font-size: 12px; line-height: 16px; height: 16px; }
    .bo-card-value { font-size: 15px; line-height: 20px; }
    .bo-card-label { font-size: 12px; line-height: 18px; }
    .bo-card-meta { font-size: 11px; gap: 2px 6px; }
}

.boxoffice-page-banner h1 .iconfont-ylfb.yb-maoyan {
    display: inline-block;
    vertical-align: -4px;
    font-size: 32px;          /* 统一 32px */
    font-family: "iconfont-ylfb" !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
/* ═══════════════════════════════════════════════════════════════
   数据来源 (与 hotlist.css .data-source 保持一致, 2026-07-14)
   ═══════════════════════════════════════════════════════════════ */
.data-source {
    text-align: center;
    padding: 30px 0 0;
    color: #666;
    font-size: 12px;
}
.data-source a { color: #ff9800; }
