/**
 * 角色管理组件样式
 * 为角色管理界面提供现代化的UI样式
 */

/* 统计卡片样式 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #007bff;
    transition: transform 0.2s ease;
}

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

.stats-card.warning {
    border-left-color: #ffc107;
}

.stats-card.success {
    border-left-color: #28a745;
}

.stats-card.danger {
    border-left-color: #dc3545;
}

.stats-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.stats-card-header h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
    color: #333;
}

.stats-card-title {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

.stats-card-body {
    color: #888;
    font-size: 0.9rem;
}

/* 筛选工具栏样式 */
.filter-toolbar {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

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

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.filter-group label {
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.filter-group select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 120px;
}

.search-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 200px;
}

.batch-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

/* 表格样式 */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.characters-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.characters-table th,
.characters-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.characters-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

.characters-table tbody tr {
    transition: background-color 0.2s ease;
}

.characters-table tbody tr:hover {
    background-color: #f8f9fa;
}

.characters-table tbody tr.selected {
    background-color: #e7f3ff;
}

/* 角色相关样式 */
.character-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #eee;
}

.character-name strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 4px;
}

.character-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.tag {
    background: #e9ecef;
    color: #495057;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.75rem;
    white-space: nowrap;
}

.tag-more {
    background: #6c757d;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.creator-info small.gender-info {
    color: #888;
    font-size: 0.8rem;
}

/* 状态标签样式 */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-primary {
    background: #007bff;
    color: white;
}

.badge-info {
    background: #17a2b8;
    color: white;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #212529;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

.badge-secondary {
    background: #6c757d;
    color: white;
}

.time-info {
    font-size: 0.9rem;
}

.time-info small.review-time {
    display: block;
    color: #888;
    font-size: 0.8rem;
    margin-top: 2px;
}

/* 操作按钮样式 */
.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

.btn-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #0056b3;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #1e7e34;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover:not(:disabled) {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: #138496;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #545b62;
}

/* 分页样式 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    color: #666;
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    gap: 5px;
    align-items: center;
}

.page-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.page-size-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.page-size-controls label {
    color: #666;
}

.page-size-controls select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* 加载状态样式 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* 无数据状态样式 */
.no-data {
    text-align: center;
    padding: 40px;
}

.no-data-content p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.no-data-content small {
    color: #999;
    font-size: 0.9rem;
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

.modal-content.large {
    max-width: 900px;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #666;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #eee;
}

/* 角色详情样式 */
.detail-header {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.detail-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #eee;
    flex-shrink: 0;
}

.detail-info h4 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    color: #333;
}

.character-description {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.detail-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-sections {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.detail-section h5 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.info-item span {
    color: #333;
}

.tags-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.text-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.text-content.code-like {
    background: #f1f3f4;
    font-family: 'Monaco', 'Consolas', monospace;
}

.text-content p {
    margin: 0;
    line-height: 1.6;
    color: #333;
}

.text-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #333;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

/* 审核弹窗样式 */
.review-character-info {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    align-items: center;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
}

.review-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #eee;
    flex-shrink: 0;
}

.review-character-info h4 {
    margin: 0 0 8px 0;
    color: #333;
}

.review-character-info p {
    margin: 0 0 5px 0;
    color: #666;
    font-size: 0.9rem;
}

.review-character-info small {
    color: #888;
    font-size: 0.8rem;
}

.review-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-text {
    font-size: 0.95rem;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.radio-text.success {
    color: #28a745;
    background: #d4edda;
}

.radio-text.danger {
    color: #dc3545;
    background: #f8d7da;
}

.radio-label input:checked + .radio-text {
    font-weight: 600;
    transform: scale(1.05);
}

.form-textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    font-family: inherit;
}

.form-textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.char-count {
    text-align: right;
    color: #999;
    font-size: 0.8rem;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .stats-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .characters-table {
        font-size: 0.8rem;
    }
    
    .characters-table th,
    .characters-table td {
        padding: 8px;
    }
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    .search-group {
        flex-direction: column;
    }
    
    .search-input {
        min-width: auto;
    }
    
    .batch-actions {
        margin-left: 0;
        justify-content: flex-end;
    }
    
    .pagination-container {
        flex-direction: column;
        text-align: center;
    }
    
    .modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .detail-header {
        flex-direction: column;
        text-align: center;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    /* 隐藏部分列在小屏幕上 */
    .characters-table th:nth-child(4),
    .characters-table td:nth-child(4),
    .characters-table th:nth-child(8),
    .characters-table td:nth-child(8) {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .characters-table th:nth-child(5),
    .characters-table td:nth-child(5),
    .characters-table th:nth-child(7),
    .characters-table td:nth-child(7) {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        flex-direction: column;
    }
}