/* 
 * Ghost 付费墙按钮美化 & 全站暗色模式样式
 * 色彩体系: 炭黑 (Charcoal) + 琥珀金 (Amber)
 * 版本: 13.0 (严格颜色替换版)
 */
 
/* --- 1. [核心] 定义新的暗色模式色彩变量 --- */
html[data-theme="dark"] {
    /* 基础背景色 (由深到浅) */
    --color-bg-deep: #121212;
    --color-bg-base: #121212;
    --color-surface: #181818;
    --color-primary-btn: #242424;
    --color-border: #181818;
    --color-overlay: rgba(36, 47, 52, 1);
    --color-overlay-strong: rgba(255, 255, 255, 0.12);

    /* 文字颜色 (由主到次) */
    --color-text-primary: #f3efeb;
    --color-text-secondary: #f2f2f2;
    --color-text-tertiary: #707070;
    --color-text-inverted: #121212;

    /* 品牌/点缀色 */
    --color-brand-accent: #b48c5a;
    --color-brand-accent-hover: #e7c568;
}


/* --- 2. 容器与通用按钮布局 (保持不变) --- */
.gh-cta-actions {
    display: flex;
    gap: 12px;
}

.gh-cta-actions .gh-primary-btn,
#crypto-subscribe-button-final {
    flex: 1; 
    margin: 0 !important;
    padding: 10px 15px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    text-align: center !important;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
}


/* --- 3. 浅色模式 (Light Mode) (保持不变) --- */
.gh-cta-actions .gh-primary-btn {
    background-color: #ffffff !important;
    color: #333333 !important;
    border-color: #dddddd !important;
}
.gh-cta-actions .gh-primary-btn:hover {
    background-color: #f7f7f7 !important;
    border-color: #bbbbbb !important;
}

#crypto-subscribe-button-final {
    background-color: #555555 !important;
    color: #ffffff !important;
    border-color: #555555 !important;
}
#crypto-subscribe-button-final:hover {
    background-color: #333333 !important;
    border-color: #333333 !important;
}


/* --- 4. 深色模式 (Dark Mode) - [已替换为新色彩体系] --- */

/* 次要按钮 (银行卡): 透明背景 + 边框 */
html[data-theme="dark"] .gh-cta-actions .gh-primary-btn {
    background-color: transparent !important;
    color: var(--color-text-primary) !important;
    border-color: var(--color-border) !important;
}
html[data-theme="dark"] .gh-cta-actions .gh-primary-btn:hover {
    background-color: var(--color-overlay) !important;
    border-color: var(--color-text-secondary) !important;
}

/* 主推按钮 (USDT): 品牌琥珀金色 */
html[data-theme="dark"] #crypto-subscribe-button-final {
    background-color: var(--color-brand-accent) !important;
    color: var(--color-text-inverted) !important;
    border-color: var(--color-brand-accent) !important;
}
html[data-theme="dark"] #crypto-subscribe-button-final:hover {
    background-color: var(--color-brand-accent-hover) !important;
    border-color: var(--color-brand-accent-hover) !important;
}

/* 侧边栏标签统计角标 */
html[data-theme="dark"] .gh-topic-count {
  border: none !important;
  color: var(--color-text-secondary) !important;
  background-color: var(--color-overlay-strong) !important;
}
html[data-theme="dark"] a.gh-topic-item:hover .gh-topic-count {
  color: var(--color-text-inverted) !important;
  background-color: var(--color-brand-accent) !important;
}

/* 页脚链接 */
html[data-theme="dark"] .gh-foot-menu .nav li a {
  color: var(--color-text-tertiary) !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .gh-foot-menu .nav li a:hover {
  color: var(--color-text-secondary) !important;
  opacity: 1 !important;
}

/* 头部Logo */
html[data-theme="dark"] a.gh-head-logo {
  color: var(--color-text-primary) !important;
}
html[data-theme="dark"] a.gh-head-logo:hover,
html[data-theme="dark"] a.gh-head-logo:active {
  color: var(--color-text-secondary) !important;
}

/* 我的账户按钮描边样式 */
html[data-theme="dark"] a.gh-head-link {
  color: var(--color-text-primary) !important;
  border: 1px solid var(--color-border) !important;
}


/* 右上角会员按钮描边样式 */
html[data-theme="dark"] .gh-head-members a.gh-primary-btn {
  color: var(--color-text-primary) !important;
  border: 1px solid var(--color-border) !important;
}
html[data-theme="dark"] .gh-head-members a.gh-primary-btn:hover {
  background-color: var(--color-overlay) !important;
  color: var(--color-text-primary) !important;
  border-color: var(--color-text-secondary) !important;
}

/* --- 全站基础样式 & 暗色模式覆盖 - [已全部替换为新色彩体系] --- */
html[data-theme="dark"] {
  --color-light-gray: #2a2a2a !important; /* <--- 在这里修改为您想要的颜色 */
}
html[data-theme="dark"],
html[data-theme="dark"] body, 
html[data-theme="dark"] .site-wrapper { 
    background-color: var(--color-bg-deep) !important; 
    color: var(--color-text-secondary) !important; 
}
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3, html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6, html[data-theme="dark"] .post-card-title a { color: var(--color-text-primary) !important; }
html[data-theme="dark"] a { color: var(--color-brand-accent) !important; }
html[data-theme="dark"] a:hover { color: var(--color-brand-accent-hover) !important; }
html[data-theme="dark"] blockquote:not([class]) { color: var(--color-text-primary) !important; border-left-color: var(--color-brand-accent) !important; background-color: rgba(212, 175, 55, 0.05); }
html[data-theme="dark"] .post-card, html[data-theme="dark"] .gh-card, html[data-theme="dark"] .gh-card-box, html[data-theme="dark"] .kg-card, html[data-theme="dark"] .post-full-content, html[data-theme="dark"] .site-footer { background-color: var(--color-surface) !important; border-color: var(--color-border) !important; }
html[data-theme="dark"] .gh-head { background-color: var(--color-bg-base) !important; border-color: var(--color-border) !important; }
html[data-theme="dark"] .gh-head-menu a { color: var(--color-text-secondary) !important; }
html[data-theme="dark"] .gh-head-menu a:hover { color: var(--color-text-primary) !important; }
html[data-theme="dark"] .gh-burger::before, html[data-theme="dark"] .gh-burger::after { background-color: var(--color-text-primary) !important; }
html[data-theme="dark"] .gh-subscribe { background-color: var(--color-surface) !important; border-color: var(--color-border) !important; }
html[data-theme="dark"] .gh-subscribe-title, html[data-theme="dark"] .gh-subscribe-description { color: var(--color-text-primary) !important; }
html[data-theme="dark"] .gh-subscribe-description p { color: var(--color-text-secondary) !important; }
html[data-theme="dark"] .gh-subscribe-input { background-color: var(--color-bg-deep) !important; border: 1px solid var(--color-border) !important; color: var(--color-text-primary) !important; }
html[data-theme="dark"] .gh-form-input::placeholder { color: var(--color-text-tertiary) !important; }
html[data-theme="dark"] .gh-head-actions .gh-btn, html[data-theme="dark"] .gh-form-button { color: var(--color-text-inverted) !important; background-color: var(--color-primary-btn) !important; border-color: var(--color-brand-accent) !important; }
html[data-theme="dark"] .gh-head-actions .gh-btn:hover, html[data-theme="dark"] .gh-form-button:hover { background-color: var(--color-brand-accent-hover) !important; border-color: var(--color-brand-accent-hover) !important; }
html[data-theme="dark"] .gh-loadmore { border-color: var(--color-border) !important; color: var(--color-text-primary) !important; background-color: var(--color-surface) !important; }
html[data-theme="dark"] .gh-loadmore:hover { background-color: var(--color-overlay) !important; color: var(--color-text-primary) !important; border-color: var(--color-border) !important; }
html[data-theme="dark"] .gh-content img, html[data-theme="dark"] .post-card-image, html[data-theme="dark"] .kg-image-card img { filter: brightness(.85) contrast(1.1); }
html[data-theme="dark"] .gh-mobile-nav { background-color: var(--color-bg-base) !important; }
html[data-theme="dark"] .gh-mobile-nav .gh-icon-btn svg { color: var(--color-text-primary) !important; }
html[data-theme="dark"] .gh-dropdown { background-color: var(--color-surface) !important; border: 1px solid var(--color-border) !important; box-shadow: 0 7px 20px -5px rgba(0,0,0,.5) !important; }
html[data-theme="dark"] .gh-dropdown a { color: var(--color-text-secondary) !important; }
html[data-theme="dark"] .gh-dropdown a:hover { color: var(--color-text-primary) !important; }
html[data-theme="dark"] .gh-powered-by a { color: var(--color-text-tertiary) !important; }
html[data-theme="dark"] .gh-powered-by a:hover { color: var(--color-text-tertiary) !important; }
html[data-theme="dark"] .gh-article-excerpt, html[data-theme="dark"] .gh-card-meta, html[data-theme="dark"] .gh-card-excerpt, html[data-theme="dark"] .gh-article-meta, html[data-theme="dark"] .gh-card-date { color: #958d8d !important; font-size: 1.55rem; }
html[data-theme="dark"] .post-full-content > :not(.kg-callout-card) pre, html[data-theme="dark"] pre { background-color: var(--color-bg-base) !important; color: var(--color-text-primary) !important; }
html[data-theme="dark"] .post-full-content > :not(.kg-callout-card) code { color: var(--color-text-primary) !important; background: var(--color-surface) !important; padding: 2px 6px !important; border-radius: 4px !important; }
html[data-theme="dark"] .gh-card-duration, html[data-theme="dark"] .gh-card-excerpt { color: var(--color-text-secondary) !important; }
html[data-theme="dark"] .gh-content table { background: var(--color-surface) !important; box-shadow: 0 0 0 1px var(--color-border); }
html[data-theme="dark"] .gh-content th { background-color: var(--color-bg-base) !important; color: var(--color-text-primary) !important; }
html[data-theme="dark"] .gh-content td { background-color: var(--color-surface) !important; color: var(--color-text-secondary) !important; }
html[data-theme="dark"] .gh-content th, html[data-theme="dark"] .gh-content td { border-color: var(--color-border) !important; }
html[data-theme="dark"] .gh-content table:not(.gist table) td:first-child { background-image: linear-gradient(90deg, var(--color-surface) 50%, transparent) !important; }
html[data-theme="dark"] .gh-content table:not(.gist table) td:last-child { background-image: linear-gradient(270deg, var(--color-surface) 50%, transparent) !important; }
html[data-theme="dark"] .gh-about .gh-about-title a { color: var(--color-text-primary) !important; }
html[data-theme="dark"] .gh-about .gh-about-title a:hover, html[data-theme="dark"] .gh-about .gh-about-title a:active { color: var(--color-text-secondary) !important; }

@media (max-width: 767px) { 
    html[data-theme="dark"] .is-head-open #gh-head .gh-head-actions { background-color: var(--color-bg-base) !important; } 
}

/* --- 其他非暗色模式相关的样式 (保持不变) --- */
.gh-head .gh-head-logo { font-size: 2.6rem !important; }
.gh-head-menu a { font-size: 2rem !important; }
.gh-foot-about h3 { font-size: 2.4rem !important; }
.gh-subscribe-title { font-size: 2.8rem !important; }
.gh-subscribe-description p { color: #888888; font-size: 1.4rem; line-height: 1.5; margin-top: 8px; }
.home-template .gh-card, .tag-template .gh-card, .author-template .gh-card { padding: 32px !important; }
@media (max-width: 767px) { .home-template .gh-card, .tag-template .gh-card, .author-template .gh-card { padding: 24px !important; } }
.gh-card-title { font-size: 3.0rem !important; line-height: 1.3 !important; }
.home-template .gh-article-title, .tag-template .gh-article-title, .author-template .gh-article-title { font-size: 2.2rem !important; line-height: 1.2 !important; margin: 0 !important; }
.home-template .gh-article-excerpt, .tag-template .gh-article-excerpt, .author-template .gh-article-excerpt, .post-template .gh-article-excerpt { font-size: 1.4rem !important; line-height: 1.6 !important; margin-top: 12px !important; -webkit-line-clamp: 2 !important; display: -webkit-box !important; -webkit-box-orient: vertical !important; overflow: hidden !important; }
.home-template .gh-card-excerpt, .tag-template .gh-card-excerpt, .author-template .gh-card-excerpt { -webkit-line-clamp: 3 !important; display: -webkit-box !important; -webkit-box-orient: vertical !important; overflow: hidden !important; }
.home-template .gh-featured .gh-article-title { font-size: 4.2rem !important; }
.post-template .gh-article-title { font-size: 3.0rem !important; line-height: 1.3 !important; }
.page-template .gh-article-title { font-size: 3.0rem !important; }
.gh-article-excerpt { max-width: none !important; }
.gh-card-duration, .gh-card-excerpt { color: #555555 !important; }
.gh-content table { display: table !important; width: 100% !important; white-space: normal !important; border-radius: 8px; border-style: hidden; box-shadow: 0 0 0 1px #e5e7eb; overflow: hidden; }
.gh-content th, .gh-content td { border: 1px solid #e5e7eb !important; padding: 12px 16px !important; }
.gh-content th { background-color: #f1f5f9 !important; font-weight: 600 !important; }
#gh-main { padding-top: 4rem !important; padding-bottom: 4rem !important; }



/* --- 视觉重构：标签云，亮/暗模式严格协调 (第九版 · 移动端触摸优化) --- */

/* === 1. 通用基础样式 (适用于所有模式) === */

/* 重置外部容器 */
.gh-section:has(#gh-topic-randomizer) {
    margin-top: 2rem; padding: 0; background: transparent; border: none; box-shadow: none;
}

/* 标题样式，使用::after伪元素创建装饰线 */
.gh-section:has(#gh-topic-randomizer) > h3 {
    margin: 0 0 20px 0; padding-bottom: 0; font-size: 1.1rem;
    letter-spacing: 0.5px; border-bottom: none;
}
.gh-section:has(#gh-topic-randomizer) > h3::after {
    content: ''; display: block; width: 40px; height: 3px;
    margin-top: 12px; border-radius: 3px;
}

/* 统一标签容器的布局 */
.gh-topic {
    list-style: none; padding: 0; margin: 0; display: flex;
    flex-wrap: wrap; gap: 12px;
}

/* 通用标签项 */
.gh-topic-item {
    display: inline-flex; align-items: center; text-decoration: none;
    transition: all 0.2s ease-out;
    border-radius: 999px; /* [核心修正] 统一所有模式下的形状为药丸形 */
    
    /* [移动端触摸优化] 去除移动设备上默认的点击高亮矩形背景 */
    -webkit-tap-highlight-color: transparent; 
}
.gh-topic-item .gh-topic-name {
    font-size: inherit; font-weight: 500;
}

/* 统一悬浮交互效果 */
.gh-topic-item:hover {
    transform: translateY(-2px);
}

/* “issue数量”标签的通用样式和过渡 */
.gh-topic-item .gh-topic-count {
    background: none !important; padding: 1px 6px !important; color: inherit !important;
    font-size: 0.8em; opacity: 0.7; margin-left: 8px;
    border-radius: 4px;
    transition: all 0.2s ease-out;
}


/* === 2. 亮色主题 (Light Theme) === */

html[data-theme="light"] .gh-section:has(#gh-topic-randomizer) > h3::after {
    background-color: #1a1a1a;
}
html[data-theme="light"] .gh-topic-item {
    padding: 15px 16px; font-size: 1.5rem;
    background-color: #f0f2f5; color: #555;
}
html[data-theme="light"] .gh-topic-item:hover {
    background-color: #e4e6e9; color: #111;
}
html[data-theme="light"] .gh-topic-item:hover .gh-topic-count {
    background-color: #222 !important; color: #fff !important; opacity: 1;
}


/* === 3. 暗色主题 (Dark Theme) === */

html[data-theme="dark"] .gh-section:has(#gh-topic-randomizer) > h3::after {
    background-color: #555;
}
html[data-theme="dark"] .gh-topic-item {
    padding: 15px 16px; 
    font-size: 1.5rem;
    background-color: #242424; color: #ccc; 
}
html[data-theme="dark"] .gh-topic-item:hover {
    background-color: #383838; border-color: #555; color: #fff;
}
html[data-theme="dark"] .gh-topic-item:hover .gh-topic-count {
    background-color: #fbb000 !important; color: #111 !important; opacity: 1;
}
