/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    font-size: 1rem;
    line-height: 1.5;
}

/* 响应式字体大小调整 */
@media (max-width: 575.98px) {
    body {
        font-size: 0.9rem;
    }
    
    h1, .h1 {
        font-size: 1.75rem;
    }
    
    h2, .h2 {
        font-size: 1.5rem;
    }
    
    h3, .h3 {
        font-size: 1.25rem;
    }
    
    h4, .h4 {
        font-size: 1.1rem;
    }
    
    h5, .h5 {
        font-size: 1rem;
    }
    
    h6, .h6 {
        font-size: 0.9rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .display-1 {
        font-size: 3rem;
    }
    
    .display-2 {
        font-size: 2.5rem;
    }
    
    .display-3 {
        font-size: 2rem;
    }
    
    .display-4 {
        font-size: 1.75rem;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    body {
        font-size: 0.95rem;
    }
    
    h1, .h1 {
        font-size: 2rem;
    }
    
    h2, .h2 {
        font-size: 1.75rem;
    }
    
    h3, .h3 {
        font-size: 1.5rem;
    }
    
    h4, .h4 {
        font-size: 1.25rem;
    }
    
    h5, .h5 {
        font-size: 1.1rem;
    }
    
    h6, .h6 {
        font-size: 1rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    h1, .h1 {
        font-size: 2.25rem;
    }
    
    h2, .h2 {
        font-size: 1.75rem;
    }
    
    h3, .h3 {
        font-size: 1.5rem;
    }
    
    .display-4 {
        font-size: 3rem;
    }
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* 导航栏响应式优化 */
@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-item {
        margin: 0.25rem 0;
    }
    
    .navbar-nav .dropdown-menu {
        text-align: center;
    }
    
    .navbar-toggler {
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-toggler-icon {
        width: 1.2em;
        height: 1.2em;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .navbar-brand {
        font-size: 1.35rem;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-item {
        margin: 0.25rem 0;
    }
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

.poll-card {
    overflow: hidden;
}

.poll-card .card-img-top {
    transition: transform 0.3s;
}

.poll-card:hover .card-img-top {
    transform: scale(1.05);
}

/* 投票卡片图片样式 */
.poll-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    background-color: #fff;
    padding: 2px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.poll-card-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.1);
}

/* 投票卡片图片占位符样式 */
.poll-card-image-placeholder {
    width: 100%;
    height: 160px;
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0,0,0,.125);
}

.image-placeholder-container {
    width: 100%;
    overflow: hidden;
}

/* 按钮样式 */
.btn {
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #4e73df;
    border-color: #4e73df;
}

.btn-primary:hover {
    background-color: #2e59d9;
    border-color: #2653d4;
}

/* 表单样式 */
.form-control {
    border-radius: 5px;
    border: 1px solid #d1d3e2;
}

.form-control:focus {
    border-color: #bac8f3;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

/* 进度条样式 */
.progress {
    height: 25px;
    border-radius: 5px;
    background-color: #eaecf4;
}

.progress-bar {
    background-color: #4e73df;
    border-radius: 5px;
}

/* 徽章样式 */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
}

/* 分页样式 */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: #4e73df;
    border-radius: 5px;
    margin: 0 2px;
}

.page-item.active .page-link {
    background-color: #4e73df;
    border-color: #4e73df;
}

/* 页脚样式 */
footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* 响应式调整 */
/* 超小屏幕设备 (小于 576px) */
@media (max-width: 575.98px) {
    .jumbotron {
        padding: 1.5rem 1rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
    
    .form-control {
        font-size: 0.875rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .poll-main-image {
        height: 180px;
    }
    
    .option-image {
        width: 50px;
        height: 50px;
    }
    
    .poll-card-image {
        height: 120px;
    }
    
    .poll-card-image-placeholder {
        height: 120px;
    }
    
    .progress {
        height: 20px;
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 0.35em 0.65em;
    }
}

/* 小屏幕设备 (576px - 767.98px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .jumbotron {
        padding: 2rem 1rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .poll-main-image {
        height: 220px;
    }
    
    .option-image {
        width: 60px;
        height: 60px;
    }
    
    .poll-card-image {
        height: 140px;
    }
    
    .poll-card-image-placeholder {
        height: 140px;
    }
    
    .image-thumbnail {
        height: 130px;
    }
}

/* 中等屏幕设备 (768px - 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .jumbotron {
        padding: 2.5rem 1.5rem;
    }
    
    .display-4 {
        font-size: 3rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .poll-main-image {
        height: 250px;
    }
    
    .option-image {
        width: 70px;
        height: 70px;
    }
    
    .poll-card-image {
        height: 150px;
    }
    
    .poll-card-image-placeholder {
        height: 150px;
    }
    
    .image-thumbnail {
        height: 140px;
    }
}

/* 大屏幕设备 (992px - 1199.98px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .poll-main-image {
        height: 280px;
    }
    
    .option-image {
        width: 75px;
        height: 75px;
    }
    
    .poll-card-image {
        height: 160px;
    }
    
    .poll-card-image-placeholder {
        height: 160px;
    }
    
    .image-thumbnail {
        height: 160px;
    }
}

/* 超大屏幕设备 (1200px 及以上) */
@media (min-width: 1200px) {
    .poll-main-image {
        height: 320px;
    }
    
    .option-image {
        width: 80px;
        height: 80px;
    }
    
    .poll-card-image {
        height: 160px;
    }
    
    .poll-card-image-placeholder {
        height: 160px;
    }
    
    .image-thumbnail {
        height: 170px;
    }
}

/* 管理后台样式 */
.border-left-primary {
    border-left: 0.25rem solid #4e73df !important;
}

.border-left-success {
    border-left: 0.25rem solid #1cc88a !important;
}

.border-left-info {
    border-left: 0.25rem solid #36b9cc !important;
}

.border-left-warning {
    border-left: 0.25rem solid #f6c23e !important;
}

.text-xs {
    font-size: 0.7rem;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

.text-gray-300 {
    color: #dddfeb !important;
}

/* 投票选项样式 */
.option-item {
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}

.option-item:hover {
    background-color: #e9ecef;
}

/* 投票结果卡片样式 */
.option-result-card {
    background-color: #f8f9fa;
    transition: all 0.2s ease-in-out;
    border: 1px solid #e9ecef;
}

.option-result-card:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 投票结果卡片中的图片样式优化 */
.option-result-card .image-thumbnail {
    border-radius: 8px;
    margin-top: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    background-color: #fff;
    padding: 2px;
}

.option-result-card .image-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.1);
}

/* 确保图片容器在所有浏览器中居中 */
.option-result-card .image-container {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.option-result-card .image-thumbnail:hover {
    transform: scale(1.02);
}

/* 投票结果卡片中的进度条样式优化 */
.option-result-card .progress {
    background-color: #e9ecef;
    border-radius: 5px;
}

.option-result-card .progress-bar {
    border-radius: 5px;
}

/* 图片上传预览 */
.image-preview {
    max-width: 100%;
    max-height: 200px;
    margin-top: 10px;
    border-radius: 5px;
    display: none;
}

/* 图片优化样式 */
.image-thumbnail {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    background-color: #fff;
    padding: 2px;
}

.image-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.1);
}

/* 投票主图样式 */
.poll-main-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    background-color: #fff;
    padding: 2px;
}

.poll-main-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.1);
}

/* 选项图片样式 */
.option-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    background-color: #fff;
    padding: 2px;
}

.option-image:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.1);
}

/* 图片缩略图样式 */
.image-thumbnail {
    max-width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-thumbnail:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 响应式图片容器 */
.responsive-image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 5px;
}

.responsive-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* 图片网格布局 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* 图片加载优化 */
.optimized-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    max-width: 100%;
    height: auto;
}

/* 图片模态框样式 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s;
}

.image-modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 5px;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.image-modal-close:hover {
    color: #bbb;
}

/* 图片加载动画 */
.image-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #4e73df;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 投票详情页面响应式布局 */
@media (max-width: 767.98px) {
    /* 在小屏幕上将侧边栏移到底部 */
    .col-lg-4 {
        margin-top: 1.5rem;
    }
    
    /* 调整投票选项的间距 */
    .form-check {
        padding: 0.75rem;
    }
    
    /* 优化按钮布局 */
    .d-grid.gap-2 {
        gap: 0.75rem !important;
    }
    
    /* 调整进度条高度 */
    .progress {
        height: 20px;
    }
    
    /* 优化徽章显示 */
    .badge {
        font-size: 0.65rem;
        padding: 0.25em 0.5em;
        white-space: normal;
        word-break: break-word;
        text-align: center;
        display: inline-block;
        max-width: 100%;
    }
    
    /* 徽章容器优化 */
    .d-flex.gap-2 {
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }
    
    /* 调整卡片间距 */
    .card.mb-4 {
        margin-bottom: 1rem !important;
    }
    
    /* 优化表单元素间距 */
    .mb-3 {
        margin-bottom: 1rem !important;
    }
    
    /* 调整图片大小 */
    .poll-main-image {
        height: 180px;
    }
    
    .option-image {
        width: 50px;
        height: 50px;
    }
    
    .poll-card-image {
        height: 150px;
    }
    
    .image-thumbnail {
        height: 120px;
    }
    
    /* 优化文本显示 */
    .small {
        font-size: 0.8rem;
    }
    
    /* 调整列表组样式 */
    .list-group-item {
        padding: 0.5rem 0.75rem;
    }
    
    /* 优化投票选项布局 */
    .form-check .d-flex {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-check .d-flex .me-3 {
        margin-right: 0 !important;
        margin-bottom: 0.5rem;
    }
    
    /* 优化标题和描述文本 */
    .card-title {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .card-text {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* 优化元数据显示 */
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .d-flex.justify-content-between span {
        font-size: 0.8rem;
    }
    
    /* 投票结果卡片响应式优化 */
    .option-result-card {
        padding: 0.75rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .option-result-card h6 {
        font-size: 0.9rem;
    }
    
    .option-result-card .badge {
        font-size: 0.65rem;
        padding: 0.25em 0.5em;
    }
    
    .option-result-card .progress {
        height: 15px !important;
    }
    
    .option-result-card .image-thumbnail {
        max-height: 100px !important;
    }
}

/* 中等屏幕设备优化 */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* 调整侧边栏宽度 */
    .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    /* 调整主内容区域宽度 */
    .col-lg-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }
    
    /* 优化图片大小 */
    .poll-main-image {
        height: 250px;
    }
    
    .option-image {
        width: 70px;
        height: 70px;
    }
    
    /* 优化徽章显示 */
    .badge {
        font-size: 0.7rem;
        padding: 0.3em 0.6em;
    }
    
    /* 优化表单元素 */
    .form-control {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* 优化按钮 */
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    /* 投票结果卡片中等屏幕响应式优化 */
    .option-result-card {
        padding: 1rem !important;
    }
    
    .option-result-card h6 {
        font-size: 1rem;
    }
    
    .option-result-card .badge {
        font-size: 0.75rem;
        padding: 0.35em 0.65em;
    }
    
    .option-result-card .progress {
        height: 20px !important;
    }
    
    .option-result-card .image-thumbnail {
        max-height: 120px !important;
    }
}

/* 大屏幕设备优化 */
@media (min-width: 992px) {
    /* 确保侧边栏在大屏幕上正确显示 */
    .col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    /* 调整主内容区域宽度 */
    .col-lg-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }
    
    /* 优化图片大小 */
    .poll-main-image {
        height: 300px;
    }
    
    .option-image {
        width: 80px;
        height: 80px;
    }
    
    /* 投票结果卡片大屏幕响应式优化 */
    .option-result-card {
        padding: 1.25rem !important;
    }
    
    .option-result-card h6 {
        font-size: 1.1rem;
    }
    
    .option-result-card .badge {
        font-size: 0.8rem;
        padding: 0.4em 0.7em;
    }
    
    .option-result-card .progress {
        height: 25px !important;
    }
    
    .option-result-card .image-thumbnail {
        max-height: 150px !important;
    }
}

/* 懒加载图片样式 */
.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy.loaded {
    opacity: 1;
}

/* 图片占位符样式 */
.image-placeholder {
    background-color: #f8f9fa;
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
                      linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
                      linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 14px;
}

/* 图片加载错误样式 */
.image-error {
    border: 1px dashed #dc3545;
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    text-align: center;
    border-radius: 5px;
}

/* 图片加载指示器 */
.image-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

/* 图片容器样式 */
.image-container {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

/* 确保所有图片容器在移动设备上居中显示 */
@media (max-width: 767.98px) {
    .option-result-card .image-container {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }
    
    .option-result-card .image-thumbnail {
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
}

.image-container img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* 图片缩放动画 */
@keyframes imageZoom {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.image-zoom-animation {
    animation: imageZoom 0.5s ease-in-out;
}

/* 图片加载优化 */
.optimized-image {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    max-width: 100%;
    height: auto;
}

/* 响应式图片处理 */
@media (max-width: 575.98px) {
    /* 超小屏幕设备图片优化 */
    .image-thumbnail {
        max-height: 120px;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }
    
    /* 图片模态框优化 */
    .image-modal-content {
        max-width: 95%;
        max-height: 85%;
    }
    
    .image-modal-close {
        font-size: 30px;
        top: 15px;
        right: 25px;
    }
    
    /* 图片占位符优化 */
    .image-placeholder {
        min-height: 120px;
        font-size: 0.75rem;
    }
    
    /* 图片错误处理优化 */
    .image-error {
        min-height: 120px;
        font-size: 0.75rem;
        padding: 0.5rem;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    /* 小屏幕设备图片优化 */
    .image-thumbnail {
        max-height: 150px;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    
    /* 图片模态框优化 */
    .image-modal-content {
        max-width: 90%;
        max-height: 88%;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    /* 中等屏幕设备图片优化 */
    .image-thumbnail {
        max-height: 180px;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    /* 大屏幕设备图片优化 */
    .image-thumbnail {
        max-height: 200px;
    }
}

@media (min-width: 1200px) {
    /* 超大屏幕设备图片优化 */
    .image-thumbnail {
        max-height: 220px;
    }
}

/* 图片懒加载优化 */
.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy.loaded {
    opacity: 1;
}

/* 图片加载动画优化 */
@keyframes imageLoad {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.image-load-animation {
    animation: imageLoad 0.5s ease forwards;
}

/* 图片错误处理优化 */
.image-error {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 5px;
    color: #6c757d;
    font-size: 0.875rem;
    padding: 1rem;
    text-align: center;
    min-height: 150px;
}

/* 图片占位符优化 */
.image-placeholder {
    background-color: #f8f9fa;
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
                      linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
                      linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.875rem;
    border-radius: 5px;
    min-height: 150px;
}

/* 错误页面样式 */
.error-template {
    padding: 40px 15px;
    text-align: center;
}

.error-actions {
    margin-top: 15px;
    margin-bottom: 15px;
}

.error-actions .btn {
    margin-right: 10px;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 表单验证样式 */
.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

.form-control.is-invalid, .form-select.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid:focus, .form-select.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* 密码强度指示器 */
.password-strength {
    height: 5px;
    margin-top: 0.5rem;
    border-radius: 5px;
    background-color: #e9ecef;
    transition: all 0.3s ease;
}

.password-strength-weak {
    background-color: #dc3545;
    width: 33.33%;
}

.password-strength-medium {
    background-color: #ffc107;
    width: 66.66%;
}

.password-strength-strong {
    background-color: #28a745;
    width: 100%;
}

/* 表单验证提示动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.form-control.is-invalid {
    animation: shake 0.5s;
}

/* 注册和登录页面特殊样式 */
.auth-page .card {
    max-width: 500px;
    margin: 0 auto;
}

.auth-page .form-text {
    font-size: 0.8rem;
    color: #6c757d;
}

.auth-page .form-text.text-danger {
    color: #dc3545;
}

.auth-page .invalid-feedback {
    font-size: 0.8rem;
    font-weight: 500;
}

/* 表单提交按钮样式 */
.auth-page .btn-primary {
    padding: 0.75rem;
    font-weight: 500;
}

/* 表单输入框样式优化 */
.auth-page .form-control {
    padding: 0.75rem;
    font-size: 1rem;
}

.auth-page .input-group-text {
    padding: 0.75rem;
    font-size: 1rem;
}