/* 自定义样式 */
.bank-logo {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
}

.bank-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.bank-logo-large {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 16px;
    border: 3px solid #e9ecef;
    padding: 8px;
}

.bank-logo-large-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.bank-logo-small {
    width: 48px;
    height: 48px;
    object-fit: contain;
    padding: 4px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bank-logo-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.risk-rating .fa-star {
    font-size: 0.8rem;
}

.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.075);
}

.navbar-brand {
    font-weight: 600;
}

.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.badge {
    font-size: 0.75rem;
    font-weight: 500;
}

.alert {
    border: none;
    border-radius: 0.5rem;
}

footer {
    margin-top: auto;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

.text-primary {
    color: #0d6efd !important;
}

.text-success {
    color: #198754 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-info {
    color: #0dcaf0 !important;
}

.bg-primary {
    background-color: #0d6efd !important;
}

.bg-success {
    background-color: #198754 !important;
}

.bg-warning {
    background-color: #ffc107 !important;
}

.bg-danger {
    background-color: #dc3545 !important;
}

.bg-info {
    background-color: #0dcaf0 !important;
}

/* 可点击的表格行 */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.clickable-row:hover {
    background-color: rgba(13, 110, 253, 0.08) !important;
}

.clickable-row:active {
    transform: scale(0.99);
}

/* 固定表头 */
.ranking-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.ranking-table thead th {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 移动端优化 */
@media (max-width: 992px) {
    .clickable-row {
        cursor: pointer;
    }

    .clickable-row:active {
        background-color: rgba(13, 110, 253, 0.15) !important;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }

    .card-body {
        padding: 1rem;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    h1, .h1 {
        font-size: 1.75rem;
    }

    h2, .h2 {
        font-size: 1.5rem;
    }

    /* 移动端表格行样式优化 */
    .ranking-table tbody tr {
        border-bottom: 1px solid #dee2e6;
    }

    .ranking-table tbody td {
        padding: 0.75rem 0.5rem;
    }

    /* 移动端利率字体大小调整 */
    .ranking-table .text-primary.fs-5 {
        font-size: 1.1rem !important;
    }

    /* 移动端排名徽章 */
    .ranking-table .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
    }

    /* 移动端银行logo */
    .bank-logo {
        width: 28px;
        height: 28px;
    }

    /* 移动端dashboard优化 */
    .border-end-md {
        border-right: none !important;
    }

    /* 移动端徽章优化 */
    .dashboard-badge {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.6rem !important;
    }

    /* 移动端统计项优化 */
    .stat-item {
        padding: 0.75rem 0.5rem;
    }

    .stat-item:hover {
        transform: none; /* 移动端禁用上浮效果 */
    }

    .stat-icon {
        font-size: 1.2rem;
    }

    .stat-number {
        font-size: 1.75rem !important;
        font-weight: 600;
    }

    /* 移动端按钮优化 */
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
        white-space: nowrap;
    }

    /* 移动端卡片header优化 */
    .card-header {
        padding: 0.5rem 1rem;
    }

    .card-header h5 {
        font-size: 0.9rem;
        max-width: 40%;
        min-width: fit-content;
    }

    /* 移动端按钮组保持一行显示 */
    .card-header .d-flex.gap-1,
    .card-header .d-flex.gap-2,
    .d-flex.gap-2 {
        gap: 0.25rem !important;
    }

    .card-header .btn-sm {
        font-size: 0.7rem;
        padding: 0.3rem 0.4rem;
        white-space: nowrap;
    }

    .card-header .btn-sm i {
        font-size: 0.75rem;
    }

    /* 移动端统计数字优化 */
    h3 {
        font-size: 1.5rem;
    }

    /* 移动端gap调整 */
    .g-2 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.75rem;
    }

    .g-3 {
        --bs-gutter-y: 1rem;
    }

    .g-4 {
        --bs-gutter-y: 1rem;
    }

    /* 移动端统计项文字缩短 */
    .stat-item .small {
        font-size: 0.7rem;
    }

    /* 移动端首页优化 */
    .form-label.small {
        font-size: 0.8rem;
    }

    .form-select-sm {
        font-size: 0.85rem;
    }

    .card-header .small-title {
        font-size: 0.95rem;
    }

    .card-header .badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
    }

    /* 移动端首页表单优化 */
    .index-label {
        font-size: 0.8rem;
    }

    .index-select {
        font-size: 0.85rem;
    }

    /* 移动端首页按钮优化 */
    .index-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }

    .index-btn-group {
        flex-wrap: wrap;
    }

    .index-btn-group .index-btn {
        flex: 1;
    }
}

/* PC端首页按钮优化 */
@media (min-width: 769px) {
    .index-btn-group .index-btn {
        flex: 0 0 auto;
        min-width: 100px;
    }
}

/* 桌面端边框 */
@media (min-width: 769px) {
    .border-end-md {
        border-right: 1px solid #dee2e6 !important;
    }
}

/* 任务页面移动端优化 */
@media (max-width: 991px) {
    /* 移动端表格优化 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 任务表格隐藏部分列 */
    .tasks-table th:nth-child(2),
    .tasks-table td:nth-child(2),  /* 官网链接 */
    .tasks-table th:nth-child(3),
    .tasks-table td:nth-child(3),  /* 利率抓取链接 */
    .tasks-table th:nth-child(4),
    .tasks-table td:nth-child(4),  /* 数据状态 */
    .tasks-table th:nth-child(7),
    .tasks-table td:nth-child(7),  /* 审核状态（编辑员） */
    .tasks-table th:nth-child(8),
    .tasks-table td:nth-child(8) { /* 优先级 */
        display: none;
    }

    /* 调整剩余列宽度 */
    .tasks-table th:nth-child(1),
    .tasks-table td:nth-child(1) {
        min-width: 130px;
        max-width: 150px;
    }

    .tasks-table th:nth-child(5),
    .tasks-table td:nth-child(5) {
        min-width: 90px;
        font-size: 0.7rem;
    }

    .tasks-table th:nth-child(6),
    .tasks-table td:nth-child(6) {
        min-width: 70px;
        font-size: 0.75rem;
    }

    .tasks-table th:nth-child(9),
    .tasks-table td:nth-child(9) {
        min-width: 120px;
    }

    /* 银行信息列优化 */
    .tasks-table .bank-logo {
        width: 28px !important;
        height: 28px !important;
        margin-right: 0.5rem !important;
    }

    .tasks-table .bank-logo img {
        width: 28px !important;
        height: 28px !important;
    }

    .tasks-table .fw-bold {
        font-size: 0.85rem;
    }

    .tasks-table .text-muted.small {
        font-size: 0.7rem;
    }

    /* 按钮组优化 */
    .tasks-table .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0.25rem;
    }

    .tasks-table .btn-group .btn {
        border-radius: 0.25rem !important;
        width: 100%;
        margin: 0;
    }

    /* 筛选按钮优化 */
    .filter-btn {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
        margin: 0.125rem;
        white-space: nowrap;
    }

    /* 徽章优化 */
    .tasks-table .badge.small {
        font-size: 0.6rem;
        padding: 0.15rem 0.3rem;
    }

    .tasks-table .task-status-cell .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }

    /* 操作按钮优化 */
    .tasks-table .btn-sm {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }

    /* 表格字体缩小 */
    .tasks-table {
        font-size: 0.8rem;
    }

    .tasks-table thead th {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }

    .tasks-table tbody td {
        padding: 0.5rem 0.25rem;
    }
}

/* Dashboard PC端优化 */
.dashboard-badge {
    font-size: 0.95rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

@media (min-width: 769px) {
    .dashboard-badge:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }
}

.stat-item {
    display: block;
    padding: 1rem;
    transition: all 0.3s ease;
    border-radius: 0.5rem;
}

@media (min-width: 769px) {
    .stat-item:hover {
        background-color: rgba(0, 0, 0, 0.02);
        transform: translateY(-5px);
    }
}

.stat-icon {
    font-size: 1.5rem;
}

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

/* 卡片阴影增强 */
.card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: none;
    border-radius: 0.75rem;
    overflow: hidden;
}

@media (min-width: 769px) {
    .card:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }
}

.card-header {
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    padding: 0.7rem 1.2rem;
}

/* 按钮样式增强 */
.btn {
    transition: all 0.2s ease;
}

@media (min-width: 769px) {
    .btn:hover {
        transform: translateY(-2px);
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.stat-number:hover {
    animation: pulse 0.5s ease-in-out;
}

/* 特殊样式 */
.bank-info .row {
    margin-bottom: 0.5rem;
}

.bank-info .row:last-child {
    margin-bottom: 0;
}

/* 图表样式 */
canvas {
    max-height: 400px;
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid #ccc;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 许愿墙样式 */
.wishwall-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wishwall-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 排名样式 */
.wishwall-rank {
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-number {
    font-size: 1.5rem;
    font-weight: 700;
}

.rank-badge {
    font-size: 1.3rem;
    padding: 0.5rem 0.8rem;
    border-radius: 0.5rem;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
    color: white;
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.4);
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #CD7F32, #B8860B);
    color: white;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
}

.rank-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #6c757d;
}

/* 投票样式 */
.wishwall-votes {
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.vote-btn {
    color: #6c757d;
    font-size: 2rem;
    padding: 0.25rem;
    transition: all 0.2s ease;
}

.vote-btn:hover:not(:disabled) {
    color: #28a745;
    transform: scale(1.2);
}

.vote-btn.active {
    color: #28a745;
    animation: bounce 0.5s ease;
}

.vote-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vote-count {
    font-size: 1.3rem;
    font-weight: 700;
    color: #28a745;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.wishwall-image {
    max-width: 200px;
    max-height: 200px;
    object-fit: cover;
}

/* 响应式优化 */
@media (max-width: 768px) {
    /* 页面标题优化 */
    .wishwall-title {
        font-size: 1.3rem;
    }

    .wishwall-header-btns .btn {
        font-size: 0.8rem;
        padding: 0.35rem 0.6rem;
    }

    .wishwall-rank {
        min-width: 40px;
    }

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

    .rank-badge {
        font-size: 0.85rem;
        padding: 0.3rem 0.5rem;
    }

    .rank-text {
        font-size: 1rem;
    }

    .wishwall-votes {
        min-width: 50px;
    }

    .vote-btn {
        font-size: 1.3rem;
        padding: 0.15rem;
    }

    .vote-count {
        font-size: 0.95rem;
    }

    .wishwall-votes small {
        font-size: 0.7rem;
    }

    .wishwall-item .card-title {
        font-size: 1rem;
    }

    .wishwall-item .card-title .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
    }

    .wishwall-item .card-text {
        font-size: 0.9rem;
    }

    .wishwall-item small {
        font-size: 0.75rem;
    }

    .wishwall-image {
        max-width: 150px;
        max-height: 150px;
    }

    /* 移动端按钮优化 */
    .wishwall-item .btn-outline-primary,
    .wishwall-item .btn-primary {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    /* 移动端卡片优化 */
    .wishwall-item .card-body {
        padding: 0.75rem;
    }

    .wishwall-item .card {
        margin-bottom: 0.75rem !important;
    }

    /* 移动端内容间距优化 */
    .wishwall-item .card-title {
        margin-bottom: 0.5rem;
    }

    .wishwall-item .card-text {
        margin-bottom: 0.5rem;
        line-height: 1.4;
    }

    .wishwall-item .d-flex.mt-3 {
        margin-top: 0.75rem !important;
    }
}

/* 问卷悬浮按钮 */
.survey-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
}

.survey-float-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    color: white;
}

.survey-float-btn i {
    font-size: 24px;
    margin-bottom: 2px;
}

.survey-float-btn .survey-text {
    font-size: 11px;
    font-weight: bold;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .survey-float-btn {
        bottom: 75px; /* 避免遮挡页面底部内容 */
        right: 15px;
        width: 56px;
        height: 56px;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
    }

    .survey-float-btn:active {
        transform: scale(0.95);
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    }

    .survey-float-btn i {
        font-size: 22px;
        margin-bottom: 1px;
    }

    .survey-float-btn .survey-text {
        font-size: 10px;
        font-weight: 600;
    }
}

/* 小屏手机适配 */
@media (max-width: 374px) {
    .survey-float-btn {
        width: 52px;
        height: 52px;
        bottom: 70px;
        right: 12px;
    }

    .survey-float-btn i {
        font-size: 20px;
    }

    .survey-float-btn .survey-text {
        font-size: 9px;
    }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .survey-float-btn {
        width: 48px;
        height: 48px;
        bottom: 15px;
        right: 15px;
    }

    .survey-float-btn i {
        font-size: 18px;
    }

    .survey-float-btn .survey-text {
        font-size: 9px;
    }
}