/* 
 * 样式覆盖方案
 * 用于处理特殊情况和不兼容的样式
 * 优先级高于模板默认样式
 */

/* 特殊情况处理 */
.legacy-component {
    /* 保留旧组件的特殊样式 */
    background: rgba(10, 10, 10, 0.9) !important;
    border: 1px solid rgba(0, 255, 65, 0.5) !important;
}

/* 第三方组件兼容性 */
.third-party-widget {
    /* 确保第三方组件在黑客主题下正常显示 */
    background: rgba(10, 10, 10, 0.8) !important;
    color: #ffffff !important;
    border: 1px solid rgba(0, 255, 65, 0.3) !important;
}

/* 表单元素特殊处理 */
.form-control-override {
    background: rgba(10, 10, 10, 0.9) !important;
    border: 1px solid rgba(0, 255, 65, 0.4) !important;
    color: #00ff41 !important;
}

.form-control-override:focus {
    box-shadow: 0 0 0 2px rgba(0, 255, 65, 0.3) !important;
    border-color: #00ff41 !important;
}

/* 表格样式覆盖 */
.table-override {
    background: rgba(10, 10, 10, 0.8) !important;
    border: 1px solid rgba(0, 255, 65, 0.3) !important;
}

.table-override th {
    background: rgba(0, 255, 65, 0.1) !important;
    color: #00ff41 !important;
    border-color: rgba(0, 255, 65, 0.3) !important;
}

.table-override td {
    border-color: rgba(0, 255, 65, 0.2) !important;
    color: #ffffff !important;
}

/* 代码块样式 */
.code-block-override {
    background: rgba(10, 10, 10, 0.9) !important;
    border: 1px solid rgba(0, 255, 65, 0.3) !important;
    color: #00ff41 !important;
    font-family: 'Courier New', Courier, monospace !important;
}

/* 响应式断点特殊处理 */
@media (max-width: 768px) {
    .mobile-override {
        /* 移动端特殊样式 */
        font-size: 14px !important;
        padding: 10px !important;
    }
    
    .mobile-nav-override {
        background: rgba(10, 10, 10, 0.95) !important;
        backdrop-filter: blur(15px) !important;
    }
}

/* 打印样式 */
@media print {
    .print-override {
        /* 打印时隐藏不必要的元素 */
        background: white !important;
        color: black !important;
        border: none !important;
    }
    
    .no-print {
        display: none !important;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .high-contrast-override {
        background: #000000 !important;
        color: #00ff41 !important;
        border: 2px solid #00ff41 !important;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .reduce-motion-override {
        animation: none !important;
        transition: none !important;
    }
    
    .scanline {
        display: none !important;
    }
}

/* 深色模式兼容性 */
@media (prefers-color-scheme: dark) {
    .dark-mode-override {
        /* 确保在系统深色模式下的一致性 */
        background: #0a0a0a !important;
        color: #ffffff !important;
    }
}

/* 特殊浏览器兼容性 */
@supports not (backdrop-filter: blur(10px)) {
    .backdrop-fallback {
        /* 不支持backdrop-filter的浏览器回退方案 */
        background: rgba(10, 10, 10, 0.95) !important;
    }
}

/* 特殊状态样式 */
.loading-override {
    position: relative !important;
    overflow: hidden !important;
}

.loading-override::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.2), transparent) !important;
    animation: loading-scan 1.5s infinite !important;
}

@keyframes loading-scan {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 错误状态样式 */
.error-override {
    background: rgba(255, 0, 0, 0.1) !important;
    border: 1px solid rgba(255, 0, 0, 0.5) !important;
    color: #ff3e3e !important;
}

.error-override::before {
    content: '⚠ ' !important;
}

/* 成功状态样式 */
.success-override {
    background: rgba(0, 255, 65, 0.1) !important;
    border: 1px solid rgba(0, 255, 65, 0.5) !important;
    color: #00ff41 !important;
}

.success-override::before {
    content: '✓ ' !important;
}

/* 警告状态样式 */
.warning-override {
    background: rgba(255, 165, 0, 0.1) !important;
    border: 1px solid rgba(255, 165, 0, 0.5) !important;
    color: #ffa500 !important;
}

.warning-override::before {
    content: '⚠ ' !important;
}

/* 信息状态样式 */
.info-override {
    background: rgba(0, 255, 255, 0.1) !important;
    border: 1px solid rgba(0, 255, 255, 0.5) !important;
    color: #00ffff !important;
}

.info-override::before {
    content: 'ℹ ' !important;
}

/* 特殊组件样式覆盖 */
.modal-override {
    background: rgba(10, 10, 10, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(0, 255, 65, 0.5) !important;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.3) !important;
}

.tooltip-override {
    background: rgba(10, 10, 10, 0.9) !important;
    border: 1px solid rgba(0, 255, 65, 0.4) !important;
    color: #00ff41 !important;
    font-family: 'Courier New', Courier, monospace !important;
}

/* 滚动条样式 */
.scrollbar-override::-webkit-scrollbar {
    width: 8px !important;
}

.scrollbar-override::-webkit-scrollbar-track {
    background: rgba(10, 10, 10, 0.8) !important;
}

.scrollbar-override::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 65, 0.5) !important;
    border-radius: 4px !important;
}

.scrollbar-override::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 65, 0.7) !important;
}

/* 选择文本样式 */
::selection {
    background: rgba(0, 255, 65, 0.3) !important;
    color: #ffffff !important;
}

::-moz-selection {
    background: rgba(0, 255, 65, 0.3) !important;
    color: #ffffff !important;
}

/* 焦点样式 */
.focus-override:focus {
    outline: 2px solid #00ff41 !important;
    outline-offset: 2px !important;
}

/* 禁用状态样式 */
.disabled-override {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background: rgba(10, 10, 10, 0.5) !important;
}

/* 特殊布局处理 */
.flex-override {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
}

.grid-override {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 1rem !important;
}

/* 文本溢出处理 */
.text-ellipsis-override {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.text-clamp-override {
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* 图片样式覆盖 */
.img-override {
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
}

.img-rounded-override {
    border-radius: 8px !important;
    border: 1px solid rgba(0, 255, 65, 0.3) !important;
}

/* 链接样式覆盖 */
.link-override {
    color: #00ff41 !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

.link-override:hover {
    color: #ffffff !important;
    text-decoration: underline !important;
}

.link-override:visited {
    color: #00cc33 !important;
}

/* 按钮组样式 */
.btn-group-override {
    display: inline-flex !important;
    border: 1px solid rgba(0, 255, 65, 0.3) !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

.btn-group-override .btn {
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

.btn-group-override .btn:not(:last-child) {
    border-right: 1px solid rgba(0, 255, 65, 0.3) !important;
}

/* 分页样式 */
.pagination-override {
    display: flex !important;
    gap: 0.5rem !important;
    list-style: none !important;
    padding: 0 !important;
}

.pagination-override .page-item {
    margin: 0 !important;
}

.pagination-override .page-link {
    padding: 0.5rem 1rem !important;
    border: 1px solid rgba(0, 255, 65, 0.3) !important;
    color: #00ff41 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

.pagination-override .page-link:hover {
    background: rgba(0, 255, 65, 0.1) !important;
}

.pagination-override .page-item.active .page-link {
    background: #00ff41 !important;
    color: #0a0a0a !important;
    border-color: #00ff41 !important;
}

.pagination-override .page-item.disabled .page-link {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}