/*
Theme Name: Credits Ex Sys
Theme URI: https://github.com/crbn4/crbn-theme
Author: Antigravity
Author URI: https://deepmind.google
Description: A retro terminal-style, cyber-aesthetic WordPress theme based on CREDITS_EX.SYS. Features a canvas character wall, starfield, interactive click effects, and a customizable background image that darkens on scroll.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: credits-ex-sys
*/

/* --- 核心基础样式 --- */
body {
    margin: 0;
    overflow: hidden;
    background-color: #000000;
    color: #d1d5db; /* gray-300 */
    font-family: "Courier New", Courier, monospace;
    user-select: none;
}

/* 隐藏滚动条但保留功能 */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* --- 背景图片及叠加层 --- */
#theme-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
    background-color: #000000;
}
#theme-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center 14.28%; /* 从图片的上1/7处 (14.28%) 开始显示/显示中心 */
    background-repeat: no-repeat;
    opacity: 0.65; /* 设置一定的不透明度 */
    transition: opacity 0.1s ease;
}
#theme-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    opacity: 0; /* 初始顶部时最亮 (没有暗色遮罩) */
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.1s ease;
}

/* --- 菜单栏按钮样式修改 --- */
.ascii-btn {
    position: relative;
    background: transparent;
    color: #9ca3af; /* gray-400 */
    border: none !important;
    padding: 0.25rem 0 !important;
    margin: 0 0.5rem;
    cursor: pointer;
    font-family: "Courier New", Courier, monospace;
    font-size: 1rem;
    letter-spacing: 0.1em;
    transition: color 0.15s ease;
}
.ascii-btn .btn-text {
    border-bottom: 2px solid transparent;
    padding-bottom: 4px;
    transition: border-color 0.15s ease;
}
.ascii-btn:hover, .ascii-btn.active {
    color: #ffffff;
    background: transparent !important;
}
.ascii-btn:hover .btn-text, .ascii-btn.active .btn-text {
    border-bottom-color: #ffffff;
}

/* WordPress 自定义菜单适配 */
.nav-menu-container ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 1.5rem;
}
.nav-menu-container li {
    margin: 0;
}
.nav-menu-container li a {
    color: #9ca3af;
    text-decoration: none;
    font-family: "Courier New", Courier, monospace;
    font-size: 1rem;
    letter-spacing: 0.1em;
    font-weight: bold;
    border-bottom: 2px solid transparent;
    padding-bottom: 4px;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-menu-container li.current-menu-item a,
.nav-menu-container li.active a,
.nav-menu-container li a:hover {
    color: #ffffff;
    border-bottom-color: #ffffff;
}

/* 移除方框和背景 */
.ascii-btn:focus, .nav-menu-container li a:focus {
    outline: none;
}

/* --- 博客列表 hover 样式 (下划线明暗视觉效果) --- */
.blog-item h3 {
    text-decoration: underline 2px transparent;
    text-underline-offset: 4px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.blog-item:hover h3 {
    text-decoration-color: #ffffff;
    color: #ffffff;
}
.blog-item:hover .blog-date {
    color: #9ca3af;
}

/* --- 视图切换逻辑类 --- */
.view-content { display: none; }
.view-content.active { display: flex; }

/* --- WordPress 页面标准排版适配 --- */
.entry-content {
    line-height: 1.8;
}
.entry-content p {
    margin-bottom: 1.5rem;
}
.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4, .entry-content h5 {
    color: #ffffff;
    font-weight: bold;
    margin-top: 2rem;
    margin-bottom: 1rem;
}
.entry-content h1 { font-size: 1.8rem; }
.entry-content h2 { font-size: 1.5rem; border-left: 2px solid #ffffff; padding-left: 0.75rem; }
.entry-content h3 { font-size: 1.25rem; }

.entry-content blockquote {
    border-left: 2px dashed #4b5563;
    padding-left: 1rem;
    color: #9ca3af;
    margin: 1.5rem 0;
    font-style: italic;
}
.entry-content pre, .entry-content code {
    font-family: "Courier New", Courier, monospace;
    background-color: rgba(255, 255, 255, 0.05);
}
.entry-content pre {
    padding: 1rem;
    border: 1px dashed #374151;
    overflow-x: auto;
    margin: 1.5rem 0;
}

/* --- 插件适配: WordPress 核心音频块与第三方音频插件 --- */

/* 1. WordPress 原生音频块 (Audio Block) */
.wp-block-audio {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: rgba(17, 24, 39, 0.6);
    border: 1px dashed #4b5563;
}
.wp-block-audio audio {
    width: 100%;
    filter: invert(1) hue-rotate(180deg); /* 将一些默认浏览器的播放器反色以配合暗色主题 */
}
.wp-block-audio figcaption {
    color: #9ca3af;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    text-align: left;
    font-family: "Courier New", Courier, monospace;
}

/* WordPress Core MediaElement.js 播放器皮肤自定义 */
.mejs-container, .mejs-embed, .mejs-embed body {
    background: #000000 !important;
    border: 1px dashed #4b5563 !important;
    font-family: "Courier New", Courier, monospace !important;
}
.mejs-controls {
    background: #111827 !important;
    border-top: 1px solid #1f2937 !important;
}
.mejs-time {
    color: #d1d5db !important;
    font-weight: bold;
}
.mejs-time-rail .mejs-time-total {
    background: #374151 !important;
}
.mejs-time-rail .mejs-time-current {
    background: #ffffff !important;
}
.mejs-time-rail .mejs-time-handle {
    background: #ffffff !important;
    border-color: #ffffff !important;
    border-radius: 0 !important;
}
.mejs-horizontal-volume-slider .mejs-horizontal-volume-total {
    background: #374151 !important;
}
.mejs-horizontal-volume-slider .mejs-horizontal-volume-current {
    background: #ffffff !important;
}

/* 2. Compact Audio Player 插件适配 (Tips and Tricks HQ) */
.sc_embed_player_wrapper {
    display: inline-flex !important;
    align-items: center !important;
    background: rgba(17, 24, 39, 0.8) !important;
    border: 1px dashed #4b5563 !important;
    padding: 6px 12px !important;
    font-family: "Courier New", Courier, monospace !important;
    color: #d1d5db !important;
    gap: 8px !important;
}
.sc_embed_player_wrapper input, 
.sc_embed_player_wrapper button,
.sc-embed-player-play, 
.sc_player_play, 
.myButton {
    background: transparent !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
    padding: 2px 8px !important;
    font-family: "Courier New", Courier, monospace !important;
    cursor: pointer !important;
    font-size: 0.85rem !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    transition: all 0.15s ease !important;
}
.sc_embed_player_wrapper button:hover,
.sc-embed-player-play:hover, 
.sc_player_play:hover, 
.myButton:hover {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #ffffff !important;
}

/* 3. AudioIgniter 音乐播放器插件适配 (CSSIgniter) */
.audioigniter-player {
    background: rgba(17, 24, 39, 0.7) !important;
    border: 1px dashed #4b5563 !important;
    border-radius: 0 !important;
    padding: 1.5rem !important;
    font-family: "Courier New", Courier, monospace !important;
    color: #d1d5db !important;
}
.audioigniter-player .ai-track-title {
    color: #ffffff !important;
    font-weight: bold !important;
}
.audioigniter-player .ai-control-play, 
.audioigniter-player .ai-control-pause,
.audioigniter-player .ai-btn {
    background: transparent !important;
    border: 1px solid #4b5563 !important;
    color: #ffffff !important;
    border-radius: 0 !important;
}
.audioigniter-player .ai-control-play:hover, 
.audioigniter-player .ai-control-pause:hover,
.audioigniter-player .ai-btn:hover {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #ffffff !important;
}
.audioigniter-player .ai-progress {
    background: #374151 !important;
    height: 6px !important;
    border-radius: 0 !important;
}
.audioigniter-player .ai-progress-bar {
    background: #ffffff !important;
}
.audioigniter-player .ai-track {
    border-bottom: 1px dashed #374151 !important;
}
.audioigniter-player .ai-track.ai-track-active {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* --- WordPress Widgets Override (适配常规小工具) --- */
.widget {
    margin-bottom: 2rem;
}
.widget ul {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
}
.widget ul li {
    padding: 0.35rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.widget ul li a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.15s ease;
}
.widget ul li a:hover {
    color: #ffffff;
    text-decoration: underline 2px solid #ffffff;
    text-underline-offset: 4px;
}
/* Calendar widget */
.widget_calendar table {
    width: 100%;
    text-align: center;
    border-collapse: collapse;
    margin-top: 0.5rem;
}
.widget_calendar th, .widget_calendar td {
    padding: 4px;
    border: 1px dashed #374151;
}
.widget_calendar caption {
    color: #ffffff;
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-family: "Courier New", Courier, monospace;
}
/* Text, RSS and other widgets */
.widget_rss ul li .rss-date, .widget_recent_entries .post-date {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

