* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* 登录页面样式 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #667eea;
    font-size: 28px;
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.form-group label::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    margin-right: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #d9d9d9;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #bfbfbf;
}

.form-group input:required:not(:placeholder-shown):invalid {
    border-color: #ff4d4f;
}

.form-group input:required:not(:placeholder-shown):invalid:focus {
    box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #52c41a;
    color: white;
}

.btn-success:hover {
    background: #73d13d;
}

.btn-danger {
    background: #ff4d4f;
    color: white;
}

.btn-danger:hover {
    background: #ff7875;
}

.btn-warning {
    background: #faad14;
    color: white;
}

.btn-warning:hover {
    background: #ffc53d;
}

.btn-default {
    background: #f0f0f0;
    color: #333;
}

.btn-default:hover {
    background: #d9d9d9;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.login-tips {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
}

.login-tips p {
    color: #666;
    font-size: 12px;
    margin-bottom: 5px;
}

.login-tips p:last-child {
    margin-bottom: 0;
}

/* 主页面样式 */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-left h2 {
    font-size: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right span {
    font-size: 14px;
}

.main-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 240px;
    background: white;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav li a {
    display: block;
    padding: 15px 25px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar nav li a:hover,
.sidebar nav li a.active {
    background: #f0f2f5;
    color: #667eea;
    border-left-color: #667eea;
}

.content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

/* 内容区域样式 */
.content-header {
    margin-bottom: 30px;
}

.content-header h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 5px;
}

.content-header p {
    color: #666;
    font-size: 14px;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.card-header h3 {
    font-size: 18px;
    color: #333;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch input[type="checkbox"] {
    width: 48px;
    height: 24px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle-switch input[type="checkbox"]:checked {
    background: #667eea;
}

.toggle-switch input[type="checkbox"]::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.3s;
}

.toggle-switch input[type="checkbox"]:checked::after {
    left: 26px;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table th {
    background: #fafafa;
    color: #666;
    font-weight: 600;
    font-size: 13px;
}

table tr:hover {
    background: #fafafa;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.success {
    background: #f6ffed;
    color: #52c41a;
}

.status-badge.warning {
    background: #fffbe6;
    color: #faad14;
}

.status-badge.error {
    background: #fff2f0;
    color: #ff4d4f;
}

.status-badge.info {
    background: #e6f7ff;
    color: #1890ff;
}

/* 模态框样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-overlay {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-body {
    padding: 24px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px 8px 0 0;
}

.modal-header h3 {
    font-size: 18px;
    margin: 0;
    color: #fff;
    font-weight: 600;
}

.modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #fff;
    padding: 4px 10px;
    line-height: 1;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255,255,255,0.3);
    color: #fff;
    transform: rotate(90deg);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stat-card h4 {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
}

.stat-card .stat-change {
    margin-top: 8px;
    font-size: 13px;
    color: #52c41a;
}

/* 图片预览 */
.image-preview {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}

.image-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.image-upload-area:hover {
    border-color: #667eea;
    background: #f9f9ff;
}

.image-upload-area i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 10px;
}

.image-upload-area p {
    color: #999;
}

/* 响应式 */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 20px;
    }
    
    .header-right {
        flex-direction: column;
        gap: 10px;
    }
}
