/* ================= 基础重置 ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent: #ff7eb3;
    --accent-2: #8e6bff;
    --bg-dark: #14141f;
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-border: rgba(255, 255, 255, 0.12);
    --text-main: #f2f2f7;
    --text-sub: #a0a0b0;
    --radius: 16px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    color: var(--text-main);
    background:
        linear-gradient(rgba(16, 16, 26, 0.72), rgba(16, 16, 26, 0.8)),
        url(img/background.svg) no-repeat center center fixed;
    background-size: cover;
}

li { list-style: none; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
code {
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 12px;
}

/* 内联 SVG 图标 */
.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    vertical-align: middle;
}

.icon-lg {
    width: 56px;
    height: 56px;
}

/* ================= 导航栏 ================= */
.navigation {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: rgba(20, 20, 31, 0.72);
    border-bottom: 1px solid var(--card-border);
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 64px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.search-box {
    display: flex;
    flex: 1;
    max-width: 460px;
    margin: 0 auto;
}

.search-box input {
    flex: 1;
    min-width: 0;
    height: 38px;
    border: 1px solid var(--card-border);
    border-right: none;
    padding: 0 16px;
    border-radius: 20px 0 0 20px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.search-box input::placeholder { color: var(--text-sub); }

.search-box input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.12);
}

.search-box button {
    width: 46px;
    height: 38px;
    border: 1px solid var(--card-border);
    border-left: none;
    border-radius: 0 20px 20px 0;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: #fff;
    font-size: 15px;
    transition: filter 0.2s;
}

.search-box button:hover { filter: brightness(1.15); }

.nav-actions {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--card-border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    font-size: 15px;
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.icon-btn.spinning .icon { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= 公告条 ================= */
.notice-bar {
    max-width: 1400px;
    margin: 16px auto 0;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #ffe9a8;
    background: rgba(255, 195, 16, 0.1);
    border: 1px solid rgba(255, 195, 16, 0.25);
    border-radius: 12px;
    width: calc(100% - 40px);
}

/* ================= 图片墙 ================= */
.gallery-wrap {
    max-width: 1400px;
    margin: 20px auto 60px;
    padding: 0 20px;
}

.value-box {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.pick-box {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    aspect-ratio: 3 / 4;
    animation: fadeUp 0.45s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pick-box a { display: block; width: 100%; height: 100%; }

.pick-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    transition: transform 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}

.pick-box img.loaded { opacity: 1; }
.pick-box:hover img { transform: scale(1.06); }

/* 骨架屏 */
.pick-box.skeleton::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg,
        rgba(255,255,255,0.04) 30%,
        rgba(255,255,255,0.14) 50%,
        rgba(255,255,255,0.04) 70%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    from { background-position: 180% 0; }
    to   { background-position: -20% 0; }
}

/* 悬停信息条 */
.pick-box .pick-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 24px 14px 12px;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}

.pick-box:hover .pick-overlay { opacity: 1; }

.pick-overlay strong,
.pick-overlay span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pick-overlay strong { font-size: 13px; }
.pick-overlay span { color: rgba(255, 255, 255, 0.75); margin-top: 2px; }
.pick-overlay .icon { width: 13px; height: 13px; }

/* ================= 空结果 / 加载更多 ================= */
.nullerr {
    display: none;
    text-align: center;
    padding: 80px 0;
    color: var(--text-sub);
}

.nullerr .icon-lg { margin-bottom: 14px; }
.nullerr p { font-size: 18px; }

.loading-more {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 0;
    color: var(--text-sub);
    font-size: 14px;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-more.show { display: flex; }

/* ================= 弹窗 ================= */
.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal-mask.open { display: flex; }

.modal {
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    background: #1e1e2e;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    animation: popIn 0.25s ease both;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.94) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--card-border);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 600;
}
.modal-header h3 .icon { color: var(--accent); }

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    transition: background 0.2s;
}

.modal-close:hover { background: rgba(255, 255, 255, 0.18); }

.modal-body { padding: 20px 22px; }

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    margin: 16px 0 8px;
}

.field-label:first-child { margin-top: 0; }

.field-tip {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.8;
    color: var(--text-sub);
}

.text-input {
    width: 100%;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
}

.text-input:focus { border-color: var(--accent); }

.preset-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preset-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    font-size: 13px;
}

.preset-item:hover { background: rgba(255, 255, 255, 0.09); }

.preset-item.active {
    border-color: var(--accent);
    background: rgba(255, 126, 179, 0.12);
}

.preset-item .preset-name { font-weight: 600; }
.preset-item .preset-url {
    color: var(--text-sub);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preset-item .preset-check {
    margin-left: auto;
    color: var(--accent);
    visibility: hidden;
}

.preset-item.active .preset-check { visibility: visible; }

/* ================= R18 开关 ================= */
.switch-row {
    margin-top: 16px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.switch-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.switch-title { font-size: 14px; font-weight: 600; }
.switch-desc { font-size: 12px; color: var(--text-sub); }

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    inset: 0;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s;
}

.switch-slider::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.25s;
}

.switch input:checked + .switch-slider {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    border-color: transparent;
}

.switch input:checked + .switch-slider::before {
    transform: translateY(-50%) translateX(20px);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--card-border);
}

.btn {
    height: 38px;
    padding: 0 20px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    font-size: 14px;
    transition: filter 0.2s, background 0.2s;
}

.btn-primary {
    border: none;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: #fff;
    font-weight: 600;
}

.btn-primary:hover { filter: brightness(1.15); }

.btn-ghost {
    background: transparent;
    color: var(--text-sub);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-main); }

/* ================= 图片预览灯箱 ================= */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 16, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lightbox.open { display: flex; }

.lightbox-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 48px 88px;   /* 底部给信息栏留位 */
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: var(--shadow);
    animation: popIn 0.25s ease both;
    transition: filter 0.35s ease, transform 0.35s ease;
}

/* 常规大小加载完成前：以模糊小图占位 */
.lightbox-img.low-res {
    filter: blur(14px);
    transform: scale(1.04);
}

.lightbox-loading {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.lightbox.loading .lightbox-loading { display: block; }

.lightbox-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
}

.lightbox-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lightbox-info strong,
.lightbox-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lightbox-info strong { font-size: 14px; }
.lightbox-info span { font-size: 12px; color: var(--text-sub); }

.lightbox-origin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    height: 34px;
    padding: 0 14px;
    border: 1px solid var(--card-border);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 13px;
    transition: background 0.2s, border-color 0.2s;
}

.lightbox-origin:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: var(--accent);
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--card-border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    transition: background 0.2s;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.18); }

/* ================= Toast ================= */
.toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    z-index: 300;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 22px;
    border-radius: 12px;
    background: rgba(30, 30, 46, 0.95);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    max-width: 80vw;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error { border-color: #ff6b6b; color: #ffb3b3; }
.toast.success { border-color: #51cf66; color: #b2f2bb; }

/* ================= 回到顶部 ================= */
.back-top {
    position: fixed;
    right: 26px;
    bottom: 26px;
    z-index: 150;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: #fff;
    font-size: 16px;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.25s, transform 0.25s;
}

.back-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-top:hover { filter: brightness(1.15); }

/* ================= 响应式 ================= */
@media only screen and (max-width: 600px) {
    .nav-inner { gap: 10px; padding: 0 12px; }
    .nav-brand span { display: none; }
    .value-box { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .gallery-wrap { padding: 0 12px; }
    .notice-bar { width: calc(100% - 24px); font-size: 12px; }
    .lightbox-stage { padding: 16px 12px 80px; }
    .lightbox-bar { padding: 12px 14px; }
}
