/* 后台管理页面样式 */
.admin-body {
    background-color: #f5f7fa;
    color: #333;
}

/* 顶部导航 */
.admin-header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    margin-right: 1rem;
    cursor: pointer;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
}

.username {
    margin-right: 0.5rem;
}

#admin-logout {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
}

/* 管理容器 */
.admin-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* 侧边栏 */
.admin-sidebar {
    width: 250px;
    background-color: white;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    z-index: 90;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    border-bottom: 1px solid #f1f1f1;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: #555;
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-link:hover, .nav-item.active .nav-link {
    background-color: #3498db;
    color: white;
}

/* 主内容区 */
.admin-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e1e1e1;
}

.section-header h2 {
    margin: 0;
    font-size: 1.8rem;
}

.section-header p {
    color: #777;
    margin: 0.5rem 0 0 0;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-right: 1rem;
}

.stat-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #777;
}

.stat-content .stat-value {
    margin: 0;
    font-size: 1.8rem;
    font-weight: bold;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 60px;
        bottom: 0;
        transform: translateX(-100%);
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .admin-content {
        padding: 1rem;
    }
}

/* 图片管理样式 */
.gallery-manager {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.image-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    position: relative;
}

.image-item:hover {
    transform: translateY(-5px);
}

.image-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.image-item .image-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 5px;
}

.image-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    color: #555;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.image-action-btn:hover {
    background-color: #3498db;
    color: white;
}

/* 数据表格样式 */
.data-table-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f1f1f1;
}

.data-table th {
    background-color: #f9f9f9;
    font-weight: bold;
}

.action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: all 0.2s ease;
}

.btn-edit {
    background-color: #3498db;
    color: white;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

/* 设置表单样式 */
.settings-form-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.settings-form .form-group {
    margin-bottom: 1.5rem;
}

.settings-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.settings-form input, .settings-form textarea, .settings-form select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.settings-form textarea {
    resize: vertical;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e1e1e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e1e1e1;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Admin Login Styles */
.admin-auth-card {
    max-width: 650px;
    margin: 2rem auto;
    position: relative;
    overflow: hidden;
    border-top: 4px solid #e74c3c;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.admin-header {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.admin-button {
    background-color: #e74c3c;
}

.admin-button:hover {
    background-color: #c0392b;
}

.auth-card.admin-auth-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Admin login animation */
@keyframes adminPulse {
    0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

.admin-auth-card:focus-within {
    animation: adminPulse 1.5s infinite;
}

/* 背景动态效果 */
.admin-auth-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, #ff416c, #ff4b2b, #3a86ff, #8338ec);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    z-index: -1;
    opacity: 0.1;
}

.decorative-element {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.1);
    top: -50px;
    right: -50px;
    animation: float 6s ease-in-out infinite;
}

.decorative-element::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(156, 39, 176, 0.1);
    bottom: -30px;
    left: -30px;
    animation: float 8s ease-in-out infinite 2s;
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}