/* ===== 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Open Sans", sans-serif;
    min-height: 100vh;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.6)),
        url("https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=80");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: white;
}

/* ===== 导航栏 ===== */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 40, 20, 0.3);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(163, 201, 98, 0.3);
    z-index: 1000;
}

.nav-logo h1 a {
    color: #d4c5a2;
    font-size: 24px;
    font-family: 'Ma Shan Zheng', cursive;
    text-decoration: none;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* ===== 返回首页按钮 ===== */
.back-home {
    position: fixed;
    top: 100px;
    left: 20px;
    z-index: 100;
}

.back-home a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: rgba(44, 62, 44, 0.8);
    backdrop-filter: blur(5px);
    border: 1px solid #a3c962;
    border-radius: 30px;
    color: #e8e0c0;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    font-size: 14px;
}

.back-home a:hover {
    background: #a3c962;
    color: #1a2f1a;
    transform: scale(1.05);
}

/* ===== 管理员按钮区域 ===== */
.admin-actions {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(30, 40, 20, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid #a3c962;
    border-radius: 30px;
    color: #e8e0c0;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 140px;
}

.admin-btn:hover {
    background: #a3c962;
    color: #1a2f1a;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(163, 201, 98, 0.5);
}

/* ===== 主要内容区域 ===== */
.main-content {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 100px 20px 80px;
}

.project-container {
    max-width: 1200px;
    width: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px 20px;
    border: 1px solid rgba(163, 201, 98, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: 36px;
    color: #d4c5a2;
    font-family: 'Ma Shan Zheng', cursive;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.description {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 30px;
    line-height: 1.8;
    color: #e8e0c0;
}

/* ===== 搜索栏 ===== */
.search-section {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 620px;
    flex-wrap: wrap;
}

.search-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 12px 22px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid #a3c962;
    border-radius: 30px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.search-form input[type="text"]::placeholder {
    color: #999;
}

.search-form input[type="text"]:focus {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(163, 201, 98, 0.4);
}

.search-form button {
    padding: 12px 26px;
    background: #a3c962;
    color: #1a2f1a;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-form button:hover {
    background: #ffd700;
    transform: scale(1.05);
}

.clear-search {
    color: #a3c962;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border: 1px solid #a3c962;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.clear-search:hover {
    background: #a3c962;
    color: #1a2f1a;
}

.result-info {
    text-align: center;
    color: #a3c962;
    font-size: 14px;
    margin-bottom: 20px;
}

/* ===== 作品列表 ===== */
.project-list {
    margin-top: 10px;
}

.project-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #a3c962;
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.project-item:hover {
    transform: translateX(8px);
    background: rgba(163, 201, 98, 0.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

/* 视频展示区 */
.video-wrapper {
    flex: 0 0 320px;
    width: 320px;
    max-width: 320px;
    aspect-ratio: 16 / 9;
    background: #000;
    border: 1px solid rgba(163, 201, 98, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.video-wrapper video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    outline: none;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

/* 作品信息区 */
.project-info {
    flex: 1;
    min-width: 0;
}

.project-name {
    font-size: 20px;
    font-weight: bold;
    color: #d4c5a2;
    margin-bottom: 8px;
    word-break: break-word;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: #999;
    font-size: 12px;
    margin-bottom: 12px;
}

.project-remark {
    color: #e8e0c0;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 14px;
}

.project-remark.is-empty {
    display: none;
}

.project-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.action-btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-family: inherit;
    text-decoration: none;
}

/* 下载按钮 - 透明背景 */
.download-btn {
    background: transparent;
    border: 1px solid #a3c962;
    color: #a3c962;
}

.download-btn:hover {
    background: #a3c962;
    color: #1a2f1a;
}

/* 修改备注按钮 */
.remark-btn {
    background: transparent;
    border: 1px solid #a3c962;
    color: #a3c962;
}

.remark-btn:hover {
    background: #a3c962;
    color: #1a2f1a;
}

.no-doc {
    color: #999;
    font-size: 13px;
    line-height: 32px;
}

/* ===== 弹窗 ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2a3a2a;
    padding: 30px;
    border-radius: 20px;
    border: 2px solid #a3c962;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    color: #a3c962;
    font-size: 22px;
    text-align: left;
}

.modal-close {
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #a3c962;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #ffd700;
    transform: scale(1.1);
}

.modal-body {
    color: #e8e0c0;
}

.remark-input {
    width: 100%;
    min-height: 160px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #a3c962;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.7;
    outline: none;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.remark-input:focus {
    border-color: #ffd700;
}

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

.cancel-btn {
    background: transparent;
    border: 1px solid #a3c962;
    color: #a3c962;
}

.cancel-btn:hover {
    background: #a3c962;
    color: #1a2f1a;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    line-height: 2;
}

.empty-link {
    color: #a3c962;
    text-decoration: none;
}

.empty-link:hover {
    text-decoration: underline;
}

/* ===== 上传 / 编辑管理页 ===== */
.admin-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 40px;
    background: rgba(30, 40, 20, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(163, 201, 98, 0.3);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.admin-container h1 {
    text-align: left;
    font-size: 30px;
    margin-bottom: 25px;
}

.admin-nav {
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.admin-nav a {
    color: #e8e0c0;
    text-decoration: none;
    padding: 6px 16px;
    border: 1px solid #a3c962;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.admin-nav a:hover {
    background: #a3c962;
    color: #1a2f1a;
}

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

.form-group label {
    display: block;
    color: #a3c962;
    margin-bottom: 8px;
    font-size: 15px;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #a3c962;
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    border-color: #ffd700;
}

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

.form-group input[type="file"] {
    color: #e8e0c0;
    font-size: 14px;
}

.hint {
    color: #999;
    font-size: 13px;
    margin-top: 6px;
    line-height: 1.6;
}

.btn-primary {
    background: #a3c962;
    color: #1a2f1a;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    font-family: inherit;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #ffd700;
    transform: scale(1.05);
}

.message {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 14px;
}

.message.error {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
}

.message.success {
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid #a3c962;
    color: #a3c962;
}

.project-table {
    margin-top: 40px;
    width: 100%;
    border-collapse: collapse;
}

.project-table th {
    text-align: left;
    padding: 10px;
    color: #a3c962;
    border-bottom: 1px solid #a3c962;
    white-space: nowrap;
}

.project-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(163, 201, 98, 0.3);
    font-size: 14px;
    vertical-align: top;
}

.project-table tr:hover {
    background: rgba(163, 201, 98, 0.1);
}

.edit-link {
    color: #a3c962;
    text-decoration: none;
    margin-right: 10px;
}

.delete-link {
    color: #ff6b6b;
    text-decoration: none;
}

.edit-link:hover,
.delete-link:hover {
    text-decoration: underline;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    #navbar {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
    }

    .admin-actions {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        margin: 10px 0;
    }

    .back-home {
        position: static;
        margin: 10px;
        text-align: center;
    }

    .main-content {
        width: 100%;
        padding: 20px 15px 60px;
        margin-top: 60px;
    }

    .project-container {
        padding: 20px 15px;
        width: 100%;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form input[type="text"] {
        width: 100%;
    }

    .search-form button {
        width: 100%;
    }

    .project-item {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }

    .video-wrapper {
        flex-basis: auto;
        width: 100%;
        max-width: 100%;
    }

    .project-actions .action-btn {
        width: 100%;
        text-align: center;
    }

    .admin-container {
        margin: 20px 15px;
        padding: 20px 15px;
    }

    .project-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 24px;
    }

    .project-name {
        font-size: 17px;
    }

    .admin-btn {
        width: 100%;
    }
}
