/* 主题变量与护眼模式 · 与 style.css 配合 */
:root {
    --bg-card: #ffffff;
    --bg-body: #f9fafb;
    --bg-page: #f1f5f9;
    --card: #ffffff;
    --card-border: rgba(148, 163, 184, 0.35);
    --theme-color: #4f46e5;
    --text-color: #333333;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --radius-card: 16px;
}

html.dark,
.dark-mode {
    --bg-card: #f6f1e3;
    --bg-body: #efe7d3;
    --bg-page: #e8dfc8;
    --card: #f6f1e3;
    --card-border: rgba(140, 122, 86, 0.24);
    --theme-color: #7a8d55;
    --text-color: #3f3422;
    --text-main: #332918;
    --text-muted: #6f624a;
    --border-color: rgba(140, 122, 86, 0.32);
    --shadow: 0 8px 24px rgba(101, 84, 48, 0.16);
}

body {
    background: var(--bg-page) !important;
}

/* 文章详情与评论卡片（含内页 .cardpro-inner） */
.article-container,
.comments-wrapper,
.article-container.cardpro-inner,
.comments-wrapper.cardpro-inner {
    transition: box-shadow 0.3s ease;
}

.article-container:not(.cardpro-inner),
.comments-wrapper:not(.cardpro-inner) {
    box-shadow: var(--shadow);
}

.article-container.cardpro-inner:hover,
.comments-wrapper.cardpro-inner:hover {
    box-shadow: 0 10px 36px rgba(15, 23, 42, 0.08);
}

html.dark .article-container.cardpro-inner:hover,
html.dark .comments-wrapper.cardpro-inner:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

html.dark .sidebar-nav-link {
    color: var(--text-main, #edf7f0);
}

html.dark .sidebar-nav-link:hover {
    background: rgba(122, 141, 85, 0.16);
    color: #2e2619;
}

html.dark .sidebar-nav-link.active {
    background: rgb(232 223 200);
    color: #2e2619;
}

html.dark .theme-btn.active {
    background: rgba(122, 141, 85, 0.22);
    color: #3b3121;
}

/* 评论区表单 */
#commentform input[type="text"],
#commentform textarea {
    background: var(--bg-card);
    color: var(--text-color);
    border: 1px solid var(--border-color) !important;
}

#commentform input[type="text"]:focus,
#commentform textarea:focus {
    outline: none;
    border-color: var(--theme-color) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* 小工具列表（若模板其它处使用） */
.widget-card ul {
    list-style: none;
    padding-left: 0;
}

.widget-card ul li a {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.widget-card ul li a:hover {
    color: var(--theme-color);
}

html.dark .widget-card--native .native-widget-block {
    background: rgba(122, 141, 85, 0.11);
    border-color: rgba(140, 122, 86, 0.34);
}

html.dark .widget-card--native .native-widget-block:hover {
    border-color: rgba(122, 141, 85, 0.5);
    box-shadow: 0 10px 24px rgba(101, 84, 48, 0.2);
}

html.dark .native-widget-content a {
    color: var(--text-main, #3f3422);
    border-bottom-color: rgba(122, 141, 85, 0.45);
}

html.dark .native-widget-content a:hover {
    color: #6f7f49;
    border-bottom-color: #6f7f49;
}

html.dark .widget-profile-fallback .widget-profile-name {
    background: linear-gradient(90deg, #8f9f6a 0%, #b08a5a 52%, #7a8d55 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
}

html.dark .native-widget-block--blogger .native-widget-content > a:first-child,
html.dark .native-widget-block--profile .native-widget-content > a:first-child,
html.dark .native-widget-block--blogger .native-widget-content > b:first-child,
html.dark .native-widget-block--profile .native-widget-content > b:first-child,
html.dark .native-widget-block--blogger .native-widget-content strong:first-child,
html.dark .native-widget-block--profile .native-widget-content strong:first-child {
    color: #7a8d55 !important;
}

@supports (-webkit-background-clip: text) {
    html.dark .native-widget-block--blogger .native-widget-content > a:first-child,
    html.dark .native-widget-block--profile .native-widget-content > a:first-child,
    html.dark .native-widget-block--blogger .native-widget-content > b:first-child,
    html.dark .native-widget-block--profile .native-widget-content > b:first-child,
    html.dark .native-widget-block--blogger .native-widget-content strong:first-child,
    html.dark .native-widget-block--profile .native-widget-content strong:first-child {
        background: linear-gradient(90deg, #8f9f6a 0%, #b08a5a 52%, #7a8d55 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent !important;
    }
}

html.dark .article-copyright-card {
    border-color: rgba(122, 141, 85, 0.4);
    background: linear-gradient(135deg, rgba(122, 141, 85, 0.2) 0%, rgba(176, 138, 90, 0.16) 100%);
    box-shadow: 0 10px 24px rgba(101, 84, 48, 0.2);
}

html.dark .article-share-btn {
    background: rgba(246, 241, 227, 0.76);
    border-color: rgba(122, 141, 85, 0.34);
    color: #6f7f49;
}

/* ===== 高级感美化包 v1（仅视觉增强，不改逻辑） ===== */
:root {
    --ui-elev-1: 0 6px 18px rgba(15, 23, 42, 0.06);
    --ui-elev-2: 0 12px 30px rgba(15, 23, 42, 0.1);
    --ui-elev-soft: 0 4px 14px rgba(79, 70, 229, 0.12);
    --ui-ring: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.long-card,
.featured-card,
.widget-card,
.article-container.cardpro-inner,
.comments-wrapper.cardpro-inner,
.comment-item,
.comment-child {
    border-color: color-mix(in srgb, var(--card-border, rgba(148, 163, 184, 0.35)) 86%, #fff 14%);
    box-shadow: var(--ui-elev-1) !important;
    transition: transform 0.2s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.long-card:hover,
.featured-card:hover,
.widget-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ui-elev-2) !important;
    border-color: color-mix(in srgb, var(--primary) 32%, var(--card-border, #dbe3ef) 68%);
}

.feed-tag {
    border-radius: 999px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset;
}

.feed-tag:hover {
    background: color-mix(in srgb, var(--primary) 8%, var(--card) 92%);
}

.feed-tag.is-active {
    box-shadow: var(--ui-elev-soft);
}

#pagenavi a,
#pagenavi span {
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--card-border, #e5e7eb) 80%, #fff 20%);
}

#pagenavi a:hover {
    box-shadow: var(--ui-elev-soft);
}

.sidebar-nav-link,
.sidebar-social a {
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.sidebar-nav-link:hover,
.sidebar-social a:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.16);
}

.btn-comment-submit {
    border-radius: 12px;
    box-shadow: var(--ui-elev-soft);
}

.btn-comment-reply {
    border-radius: 999px;
}

.btn-comment-submit:focus-visible,
.btn-comment-reply:focus-visible,
.feed-tag:focus-visible,
#pagenavi a:focus-visible,
.sidebar-nav-link:focus-visible,
.sidebar-social a:focus-visible {
    outline: none;
    box-shadow: var(--ui-ring);
}

.widget-card--native .native-widget-block {
    border-radius: 14px;
    background: color-mix(in srgb, var(--card) 92%, #fff 8%);
}

html.dark {
    --ui-elev-1: 0 8px 22px rgba(45, 36, 20, 0.18);
    --ui-elev-2: 0 14px 30px rgba(45, 36, 20, 0.28);
    --ui-elev-soft: 0 6px 16px rgba(122, 141, 85, 0.2);
    --ui-ring: 0 0 0 3px rgba(122, 141, 85, 0.24);
}

@media (prefers-reduced-motion: reduce) {
    .long-card,
    .featured-card,
    .widget-card,
    .sidebar-nav-link,
    .sidebar-social a {
        transition: none !important;
    }
}
