/* Lily Tk catalog theme — original design */
:root {
    --ink: #1a1a1a;
    --ink-2: #6b6b6b;
    --line: #e8e8e8;
    --bg: #f7f7f8;
    --card: #ffffff;
    --accent: #111111;
    --radius: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- top bar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 16px;
}
.logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .04em;
    white-space: nowrap;
}
.logo::first-letter { color: #c8a24b; }

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 420px;
}
.search input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 19px;
    background: #f2f2f3;
    font-size: 14px;
    outline: none;
}
.search input:focus { border-color: #bbb; background: #fff; }
.search button {
    flex: none;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.cats { border-top: 1px solid var(--line); }
.cats-inner {
    display: flex;
    gap: 8px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 16px;
    overflow-x: auto;
    scrollbar-width: none;
}
.cats-inner::-webkit-scrollbar { display: none; }
.cat {
    flex: none;
    padding: 7px 16px;
    border-radius: 17px;
    background: #f0f0f1;
    color: var(--ink-2);
    font-size: 13.5px;
    font-weight: 600;
    transition: all .15s ease;
}
.cat:hover { background: #e6e6e8; }
.cat.active { background: var(--accent); color: #fff; }

/* ---------- grid ---------- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

/* PC 双栏：侧边分类 + 内容区 */
.shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}
.sidecats { display: none; }

@media (min-width: 992px) {
    .cats { display: none; }
    .shell {
        display: grid;
        grid-template-columns: 232px minmax(0, 1fr);
        gap: 28px;
        align-items: start;
    }
    .sidecats {
        display: block;
        position: sticky;
        top: 16px;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 14px;
        padding: 10px;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }
}

/* 侧边分类 */
.sc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-2);
    transition: background .12s ease, color .12s ease;
}
.sc-item + .sc-item { margin-top: 2px; }
.sc-item:hover { background: #f4f4f5; color: var(--ink); }
.sc-item.active { background: var(--accent); color: #fff; }
.sc-item.context { background: #f4f4f5; color: var(--ink); }
.sc-all { margin-bottom: 4px; }
.sc-group {
    padding: 6px 0;
    border-top: 1px solid var(--line);
}
.sc-parent { color: var(--ink); font-weight: 700; }
.sc-parent.active { color: #fff; }
.sc-child { padding-left: 26px; font-size: 13.5px; font-weight: 500; }
.sc-count {
    font-size: 11.5px;
    font-weight: 600;
    color: #b0b0b4;
}
.sc-item.active .sc-count { color: rgba(255, 255, 255, .75); }

/* 列表标题 */
.list-head { margin: 2px 0 16px; min-height: 10px; }
.list-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.list-count { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.result-note { color: var(--ink-2); font-size: 14px; margin: 0; }

/* 移动端二级分类行 */
.cats.sub { border-top: 0; }
.cats.sub .cat { background: #fff; border: 1px solid var(--line); }
.cats.sub .cat.active { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (min-width: 992px) {
    .cats.sub { display: none; }
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
@media (min-width: 560px)  { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 860px)  { .grid { grid-template-columns: repeat(4, 1fr); gap: 18px; } }
@media (min-width: 1180px) { .grid { grid-template-columns: repeat(5, 1fr); } }

.card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}
.cover {
    position: relative;
    aspect-ratio: 3 / 4;
    background: #efeff0;
    overflow: hidden;
}
.cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.noimg {
    width: 100%;
    height: 100%;
    background:
        linear-gradient(45deg, #e7e7e9 25%, transparent 25%, transparent 75%, #e7e7e9 75%),
        linear-gradient(45deg, #e7e7e9 25%, transparent 25%, transparent 75%, #e7e7e9 75%);
    background-size: 24px 24px;
    background-position: 0 0, 12px 12px;
}
.count {
    position: absolute;
    right: 8px;
    top: 8px;
    padding: 3px 9px;
    border-radius: 12px;
    background: rgba(17, 17, 17, .72);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    backdrop-filter: blur(2px);
}
.meta { padding: 10px 12px 12px; }
.meta h3 {
    margin: 0;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.code { margin: 2px 0 0; font-size: 12px; color: var(--ink-2); }
.empty { grid-column: 1 / -1; text-align: center; color: var(--ink-2); padding: 60px 0; }

/* ---------- pager ---------- */
.pager {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 34px;
}
.pg {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 14px;
    font-weight: 600;
}
.pg:hover { border-color: #bbb; }
.pg.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.dots { align-self: center; color: var(--ink-2); }

/* ---------- album ---------- */
.backlink {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--ink-2);
    font-weight: 600;
}
.backlink:hover { color: var(--ink); }
.album-head { margin: 4px 0 22px; }
.album-head h1 {
    margin: 0 0 8px;
    font-size: clamp(20px, 3.4vw, 30px);
    font-weight: 800;
    line-height: 1.25;
}
.album-sub {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: var(--ink-2);
}
.tag {
    padding: 4px 12px;
    border-radius: 14px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 12.5px;
}
.album-desc {
    margin: 14px 0 0;
    max-width: 760px;
    color: #3c3c3c;
    font-size: 14.5px;
    white-space: pre-line;
}
.album-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
@media (min-width: 640px)  { .album-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .album-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.shot {
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: #efeff0;
    cursor: zoom-in;
    aspect-ratio: 3 / 4;
}
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.shot:hover img { transform: scale(1.03); }

.album-pn {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 30px;
}
.pn {
    max-width: 46%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-2);
}
.pn:hover { color: var(--ink); }
.pn.right { text-align: right; }

/* ---------- lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(12, 12, 12, .96);
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox[hidden] { display: none; }
.lb-stage { margin: 0; max-width: min(1100px, 94vw); max-height: 92vh; display: flex; flex-direction: column; align-items: center; }
.lb-stage img {
    max-width: 100%;
    max-height: 86vh;
    object-fit: contain;
    border-radius: 6px;
}
.lb-stage figcaption { color: #bbb; font-size: 13px; padding: 10px 4px 0; }
.lb-close, .lb-prev, .lb-next {
    position: absolute;
    border: 0;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    transition: background .15s ease;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, .28); }
.lb-close { top: 14px; right: 14px; width: 42px; height: 42px; font-size: 24px; line-height: 1; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; font-size: 30px; line-height: 1; }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
@media (max-width: 640px) {
    .lb-prev { left: 4px; width: 38px; height: 38px; }
    .lb-next { right: 4px; width: 38px; height: 38px; }
}

/* ---------- floating WhatsApp ---------- */
.wa-float {
    position: fixed;
    right: 16px;
    bottom: 18px;
    z-index: 60;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 6px 20px rgba(37, 211, 102, .45);
}

/* ---------- footer ---------- */
.footer {
    border-top: 1px solid var(--line);
    background: #fff;
    text-align: center;
    padding: 28px 16px 84px;
}
.f-name { margin: 0; font-weight: 800; font-size: 16px; letter-spacing: .03em; }
.f-note { margin: 6px 0 0; color: var(--ink-2); font-size: 13px; }
.f-copy { margin: 10px 0 0; color: #a5a5a5; font-size: 12px; }

/* ---------- password gate ---------- */
.gate-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(1000px 500px at 20% -10%, #ffffff 0%, transparent 60%),
        var(--bg);
}
.gate { width: min(380px, calc(100vw - 40px)); text-align: center; }
.gate-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 38px 28px 30px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .06);
}
.gate-logo { margin: 0 0 14px; font-size: 24px; font-weight: 800; letter-spacing: .04em; }
.gate-logo::first-letter { color: #c8a24b; }
.gate-tip { margin: 0 0 22px; color: var(--ink-2); font-size: 14px; }
#gatePwd {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 15px;
    text-align: center;
    letter-spacing: .12em;
    outline: none;
}
#gatePwd:focus { border-color: #999; }
#gateBtn {
    width: 100%;
    height: 46px;
    margin-top: 12px;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}
#gateBtn:disabled { opacity: .6; cursor: wait; }
.gate-err { min-height: 20px; margin: 12px 0 0; color: #d33; font-size: 13px; }
.gate-copy { margin-top: 22px; color: #a5a5a5; font-size: 12px; }
