* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #f7f7f7 0%, #9686a7 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 首页样式 */
.main-header {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.main-header h1 {
    color: #333;
    font-size: 2.5em;
    display: flex;
    align-items: center;
    gap: 15px;
}

.main-header h1 i {
    color: #ff6b6b;
}

.admin-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.gallery-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.gallery-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.no-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.2em;
}

.no-image i {
    font-size: 3em;
    margin-bottom: 10px;
}

.item-title {
    padding: 20px;
}

.item-title h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #333;
}

.preview-text {
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
}

.main-footer {
    text-align: center;
    color: white;
    padding: 20px;
    font-size: 0.9em;
    opacity: 0.8;
}

/* 详情页样式 */
.detail-container {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 0 0 15px 15px;
    margin-bottom: 20px;
}

.detail-content {
    padding: 30px;
}

.detail-title {
    font-size: 3em;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
}

.detail-title:after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 15px auto;
    border-radius: 2px;
}

.media-section {
    margin-bottom: 30px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.detail-image {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    display: block;
}

.detail-video {
    width: 100%;
    max-height: 600px;
    display: block;
    background: #000;
}

.description-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
}

.description-section h2 {
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.description-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 1.1em;
    line-height: 1.8;
    color: #555;
    background: white;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 40px;
}

/* 登录页样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header i {
    font-size: 3em;
    color: #667eea;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header h2 {
    color: #333;
    font-size: 1.8em;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
}

.input-with-icon input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.input-with-icon input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
}

/* 管理后台样式 */
.admin-container {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
}

.admin-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-title h1 {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.8em;
}

.admin-info {
    font-size: 0.9em;
}

.admin-info a {
    color: white;
    margin: 0 10px;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.admin-info a:hover {
    opacity: 1;
}

.admin-content {
    padding: 30px;
}

.admin-controls {
    margin-bottom: 30px;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.9em;
}

/* 模态框样式 */
.form-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    color: #666;
    cursor: pointer;
    line-height: 1;
}

.modal-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.file-preview {
    margin-top: 10px;
    min-height: 60px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* 表格样式 */
.items-table {
    margin-top: 40px;
}

.items-table h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

tbody tr:hover {
    background: #f8f9fa;
}

.table-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.no-img {
    width: 60px;
    height: 60px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.status {
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
}

.status.active {
    background: #d4edda;
    color: #155724;
}

.status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.actions {
    display: flex;
    gap: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .main-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 20px;
    }

    .main-header h1 {
        font-size: 2em;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .detail-title {
        font-size: 2em;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .admin-title {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    .action-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .login-box {
        padding: 20px;
        margin: 10px;
    }
}

/* 添加上传区域样式 */
.upload-section {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
}

.section-header {
    margin-bottom: 15px;
}

.section-header h4 {
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.text-muted {
    color: #6c757d;
    font-size: 0.9em;
}

.current-files {
    margin-bottom: 20px;
}

.files-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.file-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.file-item img,
.file-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-item .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.file-item:hover .delete-btn {
    opacity: 1;
}

.upload-area {
    position: relative;
    border: 3px dashed #667eea;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(102, 126, 234, 0.05);
}

.upload-area:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #5a67d8;
}

.upload-area.dragover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #4c51bf;
}

.upload-placeholder {
    color: #667eea;
}

.upload-placeholder i {
    font-size: 3em;
    margin-bottom: 10px;
}

.upload-placeholder p {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 5px;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.uploaded-files {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.upload-preview {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.upload-preview img,
.upload-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-preview .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px;
    font-size: 0.8em;
    text-align: center;
}

.text-center {
    text-align: center;
}