:root {
    --ink: #092f61;
    --muted: #28709c;
    --accent: #155d89;
    --rule: #d5dee6;
    --paper: #eff8ff;
    font: 16px/1.65 "Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
    color: var(--ink);
    background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: default; }
:focus-visible { outline: 3px solid #ce853e; outline-offset: 3px; }
.wrap,.mast-inner { width: min(1440px,94%); margin-inline: auto; }
.mast { background: #092d5f; color: #fff; }
.mast-inner { min-height: 66px; display: flex; align-items: center; gap: 28px; }
.mast a { color: inherit; }
.brand { font-size: 19px; font-weight: 750; display: inline-flex; align-items: center; gap: 9px; }
.brandmark { font-size: 29px; color: #c7d0d8; }
.mast nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; font-size: 16px; }
.login-link { margin-left: auto; font-size: 16px; white-space: nowrap; }
.hero { position: relative; isolation: isolate; overflow: hidden; background: #103b6d; color: white; }
.banner-photo,.landscape { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; object-fit: cover; }
.hero::after { content:""; position:absolute; inset:0; background:linear-gradient(95deg,#093062 8%,#0e396be3 35%,#1c47791a 85%); z-index:-1; }
.landscape { background: radial-gradient(circle at 78% 15%, #e4b379 0 28px,transparent 29px), linear-gradient(155deg,#60a8d4,#adb6be 63%,#dfa980); }
.landscape i,.landscape b,.landscape em { position:absolute; width:100%; left:0; bottom:0; height: 85%; background:#438bb7; clip-path: polygon(0 85%,17% 23%,31% 68%,49% 30%,56% 59%,68% 12%,78% 35%,85% 4%,100% 32%,100% 100%,0 100%); }
.landscape b { height:80%; background:#29719d; transform:scaleX(-1); }
.landscape em { bottom:-34%; background:#224d7f; }
.hero-in { padding-block: clamp(28px,4vw,60px); }
.hero h1 { margin:0 0 12px; font-size:clamp(30px,4vw,54px); line-height:1.2; letter-spacing:.035em; }
.hero p { margin:0 0 18px; color:#e1eaf2; max-width:55ch; }
.search { display:flex; align-items:center; background:white; color:var(--accent); max-width:550px; border-radius:5px; padding:5px; gap:8px; }
.search span { padding-left:8px; font-size:24px; line-height:1; }
.search input { min-width:0; flex:1; border:0; padding:7px 2px; }
.search button,.action { background:var(--accent); color:#fff; border:0; border-radius:4px; padding:8px 20px; font-weight:600; display:inline-block; }
.library { padding-block:28px 36px; }
.section-line { display:flex; align-items:baseline; gap:14px; margin-bottom:16px; }
.section-line h2 { margin:0; font-size:24px; }
.section-line span,.muted,small { color:var(--muted); }
.filters,.pager nav,.jump { display:flex; align-items:center; flex-wrap:wrap; gap:7px; }
.filters { margin-bottom:18px; }
.filters a,.pager nav a,.secondary,.jump button { border:1px solid var(--rule); border-radius:4px; padding:4px 12px; background:white; color:var(--ink); }
.filters .sel,.pager .sel { color:#fff; background:var(--accent); border-color:var(--accent); }
.tiles { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.tile { background:white; border:1px solid var(--rule); border-radius:7px; color:inherit; overflow:hidden; display:flex; flex-direction:column; transition:box-shadow .18s ease; }
.tile:hover { box-shadow:0 3px 16px #0d386a20; }
.cover { height:var(--mobile); background:linear-gradient(150deg,#dfe8f0,#b2bbc3); }
.cover img { width:100%; height:100%; object-fit:cover; display:block; }
.tile-text { padding:10px; min-width:0; }
.tile-text strong { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; line-height:1.45; height:2.9em; font-weight:650; overflow-wrap:anywhere; }
.catalog-home .tile-text strong { font-size:calc(1em - 1px); }
.tile-text small { display:flex; flex-wrap:wrap; align-items:center; gap:5px; font-size:clamp(9px,2.4vw,12px); margin-top:9px; }
.tile-text time { margin-right:auto; }
.pager { display:flex; justify-content:center; align-items:center; gap:14px; flex-wrap:wrap; margin-top:26px; font-size:14px; }
.jump input { width:60px; padding:4px; }
.empty { border:1px dashed #b4bdc5; border-radius:8px; padding:40px 16px; text-align:center; }
.foot { display:flex; gap:18px; border-top:1px solid var(--rule); padding-block:22px; color:var(--muted); font-size:13px; }
.foot a:last-child { margin-left:auto; }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.notice { margin-block:16px; padding:12px; background:#e4edf5; border-radius:6px; }
#resource-dialog { position:fixed; padding:0; border:0; border-radius:10px; color:var(--ink); width:min(880px,96vw); max-height:90dvh; overscroll-behavior:contain; background:white; }
#resource-dialog::backdrop { background:rgba(0, 0, 0, 0.5); }
html:has(#resource-dialog[open]) { overflow:hidden; }
.close::before,.close::after { content:""; position:absolute; top:50%; left:50%; width:14px; height:2px; background:currentColor; transform:translate(-50%,-50%) rotate(45deg); }
.close::after { transform:translate(-50%,-50%) rotate(-45deg); }
.close { padding:0; position:sticky; top:8px; margin:8px 8px -46px auto; display:block; z-index:2; width:38px; height:38px; border-radius:50%; background:white; border:1px solid var(--rule); font-size:23px; }
.standalone { max-width:880px; margin-block:22px; }
.back { display:inline-block; margin-bottom:12px; }
.resource { background:#fff; border-radius:9px; overflow:hidden; }
.detail-title,.download-box,.prose,.thumbs { padding:18px clamp(15px,4vw,30px); }
.detail-title { padding-right:56px; }
.detail-title h2 { font-size:clamp(17px,2vw,22px); line-height:1.35; margin:3px 0; overflow-wrap:anywhere; }
.gallery { background:transparent; text-align:center; }
.main-image { max-width:100%; display:block; height:auto; margin:auto; }
.thumbs { display:flex; overflow:auto; gap:8px; }
.thumbs img { width:68px; height:48px; object-fit:cover; display:block; }
.thumbs a[aria-current=true] { outline:2px solid var(--accent); outline-offset:1px; }
.download-box { background:#eaf3fb; display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.download-box h2,.prose h2 { font-size:18px; margin:0 0 8px; }
.download-box a + a,.download-box form + a { margin-left:6px; }
.download-box p { margin:5px 0 10px; }
.download-box > div { min-width:0; max-width:100%; }
.resource-file-details { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 20px; margin:0 0 12px; font-size:14px; }
.resource-file-details div { display:flex; flex-wrap:wrap; gap:0 6px; }
.resource-file-details dd { margin:0; font-weight:600; overflow-wrap:anywhere; }
.prose { border-top:1px solid var(--rule); }
.prose p { white-space:pre-wrap; overflow-wrap:anywhere; }
.prose textarea { display:block; resize:vertical; min-height:74px; width:100%; padding:10px; border:1px solid #a9b2ba; border-radius:4px; margin:12px 0; }
.comment { margin-top:14px; border-top:1px solid var(--rule); padding-top:12px; }
.comment small { margin-left:10px; }
.comment p { margin-top:4px; }
@media(min-width:768px) {
    .tiles { grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
    .cover { height:var(--tablet); }
    .tile-text { padding:14px; }
}
@media(min-width:1200px) {
    .tiles { grid-template-columns:repeat(5,minmax(0,1fr)); }
    .cover { height:var(--desktop); }
}
@media(max-width:767px) {
    .mast-inner { flex-wrap:nowrap; gap:12px; padding:10px 0; }
    .mast-inner .brand { max-width:min(160px,30%); overflow:hidden; white-space:nowrap; }
    .mast .brand .site-logo { max-width:100%; }
    .mast nav { flex:1 1 0; min-width:0; flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; padding-block:4px; }
    .mast nav a { flex:none; white-space:nowrap; }
    .mast .login-link { flex:none; }
    .tile-text { font-size:14px; padding:8px; }
    .pager nav a:not(.sel):nth-child(n+3):nth-last-child(n+3) { display:none; }
}
@media(prefers-reduced-motion:reduce) { * { transition:none!important; } }


/* Telegram blue surfaces and preview stage */
body { background:#f3f7fb; color:#172f44; }
.mast { background:#153955; }
.hero::after { background:linear-gradient(100deg,#123750ef,#164a7380 60%,#176fa52b); }
.hero-in { padding-block:clamp(28px,5vw,72px); }
.search button,.action { background:#087aad; color:#fff; }
.tile { border-color:#d8e4ef; border-radius:12px; box-shadow:0 2px 8px #19466a09; }
.tile:hover { border-color:#77bddf; box-shadow:0 5px 18px #19466a18; }
.gallery { padding:0; background:transparent; }
.gallery a[data-original] { display:grid; place-items:center; width:100%; height:var(--preview-height); }
.gallery .main-image { width:100%; height:100%; min-height:0; object-fit:contain; object-position:center; }



.download-buttons {
    display: grid;
    gap: 10px;
    width: 176px;
    max-width: 100%;
}
.download-buttons form { min-width: 0; margin: 0; }
.download-buttons button {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    padding: 0 12px;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}
