/* ==========================================================================
   dczyw 资源站主题 · 基础样式
   设计基调取自原模板：白色卡片 / 蓝色主色 #007bf5 / 浅灰背景 #f2f5f9 /
   圆角 5px / 1300px 容器。原模板依赖 layui + font-awesome + jQuery，
   这里全部改成原生 CSS 与少量 JS。
   ========================================================================== */

:root {
    --brand: #007bf5;
    --brand-dark: #0068cf;
    --brand-soft: rgba(0, 123, 245, 0.09);
    --bg: #f2f5f9;
    --surface: #ffffff;
    --surface-alt: #fbfcfe;
    --border: #f1f1f1;
    --line: #f6f6f6;
    --text: #333333;
    --text-soft: #666666;
    --muted: #888888;
    --muted-light: #ababab;
    --danger: #ff5722;
    --radius: 5px;
    --radius-lg: 8px;
    --shadow: 0 14px 28px -18px rgba(0, 0, 0, 0.18);
    --container: 1300px;
    --header-h: 70px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; transition: color .25s ease; }
a:hover { color: var(--brand); }
img { max-width: 100%; vertical-align: middle; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0 0 10px; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; }

.container { width: var(--container); max-width: 100%; margin: 0 auto; padding: 0 0; }
.muted { color: var(--muted); }
.soft-dot { color: #dcdcdc; margin: 0 6px; }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    padding: 8px 16px;
    background: var(--brand);
    color: #fff;
    border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- 顶部导航 ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    height: var(--header-h);
    background: var(--surface);
    box-shadow: 0 2px 5px rgba(0, 0, 0, .08);
    transition: height .3s ease, box-shadow .3s ease;
}
.site-header.is-compact { height: 54px; }
.header-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 100%;
}

.logo { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.logo-image { display: block; width: auto; max-width: 240px; max-height: 120px; object-fit: contain; }
.site-header.is-compact .logo-image { max-height: 30px; }
.logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #007bf5, #46a4ff);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 18px -10px rgba(0, 123, 245, .9);
    transition: width .3s ease, height .3s ease, font-size .3s ease;
}
.site-header.is-compact .logo-mark { width: 30px; height: 30px; border-radius: 8px; font-size: 15px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.25; }
.logo-text strong { font-size: 17px; color: var(--text); letter-spacing: .5px; }
.logo-text small { font-size: 11px; color: var(--muted-light); }
.site-header.is-compact .logo-text small { display: none; }

.primary-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 auto;
    overflow: hidden;
}
.primary-nav a {
    display: inline-block;
    padding: 0 14px;
    height: 40px;
    line-height: 40px;
    font-size: 15px;
    color: var(--text-soft);
    border-radius: var(--radius);
    position: relative;
    white-space: nowrap;
}
.primary-nav a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 0;
    height: 3px;
    border-radius: 10px;
    background: var(--brand);
    transform: translateX(-50%);
    transition: width .25s ease;
}
.primary-nav a:hover { color: var(--brand); }
.primary-nav a.is-active { color: var(--brand); }
.primary-nav a.is-active::after { width: 22px; }

.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .25s ease, color .25s ease;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.menu-toggle { display: none; }

/* ---------- 搜索浮层 ---------- */

.search-overlay { position: fixed; inset: 0; z-index: 1000; }
.search-overlay[hidden] { display: none; }
.search-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 32, .55); backdrop-filter: blur(2px); }
.search-panel {
    position: relative;
    width: 640px;
    max-width: calc(100% - 32px);
    margin: 14vh auto 0;
    padding: 26px 26px 20px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .45);
    animation: panel-in .2s ease-out;
}
@keyframes panel-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.search-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 18px; font-weight: 700; }
.search-form { display: flex; gap: 10px; }
.search-form input[type="search"] {
    flex: 1 1 auto;
    height: 46px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-alt);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.search-form input[type="search"]:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 123, 245, .12); }
.search-form button {
    flex: 0 0 96px;
    height: 46px;
    border: 0;
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    font-size: 15px;
    transition: background .2s ease;
}
.search-form button:hover { background: var(--brand-dark); }
.search-tags { margin-top: 18px; font-size: 13px; color: var(--muted); }
.search-tags strong { display: block; margin-bottom: 9px; font-size: 13px; color: var(--text-soft); }
.search-tags a {
    display: inline-block;
    padding: 4px 12px;
    margin: 0 6px 6px 0;
    border-radius: 14px;
    background: #f4f6f9;
    color: var(--text-soft);
}
.search-tags a:hover { background: var(--brand); color: #fff; }

/* ---------- 主区域 ---------- */

.site-main { min-height: 60vh; padding-bottom: 40px; }

/* ---------- 通用面板 ---------- */

.panel {
    background: var(--surface);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}
.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--line);
}
.panel-head.compact { padding: 15px 16px 12px; }
.panel-head h2 { font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.panel-head.compact h2 { font-size: 16px; }
.panel-more { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.panel-more:hover { color: var(--brand); }
.panel-hint { font-size: 12px; color: var(--muted-light); }
.panel-body { padding: 18px 20px 20px; }
.panel-body.tight { padding: 12px; }

/* ---------- 按钮 ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 38px;
    padding: 0 20px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 14px;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: transparent; border-color: #dfe4ea; color: var(--text-soft); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- 空状态 ---------- */

.empty-state { text-align: center; padding: 46px 20px 50px; color: var(--muted); }
.empty-state .empty-mark {
    width: 62px;
    height: 62px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
}
.empty-state h3 { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.empty-state p { max-width: 380px; margin: 0 auto 18px; }
.empty-state .btn { margin-top: 4px; }

/* ---------- 标签云 ---------- */

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
    padding: 5px 12px;
    border-radius: 14px;
    background: #f4f6f9;
    color: var(--text-soft);
    font-size: 13px;
}
.tag-cloud a:hover { background: var(--brand); color: #fff; }

/* ---------- 面包屑 ---------- */

.breadcrumbs {
    padding: 18px 0 12px;
    font-size: 13px;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--brand); }
.crumb-sep { margin: 0 7px; color: #d2d2d2; }

/* ---------- 分页 ---------- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 26px 0 6px;
}
.pagination a, .pagination span {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid #e6ebf1;
    color: var(--text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pagination .is-current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .is-disabled { color: #cfd6de; background: #f7f9fb; }
.pagination .page-ellipsis { border: 0; background: transparent; color: var(--muted-light); }

/* ---------- 分类导航 ---------- */

.cat-nav { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 0; }
.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: 17px;
    background: var(--surface);
    border: 1px solid #e9eef4;
    color: var(--text-soft);
    font-size: 14px;
}
.cat-chip em { font-style: normal; font-size: 12px; color: var(--muted-light); }
.cat-chip:hover { border-color: var(--brand); color: var(--brand); }
.cat-chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat-chip.is-active em { color: rgba(255, 255, 255, .78); }
.cat-subnav { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 0; }
.cat-subnav a {
    padding: 4px 12px;
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-soft);
    font-size: 13px;
}
.cat-subnav a em { font-style: normal; color: var(--muted-light); margin-left: 5px; font-size: 12px; }
.cat-subnav a:hover { color: var(--brand); }

/* ---------- 页脚 ---------- */

.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 26px 0 34px;
    color: var(--muted);
    font-size: 13px;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-copy { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0; }
.footer-links li { position: relative; padding: 0 10px; }
.footer-links li + li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 1px;
    height: 12px;
    margin-top: -6px;
    background: #e2e6ec;
}
.footer-links a:hover { color: var(--brand); }
.footer-brand strong { color: var(--text-soft); }

/* ---------- 回到顶部 ---------- */

.back-to-top {
    position: fixed;
    right: 26px;
    bottom: 30px;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-soft);
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease, color .2s ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { color: var(--brand); }

/* ---------- 正文排版 ---------- */

.prose { font-size: 15px; line-height: 1.85; color: #3b3b3b; word-wrap: break-word; }
.prose p { margin: 0 0 14px; }
.prose h2 { font-size: 22px; font-weight: 700; margin: 30px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 18px; font-weight: 700; margin: 26px 0 12px; color: #2f2f2f; }
.prose h4 { font-size: 16px; font-weight: 700; margin: 22px 0 10px; padding-left: 10px; border-left: 3px solid var(--brand); }
.prose h5, .prose h6 { font-size: 15px; font-weight: 600; margin: 20px 0 10px; }
.prose a { color: var(--brand); }
.prose a:hover { text-decoration: underline; }
.prose img { border-radius: var(--radius); margin: 12px 0; height: auto; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; list-style: revert; }
.prose li { margin-bottom: 6px; line-height: 1.8; }
.prose blockquote {
    margin: 20px 0;
    padding: 16px 20px;
    background: #f8f9fb;
    border-left: 3px solid #c0c6cc;
    color: #555;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
    padding: 2px 6px;
    border-radius: 3px;
    background: #f4f6f9;
    color: #d6336c;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}
.prose pre.code-block {
    margin: 16px 0;
    padding: 14px 16px;
    background: #1f2430;
    border-radius: var(--radius);
    overflow-x: auto;
    line-height: 1.65;
}
.prose pre.code-block code { background: none; color: #e6e9ef; padding: 0; font-size: 13px; }
.prose .table-wrap { overflow-x: auto; margin: 16px 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { padding: 9px 12px; border: 1px solid #eaeef3; text-align: left; }
.prose th { background: #f6f9fc; font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.prose .md-figure { margin: 18px 0; text-align: center; }
.prose .md-figure figcaption { margin-top: 6px; font-size: 13px; color: var(--muted); }
.prose .heading-anchor { margin-left: 6px; font-size: 14px; color: #c8ced6; opacity: 0; }
.prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor { opacity: 1; }

/* ---------- 评论区 ---------- */

.comments { margin-top: 22px; background: var(--surface); border-radius: var(--radius); padding: 22px 22px 26px; }
.comments-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.comments-head h2 { font-size: 19px; font-weight: 800; }
.comments-head h2 span { color: var(--brand); font-size: 15px; margin-left: 4px; }
.comments-head p { margin: 0; font-size: 12px; color: var(--muted-light); }

.comment-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
}
.comment-alert.is-success { background: #eefaf2; color: #1f7a45; }
.comment-alert.is-error { background: #fdeeec; color: #b3352a; }

.comment-form { margin-top: 18px; }
.hp-field { position: absolute; left: -9999px; opacity: 0; }
.reply-state {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 7px 12px;
    background: var(--brand-soft);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--brand-dark);
}
.reply-state[hidden] { display: none; }
.reply-state button { border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: underline; }
.comment-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.comment-fields label, .comment-textarea { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-soft); }
.comment-fields span em, .comment-textarea span em { color: var(--danger); font-style: normal; }
.comment-fields span i { color: var(--muted-light); font-style: normal; font-size: 12px; }
.comment-fields input, .comment-textarea textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e6ebf1;
    border-radius: var(--radius);
    background: var(--surface-alt);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.comment-fields input:focus, .comment-textarea textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 123, 245, .1); }
.comment-textarea { margin-top: 12px; }
.comment-textarea textarea { resize: vertical; min-height: 110px; line-height: 1.7; }
.comment-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.comment-note { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted-light); }

.comment-list-wrap { margin-top: 26px; }
.comment-list-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.comment-list-head h3 { font-size: 15px; font-weight: 700; }
.comment-list-head span { font-size: 12px; color: var(--muted-light); }
.comment-list { margin-top: 6px; }
.comment-list > li:first-child { border-top: 0; }
.comment-item { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment-item.is-reply { grid-template-columns: 32px 1fr; padding-left: 14px; border-left: 2px solid var(--line); }
.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}
.comment-item.is-reply .comment-avatar { width: 32px; height: 32px; font-size: 13px; }
.comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.comment-author { font-weight: 600; color: var(--text); }
.comment-badge { padding: 1px 7px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font-size: 11px; }
.comment-head time { color: var(--muted-light); font-size: 12px; }
.comment-reply-btn { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 0; }
.comment-reply-btn:hover { color: var(--brand); }
.comment-text { margin-top: 6px; font-size: 14px; line-height: 1.75; color: #4a4a4a; word-wrap: break-word; }
.comment-children { margin: 8px 0 0; }
.comment-empty { padding: 30px 0 10px; text-align: center; color: var(--muted-light); font-size: 13px; }
.comment-closed {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--surface-alt);
    color: var(--muted);
    font-size: 13px;
}

/* ---------- 夜间模式 ---------- */

html.night body {
    background: #121417;
    color: #c0c4cc;
}
html.night .site-header,
html.night .site-footer,
html.night .panel,
html.night .comments,
html.night .page-card,
html.night .pagination a,
html.night .pagination span,
html.night .cat-chip,
html.night .cat-subnav a,
html.night .back-to-top {
    background: #1b1e23;
    border-color: #2a2f36;
    color: #c0c4cc;
}
html.night .site-header { box-shadow: 0 2px 5px rgba(0, 0, 0, .5); }
html.night .panel-head,
html.night .comments-head,
html.night .comment-list-head,
html.night .article-meta,
html.night .comment-item,
html.night .prose h2 {
    border-color: #2a2f36;
}
html.night .logo-text strong,
html.night .panel-head h2,
html.night .article-head h1,
html.night .prose,
html.night .prose h2,
html.night .prose h3,
html.night .prose h4,
html.night .comment-author,
html.night .comment-head h3,
html.night .list-heading h1,
html.night .pagination .is-current {
    color: #e6e8eb;
}
html.night .prose { color: #b9bec6; }
html.night .prose code { background: #262b33; color: #ff9ec1; }
html.night .prose blockquote { background: #22262c; color: #a9b0b9; border-left-color: #3a414a; }
html.night .prose th { background: #22262c; }
html.night .prose th, html.night .prose td { border-color: #2a2f36; }
html.night .tag-cloud a,
html.night .search-tags a,
html.night .search-form input[type="search"],
html.night .comment-fields input,
html.night .comment-textarea textarea,
html.night .comment-closed {
    background: #22262c;
    border-color: #2a2f36;
    color: #c0c4cc;
}
html.night .search-tags a:hover,
html.night .tag-cloud a:hover { background: var(--brand); color: #fff; }
html.night .btn-ghost { border-color: #2f353d; color: #b9bec6; }
html.night .empty-state .empty-mark { background: rgba(0, 123, 245, .16); }
html.night .footer-links li + li::before { background: #2a2f36; }
html.night .pagination .is-disabled { background: #1b1e23; color: #4a515a; }
html.night .breadcrumbs, html.night .breadcrumbs a { color: #7f8792; }
html.night .site-footer { border-top-color: #2a2f36; }
html.night .footer-links a, html.night .footer-copy { color: #8b939d; }
html.night .meta-item, html.night .article-meta { color: #8b939d; }
html.night .comment-note, html.night .comment-head time { color: #7f8792; }

/* ---------- 响应式 ---------- */

@media (max-width: 1340px) {
    .container { width: 100%; padding: 0 20px; }
    .list-wrap, .article-wrap, .home-wrap, .page-wrap { padding: 0 20px; }
}

@media (max-width: 1024px) {
    .primary-nav { gap: 0; }
    .primary-nav a { padding: 0 10px; font-size: 14px; }
    .comment-fields { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .site-header { height: 58px; }
    .menu-toggle { display: inline-flex; }
    .primary-nav {
        position: fixed;
        left: 0;
        right: 0;
        top: 58px;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 12px 12px;
        background: var(--surface);
        box-shadow: 0 10px 22px -14px rgba(0, 0, 0, .4);
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
        max-height: 70vh;
        overflow-y: auto;
    }
    .primary-nav.is-open { opacity: 1; visibility: visible; transform: none; }
    .primary-nav a { height: 44px; line-height: 44px; border-radius: var(--radius); font-size: 15px; }
    .primary-nav a.is-active { background: var(--brand-soft); }
    .primary-nav a::after { display: none; }
    html.night .primary-nav { background: #1b1e23; }
    .logo-text small { display: none; }
    .comment-fields { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
    .back-to-top { right: 16px; bottom: 18px; width: 42px; height: 42px; }
}

@media (max-width: 520px) {
    body { font-size: 14px; }
    .container { padding: 0 12px; }
    .list-wrap, .article-wrap, .home-wrap, .page-wrap { padding: 0 12px; }
    .panel-head { padding: 14px 14px 12px; }
    .panel-head h2 { font-size: 17px; }
    .panel-body { padding: 14px; }
    .comments { padding: 16px 14px 20px; }
    .prose { font-size: 15px; }
    .comment-item { grid-template-columns: 32px 1fr; gap: 9px; }
    .comment-avatar { width: 32px; height: 32px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
