/* 素材库：整套成品素材 · 固定封面 · 创作点解锁（沿用 atelier 的蓝色系）
   版式参考众图网：热点日历 → 按类型分区（每区两行 + 主题小标签）→ 吸顶筛选条 + 无限加载网格。
   卡片悬停才出现“立即下载”和收藏星标；横版封面占两列，和竖版一样高。 */
.lib-member {display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:16px;font-size:13px;color:#6f6a5e}
.lib-member:empty {display:none}
.lib-member b {color:#0f5c43;font-size:16px}
.lib-member em {font-style:normal;margin-left:10px;padding:2px 10px;border-radius:999px;background:#e6f5ee;color:#23875f;font-size:12px;font-weight:700}
.lib-member .ok {color:#23875f;font-weight:800}
.lib-member button,.lib-member a {height:34px;padding:0 16px;border-radius:999px;background:#0f5c43;color:#fff;font-size:13px;font-weight:800;text-decoration:none;display:inline-flex;align-items:center}
.lib-member a {background:#edf3ee;color:#0f5c43}

/* ---------- 顶部：大搜索框 ---------- */
.lib-hero {width:calc(100% - 40px);max-width:1240px;margin:26px auto 22px;box-sizing:border-box;padding:44px 24px 28px;border-radius:30px;text-align:center;background:linear-gradient(135deg,#edf3ee 0%,#fdf6ff 55%,#fff6ea 100%);box-shadow:0 20px 50px rgba(15,92,67,.10);border:1px solid #fff}
.lib-hero h1 {font-family:"Microsoft YaHei","微软雅黑",sans-serif;font-size:clamp(32px,4vw,46px);font-weight:900;color:#1d1b16;letter-spacing:-.02em}
.lib-hero > p {max-width:660px;margin:10px auto 0;font-size:14px;line-height:1.8;color:#6f6a5e}
.lib-hero > p b {color:#0f5c43}
.lib-search {display:flex;align-items:center;gap:10px;max-width:640px;height:56px;margin:22px auto 0;padding:0 20px;border:1px solid #e3dccb;border-radius:16px;background:#fff;box-shadow:0 8px 24px rgba(40,30,10,.10);cursor:text}
.lib-search:focus-within {border-color:#0f5c43;box-shadow:0 0 0 4px rgba(15,92,67,.14),0 8px 24px rgba(40,30,10,.10)}
.lib-search span {font-size:24px;color:#6f6a5e;line-height:1}
.lib-search input {flex:1;min-width:0;height:100%;border:0;outline:0;background:transparent;font:inherit;font-size:16px;color:#2a2720}
.lib-hot {display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px;margin-top:14px;font-size:12.5px;color:#6f6a5e}
.lib-hot:empty {display:none}
.lib-hot button {padding:5px 12px;border-radius:999px;background:rgba(255,255,255,.85);border:1px solid #e3dccb;color:#0b4834;font-size:12.5px;font-weight:700}
.lib-hot button:hover {border-color:#0f5c43}
.lib-hero .lib-member {justify-content:center;margin-top:18px}

/* ---------- 热点日历 ---------- */
.lib-cal {display:flex;align-items:stretch;gap:14px;margin-bottom:26px}
.lib-cal:empty {display:none}
.lcal-title {flex:none;display:flex;flex-direction:column;justify-content:center;gap:4px;width:118px;padding:0 4px}
.lcal-title b {font-size:21px;font-weight:900;color:#1d1b16;letter-spacing:.02em}
.lcal-title small {font-size:12px;color:#6f6a5e;line-height:1.5}
.lcal-list {flex:1;min-width:0;display:flex;gap:12px;overflow-x:auto;padding:4px 2px 8px;scroll-snap-type:x proximity;scrollbar-width:thin}
.lcal-item {flex:0 0 168px;scroll-snap-align:start;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto auto auto;gap:2px 8px;padding:13px 14px 12px;border-radius:16px;background:#fff;border:1px solid #e6e0d8;text-align:left;box-shadow:0 5px 14px rgba(40,30,10,.05);transition:transform .2s,box-shadow .2s,border-color .2s}
.lcal-item:hover {transform:translateY(-2px);border-color:#b9d6c9;box-shadow:0 10px 22px rgba(40,30,10,.11)}
.lcal-item.today {border-color:#f3a59c;background:linear-gradient(160deg,#fff 40%,#fff1ee)}
.lcal-name {font-size:16px;font-weight:900;color:#2a2720;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lcal-name::before {content:"";display:inline-block;width:3px;height:14px;margin-right:7px;border-radius:2px;background:#f16c61;vertical-align:-1px}
.lcal-date {grid-column:1;font-size:12px;color:#8a93a8}
.lcal-left {grid-column:2;grid-row:1/3;align-self:center;font-size:12px;color:#8a93a8;white-space:nowrap}
.lcal-left b {font-size:24px;font-weight:900;color:#1ea37a;margin-right:1px;font-family:Arial,sans-serif}
.lcal-item.today .lcal-left {font-size:18px;font-weight:900;color:#e9564b}
.lcal-item small {grid-column:1/-1;margin-top:6px;padding-top:7px;border-top:1px dashed #e8e3dc;font-size:11.5px;font-weight:700;color:#0b4834}

/* ---------- 按类别浏览 ---------- */
.lib-section {margin-bottom:24px}
.lib-section h2 {font-size:20px;color:#1d1b16;margin-bottom:12px}
.lib-kinds {display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:14px}
.lib-kind {display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:10px 10px 14px;border-radius:18px;background:#fff;border:1px solid #e6e0d8;text-align:left;box-shadow:0 5px 16px rgba(40,30,10,.06);transition:transform .2s,box-shadow .2s}
.lib-kind:not(.soon):hover {transform:translateY(-3px);box-shadow:0 12px 26px rgba(40,30,10,.12)}
.lib-kind.on {border-color:#0f5c43;box-shadow:0 0 0 2px #0f5c43}
.lib-kind-img {display:grid;place-items:center;width:100%;aspect-ratio:16/9;margin-bottom:6px;border-radius:12px;overflow:hidden;background:linear-gradient(145deg,#edf3ee,#fff4ea)}
.lib-kind-img img {width:100%;height:100%;object-fit:cover}
.lib-kind-img i {font-style:normal;font-size:30px;color:#9a9486}
.lib-kind b {padding:0 4px;font-size:15px;color:#2a2720}
.lib-kind small {padding:0 4px;font-size:12px;color:#6f6a5e}
.lib-kind.soon {opacity:.7;cursor:default}
.lib-type {display:inline-block;margin-right:6px;padding:1px 7px;border-radius:6px;background:#edf3ee;color:#0f5c43;font-size:11px;font-weight:800}

/* ---------- 吸顶筛选条 ---------- */
.lib-bar {position:sticky;top:74px;z-index:30;display:flex;flex-direction:column;gap:10px;margin:0 -10px 16px;padding:12px 14px;border-radius:18px;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border:1px solid #e3dccb;box-shadow:0 8px 24px rgba(15,92,67,.08)}
.lib-bar-row {display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.lib-tabs {display:flex;gap:4px;padding:4px;border-radius:12px;background:#edf3ee}
.lib-tabs button {padding:7px 15px;border-radius:9px;background:none;color:#6f6a5e;font-size:14px;font-weight:800;white-space:nowrap}
.lib-tabs button small {font-size:11px;font-weight:700;opacity:.65}
.lib-tabs button.on {background:#fff;color:#1d1b16;box-shadow:0 2px 8px rgba(29,28,49,.08)}
.lib-tabs button:not(.on):hover {color:#1d1b16}
.lib-tools {display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;align-items:center}
.lib-tools select {height:36px;padding:0 12px;border:1px solid #e3dccb;border-radius:999px;background:#fff;font:inherit;font-size:13px;color:#2a2720;outline:0;cursor:pointer}
.lib-tools select:focus {border-color:#0f5c43;box-shadow:0 0 0 4px rgba(15,92,67,.12)}
.lib-mini-search {display:flex;align-items:center;gap:6px;height:36px;width:190px;padding:0 12px;border:1px solid #e3dccb;border-radius:999px;background:#fff;cursor:text}
.lib-mini-search:focus-within {border-color:#0f5c43;box-shadow:0 0 0 4px rgba(15,92,67,.12)}
.lib-mini-search span {color:#6f6a5e;font-size:17px;line-height:1}
.lib-mini-search input {flex:1;min-width:0;height:100%;border:0;outline:0;background:transparent;font:inherit;font-size:13px;color:#2a2720}
.lib-filters {display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding:1px}
.lib-filters::-webkit-scrollbar {display:none}
.lib-filters button {flex:none;padding:6px 13px;border-radius:99px;border:1px solid #e3dccb;background:#fff;color:#6f6a5e;font-size:12.5px;font-weight:800;white-space:nowrap}
.lib-filters button:hover {border-color:#0f5c43;color:#0f5c43}
.lib-filters button.on {background:#0f5c43;border-color:#0f5c43;color:#fff}
.lib-filters small {opacity:.7;font-weight:700}
.lib-filters[hidden] {display:none}
.lib-filters [data-lib-group] {background:#fff7ef;border-color:#f5d7bd;color:#b5582a}
.lib-filters [data-lib-group].on {background:#e8743b;border-color:#e8743b;color:#fff}
.lib-sep {flex:none;width:1px;margin:4px 4px;background:#e3dccb}
.lib-lang {display:flex;gap:2px;padding:3px;border-radius:999px;background:#edf3ee}
.lib-lang:empty {display:none}
.lib-lang button {height:30px;padding:0 12px;border-radius:999px;background:none;color:#6f6a5e;font-size:13px;font-weight:800}
.lib-lang button.on {background:#fff;color:#1d1b16;box-shadow:0 2px 8px rgba(29,28,49,.1)}
.lc-en {display:inline-block;margin-right:5px;padding:0 5px;border-radius:5px;background:#ffcb45;color:#4a3300;font-size:10.5px;font-weight:900;letter-spacing:.03em}
.lc-info h3 small {font-size:12px;font-weight:600;color:#9a9486}
.lh-head h2 small {font-size:14px;font-weight:800;color:#e8743b;margin-left:4px}
.btn.lv-pair {background:#fff7ef;border:1px solid #f5d7bd;color:#b5582a}
.lib-head {display:flex;align-items:baseline;gap:12px;margin:4px 2px 14px}
.lib-head h2 {font-size:22px;font-weight:900;color:#1d1b16}
.lib-head p {font-size:13px;color:#6f6a5e}
.lib-head[hidden] {display:none}

/* ---------- 首页分区 ---------- */
.lh-sec {margin-bottom:34px}
.lh-head {display:flex;align-items:center;gap:16px;margin-bottom:14px;flex-wrap:wrap}
.lh-head h2 {position:relative;font-size:24px;font-weight:900;color:#1d1b16;padding-left:14px}
.lh-head h2::before {content:"";position:absolute;left:0;top:5px;bottom:5px;width:5px;border-radius:3px;background:linear-gradient(#f16c61,#ffb46b)}
.lh-tabs {display:flex;gap:6px;flex-wrap:wrap;flex:1}
.lh-tabs button {padding:6px 14px;border-radius:999px;background:rgba(255,255,255,.7);color:#6f6a5e;font-size:13px;font-weight:700}
.lh-tabs button.on {background:#fff1e9;color:#d4532b;font-weight:800}
.lh-tabs button:not(.on):hover {color:#0f5c43}
.lh-more {margin-left:auto;padding:6px 4px;background:none;color:#0f5c43;font-size:13px;font-weight:800;white-space:nowrap}
.lh-more:hover {text-decoration:underline}

/* ---------- 素材卡片 ---------- */
/* 列数固定为偶数（6 / 4 / 2），横版卡占两列时每行都能排满；断点和 app.js 的 libCols() 保持一致。 */
.lc-grid {display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-auto-flow:row dense;gap:18px}
@media (max-width:1239px) {.lc-grid {grid-template-columns:repeat(4,minmax(0,1fr))}}
@media (max-width:759px) {.lc-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}
.lc {display:flex;flex-direction:column;min-width:0;border-radius:18px;background:#fff;border:1px solid #e9e4dd;box-shadow:0 6px 18px rgba(40,30,10,.06);transition:transform .25s,box-shadow .25s}
.lc.wide {grid-column:span 2}
.lc:hover {transform:translateY(-4px);box-shadow:0 18px 38px rgba(40,30,10,.15)}
.lc-media {position:relative;flex:1 0 auto;aspect-ratio:3/4;margin:8px 8px 0;border-radius:12px;overflow:hidden;background:linear-gradient(160deg,#f7f3ea,#f7f3ee)}
.lc.wide .lc-media {aspect-ratio:3/2}
.lc-open {position:absolute;inset:0;display:block;padding:0;background:none;cursor:zoom-in}
.lc-open img {position:absolute;inset:12px;margin:auto;max-width:calc(100% - 24px);max-height:calc(100% - 24px);width:auto;height:auto;border-radius:4px;background:#fff;box-shadow:0 6px 16px rgba(40,30,10,.14);transition:transform .45s cubic-bezier(.2,.7,.2,1)}
.lc:hover .lc-open img {transform:scale(1.035)}
.lc-badge {position:absolute;left:8px;top:8px;padding:3px 9px;border-radius:999px;background:rgba(40,30,10,.62);color:#fff;font-size:11px;font-weight:800;pointer-events:none;backdrop-filter:blur(4px)}
.lc.unlocked .lc-badge {background:rgba(40,30,10,.9)}
.lc-fav {position:absolute;right:8px;top:8px;display:grid;place-items:center;width:34px;height:34px;padding:0;border-radius:50%;background:rgba(255,255,255,.94);box-shadow:0 4px 12px rgba(40,30,10,.16);opacity:0;transform:scale(.85);transition:opacity .2s,transform .2s,background .2s}
.lc-fav svg {width:18px;height:18px;fill:none;stroke:#7a849a;stroke-width:1.8;stroke-linejoin:round;transition:fill .2s,stroke .2s}
.lc-fav:hover svg {stroke:#f0a316}
.lc.faved .lc-fav {opacity:1;transform:none}
.lc.faved .lc-fav svg {fill:#ffbe2e;stroke:#f0a316}
.lc.faved .lc-fav {animation:lc-pop .35s ease}
@keyframes lc-pop {50% {transform:scale(1.18)}}
.lc-hover {position:absolute;left:0;right:0;bottom:0;display:flex;justify-content:center;padding:44px 14px 14px;background:linear-gradient(to top,rgba(40,30,10,.55),rgba(40,30,10,0));opacity:0;pointer-events:none;transition:opacity .25s}
.lc-dl {display:inline-flex;align-items:center;justify-content:center;gap:6px;width:min(100%,210px);height:40px;padding:0 16px;border-radius:999px;background:linear-gradient(90deg,#ff9b52,#f4645c);color:#fff;font-size:14px;font-weight:900;box-shadow:0 8px 20px rgba(226,88,64,.35);transform:translateY(14px);transition:transform .3s cubic-bezier(.2,.8,.2,1),filter .2s;pointer-events:auto}
.lc-dl small {padding:1px 7px;border-radius:999px;background:rgba(255,255,255,.22);font-size:11px;font-weight:800}
.lc-dl:hover {filter:brightness(1.06)}
.lc-dl:disabled {opacity:.7;cursor:progress}
.lc:hover .lc-fav,.lc:focus-within .lc-fav {opacity:1;transform:none}
.lc:hover .lc-hover,.lc:focus-within .lc-hover {opacity:1}
.lc:hover .lc-dl,.lc:focus-within .lc-dl {transform:none}
.lc-info {padding:10px 12px 12px}
.lc-info h3 {font-size:15px;font-weight:800;color:#2a2720;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lc-info p {display:flex;align-items:center;margin-top:4px;font-size:12px;color:#6f6a5e;white-space:nowrap;overflow:hidden}
.lc-info em {margin-left:auto;padding-left:8px;font-style:normal;color:#9a9486}
/* 手机、平板没有“悬停”：星标常显，下载按钮收起（点卡片进大图再下载）。 */
@media (hover:none) {
  .lc-fav {opacity:1;transform:none;width:30px;height:30px}
  .lc-hover {display:none}
  .lc:hover {transform:none}
}

.lib-more {display:flex;justify-content:center;margin:26px 0 8px}
.lib-more .btn {min-width:220px;background:#fff;border:1px solid #e3dccb;color:#0f5c43}
.lib-end {margin:26px 0 8px;text-align:center;font-size:12.5px;color:#9a9486}
.works-empty .btn {margin-top:14px}

/* ---------- 大图查看 ---------- */
.lv-card {width:min(1120px,100%);display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:24px;align-items:start;padding:24px;max-height:94vh;overflow:auto}
.lv-image {position:relative;display:grid;place-items:center;background:#f5f1ed;border-radius:16px;overflow:hidden;aspect-ratio:3/2;max-height:68vh}
.lv-image img {max-width:100%;max-height:68vh;object-fit:contain;display:block}
.lv-nav {position:absolute;top:50%;transform:translateY(-50%);width:44px;height:44px;border-radius:50%;background:rgba(255,255,255,.92);color:#0f3d2e;font-size:28px;line-height:1;box-shadow:0 6px 18px rgba(40,30,10,.18)}
.lv-nav:hover {background:#fff;color:#0f5c43}
.lv-nav.prev {left:12px}.lv-nav.next {right:12px}
.lv-counter {position:absolute;right:12px;bottom:12px;padding:3px 10px;border-radius:999px;background:rgba(40,30,10,.72);color:#fff;font-size:12px;font-weight:700}
.lv-counter:empty {display:none}
.lv-thumbs {display:flex;gap:8px;margin-top:10px;overflow-x:auto;padding-bottom:2px}
.lv-thumbs:empty {display:none}
.lv-thumbs button {flex:none;width:88px;aspect-ratio:3/2;padding:0;border-radius:10px;overflow:hidden;background:#f5f1ed;border:2px solid transparent;opacity:.65;transition:opacity .2s,border-color .2s}
.lv-thumbs button.on,.lv-thumbs button:hover {opacity:1;border-color:#0f5c43}
.lv-thumbs img {width:100%;height:100%;object-fit:contain;display:block}
.lv-info {padding-top:26px}
.lv-info h2 {font-size:22px}
.lv-info p {margin-top:6px;font-size:13px;color:#777989}
.lv-info .btn.wide {margin-top:10px}
.lv-info .btn.wide:first-child {margin-top:18px}
.lv-info .btn:disabled {opacity:.6;cursor:progress}
.lv-info .lv-note {font-size:11.5px;color:#8a8c9b;line-height:1.6}
.btn.lv-fav {display:flex;align-items:center;justify-content:center;gap:6px;background:#fff;border:1px solid #e3dccb;color:#6f6a5e}
.btn.lv-fav svg {width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round}
.btn.lv-fav.on {background:#fff8e6;border-color:#f6d98c;color:#b77a00}
.btn.lv-fav.on svg {fill:#ffbe2e;stroke:#f0a316}
.lv-related:empty {display:none}
.lv-related {margin-top:20px;padding-top:16px;border-top:1px solid #eee9e3}
.lv-related h3 {font-size:14px;color:#2a2720;margin-bottom:10px}
.lv-related-grid {display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.lv-related-grid button {display:flex;flex-direction:column;gap:4px;padding:0;background:none;text-align:left;min-width:0}
.lv-related-grid span {display:block;width:100%;aspect-ratio:1;border-radius:10px;overflow:hidden;background:#f7f3ea;border:1px solid #ece8e2;transition:border-color .2s}
.lv-related-grid img {width:100%;height:100%;object-fit:contain;display:block}
.lv-related-grid b {font-size:11.5px;font-weight:700;color:#6f6a5e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lv-related-grid button:hover span {border-color:#0f5c43}

.member-plans {display:grid;gap:10px;margin-top:18px}
.member-plan {display:grid;grid-template-columns:1fr auto;gap:2px 12px;padding:14px 16px;border-radius:16px;background:linear-gradient(135deg,#edf3ee,#fff4ea);border:1px solid #e3dccb}
.member-plan b {font-size:15px;color:#0f3d2e}
.member-plan span {grid-row:span 2;align-self:center;font-size:22px;font-weight:900;color:#0f5c43}
.member-plan small {font-size:12px;color:#6d7187}
.member-use {margin-top:14px !important;padding:10px 12px;border-radius:12px;background:#f7f4f0;font-size:12px !important;line-height:1.6;color:#5b5e72 !important}
#memberModal .modal-card {width:min(430px,100%)}
#memberModal .login-hint {color:#8a8c9b}

@media(max-width:900px) {
  .lv-card {grid-template-columns:1fr;max-height:92vh}
  .lv-image,.lv-image img {max-height:52vh}
  .lv-info {padding-top:0}
  .lv-related-grid {grid-template-columns:repeat(6,1fr)}
}
@media(max-width:720px) {
  .lib-hero {margin:14px 14px 18px;padding:30px 16px 22px}
  .lib-cal {flex-direction:column;gap:8px}
  .lcal-title {flex-direction:row;align-items:baseline;gap:10px;width:auto}
  .lcal-title b {font-size:18px}
  .lcal-item {flex-basis:142px;padding:11px 12px}
  .lib-kinds {grid-template-columns:repeat(2,minmax(0,1fr))}
  .lib-bar {position:static;margin:0 -4px 14px;padding:10px;border-radius:14px}
  .lib-tabs {width:100%;overflow-x:auto}
  .lib-tabs button {padding:6px 11px;font-size:13px}
  .lib-tools {width:100%;justify-content:flex-start}
  .lib-mini-search {flex:1 1 100%;width:auto}
  .lib-tools select {flex:1;min-width:0;padding:0 8px;font-size:12px}
  .lh-head {gap:8px}
  .lh-head h2 {font-size:20px}
  .lh-tabs {order:3;flex-basis:100%;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
  .lh-tabs button {flex:none;padding:5px 11px;font-size:12px}
  .lc {border-radius:14px}
  .lc-media {margin:6px 6px 0;border-radius:10px}
  .lc-open img {inset:8px;max-width:calc(100% - 16px);max-height:calc(100% - 16px)}
  .lc-info {padding:8px 9px 10px}
  .lc-info h3 {font-size:13.5px}
  .lc-info p {font-size:11px}
  .lv-nav {width:36px;height:36px;font-size:22px}
  .lv-thumbs button {width:64px}
  .lv-related-grid {grid-template-columns:repeat(3,1fr)}
}
