/*
Theme Name: XzanAero
Version: 2.0.1
Description: XzanAero 独立博客主题，面向内容创作与知识管理。
Author: Xzan
Author URI: https://xzan.net
*/

/* Keep the article title consistent with the body typeface. */
.single-article__title {
    font-family: inherit;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.35;
}

/* Footer shortcut to the published About page. */
.site-footer__name-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 28px;
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer__name-link::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1px;
    background: #e11d2e;
    content: "";
    opacity: 0.7;
    transform: scaleX(0.45);
    transform-origin: left;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.site-footer__name-link:hover,
.site-footer__name-link:focus-visible {
    color: #ffffff;
}

.site-footer__name-link:hover::after,
.site-footer__name-link:focus-visible::after {
    opacity: 1;
    transform: scaleX(1);
}

@media (max-width: 768px) {
    .single-article__title {
        font-size: 27px;
    }
}

/* Daily note: an editorial quote card for the homepage sidebar. */
#block-7 {
    position: relative;
    overflow: hidden;
    padding: 24px 26px 46px;
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    background: var(--bg-card);
}

#block-7 .xzan-daily-note::before {
    content: "“";
    position: absolute;
    top: 11px;
    left: 22px;
    color: #e11d2e;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 68px;
    font-weight: 700;
    line-height: 1;
}

#block-7 .xzan-daily-note::after {
    content: "XZAN / DAILY NOTE";
    position: absolute;
    right: 26px;
    bottom: 18px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
}

#block-7 .xzan-daily-note h3 {
    margin: 0 0 14px;
    padding-left: 38px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
}

#block-7 .xzan-daily-note blockquote {
    margin: 0;
    padding: 6px 0 6px 18px;
    border: 0;
    border-left: 3px solid #e11d2e;
    color: var(--text-primary);
    text-align: center;
}

#block-7 .xzan-daily-note blockquote p {
    margin: 0;
    font-family: Georgia, "Songti SC", STSong, serif;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.65;
}

#block-7 .xzan-daily-note__source {
    display: block;
    margin-top: 9px;
    color: var(--text-tertiary);
    font-size: 11px;
    font-style: normal;
    line-height: 1.4;
    text-align: right;
}

/* Let article titles signal interaction without overriding the global emerald theme. */
.article-item__title a:hover {
    color: #e1251b;
}

/* Keep the light-mode search controls aligned with the global emerald theme. */
html:not([data-theme="dark"]) .aerocore-search.green {
    --site-color: #008b6b;
    --web-color: #008b6b;
}

/* A warm, editorial dark palette with amber as the night-mode accent. */
html[data-theme="dark"] {
    --theme-color: #ffb566;
    --color-link: #ffb566;
    --color-link-hover: #ffd19c;
    --bg-body: #292b3a;
    --bg-card: #303243;
    --bg-hover: #3a3d50;
    --bg-secondary: #34374a;
    --text-primary: #f6f3ed;
    --text-secondary: #cbcbd2;
    --text-tertiary: #9c9eaa;
    --text-muted: #777a89;
    --text-content: #e6e3de;
    --caption-color: #ffb566;
    --border-primary: #46495c;
    --border-secondary: #3b3e50;
    --border-input: #53566a;
    --border-hover: #6a6e83;
    --bg-code-inline: #202231;
    --bg-code-block: #202231;
    --text-code-block: #f3eee7;
    --bg-blockquote: #34374a;
}

/* Keep the article title distinct without changing its typeface. */
html[data-theme="dark"] .single-article .single-article__title {
    color: #b58cff;
    background: linear-gradient(90deg, #a97cff 0%, #bd83f5 56%, #ed7db4 100%);
    background-clip: text;
    font-weight: 700;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

html[data-theme="dark"] .single-article h2 {
    color: #ffb566;
    font-family: inherit;
}

html[data-theme="dark"] .single-article h2::before {
    background: #ffb566;
}

html[data-theme="dark"] .single-article h3 {
    color: #008b6b;
    font-family: inherit;
}

html[data-theme="dark"] .single-article h3::before {
    background: #008b6b;
}

html[data-theme="dark"] .single-article :is(h4, h5, h6) {
    color: #ffffff;
    font-family: inherit;
    font-size: inherit;
}

html[data-theme="dark"] .aerocore-search {
    --site-color: #ffb566;
    --web-color: #d99248;
}

/* Clear day/night symbols that inherit the active palette. */
.theme-toggle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #008b6b;
}

.theme-toggle svg {
    display: none;
}

.theme-toggle::before {
    content: "☾";
    display: block;
    font-family: Arial, sans-serif;
    font-size: 23px;
    font-weight: 400;
    line-height: 1;
    transform: translateY(-1px);
}

html[data-theme="dark"] .theme-toggle {
    color: #ffb566;
}

html[data-theme="dark"] .theme-toggle::before {
    content: "☀";
    font-size: 20px;
    transform: none;
}

.theme-toggle:hover {
    background: color-mix(in srgb, currentColor 14%, transparent);
}

/* Header light-mode rules are more specific than the theme defaults. */
html:not([data-theme="dark"]) .site-header .theme-toggle {
    color: #008b6b !important;
    background: #e3f5ef;
    border: 1px solid #b8e2d4;
    box-shadow: none;
}

html:not([data-theme="dark"]) .site-header .theme-toggle:hover {
    color: #ffffff !important;
    background: #008b6b;
    border-color: #008b6b;
}

html[data-theme="dark"] .site-header .theme-toggle {
    color: #ffb566 !important;
    background: #3a3540;
    border: 1px solid #5c5260;
    box-shadow: none;
}

html[data-theme="dark"] .site-header .theme-toggle:hover {
    color: #292b3a !important;
    background: #ffb566;
    border-color: #ffb566;
}

/* Author-card controls are rendered at their final destination. */
.author-widget__theme-toggle,
.author-widget__user-menu-trigger {
    cursor: pointer;
}

.author-widget__theme-toggle:focus-visible,
.author-widget__user-menu-trigger:focus-visible {
    outline: 2px solid var(--color-link-hover, #ffb566);
    outline-offset: 3px;
}

.author-widget__theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    box-shadow: none;
}

.author-widget__theme-toggle::before {
    content: none;
}

html[data-theme="dark"] .author-widget__theme-toggle::before {
    content: none;
}

.author-widget__theme-toggle:hover {
    background: transparent;
    opacity: 0.82;
}

.author-widget__user-menu-trigger {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
}

.xzan-author-user-menu {
    position: relative;
}

.xzan-author-user-menu .author-widget__avatar-wrap {
    flex-shrink: 0;
}

.xzan-author-user-menu .user-dropdown {
    top: calc(100% + 8px);
    right: auto;
    left: 0;
    z-index: 1000;
}

.xzan-author-user-menu.is-open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.author-widget__bio {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* Keep code copying discoverable on desktop and touch devices. */
.single-article__content pre:has(> code) .code-copy-btn {
    top: 12px;
    right: 12px;
    width: auto;
    min-width: 68px;
    height: 34px;
    gap: 7px;
    padding: 0 11px;
    border: 1px solid var(--border-hover);
    border-radius: 6px;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    color: var(--text-secondary);
    opacity: 1;
}

.single-article__content pre:has(> code) .code-copy-btn::after {
    content: "复制";
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.single-article__content pre:has(> code) .code-copy-btn:hover,
.single-article__content pre:has(> code) .code-copy-btn:focus-visible {
    border-color: var(--theme-color);
    background: var(--bg-hover);
    color: var(--theme-color);
    opacity: 1;
    outline: none;
}

.single-article__content pre:has(> code) .code-copy-btn:focus-visible {
    outline: 2px solid var(--theme-color);
    outline-offset: 2px;
}

.single-article__content pre:has(> code) .code-copy-btn--copied {
    border-color: var(--color-success);
    color: var(--color-success);
}

.single-article__content pre:has(> code) .code-copy-btn--copied::after {
    content: "已复制";
}

.single-article__content pre:has(> code) > code {
    padding-top: 58px;
}

@media (max-width: 768px) {
    .single-article__content pre:has(> code) .code-copy-btn {
        min-width: 64px;
        height: 32px;
        padding: 0 9px;
    }

    .single-article__content pre:has(> code) > code {
        padding-top: 54px;
    }
}

.post-new__feedback {
    display: none;
    margin: 0 0 16px;
    padding: 10px 14px;
    border: 1px solid rgba(22, 163, 74, 0.22);
    border-radius: var(--border-radius-sm, 8px);
    background: rgba(22, 163, 74, 0.08);
    color: #15803d;
    font-size: 13px;
}

.post-new__feedback.is-visible {
    display: block;
}

.post-new__feedback.is-error {
    border-color: rgba(220, 38, 38, 0.22);
    background: rgba(220, 38, 38, 0.07);
    color: #b91c1c;
}
