/*
1. 全局重置
2. 顶部栏
3. 标题
4. 药丸组件
5. 密码框
6. 小编寄语
7. 图库
8. Footer
9. Toast
10. 加载更多
11. Lightbox
12. Lightbox 信息区
13. 弹窗（共用样式）
14. 统一元数据表单
15. About 页面
16. 响应式
*/


/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
body {
    background: #f5f7fa;
    color: #1e2a3a;
}
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 10px;
}

/* ===== 顶部栏 ===== */
.top-bar {
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.03);
    padding: 12px 0 2px 0;
    border-bottom: 1px solid #eaedf2;
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(4px);
    background: rgba(255,255,255,0.92);
}
.top-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}
.top-bar-inner .row-1,
.top-bar-inner .row-2 {
    display: flex;
    align-items: center;
    gap: 12px 18px;
    flex: 0 1 auto;
}
.top-bar-inner .row-category {
margin: 0 auto;   /*添加这一行，让 rorow-category/居中*/
}
.top-bar-inner .row-2 {
margin-left: auto;  /*添加这一行，让 row-2 靠右 */
}
/* ===== 标题 ===== */
.site-title .subname{
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== 药丸式组件 ===== */
.pill {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 40px;
    padding: 0;
    flex-shrink: 0;
    overflow: hidden;
    gap: 0;
    height: 32px;
    align-items: center;
}
.pill .pill-item {
    padding: 0 4px;
    border: none;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    cursor: default;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 100%;
    transition: 0.15s;
    min-width: 44px;
}
.pill .pill-item i {
    font-size: 0.8rem;
}

.pill-btn .pill-item {
    cursor: pointer;
}
.pill-btn .pill-item:hover:not(.active) {
    color: #1e293b;
    background: rgba(0,0,0,0.04);
}
.pill-btn .pill-item.active {
    background: #f3e1d5;
}

.pill-stats .pill-item {
    cursor: default;
}
.pill-stats .pill-item:first-child {
    background: #f3e1d5;
    color: #1e293b;
}
.pill-stats .pill-item:last-child {
    color: #94a3b8;
}

.pill .pill-item:first-child {
    border-radius: 0;
}
.pill .pill-item:last-child {
    border-radius: 0;
}

/* ===== 分类药丸 ===== */
#categoryGroup .pill-item {
    font-size: 0.75rem;
    padding: 0 14px;
}
#categoryGroup .pill-item i {
    font-size: 0.75rem;
}

/* ===== 密码框 ===== */
.pwd-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 1 auto;
    min-width: 90px;
}
.pwd-wrap input {
    padding: 6px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.85rem;
    background: #fafcff;
    transition: 0.15s;
    min-width: 80px;
    height: 32px;
    width: 90px;
}
.pwd-wrap input:focus {
    outline: none;
    border-color: #2563eb;
}
.pwd-wrap input::placeholder {
    color: #94a3b8;
    font-size: 0.75rem;
}
.hidden-input {
    display: none;
}

/* ===== 小编寄语 ===== */
.site-desc {
    width: 100%;
    margin: 10px auto;
    background-color: #f3e1d5;
    padding: 8px 10px;
    border-radius: 40px;
    font-size: 0.8rem;
}

/* ===== 图库 ===== */
.gallery-container {
    margin-top: 16px;
}
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
}
.masonry-grid.masonry-view {
    display: block;
    column-count: 5;
    column-gap: 18px;
}
.masonry-grid.masonry-view .image-card {
    break-inside: avoid;
    margin-bottom: 18px;
}

.image-card {
    background: white;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.03);
    border: 1px solid #eef2f6;
    transition: 0.2s;
    cursor: pointer;
    min-height: auto;
}
.image-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.06);
}
.image-card img,
.image-card video {
    width: 100%;
    display: block;
    background: #f1f5f9;
    pointer-events: none;
}

.masonry-grid:not(.masonry-view) .image-card img,
.masonry-grid:not(.masonry-view) .image-card video {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
.masonry-grid.masonry-view .image-card img,
.masonry-grid.masonry-view .image-card video {
    aspect-ratio: auto;
    height: auto;
}

.image-card .card-footer {
    padding: 10px 14px 14px;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.image-card .file-meta {
    font-size: 0.75rem;
    color: #94a3b8;
}
.image-card .filename {
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #0f172a;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}
.empty-state i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 12px;
}

/* ===== Footer ===== */
.footer {
    background: #fff9f5;
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid #eaedf2;
    text-align: center;
}
.footer p {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #0b1b2f;
    color: white;
    padding: 12px 28px;
    border-radius: 60px;
    font-weight: 500;
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}
.toast.show {
    opacity: 1;
}

/* ===== 加载更多 ===== */
.load-more {
    text-align: center;
    padding: 30px 0 10px;
    color: #94a3b8;
}
.load-more button {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 10px 30px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #1e293b;
    transition: 0.15s;
}
.load-more button:hover {
    background: #f1f5f9;
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.lightbox.active {
    display: flex;
    opacity: 1;
}
.lightbox .close-btn {
    position: absolute;
    top: 24px;
    right: 32px;
    color: #fff;
    font-size: 2.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.2s;
    z-index: 1002;
    background: none;
    border: none;
}
.lightbox .close-btn:hover {
    opacity: 1;
    transform: rotate(90deg);
}
.lightbox .nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 2.8rem;
    cursor: pointer;
    opacity: 0.5;
    transition: 0.2s;
    z-index: 1001;
    background: none;
    border: none;
    padding: 20px 16px;
    user-select: none;
}
.lightbox .nav-btn:hover {
    opacity: 1;
}
.lightbox .nav-btn.prev {
    left: 16px;
}
.lightbox .nav-btn.next {
    right: 16px;
}
.lightbox .lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    background: rgba(0,0,0,0.4);
    padding: 6px 18px;
    border-radius: 30px;
    z-index: 1001;
    user-select: none;
}

/* ===== Lightbox 内容容器（图片+底栏无缝） ===== */
.lightbox-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 92vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* ===== 媒体区域（图片/视频） ===== */
.lightbox-media-wrapper {
    position: relative;
    width: 100%;
    height: auto;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox .lightbox-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 0;
}

/* ===== Lightbox 信息区（底栏） ===== */
.lightbox-info {
    width: 100%;
    flex-shrink: 0;
    height: 44px;
    padding: 0 16px;
    background: rgba(128, 128, 128, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    border-radius: 0;
    color: #e2e8f0;
    font-size: 0.85rem;
    line-height: 1;
    transition: 0.3s;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.info-desc {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    min-height: 20px;
}
.info-desc:empty::before {
    content: '暂无描述';
    color: rgba(255,255,255,0.4);
    font-style: italic;
}

.info-btn {
    flex-shrink: 0;
    padding: 2px 14px;
    height: 28px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 30px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.6);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}
.info-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.info-btn.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* ===== 详情面板 ===== */
.info-panel {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.info-field {
    margin-bottom: 8px;
}
.info-field label {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(255,255,255,0.5);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.info-field-value {
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(255,255,255,0.9);
    word-break: break-word;
    padding: 2px 0;
}
.info-field-value:empty::before {
    content: '未填写';
    color: rgba(255,255,255,0.3);
    font-style: italic;
}

.info-field-edit {
    display: none;
    width: 100%;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: #e2e8f0;
    font-size: 0.85rem;
    font-family: inherit;
    transition: 0.2s;
    box-sizing: border-box;
}
.info-field-edit:focus {
    outline: none;
    border-color: #60a5fa;
    background: rgba(255,255,255,0.08);
}
.info-field-edit.show {
    display: block;
}
.info-field-value.hidden {
    display: none;
}

#panelMeta .info-field-value {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
}

.info-panel-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.info-panel-actions button {
    padding: 5px 18px;
    border: none;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}
.info-panel-actions .btn-save {
    background: #2563eb;
    color: white;
}
.info-panel-actions .btn-save:hover {
    background: #1d4ed8;
}
.info-panel-actions .btn-cancel {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
}
.info-panel-actions .btn-cancel:hover {
    background: rgba(255,255,255,0.15);
}

/* 滚动条 */
.lightbox-info::-webkit-scrollbar {
    width: 3px;
}
.lightbox-info::-webkit-scrollbar-track {
    background: transparent;
}
.lightbox-info::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
}

/* ===== 弹窗 ===== */
.custom-prompt,
.meta-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}
.custom-prompt.active,
.meta-modal.active {
    display: flex;
}
.custom-prompt-overlay,
.meta-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}
.custom-prompt-box,
.meta-modal-box {
    position: relative;
    background: white;
    padding: 30px 28px 24px;
    border-radius: 20px;
    max-width: 480px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 1;
}
.custom-prompt-box h3,
.meta-modal-box h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1e293b;
}
.custom-prompt-box h3 i,
.meta-modal-box h3 i {
    color: #2563eb;
}

.custom-prompt-box input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: 0.15s;
    outline: none;
}
.custom-prompt-box input:focus {
    border-color: #2563eb;
}

.custom-prompt-buttons,
.meta-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}
.custom-prompt-buttons button,
.meta-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
    font-size: 0.95rem;
}
.custom-prompt-buttons .btn-cancel,
.meta-actions .btn-cancel {
    background: #f1f5f9;
    color: #475569;
}
.custom-prompt-buttons .btn-cancel:hover,
.meta-actions .btn-cancel:hover {
    background: #e2e8f0;
}
.custom-prompt-buttons .btn-confirm,
.meta-actions .btn-confirm {
    background: #2563eb;
    color: white;
}
.custom-prompt-buttons .btn-confirm:hover,
.meta-actions .btn-confirm:hover {
    background: #1d4ed8;
}

/* ===== 统一元数据表单字段 ===== */
.meta-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 12px 0 18px;
}
.meta-field label {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    display: block;
    margin-bottom: 4px;
}
.meta-field input,
.meta-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: 0.15s;
    box-sizing: border-box;
}
.meta-field input:focus,
.meta-field textarea:focus {
    outline: none;
    border-color: #2563eb;
}
.meta-field textarea {
    resize: vertical;
    min-height: 100px;
}
.meta-field input:disabled,
.meta-field textarea:disabled {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

/* ===== About 页面 ===== */
.about-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}
.about-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.about-card {
    background: white;
    border-radius: 18px;
    padding: 24px 28px;
    border: 1px solid #eef2f6;
    box-shadow: 0 4px 16px rgba(0,0,0,0.03);
}
.about-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1e293b;
}
.about-card p {
    color: #475569;
    line-height: 1.8;
    font-size: 0.95rem;
}
.about-card p a {
    color: #2563eb;
    text-decoration: none;
}
.about-card p a:hover {
    text-decoration: underline;
}
.about-list {
    color: #475569;
    line-height: 1.8;
    padding: 0;
    list-style: none;
    font-size: 0.95rem;
}

.museum-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}
.museum-pill {
    display: inline-block;
    padding: 6px 16px;
    background: #f1f5f9;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    transition: 0.15s;
    white-space: nowrap;
}
.museum-pill:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateY(-1px);
}

/* ===== 响应式 ===== */
@media (max-width: 820px) {
    .top-bar-inner {
        flex-wrap: wrap;
    }
    .top-bar-inner .row-1,
    .top-bar-inner .row-2 {
        flex: 1 1 100%;
        flex-wrap: wrap;
    }
    .masonry-grid.masonry-view {
        column-count: 2;
    }
    .masonry-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Lightbox 响应式 */
    .lightbox-content-wrapper {
        max-width: 96vw;
        max-height: 80vh;
        border-radius: 12px;
    }
    .lightbox .lightbox-image {
        max-height: 70vh;
    }
    .lightbox .nav-btn {
        font-size: 2rem;
        padding: 12px 10px;
    }
    .lightbox .close-btn {
        top: 16px;
        right: 20px;
        font-size: 1.8rem;
    }
    .lightbox-info {
        height: 40px;
        padding: 0 14px;
        font-size: 0.8rem;
    }
    .info-desc {
        font-size: 0.8rem;
    }
    .info-btn {
        font-size: 0.65rem;
        padding: 2px 12px;
        height: 24px;
    }
}

@media (max-width: 600px) {
    .top-bar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    .top-bar-inner .row-1 {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 2px;
        flex-wrap: wrap;
        flex-direction: row;
    }
    .top-bar-inner .row-1 .site-title {
        font-size: 0.8rem;
    }
    .top-bar-inner .row-1 .site-title .subname {
        font-size: 0.8rem;
    }
    .top-bar-inner .row-1 .pill-stats {
        flex-shrink: 0;
        height: 28px;
    }
    .top-bar-inner .row-1 .pill-stats .pill-item {
        font-size: 0.7rem;
        padding: 0 10px;
        min-width: 28px;
    }
    .top-bar-inner .row-1 #viewGroup {
        flex-shrink: 0;
        height: 28px;
    }
    .top-bar-inner .row-1 #viewGroup .pill-item {
        font-size: 0.65rem;
        padding: 0 8px;
        min-width: 32px;
    }

    .top-bar-inner .row-category {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    .top-bar-inner .row-category #categoryGroup {
        width: 100%;
        justify-content: space-around;
        height: 28px;
        flex-wrap: wrap;
        border-radius: 40px;
        overflow: hidden;
    }
    .top-bar-inner .row-category #categoryGroup .pill-item {
        font-size: 0.65rem;
        padding: 0 10px;
        min-width: 40px;
        flex-shrink: 0;
    }
    .top-bar-inner .row-2 {
        display: flex;
        align-items: center;
        gap: 6px 10px;
        width: 100%;
        flex-wrap: wrap;
        flex-direction: row;
    }
    .top-bar-inner .row-2 .pwd-wrap {
        flex: 1;
        min-width: 80px;
    }
    .top-bar-inner .row-2 .pwd-wrap input {
        width: 100%;
        min-width: 60px;
        font-size: 0.75rem;
        padding: 4px 10px;
        height: 28px;
    }
    .top-bar-inner .row-2 #uploadGroup {
        height: 28px;
        flex-shrink: 0;
    }
    .top-bar-inner .row-2 #uploadGroup .pill-item,
    .top-bar-inner .row-2 #showAboutbtn .pill-item {
        font-size: 0.65rem;
        padding: 0 10px;
        min-width: 40px;
    }
    
    .masonry-grid.masonry-view {
        column-count: 2;
        column-gap: 10px;
    }
    .masonry-grid.masonry-view .image-card {
        margin-bottom: 10px;
    }

    /* Lightbox 小屏响应式 */
    .lightbox-content-wrapper {
        max-width: 98vw;
        max-height: 85vh;
        border-radius: 10px;
    }
    .lightbox .lightbox-image {
        max-height: 65vh;
    }
    .lightbox .nav-btn {
        font-size: 1.4rem;
        padding: 6px 8px;
    }
    .lightbox .nav-btn.prev {
        left: 2px;
    }
    .lightbox .nav-btn.next {
        right: 2px;
    }
    .lightbox .close-btn {
        top: 12px;
        right: 14px;
        font-size: 1.6rem;
    }
    .lightbox-info {
        height: 36px;
        padding: 0 12px;
        font-size: 0.75rem;
    }
    .info-desc {
        font-size: 0.75rem;
    }
    .info-btn {
        font-size: 0.6rem;
        padding: 2px 10px;
        height: 22px;
    }

    .site-desc { /* 小编寄语 小屏响应式 */
        font-size: 0.8rem;
    }

    .about-card {
        padding: 18px 16px;
    }
    .about-card h3 {
        font-size: 1rem;
    }
    .museum-pill {
        font-size: 0.7rem;
        padding: 4px 12px;
    }
    .museum-pills {
        gap: 6px;
    }
}