/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 主色调定义 */
:root {
    --primary-color: #2563eb; /* 蓝色 */
    --primary-dark: #1d4ed8; /* 深蓝色 */
    --primary-light: #3b82f6; /* 浅蓝色 */
    --secondary-color: #f8fafc; /* 浅灰蓝 */
    --text-color: #1e293b; /* 深灰 */
    --text-light: #64748b; /* 中灰 */
    --light-gray: #f1f5f9; /* 浅灰 */
    --medium-gray: #e2e8f0; /* 中灰 */
    --dark-gray: #94a3b8; /* 深灰 */
    --white: #ffffff;
    --black: #0f172a;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

body {
    font-family: 'Noto Sans SC', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 登录容器 */
.login-container {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 登录框 */
.login-box {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
    text-align: center;
}

/* 登录头部 */
.login-header {
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--primary-dark);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* 登录表单 */
.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--medium-gray);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.login-button {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.login-button:hover {
    background-color: var(--primary-dark);
}

.login-button:active {
    transform: translateY(1px);
}

/* 登录消息 */
.login-message {
    margin-top: 1rem;
    text-align: center;
    color: var(--danger);
    min-height: 1.5rem;
}

/* 登录页脚 */
.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--medium-gray);
}

.login-footer p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .login-box {
        padding: 1.5rem;
    }
    
    .login-header h1 {
        font-size: 1.5rem;
    }
}

/* 管理后台样式 */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background-color: var(--primary-dark);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo h2 {
    margin-bottom: 0.5rem;
}

.logo p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.nav-menu ul {
    list-style: none;
}

.nav-menu ul li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-menu ul li a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--white);
    text-decoration: none;
    transition: background-color 0.3s;
}

.nav-menu ul li a:hover,
.nav-menu ul li.active a {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 250px;
}

/* 顶部导航 */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.user-info a {
    margin-left: 1rem;
    color: var(--primary-dark);
    text-decoration: none;
}

.user-info a:hover {
    text-decoration: underline;
}

/* 内容区域 */
.content {
    padding: 2rem;
}

.tab-content {
    display: none;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    color: var(--primary-dark);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-gray);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
}

/* 最近活动 */
.recent-activity {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.recent-activity h2 {
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.recent-activity ul {
    list-style-type: none;
}

.recent-activity ul li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--light-gray);
}

.recent-activity ul li:last-child {
    border-bottom: none;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.data-table thead {
    background-color: var(--primary-dark);
    color: var(--white);
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
}

.data-table th {
    font-weight: 600;
}

.data-table tbody tr:nth-child(even) {
    background-color: var(--secondary-color);
}

.data-table tbody tr:hover {
    background-color: var(--light-gray);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-dark);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-color);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-edit {
    background-color: var(--warning);
    color: var(--white);
}

.btn-edit:hover {
    background-color: #e68a00;
}

.btn-delete {
    background-color: var(--danger);
    color: var(--white);
}

.btn-delete:hover {
    background-color: #d32f2f;
}

/* 设置表单 */
.settings-form {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.settings-form .form-group {
    margin-bottom: 1.5rem;
}

.settings-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.settings-form input,
.settings-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--medium-gray);
    border-radius: 5px;
    font-size: 1rem;
}

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

.settings-form input:focus,
.settings-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(135, 206, 235, 0.2);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .topbar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* 模态框样式 */
.modal {
    display: block;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--white);
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    position: relative;
}

.close {
    color: var(--dark-gray);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 10px;
}

.close:hover,
.close:focus {
    color: var(--black);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary-dark);
}

.modal-content .form-group {
    margin-bottom: 1rem;
}

.modal-content .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.modal-content .form-group input,
.modal-content .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-family: inherit;
}

.modal-content .form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.modal-content .btn {
    margin-top: 10px;
}