/* ============================================
   all-style.css - 仅新增样式，不覆盖现有主题
   王子殿下 & 晨曦的小屋
   ============================================ */

/* ---------- A类页面卡片样式（保留） ---------- */
.a-base-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.post-item {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    margin-bottom: 30px;
    padding: 24px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background-image: repeating-linear-gradient(45deg, rgba(200,190,170,0.03) 0px, rgba(200,190,170,0.03) 2px, transparent 2px, transparent 8px);
    border-radius: inherit;
}

.post-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #5a7a9a;
    border-radius: 4px 0 0 4px;
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.post-title {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.post-meta {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: flex;
    gap: 20px;
}

.post-content {
    line-height: 1.8;
    margin-bottom: 20px;
}

.post-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0;
}

.post-photos img {
    max-width: 200px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 12px;
}

.post-video video {
    max-width: 100%;
    border-radius: 12px;
}

.post-actions {
    display: flex;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    margin-top: 16px;
}

.post-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #666;
    transition: background 0.2s;
}

.post-actions button:hover {
    background: #f0f0f0;
}

/* 评论区域 */
.comments-area {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
}

.comments-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.comment-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.comment-item strong {
    color: #5a7a9a;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
    resize: vertical;
}

.comment-form button {
    background: #5a7a9a;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
}

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

/* ---------- 齿轮弹窗样式（保留，A类模板用） ---------- */
.gear-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}

.close {
    float: right;
    font-size: 28px;
    cursor: pointer;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.file-list, .file-preview, .cover-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.remove-photo, .remove-video, .remove-cover {
    cursor: pointer;
    color: #e74c3c;
    margin-left: 5px;
}

/* ---------- 分页（保留） ---------- */
.pagination {
    text-align: center;
    margin: 40px 0;
}

.pagination a, .pagination span {
    display: inline-block;
    margin: 0 4px;
    padding: 8px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #5a7a9a;
}

.pagination .current {
    background: #5a7a9a;
    color: #fff;
    border-color: #5a7a9a;
}

/* ---------- A类各栏目差异样式（保留） ---------- */
.page-diary .post-item::after { background: #b87c4f; }
.page-travel .post-item::after { background: #3b7b6e; }
.page-log .post-item::after { background: #8b7a9a; }
.page-event .post-item::after { background: #d4893a; }
.page-daily .post-item::after { background: #c4956a; }
.page-sport .post-item::after { background: #5b8c5a; }
.page-health .post-item::after { background: #7caa7a; }
.page-study .post-item::after { background: #4a6b7a; }
.page-dynamic .post-item::after { background: #c4956a; }

/* 动态双封面 */
.dynamic-covers {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}
.cover-item {
    flex: 1;
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
}

/* ---------- 全局侧边音乐按钮样式（新增） ---------- */
.sbMusic {
    position: fixed;
    right: 20px;
    bottom: 100px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #5a3e2e, #4a3224);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    color: #D4AF37;
    font-size: 24px;
}

.sbMusic:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

/* 音符旋转动画 */
.sbMusic.playing {
    animation: musicRotate 2s linear infinite;
}

@keyframes musicRotate {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.05) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* ---------- 齿轮管理面板（手机底部弹出样式） ---------- */
@media (max-width: 768px) {
    .gear-modal {
        align-items: flex-end;
    }
    .gear-modal .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 80vh;
        padding: 20px;
    }
}

/* ---------- B类相册样式（完整保留） ---------- */
.b-base-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

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

.album-header h1 {
    font-size: 2rem;
    color: #5a4a38;
}

.toggle-layout {
    margin-top: 12px;
    padding: 6px 16px;
    background: #c4956a;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

/* 全部照片 - 无限滚动 */
.album-all .scroll-wall-infinite {
    overflow: hidden;
    width: 100%;
}

.album-all .scroll-track {
    display: flex;
    animation: scrollLinear 30s linear infinite;
    width: fit-content;
}

.album-all .wall-item {
    flex: 0 0 280px;
    height: 280px;
    position: relative;
}

.album-all .wall-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes scrollLinear {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* 旅行足迹 - 拍立得 */
.album-travel .polaroid-wall {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}

.album-travel .polaroid-item {
    width: 220px;
    position: relative;
}

.album-travel .polaroid-inner {
    background: #fff;
    padding: 10px 10px 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s;
}

.album-travel .polaroid-inner:hover {
    transform: translateY(-5px);
}

.album-travel .polaroid-inner img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.album-travel .polaroid-caption {
    text-align: center;
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    font-family: Georgia;
}

/* 自然风光 - 杂志 */
.album-nature .magazine-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.album-nature .magazine-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
}

.album-nature .magazine-item.featured {
    grid-column: span 2;
    grid-row: span 2;
}

.album-nature .magazine-item.large {
    grid-column: span 2;
}

.album-nature .magazine-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.album-nature .magazine-item:hover img {
    transform: scale(1.03);
}

.album-nature .magazine-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s;
}

.album-nature .magazine-item:hover .magazine-overlay {
    opacity: 1;
}

.album-nature .magazine-overlay span {
    color: #fff;
}

/* 过往的岁月 - 45度堆叠 */
.album-memory .vintage-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 40px 0;
}

.album-memory .vintage-item {
    width: 200px;
    position: relative;
    transition: transform 0.3s, z-index 0.3s;
    cursor: pointer;
}

.album-memory .vintage-item:hover {
    transform: rotate(0deg) scale(1.05) !important;
    z-index: 100 !important;
}

.album-memory .vintage-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 2px solid #f0e6d0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.album-memory .vintage-date {
    text-align: center;
    margin-top: 8px;
    font-size: 12px;
    color: #8b7355;
}

/* 个人风采 - 3D木马 */
.album-personal .album-grid {
    perspective: 1200px;
    min-height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.album-personal .carousel-3d {
    width: 100%;
    height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.album-personal .carousel-container {
    position: relative;
    width: 300px;
    height: 300px;
    transform-style: preserve-3d;
    transition: transform 0.3s;
}

.album-personal .carousel-item {
    position: absolute;
    width: 260px;
    height: 260px;
    left: 20px;
    top: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.album-personal .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 我的创作 - 横向滚动 */
.album-create .creation-wall {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 20px 0;
}

.album-create .creation-item {
    flex: 0 0 auto;
    width: 260px;
    position: relative;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.3s;
}

.album-create .creation-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.album-create .creation-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.album-create .creation-info {
    padding: 12px;
    text-align: center;
}

.album-create .creation-title {
    font-size: 14px;
    color: #333;
}

/* 上传区域通用样式 */
.upload-area {
    text-align: center;
    margin-bottom: 30px;
}

.upload-toggle {
    padding: 10px 24px;
    background: #5a7a9a;
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
}

.upload-panel {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
}

.progress-bar {
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin: 15px 0;
    display: none;
}

.progress-fill {
    width: 0;
    height: 100%;
    background: #4caf50;
    transition: width 0.3s;
}

.progress-text {
    position: absolute;
    right: 12px;
    top: 0;
    font-size: 12px;
    line-height: 24px;
}

.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
}

.preview-thumb {
    width: 80px;
    text-align: center;
}

.preview-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

[class*="-item"]:hover .delete-btn {
    opacity: 1;
}

/* 平铺布局 */
.flat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.flat-item {
    position: relative;
    aspect-ratio: 1;
}

.flat-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------- 手机端响应式适配 ---------- */
@media (max-width: 768px) {
    /* A类卡片 */
    .a-base-container {
        padding: 15px;
    }
    .post-item {
        padding: 18px;
    }
    .post-title {
        font-size: 1.1rem;
    }
    .post-photos img {
        max-width: calc(50% - 6px);
    }
    .post-actions {
        flex-wrap: wrap;
    }
    .post-actions button {
        padding: 8px 14px;
        min-height: 40px;
    }
    /* A类齿轮弹窗 */
    .gear-modal {
        align-items: flex-end;
    }
    .gear-modal .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 80vh;
        padding: 20px;
    }
    .gear-modal .form-group input,
    .gear-modal .form-group textarea,
    .gear-modal .form-group select {
        padding: 12px;
        font-size: 16px;
    }
    .gear-modal button {
        min-height: 44px;
        padding: 10px 20px;
    }
    /* 音乐按钮 */
    .sbMusic {
        right: 15px;
        bottom: 80px;
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
    /* 动态双封面 */
    .dynamic-covers {
        flex-direction: column;
    }
    .cover-item {
        height: 150px;
    }
    /* B类相册 */
    .album-all .wall-item {
        flex: 0 0 200px;
        height: 200px;
    }
    .album-travel .polaroid-item {
        width: 160px;
    }
    .album-travel .polaroid-wall {
        gap: 20px;
    }
    .album-memory .vintage-item {
        width: 140px;
    }
    .album-create .creation-item {
        width: 200px;
    }
    .album-nature .magazine-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .album-personal .carousel-item {
        width: 180px;
        height: 180px;
        left: 10px;
        top: 10px;
    }
    .album-personal .carousel-container {
        width: 200px;
        height: 200px;
    }
    .album-personal .carousel-3d {
        height: 300px;
    }
    /* 防止横向滚动 */
    body {
        overflow-x: hidden;
    }
    .b-base-container,
    .a-base-container {
        overflow-x: hidden;
    }
    .scroll-wall-infinite,
    .creation-wall {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* 触屏交互优化（移除hover依赖） */
@media (max-width: 768px) {
    .album-memory .vintage-item {
        transition: transform 0.2s;
    }
    .album-memory .vintage-item:active {
        transform: rotate(0deg) scale(1.02) !important;
        z-index: 100;
    }
    .album-travel .polaroid-inner:active {
        transform: translateY(-3px);
    }
    .album-nature .magazine-item:active img {
        transform: scale(1.02);
    }
    .delete-btn {
        opacity: 1;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}
