/* 香蕉CMS 公共样式 - Powered by xpornkit.com */

/* 隐藏滚动条 */
.scroll-hide::-webkit-scrollbar { display: none; }
.scroll-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* 播放按钮 */
.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}
.play-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-left: 16px solid white;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}
.group:hover .play-btn { opacity: 1; }

/* 卡片悬停效果 */
.card-hover { transition: transform 0.2s; }
.card-hover:hover { transform: translateY(-4px); }

/* 播放器容器 */
.player-container {
    position: relative;
    padding-bottom: 56.25%;
    background: #000;
}
.player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}
.pagination a, .pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}
.pagination a:hover { background: #f3f4f6; }
.pagination .active {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

/* 文字截断 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Toast 提示 */
.xpk-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    z-index: 9999;
    animation: fadeInOut 3s ease;
}
.xpk-toast.success { background: #10b981; }
.xpk-toast.error { background: #ef4444; }
.xpk-toast.warning { background: #f59e0b; }

@keyframes fadeInOut {
    0%, 100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    10%, 90% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Modal 弹窗 */
.xpk-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}
.xpk-modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
}

/* ========== 广告样式 ========== */

/* 广告容器 */
.xpk-ad {
    position: relative;
    margin: 10px 0;
}

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

.xpk-ad-text a {
    color: #3b82f6;
    text-decoration: underline;
}

/* 悬浮广告 */
.xpk-ad-float {
    position: fixed;
    z-index: 1000;
}
.xpk-ad-float.left { left: 10px; top: 50%; transform: translateY(-50%); }
.xpk-ad-float.right { right: 10px; top: 50%; transform: translateY(-50%); }
.xpk-ad-float.bottom { bottom: 10px; left: 50%; transform: translateX(-50%); }

.xpk-ad-float .xpk-ad-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* 弹窗广告 */
.xpk-ad-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.xpk-ad-popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}
.xpk-ad-popup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 30px;
    height: 30px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* 视频广告 */
.xpk-ad-video {
    position: relative;
    background: #000;
}
.xpk-ad-video video {
    width: 100%;
    display: block;
}
.xpk-ad-skip {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.xpk-ad-skip:hover {
    background: rgba(0,0,0,0.9);
}
.xpk-ad-countdown {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
}

/* 播放器暂停广告 */
.xpk-ad-pause {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    display: none;
}
.player-paused .xpk-ad-pause {
    display: block;
}

/* ========== 评论样式 ========== */

.xpk-comment-box {
    margin-top: 2rem;
}

.xpk-comment-form textarea:focus {
    outline: none;
    border-color: #ef4444;
}

.comment-item {
    padding-bottom: 1rem;
}

.comment-item:last-child {
    border-bottom: none;
}

.reply-item {
    padding: 0.5rem 0;
}

.reply-form-box textarea:focus {
    outline: none;
    border-color: #ef4444;
}

/* 评论加载动画 */
.comment-loading {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.comment-loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid #e5e7eb;
    border-top-color: #ef4444;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========== 评分样式 ========== */

.xpk-score-box {
    padding: 1rem;
    background: #fafafa;
    border-radius: 0.5rem;
}

.xpk-score-stars .score-star {
    user-select: none;
}

.xpk-score-stars .score-star:hover ~ .score-star {
    color: #d1d5db !important;
}

/* 评分分布条 */
.xpk-score-dist .bg-yellow-400 {
    transition: width 0.3s ease;
}

/* 小型评分显示 */
.xpk-score-mini {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.xpk-score-mini .star {
    font-size: 0.875rem;
}

/* ========== 短视频样式 ========== */

.xpk-short-wrapper {
    position: fixed;
    inset: 0;
    background: #000;
    overflow: hidden;
}

.xpk-short-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.xpk-short-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.xpk-short-slide video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.xpk-short-play-btn {
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    cursor: pointer;
}

/* 侧边操作栏 */
.xpk-short-sidebar {
    position: absolute;
    right: 16px;
    bottom: 150px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
}

.xpk-short-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: white;
    cursor: pointer;
}

.xpk-short-action .icon {
    font-size: 28px;
}

.xpk-short-action .count {
    font-size: 12px;
}

.xpk-short-action.liked .icon {
    color: #ef4444;
}

/* 底部信息 */
.xpk-short-info {
    position: absolute;
    left: 16px;
    right: 80px;
    bottom: 60px;
    color: white;
    z-index: 10;
}

.xpk-short-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.xpk-short-desc {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.xpk-short-tags .tag {
    display: inline-block;
    font-size: 13px;
    color: #60a5fa;
    margin-right: 8px;
}

/* 进度条 */
.xpk-short-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.2);
    z-index: 10;
}

.xpk-short-progress-bar {
    height: 100%;
    background: #ef4444;
    width: 0;
    transition: width 0.1s linear;
}

/* 滑动提示 */
.xpk-short-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

/* 短剧列表 */
.xpk-drama-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.xpk-drama-card img {
    width: 80px;
    height: 107px;
    object-fit: cover;
    border-radius: 4px;
}

.xpk-drama-info {
    flex: 1;
}

.xpk-drama-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.xpk-drama-meta {
    font-size: 12px;
    color: #6b7280;
}

/* 剧集选择 */
.xpk-episode-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
}

.xpk-episode-item {
    padding: 8px;
    text-align: center;
    background: #f3f4f6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.xpk-episode-item:hover {
    background: #e5e7eb;
}

.xpk-episode-item.active {
    background: #ef4444;
    color: white;
}

.xpk-episode-item.locked {
    opacity: 0.5;
    position: relative;
}

.xpk-episode-item.locked::after {
    content: '🔒';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
}
/* ========== 图片懒加载样式 ========== */

/* 懒加载图片默认样式 */
.lazy-load {
    background: #f3f4f6;
    background-image: linear-gradient(45deg, #f3f4f6 25%, transparent 25%), 
                      linear-gradient(-45deg, #f3f4f6 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #f3f4f6 75%), 
                      linear-gradient(-45deg, transparent 75%, #f3f4f6 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    animation: loading-shimmer 1.5s infinite linear;
}

/* 加载动画 */
@keyframes loading-shimmer {
    0% { background-position: 0 0, 0 10px, 10px -10px, -10px 0px; }
    100% { background-position: 20px 20px, 20px 30px, 30px 10px, 10px 20px; }
}

/* 加载完成后的样式 */
.lazy-loaded {
    background: none;
    animation: none;
}

/* 加载失败的样式 */
.lazy-error {
    background: #fee2e2;
    background-image: none;
    animation: none;
    position: relative;
}

.lazy-error::after {
    content: '图片加载失败';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #dc2626;
    font-size: 12px;
    text-align: center;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .lazy-load {
        background-size: 15px 15px;
        background-position: 0 0, 0 7.5px, 7.5px -7.5px, -7.5px 0px;
    }
    
    @keyframes loading-shimmer {
        0% { background-position: 0 0, 0 7.5px, 7.5px -7.5px, -7.5px 0px; }
        100% { background-position: 15px 15px, 15px 22.5px, 22.5px 7.5px, 7.5px 15px; }
    }
}

/* 减少动画效果（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    .lazy-load {
        animation: none;
        background: #f3f4f6;
        background-image: none;
    }
}
/* ========== 浏览器兼容性样式 ========== */

/* IE11 CSS Grid 降级方案 */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    /* IE11 专用样式 */
    .grid {
        display: -ms-flexbox;
        display: flex;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
    }
    
    .grid-cols-1 > * { -ms-flex: 0 0 100%; flex: 0 0 100%; }
    .grid-cols-2 > * { -ms-flex: 0 0 50%; flex: 0 0 50%; }
    .grid-cols-3 > * { -ms-flex: 0 0 33.333333%; flex: 0 0 33.333333%; }
    .grid-cols-4 > * { -ms-flex: 0 0 25%; flex: 0 0 25%; }
    .grid-cols-6 > * { -ms-flex: 0 0 16.666667%; flex: 0 0 16.666667%; }
    
    /* 响应式降级 */
    @media (max-width: 640px) {
        .sm\:grid-cols-2 > * { -ms-flex: 0 0 50%; flex: 0 0 50%; }
        .sm\:grid-cols-3 > * { -ms-flex: 0 0 33.333333%; flex: 0 0 33.333333%; }
    }
    
    @media (max-width: 1024px) {
        .lg\:grid-cols-3 > * { -ms-flex: 0 0 33.333333%; flex: 0 0 33.333333%; }
        .lg\:grid-cols-4 > * { -ms-flex: 0 0 25%; flex: 0 0 25%; }
    }
    
    @media (max-width: 1280px) {
        .xl\:grid-cols-4 > * { -ms-flex: 0 0 25%; flex: 0 0 25%; }
        .xl\:grid-cols-6 > * { -ms-flex: 0 0 16.666667%; flex: 0 0 16.666667%; }
    }
    
    /* Flexbox 降级 */
    .flex {
        display: -ms-flexbox;
        display: flex;
    }
    
    .items-center {
        -ms-flex-align: center;
        align-items: center;
    }
    
    .justify-between {
        -ms-flex-pack: justify;
        justify-content: space-between;
    }
    
    .justify-center {
        -ms-flex-pack: center;
        justify-content: center;
    }
    
    .space-x-4 > * + * {
        margin-left: 1rem;
    }
    
    .space-y-2 > * + * {
        margin-top: 0.5rem;
    }
}

/* 不支持CSS Grid的浏览器降级 */
@supports not (display: grid) {
    .grid {
        display: flex;
        flex-wrap: wrap;
    }
    
    .grid-cols-1 > * { flex: 0 0 100%; }
    .grid-cols-2 > * { flex: 0 0 50%; }
    .grid-cols-3 > * { flex: 0 0 33.333333%; }
    .grid-cols-4 > * { flex: 0 0 25%; }
    .grid-cols-6 > * { flex: 0 0 16.666667%; }
    
    .gap-4 > * {
        margin: 0.5rem;
    }
    
    /* 响应式降级 */
    @media (max-width: 640px) {
        .sm\:grid-cols-2 > * { flex: 0 0 50%; }
        .sm\:grid-cols-3 > * { flex: 0 0 33.333333%; }
    }
    
    @media (min-width: 1024px) {
        .lg\:grid-cols-3 > * { flex: 0 0 33.333333%; }
        .lg\:grid-cols-4 > * { flex: 0 0 25%; }
    }
    
    @media (min-width: 1280px) {
        .xl\:grid-cols-4 > * { flex: 0 0 25%; }
        .xl\:grid-cols-6 > * { flex: 0 0 16.666667%; }
    }
}

/* 不支持Flexbox的浏览器降级 */
@supports not (display: flex) {
    .flex {
        display: block;
    }
    
    .grid {
        display: block;
    }
    
    .grid > * {
        display: inline-block;
        vertical-align: top;
        width: 100%;
    }
    
    .grid-cols-2 > * { width: 48%; margin-right: 2%; }
    .grid-cols-3 > * { width: 31%; margin-right: 2%; }
    .grid-cols-4 > * { width: 23%; margin-right: 2%; }
    .grid-cols-6 > * { width: 15%; margin-right: 2%; }
    
    @media (max-width: 640px) {
        .grid > * { width: 100%; margin-right: 0; }
    }
}

/* 旧版浏览器提示样式增强 */
.browser-warning {
    position: relative;
    z-index: 9999;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ========== CSS变量兼容性处理 ========== */

/* 定义CSS变量（现代浏览器） */
:root {
    /* 主色调 */
    --color-primary: #ef4444;
    --color-primary-dark: #dc2626;
    --color-primary-light: #f87171;
    
    /* 中性色 */
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    
    /* 功能色 */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;
    
    /* 间距 */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* 字体大小 */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* 圆角 */
    --border-radius-sm: 0.25rem;
    --border-radius-md: 0.375rem;
    --border-radius-lg: 0.5rem;
    --border-radius-xl: 0.75rem;
}

/* IE11兼容性：使用备用值替代CSS变量 */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    /* 主色调备用值 */
    .text-primary { color: #ef4444; }
    .bg-primary { background-color: #ef4444; }
    .border-primary { border-color: #ef4444; }
    
    .text-primary-dark { color: #dc2626; }
    .bg-primary-dark { background-color: #dc2626; }
    .border-primary-dark { border-color: #dc2626; }
    
    /* 中性色备用值 */
    .text-gray-500 { color: #6b7280; }
    .text-gray-600 { color: #4b5563; }
    .text-gray-700 { color: #374151; }
    .text-gray-800 { color: #1f2937; }
    
    .bg-gray-50 { background-color: #f9fafb; }
    .bg-gray-100 { background-color: #f3f4f6; }
    .bg-gray-200 { background-color: #e5e7eb; }
    
    /* 功能色备用值 */
    .text-success { color: #10b981; }
    .text-warning { color: #f59e0b; }
    .text-error { color: #ef4444; }
    .text-info { color: #3b82f6; }
    
    .bg-success { background-color: #10b981; }
    .bg-warning { background-color: #f59e0b; }
    .bg-error { background-color: #ef4444; }
    .bg-info { background-color: #3b82f6; }
}

/* 使用CSS变量的现代样式（带备用值） */
.xpk-primary {
    color: #ef4444; /* 备用值 */
    color: var(--color-primary, #ef4444);
}

.xpk-primary-bg {
    background-color: #ef4444; /* 备用值 */
    background-color: var(--color-primary, #ef4444);
}

.xpk-card {
    background-color: #ffffff; /* 备用值 */
    background-color: var(--color-white, #ffffff);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* 备用值 */
    box-shadow: var(--shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
    border-radius: 0.375rem; /* 备用值 */
    border-radius: var(--border-radius-md, 0.375rem);
}

.xpk-button {
    padding: 0.5rem 1rem; /* 备用值 */
    padding: var(--spacing-sm, 0.5rem) var(--spacing-md, 1rem);
    border-radius: 0.375rem; /* 备用值 */
    border-radius: var(--border-radius-md, 0.375rem);
    font-size: 0.875rem; /* 备用值 */
    font-size: var(--font-size-sm, 0.875rem);
}

.xpk-button-primary {
    background-color: #ef4444; /* 备用值 */
    background-color: var(--color-primary, #ef4444);
    color: #ffffff; /* 备用值 */
    color: var(--color-white, #ffffff);
}

.xpk-button-primary:hover {
    background-color: #dc2626; /* 备用值 */
    background-color: var(--color-primary-dark, #dc2626);
}

.xpk-text-muted {
    color: #6b7280; /* 备用值 */
    color: var(--color-gray-500, #6b7280);
}

.xpk-spacing-md {
    margin: 1rem; /* 备用值 */
    margin: var(--spacing-md, 1rem);
}

.xpk-spacing-lg {
    margin: 1.5rem; /* 备用值 */
    margin: var(--spacing-lg, 1.5rem);
}

/* PostCSS处理示例（如果使用构建工具） */
/*
使用PostCSS的postcss-custom-properties插件可以自动处理：

.example {
    color: var(--color-primary, #ef4444);
}

会被编译为：

.example {
    color: #ef4444;
    color: var(--color-primary, #ef4444);
}
*/
/* ========== 无障碍访问样式 ========== */

/* 屏幕阅读器专用内容 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 当获得焦点时显示（用于跳转链接） */
.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: #000;
    color: #fff;
    z-index: 9999;
}

/* 焦点可见性增强 */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .text-gray-500 {
        color: #000;
    }
    
    .text-gray-600 {
        color: #000;
    }
    
    .bg-gray-100 {
        background-color: #fff;
        border: 1px solid #000;
    }
    
    .border-gray-200 {
        border-color: #000;
    }
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 跳转链接 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
}

.skip-link:focus {
    top: 6px;
}

/* ARIA状态样式 */
[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

[aria-expanded="false"] svg {
    transform: rotate(0deg);
}

/* 模态框焦点陷阱 */
.modal-open {
    overflow: hidden;
}

.modal-open .modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

/* 错误状态样式 */
[aria-invalid="true"] {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* 成功状态样式 */
[aria-invalid="false"] {
    border-color: #10b981;
}

/* 加载状态 */
[aria-busy="true"] {
    opacity: 0.6;
    pointer-events: none;
}

/* 隐藏装饰性图标 */
[role="img"][aria-hidden="true"] {
    speak: none;
}

/* 提示文本样式 */
.hint-text {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* 必填字段标识 */
.required::after {
    content: " *";
    color: #ef4444;
}

/* 表单组样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    line-height: 1.5;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
/* ========== 颜色对比度优化 ========== */

/* 改进文字颜色对比度 - 符合WCAG AA标准 */

/* 原来的 text-gray-400 (#9ca3af) 对比度不足，改为更深的颜色 */
.text-gray-400-improved {
    color: #6b7280; /* text-gray-500，对比度更好 */
}

.text-gray-500-improved {
    color: #4b5563; /* text-gray-600，对比度更好 */
}

/* 在白色背景上的文字颜色优化 */
.text-muted {
    color: #4b5563; /* 替代 text-gray-500，对比度 7.59:1 */
}

.text-secondary {
    color: #374151; /* 替代 text-gray-600，对比度 10.73:1 */
}

.text-tertiary {
    color: #6b7280; /* 替代 text-gray-400，对比度 5.74:1 */
}

/* 在深色背景上的文字颜色优化 */
.text-light-muted {
    color: #d1d5db; /* 替代 text-gray-400，在深色背景上对比度更好 */
}

.text-light-secondary {
    color: #e5e7eb; /* 替代 text-gray-300，对比度更好 */
}

/* 链接颜色优化 */
.link-muted {
    color: #4b5563;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: all 0.2s ease;
}

.link-muted:hover {
    color: #1f2937;
    text-decoration-color: currentColor;
}

/* 按钮颜色对比度优化 */
.btn-muted {
    background-color: #f3f4f6;
    color: #1f2937;
    border: 1px solid #d1d5db;
}

.btn-muted:hover {
    background-color: #e5e7eb;
    color: #111827;
}

.btn-muted:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 表单元素对比度优化 */
.form-input-improved {
    border-color: #9ca3af;
    color: #111827;
}

.form-input-improved::placeholder {
    color: #6b7280; /* 更深的占位符颜色 */
}

.form-input-improved:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 状态颜色优化 */
.text-success-improved {
    color: #059669; /* 更深的绿色，对比度更好 */
}

.text-warning-improved {
    color: #d97706; /* 更深的橙色，对比度更好 */
}

.text-error-improved {
    color: #dc2626; /* 保持红色，对比度已经足够 */
}

/* 背景色对比度优化 */
.bg-muted-improved {
    background-color: #f9fafb;
    color: #111827;
}

.bg-secondary-improved {
    background-color: #f3f4f6;
    color: #1f2937;
}

/* 边框颜色优化 */
.border-muted-improved {
    border-color: #9ca3af; /* 更深的边框色 */
}

/* 特定组件的对比度优化 */

/* 导航链接 */
.nav-link-muted {
    color: #4b5563;
    transition: color 0.2s ease;
}

.nav-link-muted:hover {
    color: #1f2937;
}

/* 页脚链接 */
.footer-link {
    color: #4b5563;
    text-decoration: none;
}

.footer-link:hover {
    color: #1f2937;
    text-decoration: underline;
}

/* 时间戳和元数据 */
.meta-text {
    color: #6b7280;
    font-size: 0.875rem;
}

/* 描述性文字 */
.description-text {
    color: #4b5563;
    line-height: 1.6;
}

/* 标签和徽章 */
.badge-muted {
    background-color: #f3f4f6;
    color: #1f2937;
    border: 1px solid #d1d5db;
}

/* 分页器 */
.pagination-muted {
    color: #4b5563;
    border-color: #d1d5db;
}

.pagination-muted:hover {
    color: #1f2937;
    background-color: #f9fafb;
}

/* 工具提示 */
.tooltip-improved {
    background-color: #1f2937;
    color: #f9fafb;
    border: 1px solid #374151;
}

/* 下拉菜单 */
.dropdown-item-improved {
    color: #1f2937;
}

.dropdown-item-improved:hover {
    background-color: #f3f4f6;
    color: #111827;
}

/* 卡片内容 */
.card-text-muted {
    color: #4b5563;
}

.card-text-secondary {
    color: #6b7280;
}

/* 响应式对比度调整 */
@media (max-width: 768px) {
    /* 移动端可能需要更高的对比度 */
    .text-muted {
        color: #374151; /* 更深的颜色 */
    }
    
    .meta-text {
        color: #4b5563; /* 更深的颜色 */
    }
}

/* 深色主题的对比度优化 */
@media (prefers-color-scheme: dark) {
    .text-muted {
        color: #d1d5db;
    }
    
    .text-secondary {
        color: #e5e7eb;
    }
    
    .text-tertiary {
        color: #9ca3af;
    }
    
    .bg-muted-improved {
        background-color: #1f2937;
        color: #f9fafb;
    }
    
    .form-input-improved {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .form-input-improved::placeholder {
        color: #9ca3af;
    }
}

/* 高对比度模式增强 */
@media (prefers-contrast: high) {
    .text-muted,
    .text-secondary,
    .text-tertiary,
    .meta-text,
    .description-text {
        color: #000000;
    }
    
    .link-muted {
        color: #0000ee;
    }
    
    .link-muted:hover {
        color: #0000aa;
    }
    
    .btn-muted {
        background-color: #ffffff;
        color: #000000;
        border: 2px solid #000000;
    }
    
    .form-input-improved {
        background-color: #ffffff;
        color: #000000;
        border: 2px solid #000000;
    }
    
    .form-input-improved::placeholder {
        color: #666666;
    }
}

/* 打印样式的对比度优化 */
@media print {
    .text-muted,
    .text-secondary,
    .text-tertiary,
    .meta-text,
    .description-text {
        color: #000000 !important;
    }
    
    .link-muted {
        color: #000000 !important;
        text-decoration: underline !important;
    }
}