/* Album Modal Styles - External CSS file */

/* Detail page - remove main-content side padding */
.main-content { padding: 0 !important; }

/* 弹窗遮罩 */
.album-modal-overlay {
    display: none !important;
    position: fixed !important;
    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: 92%;
    max-width: 1200px;
    height: 88vh;
    max-height: 820px;
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

/* 关闭按钮 */
.am-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10002;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-soft);
    border: none;
    color: var(--ink);
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.am-close-btn:hover { background: var(--bg-deeper); }

/* 左侧图片区 */
.am-left {
    flex: 1.3;
    min-width: 0;
    background: var(--bg-deeper);
    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 .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,.5);
    border: none;
    color: var(--bg);
    font-size: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, transform .2s;
}
.am-arrow:hover { background: rgba(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: 12px;
    padding: 6px 14px;
    background: rgba(0,0,0,.55);
    color: var(--bg);
    font-size: 12px;
    flex-shrink: 0;
}
.am-toolbar button {
    background: rgba(255,255,255,.12);
    border: none;
    color: var(--bg);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background .2s;
}
.am-toolbar button:hover { background: rgba(255,255,255,.28); }

/* 缩略图条 */
.am-thumbs {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(0,0,0,.55);
    overflow-x: auto;
    justify-content: center;
    flex-shrink: 0;
}
.am-thumbs .thumb {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    opacity: .55;
    transition: all .2s;
    object-fit: cover;
}
.am-thumbs .thumb.active { border-color: var(--gold); opacity: 1; }
.am-thumbs .thumb:hover { opacity: 1; }

/* Tab 面板（Info / Anno / Related） */
.am-tabbar {
    display: flex;
    border-bottom: 1px solid var(--line);
    background: var(--bg-soft);
    flex-shrink: 0;
}
.am-tab {
    flex: 1;
    padding: 14px 0;
    border: 0;
    background: transparent;
    color: var(--faint);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--serif);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all .2s;
}
.am-tab:hover { color: var(--ink); }
.am-tab.active {
    color: var(--ink);
    border-bottom-color: var(--gold);
    background: var(--bg);
}
.am-tabpane { display: none; padding: 16px 18px; overflow-y: auto; flex: 1; }
.am-tabpane.active { display: block; }

/* Info Pane */
.am-info-title {
    font-size: 18px;
    font-weight: 600;
    font-family: var(--serif);
    color: var(--ink);
    margin-bottom: 14px;
    line-height: 1.4;
}
.am-info-meta {
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 14px;
}
.am-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--line);
}
.am-info-row:last-child { border-bottom: 0; }
.am-info-label { color: var(--faint); }
.am-info-value { color: var(--ink); font-weight: 500; }
.am-info-counter { background: var(--bg); border-radius: 4px; padding: 6px 10px; margin: -2px -4px; }

/* Anno Pane */
.am-anno-list { margin-bottom: 12px; }
.am-anno-item {
    padding: 10px 12px;
    background: var(--bg-soft);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--ink);
    border-left: 3px solid var(--gold);
}
.am-anno-item .am-anno-meta { font-size: 11px; color: var(--faint); margin-top: 4px; }
.am-anno-empty, .am-related-empty {
    color: var(--faint);
    font-size: 13px;
    text-align: center;
    padding: 24px 0;
}
.am-anno-input textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    background: var(--bg);
    color: var(--ink);
    box-sizing: border-box;
}
.am-anno-input textarea:focus { border-color: var(--gold); outline: none; }
.am-anno-input button {
    margin-top: 6px;
    background: var(--gold);
    color: var(--bg);
    border: 0;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
}

/* Related Pane */
.am-related-title {
    font-size: 14px;
    font-weight: 600;
    font-family: var(--serif);
    color: var(--ink);
    margin: 0 0 10px;
}
.am-related-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 14px;
    padding-bottom: 0;
    border-bottom: 1px solid var(--line);
}
.am-rpill {
    padding: 6px 10px;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.am-rpill:hover {
    color: var(--gold);
}
.am-rpill.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}
.am-related-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: var(--ink);
}
.am-related-item:last-child { border-bottom: 0; }
.am-related-item:hover { background: var(--bg-soft); }
.am-related-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--bg-soft);
    color: var(--muted);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--serif);
}
.am-related-icon svg { width: 16px; height: 16px; }
.am-related-icon.type-encyclopedia { background: var(--gold-soft); color: var(--gold); }
.am-related-icon.type-album        { background: #fce7f3; color: #be185d; }
.am-related-icon.type-library      { background: #dbeafe; color: #1d4ed8; }
.am-related-icon.type-timeline     { background: #dcfce7; color: #15803d; }
.am-related-icon.type-kg           { background: #ede9fe; color: #6d28d9; }
[data-theme="dark"] .am-related-icon.type-album        { background: #4a1d2f; color: #f472b6; }
[data-theme="dark"] .am-related-icon.type-library      { background: #1e3a5f; color: #60a5fa; }
[data-theme="dark"] .am-related-icon.type-timeline     { background: #14532d; color: #86efac; }
[data-theme="dark"] .am-related-icon.type-kg           { background: #2e1e5e; color: #c4b5fd; }
.am-related-body { flex: 1; min-width: 0; }
.am-related-line1 {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 2px;
}
.am-related-name {
    font-size: 13px;
    color: var(--ink);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.am-related-author {
    font-size: 12px;
    color: var(--muted);
    flex-shrink: 0;
}
.am-related-line2 {
    font-size: 11px;
    color: var(--faint);
    display: flex;
    gap: 8px;
}

/* 右侧信息 */
.am-right {
    width: 380px;
    min-width: 340px;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border-left: 1px solid var(--line);
    overflow: hidden;
}

/* 作者 */
.am-author {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px 10px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}
.am-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--line);
}
.am-author-name { font-size: 14px; font-weight: 600; color: var(--ink); }

/* 内容 */
.am-body {
    padding: 14px 18px;
    overflow-y: auto;
    flex: 0 0 auto;
    min-height: 60px;
    max-height: 28vh;
}
.am-body h2 { font-size: 16px; font-weight: 700; font-family: var(--serif); color: var(--ink); margin-bottom: 8px; line-height: 1.5; }
.am-desc { font-size: 13px; color: var(--muted); line-height: 1.7; }

/* 互动按钮 */
.am-actions {
    display: flex;
    gap: 10px;
    padding: 10px 18px;
    border-top: 1px solid var(--line);
    flex-shrink: 0;
}
.am-actions button {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    transition: all .2s;
}
.am-actions button:hover { background: var(--bg-soft); border-color: var(--line-strong); }
.am-actions button.liked { color: var(--danger); }
.am-actions button.collected { color: var(--gold); }

/* 评论区 */
.am-comments {
    flex: 1;
    overflow-y: auto;
    padding: 0 18px 16px;
    border-top: 1px solid var(--line);
    min-height: 100px;
}
.am-comment-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    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%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--line);
}
.am-comment-input textarea {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    resize: vertical;
    min-height: 40px;
    font-family: inherit;
    background: var(--bg);
    color: var(--ink);
}
.am-comment-input textarea:focus { border-color: var(--gold); outline: none; }
.am-comment-input button {
    background: var(--gold);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s;
}
.am-comment-input button:hover { background: var(--gold-hover); }
.am-login-tip { font-size: 12px; color: var(--faint); padding: 10px 0; }
.am-login-tip a { color: var(--gold); }

/* ---------- 评论列表（与全站 comment-item 视觉一致） ---------- */
.am-comment-list { margin: 4px 0 12px; }
.am-comment-empty { font-size: 12px; color: var(--faint); padding: 8px 0; text-align: center; }
.am-comment-item { display: flex; gap: 8px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.am-comment-item:last-child { border-bottom: none; }
.am-ci-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--line); }
.am-ci-body { flex: 1; min-width: 0; }
.am-ci-name { font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.am-ci-content { font-size: 13px; color: var(--muted); line-height: 1.5; word-break: break-word; }
.am-ci-meta { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.am-ci-time { font-size: 11px; color: var(--faint); }
.am-ci-like { display: inline-flex; align-items: center; gap: 3px; background: none; border: none; padding: 0; cursor: pointer; color: var(--faint); font-size: 12px; transition: color .2s; }
.am-ci-like:hover { color: var(--danger); }
.am-ci-like.active { color: var(--danger); }
.am-ci-like svg { display: block; }
.am-ci-like-count { font-variant-numeric: tabular-nums; }

/* 灯箱（全屏） */
.am-lightbox {
    display: none !important;
    position: fixed !important;
    inset: 0;
    background: rgba(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: var(--bg);
    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,.1);
    border: none;
    color: var(--bg);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}
.am-lb-nav:hover { background: rgba(255,255,255,.25); }
.am-lb-prev { left: 18px; }
.am-lb-next { right: 18px; }
.am-lb-counter {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--bg);
    font-size: 13px;
    background: rgba(0,0,0,.5);
    padding: 4px 14px;
    border-radius: 20px;
}
.am-lb-toolbar {
    display: flex;
    gap: 14px;
    padding: 10px;
    color: var(--bg);
    flex-shrink: 0;
}
.am-lb-toolbar button {
    background: rgba(255,255,255,.1);
    border: none;
    color: var(--bg);
    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 var(--line); }
    .am-left { flex: 1; min-height: 40vh; }
}
