/* css/admin_dashboard.css - 管理后台样式 */

/* 重置和基础样式 */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
    min-height: calc(100vh - 120px);
}

/* 头部样式 */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.admin-title {
    font-size: 24px;
    font-weight: 700;
    color: #343a40;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-title:before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #4361ee, #3a56d4);
    border-radius: 2px;
}

.admin-user-info {
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.admin-user-name {
    font-weight: 500;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-user-name i {
    color: #4361ee;
}

/* 导航样式 */
.admin-nav {
    display: flex;
    background: white;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

.admin-nav-item {
    flex: 1;
    text-align: center;
    padding: 15px 20px;
    text-decoration: none;
    color: #6c757d;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
    white-space: nowrap;
}

.admin-nav-item:hover {
    background: #f8f9fa;
    color: #4361ee;
}

.admin-nav-item.active {
    background: linear-gradient(135deg, #4361ee, #3a56d4);
    color: white;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.3);
}

/* 标签内容 */
.admin-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.admin-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.admin-stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border-color: #4361ee;
}

.admin-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4361ee, #3a56d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.admin-stat-info {
    flex: 1;
}

.admin-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #343a40;
    line-height: 1;
    margin-bottom: 5px;
}

.admin-stat-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

/* 部分头部样式 */
.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.admin-section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #343a40;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-actions {
    display: flex;
    gap: 10px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 14px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-primary {
    background: linear-gradient(135deg, #4361ee, #3a56d4);
    color: white;
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

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

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

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

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 表格样式 */
.admin-table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.admin-table th {
    background: #f8f9fa;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
}

.admin-table td {
    padding: 16px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

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

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

.user-info-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    font-weight: 500;
    color: #343a40;
}

.admin-actions-cell {
    display: flex;
    gap: 8px;
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

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

.btn-edit:hover {
    background: #138496;
    transform: translateY(-2px);
}

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

.btn-delete:hover {
    background: #c82333;
    transform: translateY(-2px);
}

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

.btn-view:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* 徽章样式 */
.admin-badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-align: center;
    white-space: nowrap;
}

.badge-primary {
    background: linear-gradient(135deg, #4361ee, #3a56d4);
    color: white;
}

.badge-success {
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
}

.badge-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}

.badge-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

/* 群发邮件表单样式 */
.admin-broadcast-form {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.admin-form-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.admin-form-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-display {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.recipient-count-box {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: center;
}

.count-value {
    font-size: 24px;
    font-weight: 700;
    color: #4361ee;
    margin-right: 5px;
}

.count-label {
    font-size: 14px;
    color: #6c757d;
}

.broadcast-preview {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.preview-header {
    background: linear-gradient(135deg, #4361ee, #3a56d4);
    padding: 20px;
    color: white;
}

.preview-header h4 {
    margin: 0;
    font-size: 18px;
}

.preview-content {
    padding: 20px;
    min-height: 150px;
    background: white;
    max-height: 400px;
    overflow-y: auto;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* 模板样式 */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.template-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.template-card:hover {
    border-color: #4361ee;
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(67, 97, 238, 0.1);
}

.template-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4361ee, #3a56d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.template-content {
    flex: 1;
}

.template-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: #343a40;
    margin: 0 0 8px 0;
}

.template-content p {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
}

/* 文本对齐 */
.text-center {
    text-align: center;
}

/* 消息样式 */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4361ee;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* 响应式设计 */
@media (max-width: 1200px) {
    .admin-container {
        padding: 15px;
    }
    
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .admin-nav {
        flex-wrap: wrap;
    }
    
    .admin-nav-item {
        min-width: 120px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .admin-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        font-size: 13px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 12px 8px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .admin-nav {
        justify-content: flex-start;
    }
    
    .admin-nav-item {
        padding: 12px 15px;
        min-width: auto;
        flex: none;
    }
    
    .admin-broadcast-form,
    .admin-form-section {
        padding: 20px;
    }
    
    .admin-stat-value {
        font-size: 24px;
    }
    
    .admin-stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}