/* ===========================================
   1919围棋网首页样式
   =========================================== */

/* ===========================================
   0. Bootstrap Carousel 轮播图样式
   =========================================== */

/* 轮播容器 */
#carouselIndex {
    margin-bottom: 2rem;
}

/* 轮播图片样式 */
#carouselIndex .carousel-item {
    transition: transform 0.6s ease-in-out;
    padding: 1rem;
}

#carouselIndex .carousel-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

#carouselIndex .carousel-item img:hover {
    transform: scale(1.02);
}

/* 轮播标题样式 - 覆盖在图片上 */
#carouselIndex .carousel-caption {
    position: absolute;
    bottom: 20px;
    left: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(1px);
    border-radius: 8px;
    padding: 10px 12px;
    color: white;
    text-align: center;
    z-index: 10;
}

#carouselIndex .carousel-caption h5 {
    font-size: 0.9rem;
    margin-bottom: 0;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
}

/* 响应式：移动端单列显示 */
@media (max-width: 768px) {
    #carouselIndex .carousel-item {
        padding: 0.5rem;
    }

    #carouselIndex .carousel-caption {
        bottom: 15px;
        left: 8px;
        right: 8px;
        padding: 8px 10px;
    }

    #carouselIndex .carousel-caption h5 {
        font-size: 0.75rem;
    }
}

/* 轮播控制按钮样式 */
.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
}

/* 轮播指示器样式 - 更明显，显示在图片外部 */
#carouselIndex .carousel-indicators {
    position: relative;
    bottom: auto;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    gap: 4px;
    z-index: 100;
}

#carouselIndex .carousel-indicators [data-bs-target] {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: rgba(102, 126, 234, 0.3);
    border: 3px solid rgba(102, 126, 234, 0.6);
    transition: all 0.3s ease;
    opacity: 1;
    margin: 0 4px;
}

#carouselIndex .carousel-indicators [data-bs-target]:hover {
    background-color: rgba(102, 126, 234, 0.5);
    transform: scale(1.1);
    border-color: rgba(102, 126, 234, 0.8);
}

#carouselIndex .carousel-indicators .active {
    background-color: #667eea;
    border-color: #667eea;
    transform: scale(1.3);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* 暗黑主题适配 - 轮播 */
[data-bs-theme="dark"] #carouselIndex .carousel-caption,
[data-bs-theme="dark-small"] #carouselIndex .carousel-caption {
    background: rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] #carouselIndex .carousel-caption h5,
[data-bs-theme="dark-small"] #carouselIndex .carousel-caption h5 {
    color: #fff;
}

[data-bs-theme="dark"] #carouselIndex .img-thumbnail,
[data-bs-theme="dark-small"] #carouselIndex .img-thumbnail {
    border-color: #495057;
    background-color: #212529;
}

[data-bs-theme="dark"] .carousel-control-prev-icon,
[data-bs-theme="dark"] .carousel-control-next-icon,
[data-bs-theme="dark-small"] .carousel-control-prev-icon,
[data-bs-theme="dark-small"] .carousel-control-next-icon {
    background-color: rgba(255, 255, 255, 0.5);
}

[data-bs-theme="dark"] .carousel-indicators [data-bs-target],
[data-bs-theme="dark-small"] .carousel-indicators [data-bs-target] {
    background-color: rgba(102, 126, 234, 0.4);
    border-color: rgba(102, 126, 234, 0.7);
}

[data-bs-theme="dark"] .carousel-indicators [data-bs-target]:hover,
[data-bs-theme="dark-small"] .carousel-indicators [data-bs-target]:hover {
    background-color: rgba(102, 126, 234, 0.6);
    border-color: rgba(102, 126, 234, 0.9);
}

[data-bs-theme="dark"] .carousel-indicators .active,
[data-bs-theme="dark-small"] .carousel-indicators .active {
    background-color: #667eea;
    border-color: #667eea;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.6);
}

/* ===========================================
   功能卡片专业样式
   =========================================== */
.feature-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.feature-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.feature-badges {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

.feature-badges .badge {
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.feature-stats {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-item {
    padding: 8px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 3px;
}

.stat-desc {
    font-size: 0.7rem;
    color: #6c757d;
    font-weight: 500;
    line-height: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .feature-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .feature-badges {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .feature-stats {
        padding: 10px;
    }

    .stat-value {
        font-size: 1rem;
    }

    .stat-desc {
        font-size: 0.65rem;
    }
}

/* ===========================================
   1. 专业棋谱表格样式
   =========================================== */
.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, .1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.table-light th {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #495057;
}

.table-light th i {
    color: #0d6efd;
}

/* 棋手头像样式 */
.profile_pb {
    transition: all 0.3s ease;
}

.profile_pb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.profile_pw {
    transition: all 0.3s ease;
}

.profile_pw:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 标签样式 */
.badge {
    transition: all 0.2s ease;
}

.badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 棋谱名称链接样式 */
.table a.link-primary {
    font-weight: 600;
    transition: all 0.2s ease;
}

.table a.link-primary:hover {
    color: #0a58ca !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 对弈结果样式 */
.text-success {
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ===========================================
   2. 锦标赛部分样式
   =========================================== */
.tournament-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease;
}

.tournament-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.tournament-header-icon {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.tournament-header-icon i {
    font-size: 1.1rem;
    color: white;
}

/* 统计信息样式 */
.tournament-stat {
    padding: 0.5rem;
    border-radius: 6px;
    background: rgba(0, 123, 255, 0.05);
    transition: all 0.3s ease;
    min-width: 120px;
}

.tournament-stat:hover {
    background: rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

.stat-number {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    margin-top: 0.1rem;
    font-weight: 500;
    font-size: 0.75rem;
}

/* 赛事卡片样式 */
.tournament-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tournament-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
    transition: width 0.3s ease;
}

.tournament-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
}

.tournament-card:hover::before {
    width: 4px;
}

.tournament-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(255, 193, 7, 0.3);
}

.tournament-icon i {
    color: white;
    font-size: 0.9rem;
}

.tournament-title {
    font-size: 0.9rem;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.tournament-meta {
    font-size: 0.75rem;
    opacity: 0.8;
    line-height: 1.2;
}

.tournament-meta span {
    opacity: 0.7;
}

.tournament-label {
    margin-top: 0.25rem;
}

.tournament-label .badge {
    transition: all 0.3s ease;
}

.tournament-label .badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tournament-arrow {
    opacity: 0.6;
    transition: all 0.3s ease;
}

.tournament-card:hover .tournament-arrow {
    opacity: 1;
    transform: translateX(2px);
}

.tournament-card:hover .tournament-title {
    color: #0d6efd !important;
}

/* 棋手排名紧凑样式 */
.tournament-item {
    margin-bottom: 0.25rem !important;
}

.tournament-card {
    padding: 0.375rem !important;
}

.tournament-title {
    font-size: 0.8rem !important;
    line-height: 1.0 !important;
}

.tournament-meta {
    font-size: 0.65rem !important;
    line-height: 1.0 !important;
    margin-top: 0.05rem !important;
}

.tournament-label {
    margin-top: 0.05rem !important;
}

/* ===========================================
   3. 响应式设计
   =========================================== */
@media (max-width: 1200px) {
    .table {
        font-size: 0.8rem;
    }

    .profile_pb {
        width: 35px !important;
        height: 35px !important;
    }

    .badge {
        font-size: 0.7rem !important;
    }

    .tournament-header-icon {
        width: 32px;
        height: 32px;
    }

    .tournament-icon {
        width: 26px;
        height: 26px;
    }

    .stat-number {
        font-size: 1.1rem;
    }

    .tournament-title {
        font-size: 0.85rem;
    }
}

@media (max-width: 992px) {
    .table {
        font-size: 0.75rem;
    }

    .profile_pb {
        width: 30px !important;
        height: 30px !important;
    }

    .tournament-header-icon {
        width: 30px;
        height: 30px;
    }

    .tournament-icon {
        width: 24px;
        height: 24px;
    }

    .tournament-title {
        font-size: 0.8rem;
    }

    .stat-number {
        font-size: 1rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }
}

/* 暗色主题支持 */
[data-bs-theme="dark"],
[data-bs-theme="dark-small"] {
    --tournament-bg-start: #363636;
    --tournament-bg-end: #363636;
    --tournament-card-bg: #363636;
    --tournament-card-hover-bg: #495057;
    --tournament-border: rgba(255, 255, 255, 0.1);
    --tournament-title-color: #f8f9fa;
    --tournament-title-hover-color: #0dcaf0;
    --tournament-meta-color: #adb5bd;
    --tournament-arrow-color: #0dcaf0;
    --tournament-stat-bg: rgba(13, 110, 253, 0.1);
    --tournament-stat-hover-bg: rgba(13, 110, 253, 0.2);
    --stat-number-color: #f8f9fa;
    --stat-label-color: #adb5bd;
    --feature-card-bg: #343a40;
    --feature-card-hover-bg: #495057;
    --feature-stats-bg: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .tournament-section,
[data-bs-theme="dark-small"] .tournament-section {
    background: linear-gradient(135deg, var(--tournament-bg-start) 0%, var(--tournament-bg-end) 100%);
    border-color: var(--tournament-border) !important;
}

[data-bs-theme="dark"] .tournament-section:hover,
[data-bs-theme="dark-small"] .tournament-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .tournament-card,
[data-bs-theme="dark-small"] .tournament-card {
    background: var(--tournament-card-bg);
    border-color: var(--tournament-border);
}

[data-bs-theme="dark"] .tournament-card:hover,
[data-bs-theme="dark-small"] .tournament-card:hover {
    background: var(--tournament-card-hover-bg);
    border-color: rgba(255, 193, 7, 0.3);
}

[data-bs-theme="dark"] .tournament-card::before,
[data-bs-theme="dark-small"] .tournament-card::before {
    background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
}

[data-bs-theme="dark"] .tournament-stat,
[data-bs-theme="dark-small"] .tournament-stat {
    background: var(--tournament-stat-bg);
}

[data-bs-theme="dark"] .tournament-stat:hover,
[data-bs-theme="dark-small"] .tournament-stat:hover {
    background: var(--tournament-stat-hover-bg);
}

[data-bs-theme="dark"] .tournament-title,
[data-bs-theme="dark-small"] .tournament-title {
    color: var(--tournament-title-color) !important;
}

[data-bs-theme="dark"] .tournament-card:hover .tournament-title,
[data-bs-theme="dark-small"] .tournament-card:hover .tournament-title {
    color: var(--tournament-title-hover-color) !important;
}

[data-bs-theme="dark"] .tournament-meta,
[data-bs-theme="dark-small"] .tournament-meta {
    color: var(--tournament-meta-color) !important;
}

[data-bs-theme="dark"] .tournament-arrow,
[data-bs-theme="dark-small"] .tournament-arrow {
    color: var(--tournament-arrow-color) !important;
}

[data-bs-theme="dark"] .stat-number,
[data-bs-theme="dark-small"] .stat-number {
    color: var(--stat-number-color) !important;
}

[data-bs-theme="dark"] .stat-label,
[data-bs-theme="dark-small"] .stat-label {
    color: var(--stat-label-color) !important;
}

/* 功能卡片暗色主题支持 */
[data-bs-theme="dark"] .feature-card,
[data-bs-theme="dark-small"] .feature-card {
    background: var(--feature-card-bg);
    border-color: var(--tournament-border) !important;
}

[data-bs-theme="dark"] .feature-card:hover,
[data-bs-theme="dark-small"] .feature-card:hover {
    background: var(--feature-card-hover-bg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .feature-stats,
[data-bs-theme="dark-small"] .feature-stats {
    background: var(--feature-stats-bg);
    border-color: var(--tournament-border);
}

[data-bs-theme="dark"] .stat-value,
[data-bs-theme="dark-small"] .stat-value {
    color: var(--stat-number-color) !important;
}

[data-bs-theme="dark"] .stat-desc,
[data-bs-theme="dark-small"] .stat-desc {
    color: var(--stat-label-color) !important;
}

/* 表格暗色主题支持 */
[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark-small"] .table-light {
    --bs-table-color: #f8f9fa;
    --bs-table-bg: #343a40;
    --bs-table-border-color: #495057;
    --bs-table-striped-bg: #495057;
    --bs-table-striped-color: #f8f9fa;
    --bs-table-hover-bg: #495057;
    --bs-table-hover-color: #f8f9fa;
}

[data-bs-theme="dark"] .table-light th,
[data-bs-theme="dark-small"] .table-light th {
    background-color: #495057;
    border-color: #6c757d;
    color: #f8f9fa;
}

[data-bs-theme="dark"] .table-light th i,
[data-bs-theme="dark-small"] .table-light th i {
    color: #0dcaf0;
}

[data-bs-theme="dark"] .table-hover tbody tr:hover,
[data-bs-theme="dark-small"] .table-hover tbody tr:hover {
    background-color: rgba(13, 202, 240, 0.1);
    color: #f8f9fa;
}

[data-bs-theme="dark"] .table a.link-primary,
[data-bs-theme="dark-small"] .table a.link-primary {
    color: #0dcaf0 !important;
}

[data-bs-theme="dark"] .table a.link-primary:hover,
[data-bs-theme="dark-small"] .table a.link-primary:hover {
    color: #0dcaf0 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .text-success,
[data-bs-theme="dark-small"] .text-success {
    color: #20c997 !important;
}

[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark-small"] .text-muted {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark-small"] .text-dark {
    color: #f8f9fa !important;
}

/* 国旗图标样式 */
.flag-icon {
    border-radius: 2px;
    object-fit: cover;
    border: 1px solid #ccc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.flag-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* 暗色主题适配 */
[data-bs-theme="dark"] .flag-icon,
[data-bs-theme="dark-small"] .flag-icon {
    border-color: #6c757d;
    box-shadow: 0 1px 3px rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .flag-icon:hover,
[data-bs-theme="dark-small"] .flag-icon:hover {
    box-shadow: 0 2px 6px rgba(255, 255, 255, 0.2);
}

/* ===========================================
   4. Popover 弹出框样式
   =========================================== */
.popover {
    transform: scale(0.75);
    transform-origin: top center;
}

.popover .pop {
    font-size: 0.75rem;
    padding: 5px;
}

.popover .pop div {
    margin-bottom: 2px;
    line-height: 1.2;
}

.popover img {
    max-width: 100px !important;
    height: auto !important;
}