/* 通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    margin-bottom: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 3px solid #007bff;
    padding-bottom: 20px;
}

.header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 300;
}

/* 区块样式 */
.section {
    margin-bottom: 40px;
    padding: 25px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.section h3 {
    color: #495057;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.4rem;
    font-weight: 500;
}

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

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

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

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

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

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

.btn-success:hover {
    background-color: #218838;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

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

.btn-danger:hover {
    background-color: #c82333;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

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

.btn-info:hover {
    background-color: #138496;
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
}

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

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 5px;
}

.inline-form {
    display: inline-block;
}

.batch-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* 表格样式 */
.table-responsive {
    overflow-x: auto;
    margin-top: 15px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background-color: white;
}

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

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

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

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

.table tbody tr:nth-child(even) {
    background-color: #fcfcfc;
}

/* 状态样式 */
.status-online {
    color: #28a745;
    font-weight: 600;
    font-size: 14px;
}

.status-offline {
    color: #dc3545;
    font-weight: 600;
    font-size: 14px;
}

.status-warning {
    color: #ffc107;
    font-weight: 600;
    font-size: 14px;
}

/* 文本样式 */
.small-text {
    font-size: 0.85em;
    color: #6c757d;
}

.subject-cell {
    max-width: 300px;
}

.subject-cell span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 提示框样式 */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    position: relative;
}

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

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

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 0;
}

/* 页脚样式 */
.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .section {
        padding: 15px;
    }
    
    .table th,
    .table td {
        padding: 8px;
        font-size: 14px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .batch-actions .btn {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        font-size: 12px;
    }
    
    .subject-cell {
        max-width: 150px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeIn 0.3s ease-out;
}

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

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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