*,
*:before,
*:after {
    box-sizing: border-box;
}

/* 全站设计变量：亮色主题的色彩、阴影和主要内容宽度都从这里统一控制。 */
:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --surface-soft: #f1f5f4;
    --text: #20242a;
    --text-soft: #555f6d;
    --muted: #7a8492;
    --line: #dfe5eb;
    --line-soft: rgba(32, 36, 42, .08);
    --brand: #2f7c74;
    --brand-strong: #1f5f59;
    --brand-soft: rgba(47, 124, 116, .11);
    --accent: #845ec2;
    --warn: #bd4b4b;
    --shadow: 0 18px 45px rgba(36, 47, 60, .08);
    --radius: 0;
    --content-width: 800px;
    --article-width: 1080px;
    --wide-width: 1320px;
}

/* 基础排版和元素重置，保留 Typecho/AmazeUI 模板常用元素的默认可用性。 */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(47, 124, 116, .05), rgba(255, 255, 255, 0) 320px),
        var(--bg);
    font-size: 16px;
    line-height: 1.75;
}

#blog {
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--brand);
    text-decoration: none;
    text-underline-offset: .18em;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

a:hover,
a:focus {
    color: var(--brand-strong);
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(47, 124, 116, .26);
    outline-offset: 3px;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    border: 0;
}

hr {
    height: 1px;
    margin: 2rem 0;
    border: 0;
    background: var(--line-soft);
}

button,
input,
textarea {
    font: inherit;
}

input,
textarea {
    width: 100%;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: none;
}

input {
    min-height: 44px;
    padding: .65rem .8rem;
}

textarea {
    min-height: 160px;
    padding: .8rem .9rem;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #9aa3ad;
}

table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-spacing: 0;
    border-collapse: collapse;
}

th,
td {
    padding: .75rem .85rem;
    border: 1px solid var(--line);
}

th {
    background: var(--surface-soft);
}

pre {
    display: block;
    margin: 1.4rem 0;
    padding: 1rem;
    overflow: auto;
    color: #27313d;
    background: #f3f6f8;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

code {
    padding: .12em .32em;
    color: #795329;
    background: rgba(132, 94, 194, .08);
    border-radius: 0;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: .92em;
    white-space: break-spaces;
}

pre code {
    padding: 0;
    color: inherit;
    background: transparent;
    border-radius: 0;
    white-space: inherit;
}

blockquote {
    margin: 1.6rem 0;
    padding: .2rem 0 .2rem 1.2rem;
    color: var(--text-soft);
    border-left: 4px solid var(--brand);
}

::-moz-selection {
    color: #fff;
    background: var(--brand);
}

::selection {
    color: #fff;
    background: var(--brand);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track-piece {
    background: rgba(223, 229, 235, .7);
}

::-webkit-scrollbar-thumb {
    background: #aab3bd;
    border-radius: 0;
}

/* 兼容旧模板的栅格命名，同时把实际宽度收束到新的主题变量。 */
.container,
.container-fluid,
.am-g {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
}

.container,
.container-fluid {
    padding-right: 1.25rem;
    padding-left: 1.25rem;
}

.container {
    max-width: var(--content-width);
}

.am-g-fixed {
    max-width: var(--wide-width);
}

.row {
    margin-right: -1rem;
    margin-left: -1rem;
}

.container:before,
.container:after,
.container-fluid:before,
.container-fluid:after,
.row:before,
.row:after,
.am-g:before,
.am-g:after,
.navbar:before,
.navbar:after,
.navbar-header:before,
.navbar-header:after,
.navbar-collapse:before,
.navbar-collapse:after,
.clearfix:before,
.clearfix:after {
    display: table;
    content: " ";
}

.container:after,
.container-fluid:after,
.row:after,
.am-g:after,
.navbar:after,
.navbar-header:after,
.navbar-collapse:after,
.clearfix:after {
    clear: both;
}

[class*="am-u-"],
.col-lg-8,
.col-md-10 {
    position: relative;
    min-height: 1px;
    padding-right: 1.25rem;
    padding-left: 1.25rem;
}

.am-u-sm-10,
.am-u-sm-12,
.am-u-md-10,
.am-u-md-12,
.am-u-lg-2,
.am-u-lg-3,
.am-u-lg-4,
.am-u-lg-6,
.am-u-lg-8,
.am-u-lg-12,
.col-lg-8,
.col-md-10 {
    width: 100%;
}

.pull-left {
    float: left !important;
}

.pull-right {
    float: right !important;
}

.text-center,
.blog-text-center {
    text-align: center;
}

.list-inline {
    padding-left: 0;
    margin: 0;
    list-style: none;
}

.list-inline > li {
    display: inline-block;
    margin: 0 .35rem .5rem 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.navbar {
    min-height: 64px;
    margin: 0;
    border: 0;
}

/* 导航栏：首屏叠在头图上，滚动后由 JS 增加 is-fixed/is-visible 控制显示状态。 */
.navbar-fixed-top {
    position: fixed;
    right: 0;
    left: 0;
    z-index: 1030;
}

.navbar-custom {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5;
    width: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, .32), rgba(0, 0, 0, 0));
    border: 0;
}

.navbar-custom .container-fluid {
    max-width: var(--wide-width);
    min-height: 64px;
    padding-right: 1.25rem;
    padding-left: 1.25rem;
}

.navbar-header {
    min-height: 64px;
}

.navbar-brand {
    float: left;
    max-width: calc(100% - 112px);
    height: 64px;
    padding: 0;
    overflow: hidden;
    color: #fff;
    font-size: 1.02rem;
    font-weight: 750;
    line-height: 64px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-custom .navbar-brand:hover,
.navbar-custom .navbar-brand:focus {
    color: rgba(255, 255, 255, .82);
    text-decoration: none;
}

.navbar-toggle {
    position: relative;
    float: right;
    width: 42px;
    height: 42px;
    padding: 0;
    margin: 11px 0 0 .4rem;
    cursor: pointer;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 0;
    backdrop-filter: blur(12px);
}

.navbar-toggle .icon-bar {
    display: block;
    width: 17px;
    height: 2px;
    margin-right: auto;
    margin-left: auto;
    background: #fff;
    border-radius: 0;
}

.navbar-toggle .icon-bar + .icon-bar {
    margin-top: 4px;
}

.nav {
    padding-left: 0;
    margin: 0;
    list-style: none;
}

.nav > li > a {
    display: block;
    padding: .75rem 1rem;
}

.navbar-collapse {
    overflow-x: visible;
    -webkit-overflow-scrolling: touch;
}

.navbar-custom .nav li a {
    color: rgba(255, 255, 255, .88);
    font-size: .92rem;
    font-weight: 650;
    letter-spacing: 0;
}

.navbar-custom .nav li a:hover,
.navbar-custom .nav li a:focus {
    color: #fff;
    text-decoration: none;
}

.navbar-mobile-search {
    float: right;
    width: 42px;
    height: 42px;
    margin-top: 11px;
    color: #fff;
    line-height: 42px;
    text-align: center;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 0;
    backdrop-filter: blur(12px);
}

.navbar-search {
    color: #fff;
}

/* 移动端下拉菜单保持独立浮层，避免撑开顶部头图布局。 */
#huxblog_navbar {
    position: absolute;
    top: 58px;
    right: 1.25rem;
    width: min(220px, calc(100vw - 2.5rem));
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px) scale(.98);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

#huxblog_navbar.in {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#huxblog_navbar .navbar-collapse {
    height: 0;
    padding: .45rem;
    overflow: hidden;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

#huxblog_navbar.in .navbar-collapse {
    height: auto;
}

#huxblog_navbar .nav li a {
    color: var(--text);
    border-radius: 0;
}

#huxblog_navbar .nav li a:hover {
    color: var(--brand-strong);
    background: var(--brand-soft);
}

.intro-header {
    position: relative;
    margin-bottom: 2.7rem;
    overflow: hidden;
    background: var(--header-bg-image) no-repeat center center;
    background-color: #3b474f;
    background-size: cover;
}

/* 头图遮罩只负责保证文字可读，具体图片由 PHP 输出的 CSS 变量注入。 */
.intro-header:before {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(180deg, rgba(18, 24, 31, .46), rgba(18, 24, 31, .18) 42%, rgba(18, 24, 31, .58));
}

.intro-header .container,
.intro-header .row,
.intro-header [class*="col-"] {
    position: relative;
    z-index: 1;
}

.intro-header .container {
    max-width: var(--wide-width);
}

.intro-header .site-heading,
.intro-header .post-heading {
    max-width: 840px;
    padding: 7.5rem 0 4.8rem;
    color: #fff;
}

.intro-header .site-heading {
    margin-right: auto;
    margin-left: auto;
    text-align: center;
}

.intro-header .site-heading h1,
.intro-header .post-heading h1 {
    margin: 0;
    color: #fff;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: 0;
    text-wrap: balance;
}

.intro-header .site-heading h1 {
    font-size: clamp(2.35rem, 8vw, 4.8rem);
}

.intro-header .post-heading h1 {
    font-size: clamp(1.9rem, 6vw, 3.5rem);
}

.intro-header .post-heading {
    max-width: calc(var(--article-width) + 2.5rem);
    margin-right: auto;
    margin-left: auto;
    padding-right: 1.25rem;
    padding-left: 1.25rem;
}

.intro-header .site-heading .subheading,
.intro-header .post-heading .meta {
    display: block;
    margin-top: 1rem;
    color: rgba(255, 255, 255, .82);
    font-size: clamp(1rem, 2.4vw, 1.22rem);
    font-weight: 400;
    line-height: 1.8;
}

/* 文章分类和标签在头图内展示，保持可换行，避免窄屏溢出。 */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: 1rem;
}

.tags h3 {
    flex: 0 0 auto;
    margin: 0 .1rem 0 0;
    color: rgba(255, 255, 255, .84);
    font-size: .9rem;
    line-height: 32px;
}

.tags a {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: .25rem .72rem;
    color: rgba(255, 255, 255, .9);
    line-height: 1.2;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 0;
}

.tags a:hover,
.tags a:active {
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, .22);
}

/* 首页/分类列表使用同一套双栏容器，宽屏显示侧栏，窄屏自动变单栏。 */
.blog-fixed {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    max-width: var(--content-width);
    padding-right: 1.25rem;
    padding-left: 1.25rem;
}

.blog-fixed:before,
.blog-fixed:after,
#comment-form .am-g:before,
#comment-form .am-g:after {
    display: none;
    content: none;
}

.blog-fixed > [class*="am-u-"] {
    float: none;
    width: 100%;
    padding-right: 0;
    padding-left: 0;
}

.blog-entry-article {
    margin: 0;
    padding: 0;
}

.blog-entry-article + .blog-entry-article {
    margin-top: 1rem;
}

.archive-title {
    margin: 0 0 1.25rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--line-soft);
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.5;
}

.blog-entry-text {
    padding: 1.35rem 0;
    border-bottom: 1px solid var(--line-soft);
}

.post-preview > a {
    display: block;
    color: inherit;
}

.post-preview > a:hover,
.post-preview > a:focus {
    text-decoration: none;
}

.post-index-title {
    margin: .85rem 0 .55rem !important;
    color: var(--text);
    font-size: clamp(1.35rem, 3.4vw, 1.85rem);
    font-weight: 780;
    line-height: 1.36;
    letter-spacing: 0;
    text-wrap: balance;
}

.post-preview > a:hover .post-index-title {
    color: var(--brand-strong);
}

.post-content-preview {
    color: var(--text-soft);
    font-size: 1rem !important;
    font-weight: 400;
    line-height: 1.9;
}

.post-content-preview p {
    margin: 0;
}

.topic-header {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    color: var(--muted);
}

.blog-flex-center {
    display: flex !important;
    align-items: center !important;
}

.blog-flex0 {
    flex: 0 0 auto;
    display: flex;
}

.blog-flex1 {
    flex: 1 1 auto;
}

.link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.avatar {
    display: block;
    position: relative;
}

.avatar-image {
    width: 36px;
    height: 36px;
    overflow: hidden !important;
    object-fit: cover;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 8px 22px rgba(36, 47, 60, .12);
}

.author-lockup {
    min-width: 0;
    padding-left: .65rem;
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.5;
}

.topic-header .author-lockup {
    display: block;
    height: auto;
}

.topic-header .author-lockup a,
.category-name a {
    color: var(--text-soft);
    font-size: .92rem;
    font-weight: 620;
}

.topic-header .author-lockup a:hover,
.category-name a:hover {
    color: var(--brand);
}

.topic-header .author-lockup .in,
.post-views,
.topic-header .time {
    color: var(--muted);
    font-size: .9rem;
}

.topic-header .author-lockup .in {
    margin: 0 .35rem;
}

.topic-header .time {
    flex: 0 0 auto;
    line-height: 1.5;
    white-space: nowrap;
}

.topic-footer {
    display: block;
}

span.time.mobile_time {
    display: none !important;
}

span.time.pc_time {
    display: inline-block !important;
}

/* 文章详情页单独放宽，避免正文在宽屏下过窄。 */
.blog-article-p {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: .2rem 0 0;
}

.post-layout {
    width: 100%;
    max-width: calc(var(--article-width) + 2.5rem);
    margin: 0 auto;
    padding: .2rem 1.25rem 0;
}

.post-layout .blog-article-p {
    max-width: none;
}

.post-layout .article-content {
    width: 100%;
}

.post-pager {
    margin-bottom: 0 !important;
}

.am-article-title {
    margin: 0 0 1.6rem;
    color: var(--text);
    font-size: clamp(1.8rem, 6vw, 2.8rem);
    font-weight: 800;
    line-height: 1.22;
    text-wrap: balance;
}

/* 侧栏模块只在宽屏出现，内容较杂时用 section 做统一边界。 */
.sidebar-container {
    color: var(--text-soft);
    font-size: .95rem;
}

.sidebar-container section {
    margin-bottom: 1.8rem;
    padding: 1.05rem;
    background: rgba(255, 255, 255, .78);
    border: 1px solid rgba(223, 229, 235, .8);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(36, 47, 60, .05);
}

.sidebar-header {
    margin: 0 0 .85rem;
    padding: 0 0 .65rem;
    border-bottom: 1px solid var(--line-soft);
}

.sidebar-header .sidebar-header-title {
    color: var(--text);
    font-size: .98rem;
    font-weight: 760;
}

.sidebar-list ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.sidebar-list .sidebar-list-item {
    margin: 0;
}

.sidebar-list .sidebar-list-item + .sidebar-list-item {
    margin-top: .5rem;
}

.sidebar-list a {
    color: var(--text-soft);
}

.sidebar-list a:hover {
    color: var(--brand);
}

.sidebar-container iframe {
    max-width: 100%;
}

/* 分页、按钮等通用控件沿用直角风格。 */
.am-icon-btn {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    font-size: .75rem;
    font-weight: 760;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 0;
}

.am-icon-btn:hover {
    color: #fff;
    text-decoration: none;
    background: var(--brand);
    border-color: var(--brand);
}

.am-pagination,
.pager,
.page-navigator {
    padding-left: 0;
    list-style: none;
}

.am-pagination {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 2rem 0 3rem;
}

.am-pagination > li {
    display: inline-flex;
}

.am-pagination > li > a,
.am-pagination > li > span,
.pager li > a,
.page-navigator a,
.page-navigator span {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: .55rem .95rem;
    color: var(--text);
    line-height: 1.2;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.am-pagination > li > a:hover,
.pager li > a:hover,
.page-navigator a:hover {
    color: #fff;
    text-decoration: none;
    background: var(--brand);
    border-color: var(--brand);
}

.pager {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 2rem 0 !important;
}

.pager li {
    width: 100%;
}

.pager li.next {
    text-align: right;
}

.pager li.previous {
    text-align: left;
}

.pager li > a {
    width: 100%;
}

.am-btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: .65rem 1rem;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--radius);
}

.am-btn-primary {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.am-btn-primary:hover,
.am-btn-primary:focus {
    color: #fff;
    background: var(--brand-strong);
    border-color: var(--brand-strong);
}

/* 归档页按月份分组，卡片网格在不同宽度下切换列数。 */
.am-table {
    width: 100%;
    max-width: 100%;
    margin-bottom: 1.4rem;
}

.am-table th,
.am-table td {
    padding: .75rem .85rem;
    line-height: 1.6;
    vertical-align: top;
    border-top: 1px solid var(--line);
}

.am-table-bordered {
    border: 1px solid var(--line);
}

.am-table-bordered th,
.am-table-bordered td {
    border: 1px solid var(--line);
}

.am-table-striped > tbody > tr:nth-child(odd) > td,
.am-table-striped > tbody > tr:nth-child(odd) > th {
    background: var(--surface-soft);
}

.archive-page {
    max-width: var(--wide-width);
    padding: 1rem 1.25rem 3rem;
}

.archive-page .categorys-title {
    position: relative;
    margin: 2rem 0 .85rem;
    padding-left: 1rem;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 780;
}

.archive-page .categorys-title:before {
    position: absolute;
    top: .25rem;
    left: 0;
    width: 5px;
    height: 1.2rem;
    background: var(--brand);
    border-radius: 0;
    content: "";
}

.post-lists {
    display: block;
    overflow: hidden;
}

.post-list-item {
    float: left;
    width: 33.3333%;
    padding: .55rem;
}

.post-list-item-container {
    min-height: 126px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(36, 47, 60, .05);
}

.post-list-item-container:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.post-list-item-container .item-label {
    position: relative;
    min-height: 126px;
    padding: 1rem 1rem 2.7rem;
}

.post-list-item-container .item-label .item-title span {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text);
    font-size: 1rem;
    font-weight: 680;
    line-height: 1.5;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.post-list-item-container .item-label .item-meta {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 100%;
    padding: 0 1rem 1rem;
}

.post-list-item-container .item-label .item-meta .item-meta-date {
    color: var(--muted);
    font-size: .84rem;
}

.search-page {
    margin-bottom: 1.6rem;
}

.search-page .search-box {
    position: relative;
    display: block;
    width: 100%;
    margin-top: 1.5rem;
}

.search-page .search-box .input {
    height: 48px;
    padding: 0 3.1rem 0 1rem;
    border-color: var(--line);
    box-shadow: 0 8px 24px rgba(36, 47, 60, .05);
}

.search-page .search-box .spsubmit {
    position: absolute;
    top: 4px;
    right: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--brand);
    cursor: pointer;
    background: transparent;
}

/* 评论区保留 Typecho 原有结构，只重写间距、边框和响应式列。 */
.comment-container,
#comments {
    max-width: calc(var(--article-width) + 2.5rem);
    margin: 0 auto;
    padding: 0 1.25rem;
    color: var(--text-soft);
}

#comments a {
    color: var(--brand);
}

#comments h3,
#response {
    margin: 0 0 1rem;
    color: var(--text);
    font-size: 1.35rem;
}

.respond {
    margin: 2.4rem 0;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(36, 47, 60, .05);
}

.respond .cancel-comment-reply {
    float: right;
    margin-top: .15rem;
    font-size: .9rem;
}

#comment-form label {
    display: block;
    margin: .7rem 0 .35rem;
    color: var(--text);
    font-size: .9rem;
    font-weight: 700;
}

#comment-form .required:after {
    color: var(--warn);
    content: " *";
}

#comment-form .am-g {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: .8rem;
}

#comment-form .am-u-lg-4 {
    grid-column: span 4;
}

#comment-form .am-u-lg-3 {
    grid-column: span 3;
}

#comment-form .am-u-lg-2 {
    grid-column: span 2;
}

.comment-list,
.comment-list ol {
    padding-left: 0;
    margin: 0;
    list-style: none;
}

.comment-parent {
    margin: 1rem 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.comment-child,
.comment-child2 {
    border-top: 1px solid var(--line-soft);
}

.comment-view {
    padding: 1rem;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}

.comment-header .avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
}

.comment-header .comment-author {
    margin: 0;
    color: var(--text);
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.4;
}

.comment-content {
    margin-bottom: .75rem;
    color: var(--text-soft);
}

.comment-content p {
    margin: 0 0 .8rem;
}

.comment-meta {
    color: var(--muted);
    font-size: .84rem;
}

.comment-meta .comment-reply {
    float: right;
}

.comment-parent > .comment-children {
    margin-left: 1rem;
    border-left: 2px solid var(--line-soft);
}

.comment-parent > .comment-children .comment-view {
    padding-left: 1rem;
}

.lists-navigator,
.page-navigator {
    margin: 1.5rem 0;
    text-align: center;
}

.page-navigator li {
    display: inline-flex;
    margin: .2rem;
}

/* 关于页时间线和友链页共用 page-layout，保证展示宽度和页面风格一致。 */
.timeline {
    width: 100%;
    margin: 0;
    padding: 0 0 3rem;
}

.timeline > ul {
    width: 100%;
    padding: 0;
    margin: 0;
}

.timeline > ul > li {
    position: relative;
    min-height: 1rem;
    padding: .15rem 0 1.65rem 1.75rem;
    list-style: none;
}

.timeline > ul > li:before {
    position: absolute;
    top: .45rem;
    bottom: 0;
    left: .32rem;
    width: 1px;
    background: var(--line);
    content: "";
}

.timeline > ul > li i {
    position: absolute;
    top: .42rem;
    left: 0;
    z-index: 1;
    width: .7rem;
    height: .7rem;
    background: var(--surface);
    border: 2px solid var(--brand);
    border-radius: 0;
}

.timeline-content {
    color: var(--text-soft);
}

.timeline-content span {
    display: block;
    margin-bottom: .35rem;
    color: var(--text);
    font-weight: 750;
}

.timeline-content p {
    margin: 0;
}

.link-box-area {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    padding: 1.5rem 0 3rem;
}

.link-box-area p {
    text-indent: 0;
}

.more-title {
    margin: 1rem 0 0 !important;
    text-align: center;
    text-indent: 0 !important;
}

.link-box {
    display: block;
    min-height: 150px;
    padding: 1.1rem;
    overflow: hidden;
    color: inherit;
    text-decoration: none !important;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 5px;
    box-shadow: 0 8px 24px rgba(36, 47, 60, .05);
}

.link-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.link-box .link-name {
    display: -webkit-box;
    margin-bottom: .65rem;
    overflow: hidden;
    color: var(--brand);
    font-size: 1.08rem;
    font-weight: 760;
    line-height: 1.4;
    text-align: left;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.link-box .link-name .link-favicon {
    display: inline-block;
    width: 28px;
    height: 28px;
    margin: -2px .4rem 0 0;
    box-shadow: none;
    vertical-align: middle;
}

.link-box .link-direction {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-soft);
    font-size: .95rem;
    line-height: 1.7;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* 页脚和普通独立页面容器。友链内容卡片保留 5px 小圆角。 */
.blog-footer {
    width: 100%;
    margin-top: 2rem;
    padding: 2.5rem 1.25rem;
    color: rgba(255, 255, 255, .78) !important;
    background: #222831;
}

.blog-footer a,
.blog-footer span {
    color: rgba(255, 255, 255, .86);
}

.blog-text-center {
    font-size: .92rem;
    text-align: center;
}

.page-layout {
    width: 100%;
    max-width: var(--wide-width);
    margin: 0 auto;
    padding: .2rem 1.25rem 3rem;
}

.page-layout pre,
.page-layout blockquote {
    width: 100%;
    border-radius: 5px;
}

.page-layout img {
    border-radius: 5px;
}

.footer-note {
    margin: .25rem 0;
}

/* 回到顶部按钮由 theme.js 控制显隐，点击时立即回到页面顶部。 */
.cd-top {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 20;
    display: inline-block;
    width: 44px;
    height: 44px;
    overflow: hidden;
    text-indent: 100%;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    background: rgba(34, 40, 49, .72) url(../img/backtoTop.svg) no-repeat center 50%;
    background-size: 18px 18px;
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(36, 47, 60, .18);
    backdrop-filter: blur(12px);
    transition: opacity .2s ease, visibility .2s ease, background-color .2s ease, transform .2s ease;
}

.cd-top.cd-top--show,
.cd-top.cd-top--fade-out,
.cd-top:hover {
    visibility: visible;
}

.cd-top.cd-top--show {
    opacity: 1;
}

.cd-top.cd-top--fade-out {
    opacity: .55;
}

.cd-top:hover {
    opacity: 1;
    background-color: var(--brand);
    transform: translateY(-2px);
}

/* 页脚的小幅抖动效果，仅用于 Typecho 标识。 */
.jitter {
    display: inline-block;
    animation: jitters 5s infinite ease-in-out;
}

@keyframes jitters {
    0%, to { transform: translate(0) rotate(0deg); }
    2% { transform: translateY(1.5px) rotate(1.5deg); }
    4% { transform: translateY(-1.5px) rotate(-.5deg); }
    6% { transform: translateY(1.5px) rotate(-1.5deg); }
    8% { transform: translateY(-1.5px) rotate(-1.5deg); }
    10% { transform: translateY(2.5px) rotate(1.5deg); }
    12% { transform: translateY(-.5px) rotate(1.5deg); }
    14% { transform: translateY(-1.5px) rotate(1.5deg); }
    16% { transform: translateY(-.5px) rotate(-1.5deg); }
    18% { transform: translateY(.5px) rotate(-1.5deg); }
    20% { transform: translateY(-1.5px) rotate(2.5deg); }
    30% { transform: translateY(-.5px) rotate(2.5deg); }
    40% { transform: translateY(-.5px) rotate(2.5deg); }
    50% { transform: translateY(.5px) rotate(.5deg); }
    60% { transform: translateY(2.5px) rotate(2.5deg); }
    70% { transform: translateY(1.5px) rotate(.5deg); }
    80% { transform: translateY(1.5px) rotate(1.5deg); }
    90% { transform: translateY(2.5px) rotate(-.5deg); }
    98% { transform: translateY(-1.5px) rotate(-.5deg); }
}

.hljs {
    display: block;
    overflow-x: auto;
    padding: .5em;
    color: #383a42;
    background: #fafafa;
}

/* highlight.js 的亮色代码配色，深色覆盖放在 theme.dark.css。 */
.hljs-comment,
.hljs-quote {
    color: #7d8790;
}

.hljs-doctag,
.hljs-keyword,
.hljs-formula {
    color: #8a3fa0;
}

.hljs-section,
.hljs-name,
.hljs-selector-tag,
.hljs-deletion,
.hljs-subst {
    color: #b84d45;
}

.hljs-literal {
    color: #24799c;
}

.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-attribute,
.hljs-meta-string {
    color: #36784d;
}

.hljs-built_in,
.hljs-class .hljs-title {
    color: #9b6a16;
}

.hljs-attr,
.hljs-variable,
.hljs-template-variable,
.hljs-type,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-number {
    color: #795329;
}

.hljs-symbol,
.hljs-bullet,
.hljs-link,
.hljs-meta,
.hljs-selector-id,
.hljs-title {
    color: #396dc0;
}

.hljs-emphasis {
    font-style: italic;
}

.hljs-strong {
    font-weight: bold;
}

.hljs-link {
    text-decoration: underline;
}

@media (min-width: 768px) {
    /* 桌面导航恢复为横向菜单，并启用滚动后的固定导航状态。 */
    .navbar-header {
        float: left;
    }

    .navbar-toggle,
    .navbar-mobile-search {
        display: none;
    }

    .navbar-brand {
        max-width: none;
    }

    #huxblog_navbar {
        position: static;
        float: right;
        width: auto;
        overflow: visible;
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    #huxblog_navbar .navbar-collapse {
        height: auto !important;
        padding: 0;
        overflow: visible;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        backdrop-filter: none;
    }

    .navbar-nav {
        float: left;
        display: flex;
        align-items: center;
        min-height: 64px;
    }

    .navbar-nav > li {
        float: left;
    }

    .navbar-custom .nav li a {
        padding: .45rem .7rem;
        border-radius: 0;
    }

    #huxblog_navbar .nav li a {
        color: rgba(255, 255, 255, .88);
    }

    .navbar-custom .nav li a:hover,
    .navbar-custom .nav li a:focus {
        color: #fff;
        background: rgba(255, 255, 255, .14);
    }

    .navbar-search {
        display: inline-flex;
        width: 34px;
        height: 34px;
        align-items: center;
        justify-content: center;
        padding: 0 !important;
    }

    .navbar-custom.is-fixed {
        position: fixed;
        top: -66px;
        background: rgba(255, 255, 255, .84);
        border-bottom: 1px solid rgba(223, 229, 235, .78);
        box-shadow: 0 8px 30px rgba(36, 47, 60, .08);
        backdrop-filter: blur(18px);
        transition: transform .25s ease;
    }

    .navbar-custom.is-fixed .navbar-brand,
    .navbar-custom.is-fixed .nav li a,
    .navbar-custom.is-fixed #huxblog_navbar .nav li a {
        color: var(--text);
    }

    .navbar-custom.is-fixed .nav li a:hover,
    .navbar-custom.is-fixed .nav li a:focus {
        color: var(--brand);
        background: var(--brand-soft);
    }

    .navbar-custom.is-fixed.is-visible {
        transform: translate3d(0, 100%, 0);
        background-color: rgba(255, 255, 255, .1);
        backdrop-filter: blur(10px);
    }

    .intro-header .site-heading,
    .intro-header .post-heading {
        padding: 9rem 0 6.2rem;
    }

    .blog-fixed {
        grid-template-columns: minmax(0, 1fr);
        padding-right: 1.5rem;
        padding-left: 1.5rem;
    }

    .comment-input {
        padding-right: .8rem !important;
    }
}

@media (min-width: 1025px) {
    /* 宽屏首页/分类页显示右侧内容栏，文章列表列宽由这里控制。 */
    .blog-with-sidebar {
        max-width: var(--wide-width);
        grid-template-columns: minmax(0, 860px) minmax(280px, 340px);
        align-items: start;
        justify-content: space-between;
    }

    .am-u-lg-8 {
        width: 100%;
    }

    .sidebar-container {
        display: block;
        position: sticky;
        top: 86px;
    }

    .post-list-item {
        width: 33.3333%;
    }
}

@media (min-width: 1600px) {
    /* 超宽屏略微放大整体容器，减少两侧空白。 */
    :root {
        --wide-width: 1480px;
    }

    .blog-with-sidebar {
        grid-template-columns: minmax(0, 980px) minmax(300px, 360px);
    }

    .archive-page {
        max-width: var(--wide-width);
    }
}

@media (max-width: 1024px) {
    /* 平板和手机隐藏侧栏，让文章列表优先占满可用宽度。 */
    .am-u-sm-10.sidebar-container,
    .sidebar-container {
        display: none;
    }

    .post-list-item {
        width: 50%;
    }
}

@media (max-width: 767px) {
    /* 手机端收紧边距和标题头图高度，避免正文产生横向滚动。 */
    body {
        font-size: 15.5px;
        line-height: 1.72;
    }

    .container,
    .container-fluid,
    .blog-fixed,
    .post-layout,
    .comment-container,
    #comments {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .intro-header {
        margin-bottom: 1.5rem;
    }

    .intro-header .site-heading,
    .intro-header .post-heading {
        padding: 6.6rem 0 3.9rem;
    }

    .intro-header .site-heading .subheading,
    .intro-header .post-heading .meta {
        line-height: 1.65;
    }

    .blog-entry-text {
        padding: 1.15rem 0;
    }

    .topic-header {
        align-items: flex-start;
    }

    span.time.pc_time {
        display: none !important;
    }

    span.time.mobile_time {
        display: inline-block !important;
        margin-top: .6rem;
        color: var(--muted);
        font-size: .88rem;
    }

    .author-lockup {
        padding-left: .55rem;
    }

    .post-content-preview {
        line-height: 1.82;
    }

    .pager {
        grid-template-columns: 1fr;
    }

    .post-list-item,
    .link-box-area {
        width: 100%;
    }

    .post-list-item {
        float: none;
        padding: .45rem 0;
    }

    .link-box-area {
        grid-template-columns: 1fr;
    }

    .page-layout {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .respond {
        padding: 1rem;
    }

    #comment-form .am-g {
        grid-template-columns: 1fr;
        gap: 0;
    }

    #comment-form .am-u-lg-4,
    #comment-form .am-u-lg-3,
    #comment-form .am-u-lg-2 {
        grid-column: 1;
    }

    .comment-parent > .comment-children {
        margin-left: .55rem;
    }
}

@media (max-width: 480px) {
    /* 小屏继续压缩导航和标签尺寸。 */
    .navbar-brand {
        max-width: calc(100% - 96px);
        font-size: .96rem;
    }

    .navbar-custom .container-fluid {
        padding-right: .9rem;
        padding-left: .9rem;
    }

    #huxblog_navbar {
        right: .9rem;
        width: min(220px, calc(100vw - 1.8rem));
    }

    .tags {
        gap: .35rem;
    }

    .tags a {
        min-height: 30px;
        padding: .22rem .6rem;
        font-size: .88rem;
    }
}

@media (max-width: 767px) {
    /* 文章页标题容器已经由外层控制边距，这里避免重复内边距。 */
    .intro-header .post-heading {
        padding-right: 0;
        padding-left: 0;
    }
}
