/* 追番列表 */
.bgm-collection {
    display: flex;
    flex-flow: row wrap;
    margin: 0 auto 0 -15px;
    width: calc(100% + 15px);
}

.bgm-item {
    display: block;
    margin-left: 15px;
    margin-bottom: 15px;
    position: relative;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
    transition: 0.3s ease box-shadow;
    border: none !important;
    text-decoration: none !important;
    background: #fff;
}

.bgm-item:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    border: none !important;
    text-decoration: none !important;
}

@media screen and (max-width: 768px) {
    .bgm-item {
        width: calc(33.33333333333% - 15px)
    }
}

@media screen and (max-width: 450px) {
    .bgm-item {
        width: calc(50% - 15px)
    }
}

@media screen and (min-width: 768px) {
    .bgm-item {
        width: calc(25% - 15px)
    }

    .bgm-calendar {
        gap: 0.5rem;
    }

    .cal-day-row {
        flex-direction: row;
    }

    .cal-day-row-header {
        width: 3.5rem;
        border-bottom: none;
        border-right: 1px solid #edf2f7;
    }

    .cal-day-row-header h3 {
        writing-mode: vertical-rl;
        text-orientation: mixed;
        letter-spacing: 0.2rem; /* 增加字符间距，更美观 */
        font-size: 1rem; /* 调整字号以适应容器 */
    }
}

.bgm-item-thumb {
    width: 100%;
    padding-top: 143%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.bgm-item-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    overflow: hidden;
}

.bgm-item-info > * {
    display: block;
    text-align: center;
    margin: 0 auto;
    max-width: 100%;
}

.bgm-item-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
    color: #333
}

.bgm-item-title:not(.main) {
    color: #5e5b5c;
}

.bgm-item-title.main {
    font-size: 1.2rem;
}

.bgm-item-statusBar-container {
    margin: 0.2rem auto;
    padding: 0.2em;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
    position: relative;
    z-index: 0;
    color: #333;
}

.bgm-item-statusBar {
    position: absolute;
    height: 100%;
    background: lightpink;
    left: 0;
    top: 0;
    z-index: -1;
}

/* 追番日历 - 标签页新样式 */
.bgm-calendar {
    background-color: #fff;
    border-radius: 8px;
    padding: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin: 30px auto;
}

/* 标签页容器 */
.cal-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid #f0f2f5;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

/* 标签按钮 */
.cal-tab-button {
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    font-weight: 500;
    color: #555;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px; /* 让边框和容器边框重合 */
}

.cal-tab-button:hover {
    color: #000;
}

.cal-tab-button.active {
    color: #E800A4; /* 主题色 */
    border-bottom-color: #E800A4;
}

/* 内容面板容器 */
.cal-panels {
    position: relative;
}

/* 单个内容面板 */
.cal-panel {
    display: none; /* 默认隐藏 */
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); /* 响应式网格布局 */
    gap: 1rem;
    animation: fadeIn 0.5s ease;
}

.cal-panel.active {
    display: grid; /* 激活时显示为网格 */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 面板内的番剧卡片 */
.cal-bangumi-item {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3; /* 经典的封面比例 */
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cal-bangumi-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.cal-bangumi-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    font-size: 12px;
    padding: 1.5rem 0.5rem 0.5rem;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.3s ease;
}

.cal-bangumi-item:hover .cal-bangumi-title-overlay {
    opacity: 0; /* 鼠标悬浮时隐藏标题，以完整展示封面 */
}

.cal-no-item {
    color: #a0aec0;
    font-size: 1rem;
    text-align: center;
    padding: 2rem 0;
    grid-column: 1 / -1; /* 占满整行 */
}

/* 番剧卡片 */

/* 番剧卡片 - 精装版样式 */
.bgm-card {
    font-family: 'Montserrat', helvetica, arial, sans-serif;
    position: relative;
    display: block;
    max-width: 800px;
    width: 100%;
    box-sizing: border-box;
    margin: 30px auto;
    overflow: hidden;
    border-radius: 12px;
    transition: all 0.4s;
    box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0;
}

.bgm-card:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px -15px rgba(0, 0, 0, 0.3);
}

.bgm-card .bgm-card-info-section {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(245, 245, 247, 0.95) 60%, rgba(245, 245, 247, 0.8) 100%);
    z-index: 2;
    border-radius: 10px;
    padding: 20px 0;
}

.bgm-card .bgm-card-anime-header {
    position: relative;
    padding: 15px 25px;
    display: grid;
    grid-template-columns: auto 1fr auto; /* 海报 | 主要信息 | 评分徽章 */
    grid-template-rows: 1fr;
    gap: 20px;
    align-items: center;
}

.bgm-card .bgm-card-locandina {
    grid-column: 1 / 2;
    height: 160px;
    width: 112px;
    box-shadow: 0 5px 20px -5px rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    overflow: hidden;
}

.bgm-card .bgm-card-locandina img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bgm-card .main-info {
    grid-column: 2 / 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bgm-card .main-info .title {
    color: #1a1a1a;
    font-weight: 700;
    font-size: 2em;
    margin: 0;
    line-height: 1.2;
}

.bgm-card .main-info .subtitle {
    color: #555;
    font-weight: 400;
    font-size: 1rem;
    font-family: 'Noto Sans JP', sans-serif;
    margin: 5px 0 0 0;
    min-height: 1.2em; /* 确保即使为空也占据稳定高度 */
}

.bgm-card .meta-pills-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bgm-card .meta-pills {
    display: inline-block;
    color: #555;
    padding: 6px 10px;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.6);
    font-size: 0.85em;
    margin: 0;
}

.bgm-card .meta-rank,
.bgm-card .meta-eps {
    font-weight: bold;
    color: #333;
}

.bgm-card .score-badge {
    grid-column: 3 / 4;
    width: 90px;
    height: 90px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.bgm-card .score-badge .score-value {
    font-size: 2.2em;
    font-weight: 700;
    color: #E800A4;
    line-height: 1;
}

.bgm-card .score-badge .score-text {
    font-size: 0.9em;
    font-weight: 500;
    color: #333;
    margin-top: 5px;
}

.bgm-card .bgm-card-anime-desc {
    padding: 0 25px 10px 25px;
    margin-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    padding-top: 15px;
}

.bgm-card .bgm-card-anime-desc .summary-text {
    color: #4a4a4a;
    line-height: 1.7;
    clear: both;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    margin: 0;
}

.bgm-card .bgm-card-blur-back {
    position: absolute;
    top: 0;
    z-index: 1;
    height: 100%;
    width: 100%;
    right: 0;
    background-size: cover;
    background-position: center;
    border-radius: 11px;
    filter: blur(15px) saturate(1.2);
    opacity: 0.6;
}

/* 让番剧卡片的链接包裹层表现正常 */
.bgm-card .bgm-card-link-wrapper {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* 响应式调整 - 可选 */
@media screen and (max-width: 768px) {
    .bgm-card .bgm-card-anime-header {
        grid-template-columns: 1fr; /* 在移动端堆叠 */
        gap: 15px;
        text-align: center;
    }
    .bgm-card .bgm-card-locandina, .bgm-card .main-info, .bgm-card .score-badge {
        grid-column: 1 / -1; /* 全部占满整行 */
        margin-left: auto;
        margin-right: auto;
    }
    .bgm-card .meta-pills-group {
        justify-content: center;
    }
}

@media screen and (max-width: 767px) {
    .bgm-card {
        width: 95%;
        max-width: 400px;
        margin: 30px auto;
        height: auto;
    }
    .bgm-card .bgm-card-blur-back {
        width: 100%;
        background-position: 50% 50% !important;
    }
    .bgm-card .bgm-card-info-section {
        background: linear-gradient(to top, #e5e6e6dd 50%, transparent 100%);
    }
}

.meta-icon {
    display: inline-block;
    width: 1em; /* 尺寸跟随字体大小 */
    height: 1em;
    margin-right: 8px;
    background-color: currentColor; /* 继承父元素的文字颜色 */
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    flex-shrink: 0;
}

.icon-star {
    -webkit-mask-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"/></svg>');
    mask-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"/></svg>');
}

.icon-trophy {
    -webkit-mask-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.2,2H19.5H4.5H3.8H2V11C2,12 3,13 4,13H7.2C7.6,14.9 8.6,16.6 11,16.9V19C8,19.2 8,20.3 8,21H16C16,20.3 16,19.2 13,19V16.9C15.4,16.6 16.4,14.9 16.8,13H20C21,13 22,12 22,11V2H20.2M4,11V4H7V11H4M17,11V4H20V11H17Z"/></svg>');
    mask-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.2,2H19.5H4.5H3.8H2V11C2,12 3,13 4,13H7.2C7.6,14.9 8.6,16.6 11,16.9V19C8,19.2 8,20.3 8,21H16C16,20.3 16,19.2 13,19V16.9C15.4,16.6 16.4,14.9 16.8,13H20C21,13 22,12 22,11V2H20.2M4,11V4H7V11H4M17,11V4H20V11H17Z"/></svg>');
}

.icon-calendar {
    -webkit-mask-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19,19H5V8H19M19,3H18V1H16V3H8V1H6V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M16.53,11.06L15.47,10L10.59,14.88L8.47,12.76L7.41,13.82L10.59,17L16.53,11.06Z"/></svg>');
    mask-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19,19H5V8H19M19,3H18V1H16V3H8V1H6V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M16.53,11.06L15.47,10L10.59,14.88L8.47,12.76L7.41,13.82L10.59,17L16.53,11.06Z"/></svg>');
}

.icon-tv {
    -webkit-mask-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21,3H3C1.89,3 1,3.89 1,5V17A2,2 0 0,0 3,19H8V21H16V19H21A2,2 0 0,0 23,17V5C23,3.89 22.1,3 21,3M21,17H3V5H21V17Z"/></svg>');
    mask-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21,3H3C1.89,3 1,3.89 1,5V17A2,2 0 0,0 3,19H8V21H16V19H21A2,2 0 0,0 23,17V5C23,3.89 22.1,3 21,3M21,17H3V5H21V17Z"/></svg>');
}

.icon-list {
    -webkit-mask-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9,5V9H21V5M9,19H21V15H9M9,14H21V10H9M4,9H8V5H4M4,19H8V15H4M4,14H8V10H4V14Z"/></svg>');
    mask-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9,5V9H21V5M9,19H21V15H9M9,14H21V10H9M4,9H8V5H4M4,19H8V15H4M4,14H8V10H4V14Z"/></svg>');
}

.bgm-card-meta .meta-item .score {
    font-weight: bold;
    color: #ff8c00;
}

.bgm-card-meta .meta-item .rank {
    font-weight: bold;
    color: #3b82f6;
}

.bgm-card-summary {
    font-size: 0.9em;
    color: #666;
    margin-top: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.6;
}

.bgm-card .loading-state,
.bgm-card .error-state {
    width: 100%;
    text-align: center;
    color: #999;
    padding: 50px 0;
    font-size: 1em;
}

.bgm-card .error-state {
    color: #e53935;
}

.loader {
    text-align: center;
    padding: 0.3em;
    width: 6.5em;
    margin: 1.2rem auto;
    border: 3px solid rgba(0, 0, 0, 0.2);
    color: #333;
    transition: 0.3s ease all;
    cursor: pointer;
    white-space: nowrap;
}

body.theme-dark .loader {
    border: 3px solid rgba(255, 255, 255, 0.2);
    color: #b0b0b0
}

.loader:hover,
body.theme-dark .loader:hover {
    border: 3px solid lightpink;
    color: lightpink;
}

.dot {
    width: 8px;
    height: 8px;
    background: lightpink;
    border-radius: 100%;
    display: inline-block;
    -webkit-animation: slide 1s infinite;
    animation: slide 1s infinite;
    margin: 0 10px
}

.dot:nth-child(1) {
    -webkit-animation-delay: .1s;
    animation-delay: .1s;
}

.dot:nth-child(2) {
    -webkit-animation-delay: .2s;
    animation-delay: .2s;
}

.dot:nth-child(3) {
    -webkit-animation-delay: .3s;
    animation-delay: .3s;
}

@-webkit-keyframes slide {
    0% {
        -webkit-transform: scale(1);
        transform: scale(1)
    }
    50% {
        opacity: .3;
        -webkit-transform: scale(2);
        transform: scale(2)
    }
    100% {
        -webkit-transform: scale(1);
        transform: scale(1)
    }
}

@keyframes slide {
    0% {
        -webkit-transform: scale(1);
        transform: scale(1)
    }
    50% {
        opacity: .3;
        -webkit-transform: scale(2);
        transform: scale(2)
    }
    100% {
        -webkit-transform: scale(1);
        transform: scale(1)
    }
}


/* --- 夜间模式样式追加 (v3 - 匹配纯黑主题) --- */

/* 整体背景和边框 */
body.theme-dark .bgm-calendar {
    background-color: #1c1c1c; /* 几乎是黑色的深灰色，用于在纯黑背景上创建层次 */
    border: 1px solid #333333;   /* 边框颜色也相应调暗 */
    box-shadow: none;
}

/* 标签页下边框 */
body.theme-dark .cal-tabs {
    border-bottom-color: #333333; /* 匹配边框的颜色 */
}

/* 标签按钮文字颜色 */
body.theme-dark .cal-tab-button {
    color: #a9a9a9;
}

/* 标签按钮悬浮和激活颜色 */
body.theme-dark .cal-tab-button:hover,
body.theme-dark .cal-tab-button.active {
    color: #ffffff;
    border-bottom-color: #ffffff;
}

/* 日历内番剧卡片的阴影 */
body.theme-dark .cal-bangumi-item {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

body.theme-dark .cal-bangumi-item:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.7);
}

/* “今日无更新”的文字颜色 */
body.theme-dark .cal-no-item {
    color: #888888;
}