/* Album Modal Styles - External CSS file */

/* 弹窗遮罩 */
.album-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
.album-modal-overlay.open { display: flex !important; }

/* 弹窗主体 */
.album-modal-box {
    display: flex;
    width: 95%;
    max-width: 1180px;
    height: 90vh;
    max-height: 800px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

/* 关闭按钮 - 修复：改成深色，在白色背景上可见 */
.am-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 10002;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0,0,0,0.06);
    border: none;
    color: #666;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.am-close-btn:hover { background: rgba(0,0,0,0.12); color: #333; }

/* 左侧图片区 */
.am-left {
    flex: 1.3;
    min-width: 0;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    position: relative; /* 箭头定位参考 */
}
.am-img-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: default;
}
/* 隐藏滚动条但保留滚动功能 */
.am-img-wrap::-webkit-scrollbar { display: none; }
.am-img-wrap { -ms-overflow-style: none; scrollbar-width: none; }
.am-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.2s;
}
.am-img-wrap img.zoomed {
    max-width: none !important;
    max-height: none !important;
    cursor: grab;
}
.am-img-wrap img.zoomed:active { cursor: grabbing; }

/* 箭头 - 固定在左侧容器，不随图片滚动 */
.am-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20; /* 高于图片区 */
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}
.am-arrow:hover { background: rgba(0,0,0,0.75); transform: translateY(-50%) scale(1.08); }
.am-prev { left: 10px; }
.am-next { right: 10px; }

/* 工具栏 */
.am-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 7px 14px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 12px;
    flex-shrink: 0;
}
.am-toolbar button {
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}
.am-toolbar button:hover { background: rgba(255,255,255,0.28); }

/* 缩略图条 */
.am-thumbs {
    display: flex;
    gap: 5px;
    padding: 7px 10px;
    background: rgba(0,0,0,0.45);
    overflow-x: auto;
    justify-content: center;
    flex-shrink: 0;
}
.am-thumbs .thumb {
    width: 48px;
    height: 48px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    opacity: 0.55;
    transition: all 0.2s;
    object-fit: cover;
}
.am-thumbs .thumb.active { border-color: #ff2442; opacity: 1; }
.am-thumbs .thumb:hover { opacity: 1; }

/* 右侧信息 */
.am-right {
    width: 380px;
    min-width: 340px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-left: 1px solid #f0f0f0;
    overflow: hidden;
}

/* 作者 */
.am-author {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #f5f5f5;
    flex-shrink: 0;
}
.am-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg,#f5f0ec,#e8e0d8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #913500;
    font-weight: 600;
    flex-shrink: 0;
}
.am-author-name { font-size: 14px; font-weight: 600; color: #222; }

/* 内容 - 修复：确保标题和描述显示 */
.am-body {
    padding: 14px 16px;
    overflow-y: auto;
    flex: 0 0 auto;
    min-height: 60px;
    max-height: 30vh;
}
.am-body h2 { font-size: 16px; font-weight: 700; color: #111; margin-bottom: 8px; line-height: 1.5; word-break: break-word; }
.am-desc { font-size: 13px; color: #555; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

/* 互动按钮（无边框） */
.am-actions {
    display: flex;
    gap: 10px;
    padding: 10px 16px;
    border-top: 1px solid #f5f5f5;
    flex-shrink: 0;
}
.am-actions button {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    transition: background 0.2s;
}
.am-actions button:hover { background: #faf8f5; }
.am-actions button.liked { color: #e53935; }
.am-actions button.collected { color: #ff9800; }

/* 评论区 */
.am-comments {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 16px;
    border-top: 1px solid #f5f5f5;
    min-height: 100px;
}
.am-comment-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    padding: 12px 0 8px;
}
.am-comment-input {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 12px;
}
.am-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #913500;
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.am-comment-input textarea {
    flex: 1;
    border: 1px solid #e0d8cc;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    resize: vertical;
    min-height: 40px;
    font-family: inherit;
}
.am-comment-input button {
    background: #913500;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
}
.am-login-tip { font-size: 12px; color: #999; padding: 10px 0; }
.am-login-tip a { color: #913500; }

/* 灯箱 */
.am-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.96);
    z-index: 10005;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.am-lightbox.active { display: flex !important; }
.am-lb-img-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
}
.am-lb-img-wrap:active { cursor: grabbing; }
.am-lb-img-wrap img { max-width: 94vw; max-height: 86vh; display: block; }
.am-lb-close {
    position: absolute;
    top: 14px;
    right: 22px;
    z-index: 10007;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 6px;
    line-height: 1;
}
.am-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10007;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
}
.am-lb-nav:hover { background: rgba(255,255,255,0.25); }
.am-lb-prev { left: 18px; }
.am-lb-next { right: 18px; }
.am-lb-counter {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 13px;
    background: rgba(0,0,0,0.5);
    padding: 4px 14px;
    border-radius: 20px;
}
.am-lb-toolbar {
    display: flex;
    gap: 14px;
    padding: 10px;
    color: #fff;
    flex-shrink: 0;
}
.am-lb-toolbar button {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 12px;
    padding: 5px 14px;
    border-radius: 4px;
    cursor: pointer;
}

/* 响应式 */
@media (max-width: 720px) {
    .album-modal-box { flex-direction: column; height: 100vh; max-height: 100vh; border-radius: 0; }
    .am-right { width: 100%; min-width: auto; max-height: 45vh; border-left: none; border-top: 1px solid #f0f0f0; }
    .am-left { flex: 1; min-height: 40vh; }
}
