/*
Theme Name: 鼓狮新闻快讯
Theme URI: https://www.gushiio.com/
Author: 鼓狮
Author URI: https://www.gushiio.com/
Description: 一款为“鼓狮投资笔记”定制的新闻时间轴主题。功能包括时间轴布局、暗夜模式、推荐和热度追踪、自定义文章元数据以及响应式设计。
Version: 2.5
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gushinotes
*/

/* --- CSS 变量 (Variables) --- */
:root {
    --theme-color: #a62a1a;
    --theme-color-darker: #a62a1a;
    --text-color: #34495e;
    --text-color-light: #7f8c8d;
    --bg-color: #f4f6f9;
    --card-bg-color: #ffffff;
    --border-color: #eaecf1;
    --header-height: 60px;
    --timeline-color: #dcdedf;
    --timeline-dot-color: var(--theme-color);
    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 10px 25px rgba(52, 73, 94, 0.08);
    --border-radius: 12px;
    --header-btn-bg: #444;
}

body.dark-mode {
    --theme-color: #ff4d4d;
    --theme-color-darker: #e60000;
    --text-color: #ecf0f1;
    --text-color-light: #95a5a6;
    --bg-color: #1c2128;
    --card-bg-color: #282f3a;
    --border-color: #3b4658;
    --header-btn-bg: #444;
    --timeline-dot-color: var(--theme-color);
}
.footer-inner{
        line-height: 25px;
}
/* --- 通用样式 (Global Styles) --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'system-ui', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--theme-color);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover { color: var(--theme-color-darker); }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }


/* --- 头部 (Header) --- */
.site-header {
    background-color: #222;
    padding: 0 20px;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.site-header .logo img {
    height: auto;
    display: block; 
    transition: transform 0.3s ease; 
}
.site-header .logo img:hover { transform: scale(1.05); }

/* 导航 */
.nav-controls { display: flex; align-items: center; gap: 10px; }
.main-navigation .nav-links { list-style: none; display: flex; gap: 10px; align-items: center; }
.main-navigation a { color: rgba(255, 255, 255, 0.9); text-decoration: none; padding: 10px 15px; border-radius: 5px; transition: all 0.3s ease; position: relative; font-weight: 500; display: block; }
.main-navigation a:hover { background-color: rgba(255, 255, 255, 0.1); color: white; }
.main-navigation li.current-menu-item > a, .main-navigation li.current-menu-ancestor > a {
    color: white;
    background-color: var(--theme-color);
}



/* 下拉菜单 */
.main-navigation ul { margin: 0; padding: 0; list-style: none; }
.main-navigation .menu-item-has-children { position: relative; }
.main-navigation .menu-item-has-children > a { display: flex; align-items: center; gap: 5px; }
.main-navigation .menu-item-has-children .caret-icon { width: 0.7em; height: 0.7em; fill: currentColor; transition: transform 0.3s ease; }
.main-navigation .menu-item-has-children:hover .caret-icon { transform: rotate(180deg); }
.main-navigation .sub-menu {
    display: none; position: absolute; background-color: var(--card-bg-color); min-width: 200px;
    box-shadow: var(--shadow-medium); border-radius: 8px; z-index: 1000; top: calc(100% + 1px); left: 0;
    opacity: 0; transform: translateY(10px); transition: all 0.3s ease; padding: 5px 0; border: 1px solid var(--border-color);
}
.main-navigation .menu-item-has-children:hover > .sub-menu { display: block; opacity: 1; transform: translateY(0); }
.main-navigation .sub-menu a { color: var(--text-color); padding: 12px 18px; font-size: 14px; font-weight: normal; }
.main-navigation .sub-menu a:hover { background-color: var(--bg-color); color: var(--theme-color); }
body.dark-mode .main-navigation .sub-menu { background-color: #333; }
body.dark-mode .main-navigation .sub-menu a:hover { background-color: #444; }

/* 头部按钮 (暗夜, etc.) */
.header-btn {
    padding: 8px; width: 36px; height: 36px; font-size: 14px; border: none;
    border-radius: 50%; cursor: pointer; transition: all 0.3s ease;
    display: flex; justify-content: center; align-items: center;
    background-color: var(--header-btn-bg);
    color: #fff;
}
.header-btn:hover { background-color: var(--theme-color); transform: scale(1.1) rotate(15deg); }
.header-btn svg {  fill: currentColor; }
.toggle-theme .icon-sun { display: none; }
body.dark-mode .toggle-theme .icon-sun { display: block; }
body.dark-mode .toggle-theme .icon-moon { display: none; }

/* 汉堡菜单按钮 (移动端) */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0; z-index: 1201; }
.menu-toggle .hamburger { width: 28px; height: 22px; display: flex; flex-direction: column; justify-content: space-between; }
.menu-toggle .hamburger span { display: block; width: 100%; height: 3px; background-color: white; border-radius: 3px; transition: all 0.3s ease; transform-origin: center; }
body.menu-open .menu-toggle .hamburger span:nth-child(1) { transform: translateY(9.5px) rotate(45deg); }
body.menu-open .menu-toggle .hamburger span:nth-child(2) { opacity: 0; }
body.menu-open .menu-toggle .hamburger span:nth-child(3) { transform: translateY(-9.5px) rotate(-45deg); }

/* Banner */
.site-banner {
    background-color: #a62a1a;
    background-image: url('https://tools.gushiio.com/img/toolsbanner.png');
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat;
    color: white; 
    text-align: center;
    padding: 60px 20px; 
    font-weight: bold; 
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
}
.banner-title { font-size: 2.1rem; line-height: 1.2; }


/* --- 主要内容区布局 --- */
.site-content { display: flex; flex-wrap: wrap; gap: 30px; margin-top: 40px; margin-bottom: 40px; }
.main-content-area { flex: 1; min-width: 0; }
.sidebar-area { flex-basis: 320px; flex-shrink: 0; }


/* --- 时间线样式 (Timeline Style) --- */
.timeline-container { position: relative; padding-left: 20px; }
.timeline-container::before {
    content: ''; position: absolute; left: 0px; top: 15px; bottom: -80px;
    width: 1px; background-color: var(--timeline-color); border-radius: 3px;
}
.timeline-date-group { margin-bottom: 40px; }
.timeline-date-marker {
    position: relative; margin-bottom: 25px; margin-left: -32px;
    font-size: 1.5rem; font-weight: 600; color: var(--text-color); display: flex; align-items: center;
}
.timeline-date-marker::before {
    content: ''; width: 15px; height: 15px; background-color: var(--bg-color);
    border: 3px solid var(--timeline-dot-color); border-radius: 50%;
    position: absolute; left: 2px; z-index: 2;
}
.timeline-date-marker span {
    margin-left: 30px; background-color: var(--card-bg-color);
    padding: 5px 15px; border-radius: var(--border-radius); box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);font-size: 1.2rem;
}

.timeline-date-marker1 {
    position: relative; margin-bottom: 25px; margin-left: -37px;
    font-size: 1.5rem; font-weight: 600; color: var(--text-color); display: flex; align-items: center;
}
.timeline-date-marker1::before {
    content: ''; width: 15px; height: 15px; background-color: var(--bg-color);
    border: 3px solid var(--timeline-dot-color); border-radius: 50%;
    position: absolute; left: 2px; z-index: 2;
}
.timeline-date-marker1 span {
    margin-left: 35px; background-color: var(--card-bg-color);
    padding: 5px 15px; border-radius: var(--border-radius); box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    font-size: 1.2rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    padding: 25px;
    background-color: var(--card-bg-color); border-radius: var(--border-radius); 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.timeline-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-medium); }
.timeline-item::before {
    content: ''; position: absolute; left: -27px; top: 28px;
    width: 10px; height: 10px; background-color: var(--theme-color);
    border-radius: 50%; z-index: 1; border: 2px solid var(--bg-color);
}

.timeline-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-top: -5px;
}
.timeline-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
/* PC端时间样式 */
.timeline-time {
    position: absolute;
    left: -33px;
    top: 23px;
    transform: translateX(-100%) translateZ(0);
    background-color: var(--card-bg-color);
    color: var(--text-color);
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    box-shadow: none;
    transition: box-shadow 0.3s ease;
}
/* PC端悬浮时显示阴影 */
.timeline-item:hover .timeline-time {
    box-shadow: var(--shadow-soft);
}

.timeline-item.has-thumbnail {
    display: flex;
    gap: 20px;
    padding: 20px;
}
.timeline-thumbnail {
    flex-shrink: 0;
    width: 120px;
}
.timeline-thumbnail img {
    border-radius: var(--border-radius);
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 4/3;
}
.timeline-content-wrap {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-badges { 
    display: inline-flex; 
    gap: 8px; 
    margin-right: 8px; 
}
.post-badge {
    color: white; padding: 3px 10px; font-size: 0.75rem; font-weight: bold;
    border-radius: 50px; text-transform: uppercase; letter-spacing: 0.5px;
}
.post-badge.important { background-color: #3498db; }
.post-badge.hot { background-color: #e74c3c; }

.timeline-title { font-size: 1.25rem; margin: 0; }
.timeline-title a { color: var(--text-color); text-decoration: none; }
.timeline-title a:hover { color: var(--theme-color); }
.timeline-excerpt { margin-top: 10px; font-size: 0.95rem; line-height: 1.7; color: var(--text-color-light); margin-bottom: -5px;}


/* 分页 */
.pagination { margin-top: 40px; text-align: center; }
.pagination .nav-links { display: flex; justify-content: center; gap: 10px; }
.pagination .page-numbers {
    display: inline-block; padding: 10px 15px; border-radius: 8px;
    background-color: var(--card-bg-color); border: 1px solid var(--border-color);
    transition: all 0.3s ease; box-shadow: var(--shadow-soft);
}
.pagination .page-numbers:hover { background-color: var(--theme-color); color: white; border-color: var(--theme-color); transform: translateY(-2px); }
.pagination .page-numbers.current { background-color: var(--theme-color); color: white; border-color: var(--theme-color); font-weight: bold; }


/* --- 侧边栏 (Sidebar) --- */
.sidebar-area .widget {
    background-color: var(--card-bg-color); padding: 25px;
    border-radius: var(--border-radius); margin-bottom: 30px; border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}
.sidebar-area .widget-title {
    font-size: 1.2rem; font-weight: 600; margin-top: 0; margin-bottom: 20px;
    padding-bottom: 10px; border-bottom: 2px solid var(--theme-color);
}
.sidebar-area .widget ul { list-style: none; padding: 0; margin: 0; }
.sidebar-area .widget li { margin-bottom: 15px; }
.sidebar-area .widget a {
    color: var(--text-color); text-decoration: none; display: flex;
    gap: 15px; align-items: flex-start;
}
.sidebar-area .widget a:hover .list-title { color: var(--theme-color); }
.sidebar-area .list-counter {
    font-size: 0.8rem; font-weight: bold; color: var(--theme-color);
    background-color: var(--bg-color); min-width: 28px; height: 28px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.3s ease;
}
.sidebar-area .widget li:nth-child(-n+3) .list-counter {
    background-color: var(--theme-color); color: white;
}
.sidebar-area .widget a:hover .list-counter { transform: scale(1.1); }
.sidebar-area .list-title { line-height: 1.5; transition: color 0.3s ease; }


/* --- 分类页头 (Archive Header) --- */
.archive-header {
    background-color: var(--card-bg-color); padding: 20px; border-radius: var(--border-radius);
    margin-bottom: 30px; border-left: 5px solid var(--theme-color); box-shadow: var(--shadow-soft);
}
.archive-title { margin: 0; font-size: 1.5rem; }


/* --- 文章内容页 (Single Post) --- */
.single-post-content {
    background-color: var(--card-bg-color); padding: 40px;
    border-radius: var(--border-radius); border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}
.entry-header { margin-bottom: 25px; }
/* 文章元信息 */
.entry-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
    color: var(--text-color-light); font-size: 0.9rem; margin-bottom: 30px;
    padding-bottom: 20px; border-bottom: 1px solid var(--border-color);
}
.entry-meta span { display: flex; align-items: center; gap: 6px; }
.entry-meta a { color: var(--text-color-light); }
.entry-meta a:hover { color: var(--theme-color); }
.entry-meta .meta-icon { width: 1.1em; height: 1.1em; fill: currentColor; }
.entry-meta .meta-badge {
    color: white; padding: 4px 12px; font-weight: 500;
    border-radius: 50px; 
}
.entry-meta .meta-badge.important { background-color: #3498db; }
.entry-meta .meta-badge.hot { background-color: #e74c3c; }

.entry-content { font-size: 1.1rem; line-height: 1.8; }
.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4 { margin: 1.8em 0 1em; line-height: 1.4; color: var(--text-color); }
.entry-content p { margin-bottom: 1.2em; }
.entry-content ul, .entry-content ol { margin: 0 0 1.5em 1.5em; padding-left: 1.5em; }
.entry-content blockquote {
    margin: 1.5em 0; padding: 1em 1.5em;
    border-left: 4px solid var(--theme-color); background-color: var(--bg-color);
    border-radius: 0 8px 8px 0; font-style: italic; color: var(--text-color-light);
}
.entry-content img { border-radius: 10px; box-shadow: var(--shadow-medium); margin: 2em auto; }

/* 文章操作按钮 */
.post-actions {
    display: flex; justify-content: center; gap: 20px;
    margin: 40px 0 0; padding-top: 30px; border-top: 1px dashed var(--border-color);
}
.action-btn {
    background-color: var(--bg-color); border: 2px solid var(--border-color); padding: 12px 25px;
    border-radius: 50px; cursor: pointer; font-size: 1rem; font-weight: 600;
    color: var(--text-color); display: flex; align-items: center; gap: 8px; transition: all 0.3s ease;
}
.action-btn:hover {
    transform: translateY(-3px); box-shadow: var(--shadow-medium);
    border-color: var(--theme-color);
}
.action-btn.active, .action-btn:disabled {
    background-color: var(--theme-color); color: white; border-color: var(--theme-color);
    cursor: not-allowed; transform: none; box-shadow: none;
}
.action-btn svg { width: 1.2em; height: 1.2em; }

/* --- 文章标签 (Post Tags) --- */
.post-tags {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.tags-title {
    font-weight: 600;
    margin-right: 5px;
    color: var(--text-color);
}
.post-tags a {
    display: inline-block;
    background-color: var(--bg-color);
    color: var(--text-color-light);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}
.post-tags a:hover {
    background-color: var(--theme-color);
    border-color: var(--theme-color);
    color: white;
    transform: translateY(-2px);
}
.timeline-tags {
    margin-top: 15px;
    margin-bottom: -3px;
}


/* 文章底部最新快讯 */
.latest-news-section { margin-top: 40px; }
.latest-news-section .widget-title {
    font-size: 1.5rem; text-align: center; margin-bottom: 30px;
}

.latest-news-content .timeline-container { padding-left: 30px; }
.latest-news-content .timeline-container::before { left: 5px; }
.latest-news-content .timeline-item { padding: 25px; }
.latest-news-content .timeline-item::before { left: -32px; }
.latest-news-content .timeline-time {
    left: -39px;
}


/* --- 底部 (Footer) --- */
.site-footer {
    text-align: center; margin-top: 40px; padding: 30px 20px;
    background-color: #2c3e50;
    color: rgba(255, 255, 255, 0.7); font-size: 14px;
}
.site-footer a { color: white; font-weight: 500; }
.site-footer a:hover { text-decoration: underline; }

/* --- 响应式设计 (Responsive Design) --- */
@media (max-width: 1200px) {
    /* 移动端菜单弹出逻辑 */
    .menu-toggle { display: block; }
    .main-navigation {
        position: fixed; top: var(--header-height); right: 0; width: 280px; height: calc(100vh - var(--header-height));
        background-color: #2a2a2a; transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
        z-index: 1200; overflow-y: auto;
    }
    body.menu-open .main-navigation { transform: translateX(0); }
    .main-navigation .nav-links { flex-direction: column; align-items: stretch; gap: 0; padding: 20px 0; }
    .main-navigation .nav-links a { padding: 15px 25px; border-radius: 0; border-bottom: 1px solid #444; }
    .main-navigation .sub-menu {
        display: none; position: static; transform: none; opacity: 1; box-shadow: none; border-radius: 0;
        background-color: #383838; border-bottom: 1px solid #444; padding: 0;
    }
    .main-navigation .menu-item-has-children.active > .sub-menu { display: block; }
    .main-navigation .sub-menu a { padding-left: 45px; color: #ccc; }
    .main-navigation .menu-item-has-children:hover > .sub-menu { display: none; }
    .main-navigation .menu-item-has-children.active:hover > .sub-menu { display: block; }

    /* 平板和手机的徽章和时间线样式 */
    .timeline-header {
        display: block;
        margin-top: -10px;
    }
    .post-badges {
        margin-bottom: 12px;
    }
    .timeline-item { margin-top: 55px; }
    .timeline-time {
        position: absolute;
        top: -5px;
        transform: translateY(-100%);
        left: 0;
        background-color: var(--card-bg-color);
        color: var(--text-color);
        padding: 5px 12px;
        border-radius: 8px;
        border: none;
        font-weight: 600;
        box-shadow: none;
        z-index: 5;
    }
    .timeline-item::before {
        top: -25px;
        left: -27px;
    }
    .latest-news-content .timeline-item::before {
        top: -25px;
        left: -32px;
    }
    .latest-news-content .timeline-time {
    left: 0px;
}
}

/* 竖屏平板和手机的侧边栏堆叠 */
@media (max-width: 992px) {
    .site-content { flex-direction: column; }
    .main-content-area, .sidebar-area { width: 100%; flex-basis: auto; }
}

@media (max-width: 768px) {
    .banner-title { font-size: 2.2rem; }
    .site-banner { padding: 50px 15px; }
    .single-post-content, .latest-news-content { padding: 25px; }
    .entry-meta { gap: 8px 15px; }
    .timeline-date-marker, .timeline-date-marker1 { font-size: 1.2rem; }
    .timeline-title { font-size: 1.1rem; }
    .links-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

@media (max-width: 480px) {
    .container { padding: 0 15px; }
    .action-btn { padding: 10px 15px; font-size: 0.9rem; justify-content: center; }
    .post-actions { gap: 10px; flex-direction: column; }
    .timeline-container { padding-left: 20px; }
    .timeline-container::before { left: 0; }
    .timeline-date-marker { margin-left: -23px; }
    .timeline-date-marker::before { left: -6px; }
    .timeline-date-marker span { margin-left: 22px; }
    .timeline-date-marker1 { margin-left: -28px; }
    .timeline-date-marker1::before { left: -6px; }
    .timeline-date-marker1 span { margin-left: 26px; }
    
    .timeline-item { padding-left: 15px; padding-right: 15px; }
    .timeline-item::before { left: -25.5px; margin-left: -1px; top: -25px;}
    .latest-news-content .timeline-item::before { left: -32px; top: -25px;}
    .timeline-meta { flex-direction: column; align-items: flex-start; }
    .latest-news-content { padding: 20px; }
    .links-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
    .link-card { padding: 10px 15px; }

    .timeline-item.has-thumbnail {
        flex-direction: column;
        gap: 15px;
    }
    .timeline-thumbnail {
        width: 100%;
    }
}

/* --- 首页友情链接 (Homepage Links) --- */
.links-section {
    margin-top: 40px; padding: 30px; background-color: var(--card-bg-color);
    border-radius: var(--border-radius); box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}
.links-section .widget-title {
    font-size: 1.2rem; font-weight: 600; margin-top: 0; margin-bottom: 25px;
    padding-bottom: 10px; border-bottom: 2px solid var(--theme-color);
}
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}
.link-card {
    background-color: var(--bg-color); padding: 12px 18px; border-radius: 8px;
    text-align: center; font-weight: 500; color: var(--text-color);
    transition: all 0.3s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
    font-size: clamp(0.75rem, 1.1vw + 0.1rem, 0.875rem);
}
.link-card:hover {
    transform: translateY(-5px) scale(1.05); box-shadow: var(--shadow-medium);
    color: white; background-color: var(--theme-color);
    border-color: var(--theme-color-darker);
}