/* =============================================
   Assets 主内容区 — 时间线网格 + 滚动条 + 缩放
   像素级复刻 reference timeline-view.html
   ============================================= */

/* ── 外层容器 ── */
#assets-content {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    margin-right: 0;
    transition: margin-left 300ms ease, margin-right 150ms ease-out;
}

body.assets-view #assets-content {
    display: flex;
    margin-right: var(--sidebar-right-width);
}
body.assets-view.right-collapsed #assets-content {
    margin-right: 40px;
}
@media (max-width: 1023px) {
    body.assets-view #assets-content,
    body.assets-view.right-collapsed #assets-content {
        margin-right: 0;
    }
}

/* ── 主容器 ── */
.ac-main {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--background);
}

/* ── 顶部渐变遮罩 ── */
.ac-top-fade {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 10;
    height: 48px;
    background-color: var(--background);
    mask-image: linear-gradient(
        oklab(0% 0 0) 0%,
        oklab(0% 0 0 / 0.738) 19%,
        oklab(0% 0 0 / 0.541) 34%,
        oklab(0% 0 0 / 0.382) 47%,
        oklab(0% 0 0 / 0.278) 56.5%,
        oklab(0% 0 0 / 0.194) 65%,
        oklab(0% 0 0 / 0.126) 73%,
        oklab(0% 0 0 / 0.075) 80.2%,
        oklab(0% 0 0 / 0.042) 86.1%,
        oklab(0% 0 0 / 0.021) 91%,
        oklab(0% 0 0 / 0.008) 95.2%,
        oklab(0% 0 0 / 0.002) 98.2%,
        oklab(0% 0 0 / 0) 100%
    );
    -webkit-mask-image: linear-gradient(
        oklab(0% 0 0) 0%,
        oklab(0% 0 0 / 0.738) 19%,
        oklab(0% 0 0 / 0.541) 34%,
        oklab(0% 0 0 / 0.382) 47%,
        oklab(0% 0 0 / 0.278) 56.5%,
        oklab(0% 0 0 / 0.194) 65%,
        oklab(0% 0 0 / 0.126) 73%,
        oklab(0% 0 0 / 0.075) 80.2%,
        oklab(0% 0 0 / 0.042) 86.1%,
        oklab(0% 0 0 / 0.021) 91%,
        oklab(0% 0 0 / 0.008) 95.2%,
        oklab(0% 0 0 / 0.002) 98.2%,
        oklab(0% 0 0 / 0) 100%
    );
    pointer-events: none;
}

/* ── 滚动包装 ── */
.ac-scroll-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
    padding: 0 24px;
}
@media (min-width: 769px) {
    .ac-scroll-wrap { padding: 0 48px; }
}

/* ── 滚动区域（hide-scrollbar + overflow-y-scroll）── */
.ac-scroll-area {
    position: relative;
    z-index: 0;
    box-sizing: border-box;
    height: 100%;
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    overflow-y: scroll;
    overflow-x: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-user-select: none;
    user-select: none;
}
.ac-scroll-area::-webkit-scrollbar { display: none; }

/* 撑开滚动高度的占位块 */
.ac-scroll-spacer {
    position: absolute;
    width: 4px;
}

/* ── CSS Grid 布局 —— CSS 变量驱动，缩放实时生效 ── */
.ac-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols), 1fr);
    gap: 2px;
    width: 100%;
    padding-top: 60px;
    padding-right: 56px;
    --grid-cols: 10;
    transform: translateZ(0);         /* 提升为独立合成层，避免 top-fade mask 逐卡片重算 */
}

/* ═══════════════════════════════════════════
   日期标题（grid 跨列）
   ═══════════════════════════════════════════ */
.ac-date-header {
    grid-column: 1 / -1;
    z-index: 10;
    width: 100%;
    overflow: hidden;
    padding: 6px 2px;
    margin: 6px 0;
}
.ac-date-header-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    transform-origin: bottom left;
}
.ac-date-title {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.025em;
    white-space: nowrap;
    line-height: 1.3;
}
.ac-date-main { color: #ffffff; }
.ac-date-sub  { color: rgba(255,255,255,0.4); }

.ac-date-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    margin-top: 2px; padding: 4px;
    color: #3b82f6;
    background: transparent;
    border: none; border-radius: 6px;
    cursor: pointer;
    transition: background-color 150ms ease;
}
.ac-date-add-btn:hover { background-color: #272727; }
.ac-date-add-btn > svg { width: 20px; height: 20px; }

/* ═══════════════════════════════════════════
   卡片（grid 自动排列，容器始终方形）
   ═══════════════════════════════════════════ */
.ac-card-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    aspect-ratio: 1;
    background: transparent;
    will-change: transform;
    transition: transform 150ms ease, opacity 150ms ease,
                background-color 150ms ease;
}
/* 选中态：缩放 + 底色 */
.ac-card-cell.selected {
    transform: scale(0.85);
    background-color: rgba(59, 130, 246, 0.08);
    border-radius: 6px;
}
/* 选中边框 — border 替代 box-shadow，绘制成本低 */
.ac-card-cell.selected::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid rgba(59, 130, 246, 0.45);
    border-radius: 6px;
    pointer-events: none;
    z-index: 11;
}
/* 形状切换：用 aspect-ratio 过渡（可动画），cover 随盒子变窄而裁切减少至零 */
.ac-grid[data-shape="square"] .ac-card-frame {
    width: 100% !important;
    height: 100% !important;
}
.ac-grid[data-shape="original"] .ac-card-media {
    background-color: var(--background);
}

/* 卡片内框（group，承载 hover 效果） */
.ac-card-frame {
    position: relative;
    z-index: 10;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 350ms cubic-bezier(0.4, 0, 0.2, 1),
                height 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* 图片 / 视频 */
.ac-card-media {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background-color: var(--muted);
    transition: opacity 500ms cubic-bezier(0, 1.2, 0.68, 1);
}

/* 收藏按钮（左下角，hover frame 时显示） */
.ac-card-fav {
    position: absolute;
    bottom: 4px; left: 4px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    font-size: 0.75rem; font-weight: 500;
    color: #ffffff;
    background: transparent;
    border: none; border-radius: 8px;
    opacity: 0;
    cursor: pointer;
    transition: opacity 100ms ease-out, transform 100ms ease-out, rotate 100ms ease-out;
}
.ac-card-frame:hover .ac-card-fav { opacity: 1; }
.ac-card-fav:hover { transform: scale(1.1); }
.ac-card-fav:active { transform: scale(0.95); }
.ac-card-fav > svg { width: 14px; height: 14px; fill: transparent; stroke: currentColor; }

/* 底部渐变遮罩（hover frame 时显示） */
.ac-card-gradient {
    position: absolute;
    right: 0; bottom: 0; left: 0;
    height: 64px;
    background-image: linear-gradient(to top, rgba(0,0,0,0.35), transparent);
    opacity: 0;
    transition: opacity 150ms ease-out;
    pointer-events: none;
}
.ac-card-frame:hover .ac-card-gradient { opacity: 1; }

/* 视频播放按钮 */
.ac-card-play-badge {
    position: absolute;
    right: 6px; bottom: 0;
    z-index: 10;
    margin-bottom: 6px;
}
.ac-card-play-badge-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 6px;
    background-color: rgba(0,0,0,0.75);
    color: #ffffff;
    opacity: 0.75;
}
.ac-card-play-badge-inner > svg { width: 20px; height: 20px; }

/* 列表底部标记 */
.ac-grid-end {
    grid-column: 1 / -1;
    display: flex;
    width: 100%;
    justify-content: center;
    padding: 48px 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255,255,255,0.3);
}

/* ═══════════════════════════════════════════
   时间线滚动条
   ═══════════════════════════════════════════ */
.ac-timeline {
    position: absolute;
    top: 0; right: 8px; bottom: 0;
    z-index: 50;
    display: flex;
    width: 48px;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 120px 0;
    pointer-events: none;
}
.ac-timeline-track,
.ac-timeline-marker { pointer-events: auto; }

.ac-timeline-track {
    position: relative;
    width: 6px; height: 100%;
    border-radius: 9999px;
    background-color: rgba(255,255,255,0.08);
    cursor: pointer;
}

.ac-timeline-thumb {
    position: absolute;
    top: 0; left: -1px;
    width: 8px; min-height: 20px;
    height: 20px;
    border-radius: 9999px;
    background-color: rgba(255,255,255,0.5);
    pointer-events: none;
    transition: top 100ms ease, height 100ms ease;
}

.ac-timeline-marker {
    position: absolute;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateY(-50%);
    cursor: pointer;
}
.ac-timeline-marker::after {
    content: ''; position: absolute; inset: -12px;
}

.ac-timeline-label {
    position: relative; z-index: 1;
    display: flex;
    align-items: center; justify-content: center;
    padding: 4px 8px;
    font-size: 10px; font-weight: 500;
    white-space: nowrap;
    color: var(--foreground);
    background-color: rgba(38,38,38,0.5);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0; transform: scale(0.95);
    transition: opacity 200ms ease, transform 200ms ease;
    pointer-events: none;
}
.ac-timeline-marker:hover .ac-timeline-label,
.ac-timeline-marker:focus-visible .ac-timeline-label {
    opacity: 1; transform: scale(1);
}
.ac-timeline-marker--year .ac-timeline-label {
    color: var(--foreground);
    background-color: rgba(64,64,64,0.75);
}

.ac-timeline-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background-color: rgba(210,210,210,0.4);
    transition: all 150ms ease;
}
.ac-timeline-marker--year .ac-timeline-dot {
    width: 8px; height: 8px;
    background-color: rgba(210,210,210,0.6);
}

/* ═══════════════════════════════════════════
   右上工具栏（桌面）+ 移动端底部工具栏
   ═══════════════════════════════════════════ */
.ac-toolbar {
    position: absolute;
    top: 16px; right: 16px;
    z-index: 70;
    display: flex;
    justify-content: flex-end;
    pointer-events: auto;
}

.ac-toolbar-inner {
    display: flex; align-items: center; gap: 1px;
    height: auto;
    padding: 4px 4px 4px 4px;
    background-color: #262626;
    border-radius: 12px;
}

.ac-toolbar-btn {
    display: flex;
    align-items: center; justify-content: center;
    width: 28px; height: 28px;
    color: #d0d0d0;
    background: transparent;
    border: none; border-radius: 10px;
    cursor: pointer;
    flex-shrink: 0;
}
.ac-toolbar-btn:hover { background-color: #3a3a3a; }

.ac-toolbar-actions {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 4px;
    border-radius: 12px;
    padding: 3px;
}

.ac-toolbar-icon-btn {
    display: flex; align-items: center; justify-content: center;
    height: 24px; padding: 4px 6px;
    color: #a0a0a0;
    background: transparent;
    border: none; border-radius: 10px;
    cursor: pointer;
}
.ac-toolbar-icon-btn:hover { background-color: #3a3a3a; color: #e0e0e0; }
.ac-toolbar-icon-btn.active { background-color: rgba(59,130,246,0.15); color: #3b82f6; }


.ac-zoom-wrap {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    width: 150px; height: 28px;
}

.ac-zoom-slider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 17px;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 1;
    opacity: 1;
    touch-action: none;
}
.ac-zoom-slider::-webkit-slider-runnable-track {
    height: 4px; border-radius: 2px;
    background-color: rgba(255,255,255,0.15);
}
.ac-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    height: 16px; width: 16px; margin-top: -6px;
    border-radius: 50%;
    background-color: #e0e0e0;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.ac-zoom-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 5px rgba(128,128,128,0.3);
}
.ac-zoom-slider::-moz-range-track {
    height: 4px; border-radius: 2px;
    background-color: rgba(255,255,255,0.15);
}
.ac-zoom-slider::-moz-range-thumb {
    height: 16px; width: 16px;
    border: none; border-radius: 50%;
    background-color: #e0e0e0;
    cursor: pointer;
}
.ac-zoom-slider::-moz-range-thumb:hover {
    box-shadow: 0 0 0 5px rgba(128,128,128,0.3);
}

/* ── 分类筛选下拉（移动端） ── */
.ac-filter-dropdown {
    position: fixed;
    z-index: 100;
    min-width: 180px;
    padding: 6px;
    background-color: #1f1f1f;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: 450;
}
.afd-header {
    padding: 4px 12px 4px 12px;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
}
.afd-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.1s;
    user-select: none;
}
.afd-item:hover { background-color: rgba(255,255,255,0.08); }
.afd-item-label {
    display: flex;
    align-items: center;
    gap: 10px;
}
.afd-item-label svg { width: 14px; height: 14px; flex-shrink: 0; }
.afd-check {
    color: #3b82f6;
    opacity: 0;
    transition: opacity 0.1s;
}
.afd-item--active .afd-check { opacity: 1; }
.afd-divider {
    margin: 4px 2px;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ── 移动端底部搜索栏 ── */
.ac-search-mobile {
    position: absolute;
    bottom: 16px; left: 50%;
    z-index: 80;
    display: flex;
    width: 100%;
    justify-content: center;
    padding: 0 32px;
    transform: translateX(-50%);
    pointer-events: auto;
}
@media (min-width: 640px) { .ac-search-mobile { display: none; } }

.ac-search-mobile-inner {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 500px;
    height: 48px;
    align-items: center;
    border-radius: 16px;
    background-color: rgba(38,38,38,0.75);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    transition: width 300ms ease-out, background-color 300ms ease-out, border-radius 300ms ease-out;
}
.ac-search-mobile-input {
    width: 100%;
    height: 100%;
    padding: 0 48px 0 24px;
    font-size: 14px;
    font-weight: 450;
    color: #ffffff;
    background: transparent;
    border: none;
    border-radius: 16px;
    outline: none;
    letter-spacing: -0.01em;
}
.ac-search-mobile-input::placeholder { color: rgba(255,255,255,0.5); }
.ac-search-mobile-input:focus { outline: none; }

.ac-search-mobile-btn {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    padding: 8px;
    color: rgba(255,255,255,0.7);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}
.ac-search-mobile-btn > svg { width: 20px; height: 20px; }
