:root{
  --gallery-ink:#182033;
  --gallery-muted:#68748a;
  --gallery-line:#dfe4ec;
  --gallery-surface:#fff;
  --gallery-soft:#f6f8fb;
  --gallery-accent:#1677ff;
}
.gallery-page{width:min(1540px,calc(100% - 48px));margin:0 auto;padding:38px 0 72px}
.gallery-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:28px;margin-bottom:24px}
.gallery-heading-copy{min-width:0}
.gallery-eyebrow{display:block;margin-bottom:8px;color:#4b6fae;font-size:11px;font-weight:800;letter-spacing:.12em}
.gallery-heading h1{margin:0;color:var(--gallery-ink);font-size:34px;line-height:1.2;letter-spacing:0}
.gallery-heading p{margin:8px 0 0;color:var(--gallery-muted);font-size:15px;line-height:1.65}
.gallery-primary-nav,.gallery-ranking-tabs{display:flex;align-items:center;gap:4px;padding:4px;border:1px solid var(--gallery-line);border-radius:8px;background:var(--gallery-surface)}
.gallery-primary-nav a,.gallery-ranking-tabs button{min-height:34px;padding:6px 13px;border:0;border-radius:6px;background:transparent;color:#5d687b;font-size:13px;font-weight:700;cursor:pointer}
.gallery-primary-nav a:hover,.gallery-primary-nav a.is-active,.gallery-ranking-tabs button:hover,.gallery-ranking-tabs button.is-active{background:#edf4ff;color:#0958d9}
.gallery-toolbar{margin-bottom:22px;padding:16px 0;border-top:1px solid var(--gallery-line);border-bottom:1px solid var(--gallery-line)}
.gallery-search{display:flex;align-items:center;gap:9px;max-width:720px;margin-bottom:14px}
.gallery-search>svg{flex:0 0 auto;color:#7b8799}
.gallery-search input{width:100%;min-height:38px;padding:7px 11px;border:1px solid var(--gallery-line);border-radius:6px;background:#fff;outline:0}
.gallery-search input:focus{border-color:#69a7f7;box-shadow:0 0 0 3px rgba(22,119,255,.1)}
.gallery-filter-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.gallery-filter-row label{display:flex;align-items:center;gap:7px;color:#758095;font-size:12px;font-weight:700}
.gallery-filter-row select{min-height:34px;padding:5px 28px 5px 9px;border:1px solid var(--gallery-line);border-radius:6px;background:#fff;color:#263247;outline:0}
.gallery-tags{display:flex;gap:7px;margin-top:14px;overflow:auto;padding-bottom:2px;scrollbar-width:thin}
.gallery-tags button{flex:0 0 auto;min-height:30px;padding:4px 10px;border:1px solid #e2e7ee;border-radius:6px;background:#fff;color:#677489;font-size:12px;cursor:pointer}
.gallery-tags button:hover,.gallery-tags button.is-active{border-color:#91caff;background:#eef6ff;color:#0958d9}
.gallery-masonry{columns:5 230px;column-gap:16px}
.gallery-card{position:relative;display:inline-block;width:100%;margin:0 0 16px;overflow:hidden;border:1px solid var(--gallery-line);border-radius:8px;background:var(--gallery-surface);box-shadow:0 2px 10px rgba(27,39,65,.04);break-inside:avoid}
.gallery-card-media{position:relative;display:block;overflow:hidden;background:#eef1f5}
.gallery-card-media img{width:100%;height:auto;min-height:150px;max-height:520px;object-fit:cover;transition:transform .25s ease}
.gallery-card:hover .gallery-card-media img{transform:scale(1.015)}
.gallery-card-kind{position:absolute;top:9px;left:9px;display:inline-flex;align-items:center;min-height:25px;padding:3px 8px;border-radius:5px;background:rgba(17,24,39,.76);color:#fff;font-size:11px;font-weight:750;backdrop-filter:blur(6px)}
.gallery-rank{position:absolute;top:9px;right:9px;display:grid;place-items:center;min-width:30px;height:30px;padding:0 7px;border-radius:6px;background:#fff;color:#25324a;font-size:12px;font-weight:800;box-shadow:0 3px 14px rgba(17,24,39,.18)}
.gallery-card-body{padding:12px}
.gallery-card-title{display:block;overflow:hidden;color:#202b40;font-size:14px;font-weight:750;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}
.gallery-card-description{display:-webkit-box;overflow:hidden;margin:6px 0 0;color:#7b8699;font-size:12px;line-height:1.55;-webkit-box-orient:vertical;-webkit-line-clamp:2}
.gallery-author{display:flex;align-items:center;gap:9px;min-width:0;margin-top:11px;color:#354157}
.gallery-author>span:last-child{display:grid;min-width:0}
.gallery-author strong,.gallery-author small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gallery-author strong{font-size:12px}
.gallery-author small{margin-top:2px;color:#8993a4;font-size:10px}
.gallery-avatar{display:grid;place-items:center;width:30px;height:30px;flex:0 0 30px;overflow:hidden;border:1px solid #dce3ed;border-radius:50%;background:#eaf2ff;color:#2769c5;font-size:12px;font-weight:800}
.gallery-avatar img{width:100%;height:100%;object-fit:cover}
.gallery-card-tags{display:flex;gap:5px;margin-top:10px;overflow:hidden}
.gallery-card-tags a{flex:0 0 auto;padding:2px 6px;border-radius:4px;background:#f1f4f8;color:#69778d;font-size:10px}
.gallery-card-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:38px;margin-top:10px;padding-top:9px;border-top:1px solid #edf0f4}
.gallery-card-stats{display:flex;gap:10px;color:#7a8698;font-size:11px}
.gallery-card-actions{display:flex;align-items:center;gap:4px}
.gallery-mini-button,.gallery-icon-button{appearance:none;display:grid;place-items:center;padding:0;border:1px solid transparent;background:transparent;color:#6f7b8f;cursor:pointer}
.gallery-mini-button{width:29px;height:29px;border-radius:5px;font-size:15px}
.gallery-mini-button:hover,.gallery-mini-button.is-active{border-color:#dce6f6;background:#f2f7ff;color:#1677ff}
.gallery-mini-button.is-danger:hover{border-color:#ffccc7;background:#fff2f0;color:#cf1322}
.gallery-card-empty{padding:80px 24px;border:1px dashed #ccd5e1;border-radius:8px;color:#778398;text-align:center}
.gallery-state{padding:32px 12px;color:#7a8597;font-size:13px;text-align:center}
.gallery-state.is-error{color:#cf1322}
.gallery-sentinel{height:1px}
.gallery-profile{display:flex;align-items:center;gap:14px;margin:-6px 0 24px;padding:16px;border:1px solid var(--gallery-line);border-radius:8px;background:#fff}
.gallery-avatar-large{width:52px;height:52px;flex-basis:52px;font-size:18px}
.gallery-profile>div:nth-child(2){display:grid;min-width:140px}
.gallery-profile>div:nth-child(2)>strong{color:#202c42;font-size:16px}
.gallery-profile>div:nth-child(2)>span{margin-top:3px;color:#8a94a5;font-size:12px}
.gallery-profile dl{display:flex;gap:26px;margin:0 auto 0 20px}
.gallery-profile dl div{display:grid;gap:2px;text-align:center}
.gallery-profile dt{color:#26334a;font-size:18px;font-weight:800}
.gallery-profile dd{margin:0;color:#8a94a5;font-size:11px}
.gallery-profile-actions{display:flex;gap:8px}
.gallery-ranking-tabs{width:max-content;margin:0 0 20px}
.gallery-detail-nav{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px;color:#627086;font-size:13px}
.gallery-detail-nav a{display:inline-flex;align-items:center;gap:7px}
.gallery-detail{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(300px,.55fr);gap:28px;align-items:start}
.gallery-detail-media{position:relative;display:grid;place-items:center;min-height:540px;overflow:hidden;border:1px solid #dce2e9;border-radius:8px;background:#eef1f5}
.gallery-detail-media>img{width:100%;max-height:82vh;object-fit:contain}
.gallery-original-toggle{position:absolute;right:12px;bottom:12px;min-height:34px;padding:5px 11px;border:1px solid rgba(255,255,255,.5);border-radius:6px;background:rgba(17,24,39,.76);color:#fff;font-size:12px;font-weight:700;cursor:pointer;backdrop-filter:blur(6px)}
.gallery-detail-info{position:sticky;top:88px;padding:4px 0}
.gallery-content-type{color:#4f6f9e;font-size:11px;font-weight:800;letter-spacing:.08em}
.gallery-detail-info h1{overflow-wrap:anywhere;margin:9px 0 0;color:#192338;font-size:26px;line-height:1.35;letter-spacing:0}
.gallery-detail-info header p{margin:10px 0 0;color:#6f7a8c;font-size:14px;line-height:1.7}
.gallery-detail-info .gallery-author{margin-top:22px;padding:14px 0;border-top:1px solid var(--gallery-line);border-bottom:1px solid var(--gallery-line)}
.gallery-detail-tags{display:flex;gap:7px;flex-wrap:wrap;margin-top:15px}
.gallery-detail-tags a{padding:4px 8px;border-radius:5px;background:#f0f4f9;color:#526c92;font-size:11px}
.gallery-detail-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:18px 0}
.gallery-detail-stats div{padding:10px 8px;border:1px solid #e3e7ed;border-radius:6px;background:#fafbfc;text-align:center}
.gallery-detail-stats dt{overflow:hidden;color:#27334a;font-size:15px;font-weight:800;text-overflow:ellipsis;white-space:nowrap}
.gallery-detail-stats dd{margin:3px 0 0;color:#8a94a5;font-size:10px}
.gallery-detail-actions{display:flex;gap:8px;flex-wrap:wrap}
.gallery-published-time{margin:16px 0 0;color:#929baa;font-size:11px}
.gallery-modal[hidden]{display:none}
.gallery-modal{position:fixed;inset:0;z-index:180;display:grid;place-items:center;padding:20px}
.gallery-modal-backdrop{position:absolute;inset:0;border:0;background:rgba(15,23,42,.48);cursor:default;backdrop-filter:blur(3px)}
.gallery-modal-dialog{position:relative;width:min(480px,100%);overflow:hidden;border:1px solid #dce2ea;border-radius:8px;background:#fff;box-shadow:0 24px 70px rgba(15,23,42,.28)}
.gallery-modal-dialog>header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:18px 20px;border-bottom:1px solid #e7ebf0}
.gallery-modal-dialog>header span{color:#758196;font-size:11px;font-weight:750}
.gallery-modal-dialog>header h2{margin:3px 0 0;color:#1d2940;font-size:19px;letter-spacing:0}
.gallery-icon-button{width:34px;height:34px;border-color:#e0e5ec;border-radius:6px;background:#fff}
.gallery-icon-button:hover{border-color:#91caff;color:#1677ff}
.gallery-modal-dialog form{padding:20px}
.gallery-modal-dialog form>footer{display:flex;justify-content:flex-end;gap:8px;margin-top:6px;padding-top:16px;border-top:1px solid #edf0f4}
.gallery-form-message{min-height:20px;margin:0 0 8px;color:#68748a;font-size:12px}
.gallery-form-message.is-error{color:#cf1322}
.gallery-form-message.is-success{color:#389e0d}
body.is-gallery-modal-open{overflow:hidden}
@media (max-width:900px){
  .gallery-page{width:min(100% - 28px,1540px);padding-top:24px}
  .gallery-heading{align-items:flex-start;flex-direction:column}
  .gallery-heading h1{font-size:28px}
  .gallery-primary-nav{width:100%;overflow:auto}
  .gallery-primary-nav a{flex:1;text-align:center;white-space:nowrap}
  .gallery-detail{grid-template-columns:1fr}
  .gallery-detail-media{min-height:320px}
  .gallery-detail-info{position:static}
  .gallery-profile{align-items:flex-start;flex-wrap:wrap}
  .gallery-profile dl{order:4;width:100%;margin:4px 0 0;justify-content:space-around}
  .gallery-profile-actions{margin-left:auto}
}
@media (max-width:560px){
  .gallery-page{width:calc(100% - 22px);padding-bottom:48px}
  .gallery-search{align-items:stretch;flex-wrap:wrap}
  .gallery-search>svg{display:none}
  .gallery-search input{flex:1 1 100%}
  .gallery-filter-row{display:grid;grid-template-columns:1fr}
  .gallery-filter-row label{justify-content:space-between}
  .gallery-filter-row select{flex:1}
  .gallery-masonry{columns:2 145px;column-gap:10px}
  .gallery-card{margin-bottom:10px}
  .gallery-card-body{padding:10px}
  .gallery-card-description,.gallery-card-tags{display:none}
  .gallery-author{margin-top:8px}
  .gallery-card-stats{gap:6px}
  .gallery-mini-button{width:27px;height:27px}
  .gallery-detail-media{min-height:240px}
  .gallery-detail-info h1{font-size:22px}
  .gallery-modal{padding:12px}
  .gallery-profile-actions{width:100%;margin-left:0}
}
@media (prefers-color-scheme:dark){
  :root{
    --gallery-ink:#e6eaf2;
    --gallery-muted:#9ba6b9;
    --gallery-line:#303848;
    --gallery-surface:#171c26;
    --gallery-soft:#111621;
  }
  body{background:#10141c;color:#e5e9f1}
  .topbar{border-color:#2a3240;background:rgba(18,23,32,.9)}
  .gallery-search input,.gallery-filter-row select,.gallery-tags button,.gallery-primary-nav,.gallery-ranking-tabs{border-color:#303848;background:#171c26;color:#dce2ec}
  .gallery-primary-nav a:hover,.gallery-primary-nav a.is-active,.gallery-ranking-tabs button:hover,.gallery-ranking-tabs button.is-active{background:#1f3553;color:#81b4ff}
  .gallery-card{box-shadow:none}
  .gallery-card-media,.gallery-detail-media{background:#0d1118}
  .gallery-card-title,.gallery-author,.gallery-profile>div:nth-child(2)>strong,.gallery-profile dt,.gallery-detail-info h1{color:#e4e9f2}
  .gallery-card-tags a,.gallery-detail-tags a{background:#202938;color:#a9bddc}
  .gallery-card-footer,.gallery-detail-info .gallery-author{border-color:#303848}
  .gallery-profile,.gallery-modal-dialog{border-color:#303848;background:#171c26}
  .gallery-detail-stats div{border-color:#303848;background:#131923}
  .gallery-detail-stats dt{color:#e4e9f2}
  .gallery-modal-dialog>header{border-color:#303848}
  .gallery-modal-dialog>header h2{color:#e4e9f2}
  .gallery-icon-button{border-color:#384254;background:#1b222e;color:#bcc6d5}
  .gallery-modal-dialog .field input,.gallery-modal-dialog .field select,.gallery-modal-dialog .field textarea{border-color:#384254;background:#111722;color:#e4e9f2}
}
