/* P5 详情页 —— 1:1 复刻 wallhaven（读取原站 computed style 实测值）：
   侧栏 fixed 贴左缘 280px #1b1b1b 全向柔影 0 0 7px，z-index 150；
   收起=侧栏缩至 7px 色带（非移出屏幕）；按钮=D 形半圆 31.5×33 (0 100% 100% 0) */
.detail-main {
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 0 40px;
}
.detail-layout {
    display: block;
}

/* ===== 左侧信息栏（wallhaven .sidebar.lsidebar：fixed / 280px / #1b1b1b / 0 0 7px 柔影） ===== */
.detail-sidebar {
    position: fixed;
    top: 44px;
    left: 0;
    z-index: 150;
    width: 280px;
    height: calc(100vh - 44px);
    background: #1b1b1b;
    border-right: 1px solid #292929;
    box-shadow: 0 0 11px rgba(0, 0, 0, .6);
    padding: 16px 20px 24px 26px;
    overflow: visible;
    transition: width .25s ease;
}
.side-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: opacity .2s ease;
}
.detail-layout.is-collapsed .detail-sidebar { width: 7px; border-right: none; padding-left: 0; padding-right: 0; }
.detail-layout.is-collapsed .side-body { opacity: 0; visibility: hidden; overflow: hidden; }

/* 折叠把手按钮（规格：31.5×31.5 半圆凸舌 / #1b1b1b / 1px #292929 / 0 0 7px 柔影 / chevron 18px .8；左缘埋入侧栏无缝） */
.sidebar-toggle {
    position: absolute;
    top: 63px;
    right: -26px;
    z-index: 20;
    width: 31.5px;
    height: 31.5px;
    background: #1b1b1b;
    border: 1px solid #292929;
    border-left: none;
    border-radius: 0 100% 100% 0;
    color: #9aa0a6;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 7px rgba(0, 0, 0, .5);
    padding: 0;
    padding-left: 3px;
}
.sidebar-toggle:hover { background: #242424; color: #fff; }
.sidebar-toggle .st-arrow {
    display: block;
    width: 18px;
    height: 18px;
    opacity: .8;
    transition: transform .25s ease;
}
.detail-layout.is-collapsed .sidebar-toggle {
    right: -26px;
    padding-left: 0;
}
.detail-layout.is-collapsed .sidebar-toggle .st-arrow { transform: rotate(180deg); }

.side-head { text-align: center; }
.side-resolution {
    font-size: 30px;
    font-weight: 300;
    color: #e8e8e8;
    letter-spacing: -.5px;
}
.side-search-similar {
    display: block;
    color: #4a9ad9;
    font-size: 13px;
    margin-top: 6px;
}
.side-search-similar:hover, .side-source-link:hover { text-decoration: underline; }
.side-source-link {
    display: block;
    color: #4a9ad9;
    font-size: 13px;
    margin-top: 3px;
    word-break: break-all;
}

/* 色带（wallhaven .color-palette：hover 起伏放大，规则实测复刻） */
.color-strip {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 25px;
    align-items: center;
}
.color-strip .color {
    flex: 0 0 20%;
    display: flex;
    align-items: center;
    position: relative;
}
.color-chip {
    display: block;
    width: 100%;
    height: 15px;
    transition: width .25s, height .25s, margin .25s, z-index .25s, box-shadow .25s;
}
.color-chip:hover {
    position: relative;
    z-index: 200;
    width: 120%;
    height: 25px;
    margin: -5px -10%;
    box-shadow: 0 0 3px rgba(0, 0, 0, .5);
}

/* 折叠区块（▼ 标签 / ▼ 属性 / ▼ 工具） */
.side-section summary {
    color: #9aa6ac;
    font-size: 13px;
    cursor: pointer;
    padding-bottom: 8px;
    list-style: none;
    user-select: none;
}
.side-section summary::before { content: '▼ '; font-size: 9px; color: #777; }
.side-section { border-top: 1px solid #262626; padding-top: 12px; }
.side-head + .side-colors + .side-section,
.side-section:first-of-type { border-top: none; padding-top: 0; }

/* 标签胶囊（wallhaven .tag：底 #293033、对角圆角 8px 0「挤牙膏」、绿字 #94db94） */
.tag-list { display: flex; flex-wrap: wrap; gap: 4px 5px; list-style: none; margin: 0; padding: 0; }
.detail-tag {
    display: inline-block;
    padding: 4px 12px 5px;
    background: #293033;
    border-radius: 8px 0;
    color: #94db94;
    font-size: 12px;
    line-height: 1.5;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, .7);
}
.detail-tag:hover { background: #354044; color: #aeeaae; }
.side-more-wrap { text-align: center; margin-top: 10px; }
.side-more-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: linear-gradient(180deg, #1d6478, #134c5c);
    border: 1px solid #0e3d4a;
    border-radius: 3px;
    color: #eef6f8;
    font-size: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.side-more-link:hover { background: linear-gradient(180deg, #24758b, #175a6c); color: #fff; }
.side-more-ico { font-size: 11px; }

/* 属性表（dt 右对齐） */
.prop-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 7px 8px;
    margin: 0;
    font-size: 12px;
}
.prop-list dt { color: #8a969c; text-align: right; }
.prop-list dd { margin: 0; color: #ccd4d8; }
.prop-list dd a { color: #4a9ad9; }
.prop-list dd a:hover { text-decoration: underline; }
.prop-list dd.prop-sfw { color: #7fc75f; }
/* 链接行（wallhaven：readonly input #2c2c2c + 多层阴影模块） */
.prop-link { display: flex; }
.prop-link input {
    width: 100%;
    height: 25px;
    padding: 0 8px;
    background: #2c2c2c;
    border: none;
    border-radius: 2px;
    color: #ddd;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    box-shadow: inset 0 0 9px rgba(255, 255, 255, .03), 0 2px 0 #222, 0 3px 4px -3px #000, 1px 1px 2px rgba(0, 0, 0, .2);
}
.prop-link input:hover { background: #323232; }
.prop-uploader { display: flex; align-items: center; gap: 7px; }
.uploader-avatar {
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(180deg, #d86a8a, #a84868);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.uploader-meta { display: flex; flex-direction: column; line-height: 1.3; }
.uploader-meta a { color: #4a9ad9; }
.uploader-meta em { font-style: normal; color: #8a969c; font-size: 11px; }

/* 工具行 */
.tool-list { display: flex; flex-direction: column; gap: 6px; }
.side-tool-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: transparent;
    border: none;
    border-radius: 3px;
    color: #b8c2c8;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}
.side-tool-row:hover { background: #262c30; color: #fff; }
.side-tool-row svg { fill: currentColor; flex: 0 0 auto; }

/* 收藏分体按钮（☆ 添加到收藏夹 + ▾，teal，wallhaven 同款） */
.side-fav-split {
    display: flex;
    gap: 4px;
}
.side-fav-btn {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 8px;
    background: linear-gradient(180deg, #1d6478, #134c5c);
    border: 1px solid #0e3d4a;
    border-radius: 3px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 1px 3px rgba(0,0,0,.4);
    text-shadow: 0 1px 1px rgba(0,0,0,.3);
}
.side-fav-btn:hover { background: linear-gradient(180deg, #24758b, #175a6c); }
.side-fav-btn svg { fill: currentColor; flex: 0 0 auto; }
.side-fav-dd {
    flex: 0 0 30px;
    background: linear-gradient(180deg, #1d6478, #134c5c);
    border: 1px solid #0e3d4a;
    border-radius: 3px;
    color: #dbeef2;
    font-size: 12px;
    cursor: pointer;
}
.side-fav-dd:hover { background: linear-gradient(180deg, #24758b, #175a6c); color: #fff; }
.side-fav-btn.is-faved { background: linear-gradient(180deg, #3f8b46, #2c6b33); border-color: #215428; }

/* 版权块（底部小字带边框） */
.side-copyright {
    padding: 9px 10px;
    border: 1px solid #2e2e2e;
    border-radius: 3px;
    color: #77828a;
    font-size: 11px;
    line-height: 1.7;
}
.side-copyright a { color: #5a99c8; }

/* ===== 右侧大图查看器（margin 让出 fixed 侧栏；收起时跟进到 7px 色带右侧） ===== */
.detail-viewer {
    position: relative;
    z-index: 1;
    margin-left: 280px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 24px 0 20px;
    transition: margin-left .25s ease;
}
.detail-layout.is-collapsed .detail-viewer { margin-left: 7px; }
.viewer-stage {
    position: relative;
    width: 100%;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    overflow: hidden;
}
.viewer-img {
    display: block;
    max-width: 96%;
    max-height: calc(100vh - 44px - 150px);
    object-fit: contain;
    cursor: zoom-in;
}
/* 放大三态（点击一次 +25% 仅左右滑动；再点 +50% 自由拖动；再点恢复） */
.viewer-stage.is-zoomed {
    overflow-x: auto;
    overflow-y: hidden;
    cursor: grab;
    scrollbar-width: none;
    /* flex 居中会让溢出区不可滚动并收缩子项：放大态改为起点对齐+禁止收缩 */
    justify-content: flex-start;
    align-items: flex-start;
    /* 50% 态不锁高：stage 高度=图片显示高度，按钮始终紧贴图片（与 fit 态间距一致） */
}
.viewer-stage.is-zoomed.is-pan {
    overflow: auto;
    /* 200% 态锁定 stage 高度：内容超出产生滚动，全方向自由拖动 */
    height: calc(100vh - 44px - 96px);
    flex: none;
}
.viewer-stage.is-zoomed::-webkit-scrollbar { display: none; }
.viewer-stage.is-zoomed .viewer-img {
    flex: none;
    max-width: none;
    max-height: none;
    cursor: grab;
}
.viewer-stage.is-zoomed.is-dragging { cursor: grabbing; }
.viewer-stage.is-zoomed.is-dragging .viewer-img { cursor: grabbing; }
.viewer-stage.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0,0,0,.95);
    border: none;
    border-radius: 0;
}
.viewer-stage.is-fullscreen .viewer-img {
    max-width: 100vw;
    max-height: 100vh;
    cursor: zoom-out;
}

.viewer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.btn-download, .btn-ai {
    padding: 8px 18px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
}
.btn-download {
    background: linear-gradient(180deg, #a8c860, #7da63a);
    color: #fff;
    border: 1px solid #5d7f2c;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 2px 6px rgba(0,0,0,.4);
}
.btn-ai {
    background: linear-gradient(180deg, #3c6e88, #275267);
    color: #fff;
    border: 1px solid #1c3b4a;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 2px 6px rgba(0,0,0,.4);
}
.viewer-hint { color: #777; font-size: 11px; }

/* 相似图片 */
.similar-section { margin-top: 28px; margin-left: 280px; padding: 0 24px; transition: margin-left .25s ease; }
.detail-layout.is-collapsed ~ .similar-section { margin-left: 7px; }
.similar-section h2 { color: #ddd; font-size: 16px; margin-bottom: 12px; }
/* 查看更多精选（teal 大按钮，进入同类筛选页） */
.similar-more { text-align: center; margin-top: 18px; }
.btn-more-featured {
    display: inline-block;
    padding: 11px 30px;
    background: linear-gradient(180deg, #1d6478, #134c5c);
    border: 1px solid #0e3d4a;
    border-radius: 3px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 2px 6px rgba(0,0,0,.4);
}
.btn-more-featured:hover { background: linear-gradient(180deg, #24758b, #175a6c); color: #fff; }

@media (max-width: 640px) {
    .detail-sidebar { position: static; width: 100%; height: auto; box-shadow: none; }
    .sidebar-toggle { display: none; }
    .detail-viewer { margin-left: 0; }
    .similar-section { margin-left: 0; }
}

/* ===== 第10轮：侧栏 1:1 复刻 + 把手精修 + 设备预览/举报/裁剪弹窗 ===== */

/* 把手（wallhaven 真实形态：贴侧栏右缘的小凸舌，深色不抢眼） */
.sidebar-toggle {
    position: absolute;
    top: 63px;
    right: -15px;
    z-index: 20;
    width: 15px;
    height: 34px;
    background: #252525;
    border: 1px solid #2f2f2f;
    border-left: none;
    border-radius: 0 10px 10px 0;
    color: #9aa0a6;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 1px 1px 4px rgba(0, 0, 0, .45);
    transition: background .15s ease, color .15s ease;
}
.sidebar-toggle:hover { background: #2e2e2e; color: #fff; }
.sidebar-toggle .st-arrow {
    display: block;
    width: 11px;
    height: 11px;
    opacity: .85;
    transition: transform .25s ease;
}
.detail-layout.is-collapsed .sidebar-toggle { right: -15px; }
.detail-layout.is-collapsed .sidebar-toggle .st-arrow { transform: rotate(180deg); }

/* 关联 / 缩略图（wallhaven 同款灰底行） */
.side-ref-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.side-ref-row { display: flex; align-items: center; gap: 8px; }
.side-ref-label { flex: 0 0 40px; text-align: right; color: #8a969c; font-size: 12px; }
.side-ref-input {
    flex: 1 1 auto;
    min-width: 0;
    background: #3f3f3f;
    border: 1px solid #3f3f3f;
    border-radius: 3px;
    color: #d6d6d6;
    font-size: 12px;
    padding: 6px 9px;
    cursor: pointer;
    outline: none;
}
.side-ref-input:hover { background: #4a4a4a; border-color: #4a4a4a; }

/* 报告行（wallhaven 橙色警示） */
.side-tool-report { color: #d68222; }
.side-tool-report:hover { color: #f09a34; background: #2d2620; }

/* 推荐行（wallhaven 黄色） */
.side-recommend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #c9a04a;
    padding: 2px 0;
}
.side-recommend svg { fill: #f5b73f; flex: 0 0 auto; }
.side-recommend a { color: #d68222; font-weight: 600; }
.side-recommend a:hover { text-decoration: underline; }
.side-recommend em { color: #77828a; font-style: normal; margin-left: 2px; }

/* 设备预览按钮（与下载/AI 按钮同排） */
.btn-device {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(180deg, #6a5a94, #4a3d6e);
    color: #fff;
    border: 1px solid #382e54;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 2px 6px rgba(0,0,0,.4);
    cursor: pointer;
}
.btn-device:hover { background: linear-gradient(180deg, #7767a5, #544683); }

/* ===== 通用弹窗（深色主题） ===== */
.device-modal { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; }
.device-modal[hidden] { display: none; }
.device-modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .72); }
.device-modal-body {
    position: relative;
    background: #1b1b1b;
    border: 1px solid #2e2e2e;
    border-radius: 8px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, .7);
    padding: 22px 26px;
    max-width: min(920px, 92vw);
    max-height: 88vh;
    overflow: auto;
}
.device-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 26px;
    height: 26px;
    background: transparent;
    border: none;
    color: #8a969c;
    font-size: 15px;
    cursor: pointer;
    border-radius: 4px;
}
.device-modal-close:hover { background: #2e2e2e; color: #fff; }
.device-modal-body h3 { margin: 0 0 10px; color: #e8e8e8; font-size: 16px; }

/* 设备预览舞台 */
.device-modal-stage { display: flex; align-items: flex-end; justify-content: center; gap: 42px; padding: 8px 6px 4px; }
.device { display: flex; flex-direction: column; align-items: center; position: relative; }
.device .device-screen {
    background: #0d0d0d;
    border: 2px solid #3a3a3a;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 0 24px rgba(0,0,0,.55), inset 0 0 2px rgba(255,255,255,.06);
}
.device .device-screen img { display: block; width: 100%; height: 100%; object-fit: cover; }
.device-desktop .device-screen { width: min(520px, 52vw); aspect-ratio: 16 / 9; }
.device-stand { width: 26px; height: 34px; background: linear-gradient(180deg, #2c2c2c, #232323); border: 1px solid #3a3a3a; border-top: none; }
.device-base { width: 120px; height: 10px; background: #2c2c2c; border: 1px solid #3a3a3a; border-radius: 3px 3px 6px 6px; }
.device-phone { margin-left: 8px; }
.device-phone .device-screen { width: 168px; aspect-ratio: 9 / 19.5; border-radius: 22px; position: relative; }
.device-phone .device-screen::before {
    content: '';
    position: absolute;
    top: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 14px;
    background: #0a0a0a;
    border-radius: 8px;
    z-index: 2;
}
.device-tag { margin-top: 10px; font-size: 11px; color: #8a969c; letter-spacing: .5px; }

/* 解锁弹窗 */
.unlock-body { width: 360px; text-align: center; }
.unlock-ico { font-size: 38px; margin: 4px 0 8px; }
.unlock-desc { color: #9aa6ad; font-size: 13px; line-height: 1.8; margin: 0 0 14px; }
.unlock-price { color: #f5b73f; font-size: 15px; margin-bottom: 6px; }
.unlock-price b { font-size: 30px; font-weight: 700; margin: 0 4px; }
.unlock-price em { display: block; font-style: normal; color: #8a969c; font-size: 11px; margin-top: 4px; }
.unlock-balance { color: #77828a; font-size: 12px; margin-bottom: 12px; }
.unlock-btn {
    width: 100%;
    padding: 10px 0;
    background: linear-gradient(180deg, #a8c860, #7da63a);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #5d7f2c;
    border-radius: 4px;
    cursor: pointer;
}
.unlock-btn:hover { filter: brightness(1.08); }
.unlock-btn:disabled { opacity: .55; cursor: not-allowed; }
.unlock-tip { display: block; margin-top: 10px; color: #4a9ad9; font-size: 13px; }

/* 举报弹窗 */
.report-body { width: 380px; }
.report-reasons { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.report-reasons button {
    padding: 7px 14px;
    background: #262626;
    border: 1px solid #333;
    border-radius: 3px;
    color: #b8c2c8;
    font-size: 13px;
    cursor: pointer;
}
.report-reasons button:hover { background: #303030; }
.report-reasons button.active { background: #4a3013; border-color: #d68222; color: #f09a34; }
.report-body textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 74px;
    background: #232323;
    border: 1px solid #333;
    border-radius: 3px;
    color: #ccd4d8;
    font-size: 13px;
    padding: 9px;
    resize: vertical;
    margin-bottom: 12px;
}
.report-body textarea:focus { outline: none; border-color: #4a6a8a; }

/* 裁剪下载弹窗 */
.crop-body { width: 560px; }
.crop-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.crop-presets button {
    padding: 6px 13px;
    background: #262626;
    border: 1px solid #333;
    border-radius: 3px;
    color: #b8c2c8;
    font-size: 12px;
    cursor: pointer;
}
.crop-presets button:hover { background: #303030; }
.crop-presets button.active { background: #2c3c22; border-color: #7da63a; color: #a8c860; }
.crop-canvas-wrap { background: #0d0d0d; border: 1px solid #2e2e2e; border-radius: 4px; text-align: center; margin-bottom: 12px; overflow: hidden; }
.crop-canvas-wrap canvas { max-width: 100%; max-height: 46vh; display: block; margin: 0 auto; }
.crop-actions { display: flex; align-items: center; gap: 14px; }
.crop-actions .unlock-btn { width: auto; padding: 9px 22px; }
.crop-size { color: #77828a; font-size: 12px; }

@media (max-width: 900px) {
    .device-modal-stage { flex-direction: column; align-items: center; gap: 24px; }
    .device-desktop .device-screen { width: 76vw; }
}

/* 操作反馈 toast */
.detail-toast {
    position: fixed;
    left: 50%;
    bottom: 64px;
    transform: translate(-50%, 16px);
    z-index: 990;
    background: #2b2b2b;
    border: 1px solid #3d3d3d;
    color: #e0e0e0;
    font-size: 13px;
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
}
.detail-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 侧栏内容独立滚动（wallhaven 同款：把手不受影响） */
.detail-sidebar { display: flex; flex-direction: column; }
.side-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: none;
}
.side-body::-webkit-scrollbar { display: none; }
