/* 管理后台样式 */
.admin-body {
    margin: 0;
    padding: 0;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: #f0f2f5;
}

/* 登录页面 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0066CC 0%, #004999 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo-icon {
    font-size: 50px;
    display: block;
    margin-bottom: 10px;
}

.login-header h1 {
    color: #0066CC;
    font-size: 24px;
}

#login-form .form-group {
    margin-bottom: 20px;
}

#login-form label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

#login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

#login-form input:focus {
    outline: none;
    border-color: #0066CC;
}

.captcha-code {
    display: inline-block;
    padding: 8px 15px;
    background: #f0f0f0;
    border-radius: 5px;
    font-weight: bold;
    font-size: 18px;
    letter-spacing: 5px;
    cursor: pointer;
    color: #0066CC;
    margin-left: 10px;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #0066CC;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-login:hover {
    background: #0052A3;
}

.login-tip {
    text-align: center;
    margin-top: 20px;
    color: #999;
    font-size: 13px;
}

/* 管理后台布局 */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: #001529;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 1px solid #ffffff20;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-nav {
    padding: 10px 0;
}

.sidebar-nav a {
    display: block;
    padding: 12px 20px;
    color: #ffffff80;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: #0066CC;
    color: white;
}

.sidebar-nav a#logout-btn {
    margin-top: 30px;
    border-top: 1px solid #ffffff20;
    color: #ff4d4f;
}

.sidebar-nav a#logout-btn:hover {
    background: #ff4d4f;
    color: white;
}

/* 主内容区 */
.main-content {
    margin-left: 240px;
    flex: 1;
    min-height: 100vh;
    background: #f0f2f5;
}

.admin-header {
    background: white;
    padding: 15px 30px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.admin-user {
    color: #666;
}

.admin-content {
    padding: 30px;
}

/* 页面区块 */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-info h3 {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.stat-value {
    margin: 5px 0 0;
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.dashboard-info {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dashboard-info h3 {
    margin: 0 0 15px;
    color: #333;
}

.dashboard-info p {
    margin: 8px 0;
    color: #666;
}

/* 区块标题 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.btn-add {
    padding: 10px 20px;
    background: #0066CC;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-add:hover {
    background: #0052A3;
}

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

.data-table th,
.data-table td {
    padding: 15px 20px;
    text-align: left;
}

.data-table th {
    background: #fafafa;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e8e8e8;
}

.data-table td {
    border-bottom: 1px solid #f0f0f0;
    color: #666;
}

.data-table tr:last-child td {
    border-bottom: none;
}

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

.data-table .btn-edit,
.data-table .btn-delete {
    padding: 5px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.data-table .btn-edit {
    background: #0066CC;
    color: white;
}

.data-table .btn-edit:hover {
    background: #0052A3;
}

.data-table .btn-delete {
    background: #ff4d4f;
    color: white;
}

.data-table .btn-delete:hover {
    background: #ff7875;
}

.data-table .btn-move {
    background: #17a2b8;
    color: white;
}

.data-table .btn-move:hover {
    background: #138496;
}

.data-table .btn-move:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 设置表单 */
.settings-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
}

.settings-form .form-group {
    margin-bottom: 20px;
}

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

.settings-form input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.settings-form input:focus {
    outline: none;
    border-color: #0066CC;
}

.btn-save {
    padding: 12px 30px;
    background: #0066CC;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-save:hover {
    background: #0052A3;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

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

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.modal-form {
    padding: 20px;
}

.modal-form .form-group {
    margin-bottom: 15px;
}

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

.modal-form input,
.modal-form textarea,
.modal-form select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.modal-form textarea {
    min-height: 80px;
    resize: vertical;
}

.modal-form input:focus,
.modal-form textarea:focus,
.modal-form select:focus {
    outline: none;
    border-color: #0066CC;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-cancel {
    padding: 10px 20px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-cancel:hover {
    background: #e8e8e8;
}

.btn-confirm {
    padding: 10px 20px;
    background: #0066CC;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-confirm:hover {
    background: #0052A3;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar-header span:last-child,
    .sidebar-nav a span:not(:first-child) {
        display: none;
    }
    
    .main-content {
        margin-left: 60px;
    }
}

/* 备份页面 */
.backup-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 700px;
}

.backup-container h3 {
    margin: 0 0 10px;
    color: #333;
}

.backup-desc {
    color: #666;
    margin-bottom: 25px;
}

.backup-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.backup-actions .btn-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-file {
    cursor: pointer;
}

.backup-help {
    background: #f0f7ff;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #0066CC;
}

.backup-help h4 {
    margin: 0 0 15px;
    color: #0066CC;
}

.backup-help ul {
    margin: 0;
    padding-left: 20px;
    color: #666;
}

.backup-help li {
    margin-bottom: 8px;
}

/* 图片预览 */
.image-preview {
    margin-top: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 6px;
    display: inline-block;
}

.image-preview img {
    border-radius: 6px;
}

.form-group input[type="file"] {
    padding: 5px 0;
}

/* 富文本预览 */
.richtext-preview {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f9f9f9;
    cursor: pointer;
    min-height: 60px;
    color: #666;
}

.richtext-preview:hover {
    border-color: #0066CC;
    background: #f0f7ff;
}
