/* 内推码管理系统 - 前端样式 */

/* 全屏白色背景 - 强制覆盖所有WordPress主题样式 */
body, html {
    background: white !important;
    background-color: white !important;
    margin: 0;
    padding: 0;
}

body::before, html::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: -9999;
}

/* 覆盖WordPress主题可能的背景样式 */
.site, .site-content, .content-area, .site-main, .entry-content, 
.page, .single, .archive, .home, .blog, #content, #main, 
.container, .wrap, .wrapper, #wrapper, .main-content {
    background: white !important;
    background-color: white !important;
}

#page, #site, .hfeed, .site-header, .site-footer {
    background: white !important;
    background-color: white !important;
}

.rcd-frontend-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 10px 20px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: white;
    min-height: 100vh;
    position: relative;
}

.rcd-frontend-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: -1;
}

/* 删除标题样式 */

/* 搜索容器样式 - 去掉外层方框 */
.rcd-search-container {
    background: transparent;
    padding: 10px 0;
    border: none;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.rcd-search-container input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    width: 250px;
    transition: border-color 0.2s ease;
    background: white;
}

.rcd-search-container input[type="text"]:focus {
    border-color: #80bdff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 按钮样式 */
.rcd-btn {
    padding: 8px 16px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: white;
    color: #495057;
}

.rcd-btn-primary {
    background: #007bff;
    color: white;
    border: 1px solid #007bff;
}

.rcd-btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.rcd-btn-success {
    background: #28a745;
    color: white;
    border: 1px solid #28a745;
}

.rcd-btn-success:hover {
    background: #1e7e34;
    border-color: #1e7e34;
}

.rcd-btn:not(.rcd-btn-primary):not(.rcd-btn-success) {
    background: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.rcd-btn:not(.rcd-btn-primary):not(.rcd-btn-success):hover {
    background: #5a6268;
    border-color: #5a6268;
}

/* 小按钮 */
.rcd-btn-sm {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 6px;
}

/* 表格样式 */
.rcd-table-container {
    background: white;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    margin: 20px auto;
    border: 1px solid #e1e5e9;
    max-width: 600px;
}

.rcd-frontend-table {
    width: 100%;
    max-width: 600px;
    border-collapse: collapse;
    margin: 0 auto;
    background: white;
    border: 1px solid #e1e5e9;
}

.rcd-frontend-table th {
    background: #f8f9fa;
    color: #212529 !important;
    font-weight: 600;
    padding: 12px 20px;
    text-align: center;
    border-bottom: 2px solid #e1e5e9;
    border-right: 1px solid #e1e5e9;
    font-size: 14px;
    position: relative;
    opacity: 1 !important;
}

.rcd-frontend-table th:last-child {
    border-right: none;
}

.rcd-frontend-table td {
    padding: 12px 20px;
    border-bottom: 1px solid #e1e5e9;
    border-right: 1px solid #e1e5e9;
    vertical-align: middle;
    transition: background-color 0.2s ease;
    text-align: center;
    font-weight: 400;
    color: #212529 !important;
    opacity: 1 !important;
}

.rcd-frontend-table td:last-child {
    border-right: none;
}

.rcd-frontend-table tbody tr:hover {
    background: #f8f9fa;
}

.rcd-frontend-table tr:last-child td {
    border-bottom: none;
}

.rcd-frontend-table code {
    background: #f8f9fa;
    color: #212529 !important;
    padding: 6px 12px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #dee2e6;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    opacity: 1 !important;
}

.rcd-frontend-table code:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.rcd-no-data {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 50px !important;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

/* 分页样式 */
.rcd-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
}

.rcd-pagination .tablenav-pages {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

.rcd-pagination .displaying-num {
    margin-right: 20px;
    color: #495057;
    font-weight: 500;
    font-size: 14px;
}

.rcd-pagination .button {
    min-width: 40px;
    height: 40px;
    line-height: 38px;
    text-align: center;
    border-radius: 50%;
    border: 2px solid #e9ecef;
    background: white;
    color: #495057;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rcd-pagination .current-page {
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    border-color: #3498db !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.rcd-pagination .button:hover:not(.current-page) {
    background: #f8f9fa;
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* 模态框样式 */
.rcd-modal {
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.rcd-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 500px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

.rcd-modal-content h3 {
    margin-top: 0;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #3498db;
    padding-bottom: 15px;
}

.rcd-close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #adb5bd;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.rcd-close:hover {
    color: #e74c3c;
    background: #f8f9fa;
    transform: rotate(90deg);
}

/* 表单样式 */
.rcd-form-group {
    margin-bottom: 25px;
}

.rcd-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.rcd-form-group input,
.rcd-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background: #f8f9fa;
}

.rcd-form-group input:focus,
.rcd-form-group textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background: white;
}

.rcd-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.rcd-form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #e9ecef;
}

.rcd-form-actions .rcd-btn {
    min-width: 120px;
    padding: 14px 25px;
    font-size: 15px;
    font-weight: 600;
}

/* 编辑删除按钮 */
.rcd-frontend-edit-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 3px 10px rgba(243, 156, 18, 0.3);
}

.rcd-frontend-edit-btn:hover {
    background: linear-gradient(135deg, #e67e22, #f39c12) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
}

.rcd-frontend-delete-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
}

.rcd-frontend-delete-btn:hover {
    background: linear-gradient(135deg, #c0392b, #e74c3c) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

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

.rcd-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

/* 消息样式 */
.rcd-message {
    padding: 15px 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
    border-left: 4px solid;
    position: relative;
    overflow: hidden;
}

.rcd-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

.rcd-message.success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border-left-color: #28a745;
}

.rcd-message.error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border-left-color: #dc3545;
}

/* 搜索统计信息 */
.rcd-search-stats {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #0d47a1;
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid #2196f3;
    font-weight: 500;
    text-align: center;
}

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

@keyframes slideIn {
    from { 
        transform: translate(-50%, -60%);
        opacity: 0;
        scale: 0.9;
    }
    to { 
        transform: translate(-50%, -50%);
        opacity: 1;
        scale: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .rcd-frontend-container {
        padding: 15px;
    }
    
    .rcd-search-container {
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
    }
    
    .rcd-search-container input[type="text"] {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .rcd-search-container .rcd-btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .rcd-modal-content {
        width: 95vw;
        padding: 25px;
        margin: 10px;
    }
    
    .rcd-form-actions {
        flex-direction: column;
    }
    
    .rcd-form-actions .rcd-btn {
        width: 100%;
    }
    
    .rcd-pagination .tablenav-pages {
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px 15px;
    }
    
    .rcd-frontend-title {
        font-size: 22px;
    }
    
    .rcd-table-container {
        overflow-x: auto;
    }
    
    .rcd-frontend-table {
        min-width: 500px;
    }
}

@media (max-width: 480px) {
    .rcd-frontend-title {
        font-size: 20px;
    }
    
    .rcd-frontend-table th,
    .rcd-frontend-table td {
        padding: 10px 8px;
        font-size: 14px;
    }
    
    .rcd-btn-sm {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* 表格行选中效果 */
.rcd-row-selected {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb) !important;
    border-left: 4px solid #2196f3 !important;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2) !important;
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .rcd-frontend-container {
        color: #e9ecef;
    }
    
    .rcd-table-container {
        background: #343a40;
        border-color: #495057;
    }
    
    .rcd-frontend-table td {
        border-bottom-color: #495057;
    }
    
    .rcd-modal-content {
        background: #343a40;
        color: #e9ecef;
    }
}

/* 复制按钮样式 */
.rcd-copy-code-btn {
    background: #6c757d;
    color: white;
    border: 1px solid #5a6268;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.rcd-copy-code-btn:hover {
    background: #5a6268;
    border-color: #545b62;
}

.rcd-copy-code-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(72, 187, 120, 0.3);
}

.rcd-code-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* 复制功能提示 - 居中显示 */
.rcd-copy-success {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.4);
    z-index: 10000;
    animation: bounceIn 0.5s ease;
    text-align: center;
    min-width: 200px;
}

@keyframes bounceIn {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    70% {
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* 增强的浏览器兼容性和主题覆盖规则 */
.rcd-frontend-table,
.rcd-frontend-table * {
    color: #212529 !important;
    opacity: 1 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 强制覆盖可能的主题透明度设置 */
.rcd-frontend-table td,
.rcd-frontend-table th,
.rcd-frontend-table code,
.rcd-frontend-table .rcd-code-cell,
.rcd-frontend-table .rcd-copy-code-btn {
    opacity: 1 !important;
    filter: none !important;
    -webkit-filter: none !important;
}

/* 确保文字在所有背景下都清晰可见 */
.rcd-frontend-table td * {
    color: inherit !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

/* 覆盖WordPress主题可能的透明度设置 */
.entry-content .rcd-frontend-table,
.site-content .rcd-frontend-table,
.post-content .rcd-frontend-table,
.page-content .rcd-frontend-table {
    opacity: 1 !important;
}

.entry-content .rcd-frontend-table *,
.site-content .rcd-frontend-table *,
.post-content .rcd-frontend-table *,
.page-content .rcd-frontend-table * {
    opacity: 1 !important;
    color: #212529 !important;
}

/* 按钮文字确保清晰可见 */
.rcd-btn,
.rcd-copy-code-btn,
.rcd-frontend-edit-btn,
.rcd-frontend-delete-btn {
    opacity: 1 !important;
    color: white !important;
    text-shadow: none !important;
}

/* 特殊处理：确保内推码文字绝对清晰 */
.rcd-frontend-table code,
.rcd-referral-code {
    color: #000000 !important;
    background-color: #f8f9fa !important;
    opacity: 1 !important;
    font-weight: 700 !important;
    text-shadow: none !important;
    -webkit-text-fill-color: #000000 !important;
}