/*
Theme Name: PureText Poems
Theme URI: https://github.com/puretext/poems
Description: 专为古诗词内容站设计的高性能主题，CryptoAgent 深黑绿色科技风格，支持百万文章。
Version: 2.0.0
Author: PureText
Author URI: https://puretext.dev
Text Domain: puretext-poems
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: poetry, chinese, seo, performance, responsive, dark
*/

/* ============================================================
   CSS 变量（CryptoAgent 深黑绿色科技风格）
   ============================================================ */
:root {
    /* 主色系 - 绿色科技 */
    --color-primary:        #00ff88;
    --color-primary-light:  #10b981;
    --color-primary-dark:   #059669;
    --color-primary-glow:   rgba(0, 255, 136, 0.3);
    --color-accent:         #00d4aa;

    /* 背景色 - 深黑 */
    --color-bg:             #0a0e17;
    --color-bg-card:        rgba(255, 255, 255, 0.03);
    --color-bg-card-hover:  rgba(255, 255, 255, 0.06);
    --color-bg-nav:         rgba(10, 14, 23, 0.95);
    --color-bg-input:       rgba(255, 255, 255, 0.08);

    /* 边框色 */
    --color-border:         rgba(0, 255, 136, 0.15);
    --color-border-hover:   rgba(0, 255, 136, 0.4);
    --color-border-card:    rgba(255, 255, 255, 0.08);

    /* 文字色 */
    --color-text:           #e2e8f0;
    --color-text-secondary: #94a3b8;
    --color-text-muted:     #64748b;
    --color-text-link:      #00ff88;

    /* 字体 */
    --font-kai:   'KaiTi', '楷体', 'STKaiti', 'FangSong', '仿宋', serif;
    --font-body:  'Inter', 'Microsoft YaHei', '微软雅黑', -apple-system, BlinkMacSystemFont, sans-serif;

    /* 间距 */
    --space-xs:   4px;
    --space-sm:   8px;
    --space-md:   16px;
    --space-lg:   24px;
    --space-xl:   32px;

    /* 圆角 */
    --radius-sm:  6px;
    --radius-md:  8px;
    --radius-lg:  12px;

    /* 布局 */
    --max-width:  1200px;
    --sidebar-w:  280px;
    --gap:        20px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* 科技感网格背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(rgba(0,255,136,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,255,136,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--color-text-link);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--color-primary-glow);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ============================================================
   布局容器
   ============================================================ */
.pt-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
    position: relative;
    z-index: 1;
}

.pt-layout {
    display: flex;
    gap: var(--gap);
    margin-top: var(--space-lg);
}

.pt-main {
    flex: 1;
    min-width: 0;
}

.pt-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
}

/* ============================================================
   Header - 深黑科技风
   ============================================================ */
.pt-header {
    background: linear-gradient(135deg, #0a0e17 0%, #0f1923 100%);
    border-bottom: 1px solid var(--color-border);
    padding: 12px 0;
    position: relative;
    z-index: 200;
}

.pt-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pt-logo {
    font-family: var(--font-body);
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pt-logo::before {
    content: '◈';
    color: var(--color-primary);
    font-size: 24px;
}

.pt-logo:hover {
    color: var(--color-primary);
    text-shadow: 0 0 20px var(--color-primary-glow);
}

.pt-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.pt-search-form {
    display: flex;
    align-items: center;
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    padding: 6px 16px;
    gap: 8px;
    transition: border-color 0.3s;
}

.pt-search-form:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 12px var(--color-primary-glow);
}

.pt-search-form input {
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 13px;
    width: 180px;
}

.pt-search-form input::placeholder {
    color: var(--color-text-muted);
}

.pt-search-form button {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font-size: 15px;
    padding: 0;
    transition: color 0.3s;
}

.pt-search-form button:hover {
    color: #fff;
}

/* ============================================================
   Navigation - 绿色高亮
   ============================================================ */
.pt-nav {
    background: var(--color-bg-nav);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.pt-nav-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
}

.pt-nav a {
    display: inline-block;
    color: var(--color-text-secondary);
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    position: relative;
}

.pt-nav a:hover {
    color: var(--color-primary);
    background: rgba(0, 255, 136, 0.08);
    text-shadow: none;
}

.pt-nav a.current {
    color: var(--color-primary);
    background: rgba(0, 255, 136, 0.1);
}

.pt-nav a.current::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
}

/* ============================================================
   卡片组件 - 暗色玻璃态
   ============================================================ */
.pt-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.pt-card:hover {
    border-color: var(--color-border-hover);
    box-shadow: 0 0 20px var(--color-primary-glow);
}

.pt-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    border-left: 3px solid var(--color-primary);
    padding-left: var(--space-sm);
    margin-bottom: 16px;
}

/* ============================================================
   Hero 区域（首页专用）
   ============================================================ */
.pt-hero {
    background: linear-gradient(135deg, #0a0e17 0%, #0d1b2a 50%, #0a0e17 100%);
    padding: 60px 0 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--color-border);
}

.pt-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(0,255,136,0.06) 0%, transparent 70%);
    animation: heroGlow 8s ease-in-out infinite;
}

@keyframes heroGlow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; }
}

.pt-hero-title {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.pt-hero-title span {
    color: var(--color-primary);
}

.pt-hero-subtitle {
    font-size: 16px;
    color: var(--color-text-secondary);
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.pt-hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
    position: relative;
    z-index: 1;
}

.pt-hero-stat {
    text-align: center;
}

.pt-hero-stat .num {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
    display: block;
}

.pt-hero-stat .label {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* CTA 按钮 */
.pt-btn-primary {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: #0a0e17;
    font-weight: 600;
    padding: 10px 28px;
    border-radius: 24px;
    font-size: 14px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.pt-btn-primary:hover {
    box-shadow: 0 0 24px var(--color-primary-glow);
    transform: translateY(-1px);
    color: #0a0e17;
    text-shadow: none;
}

/* ============================================================
   标签/分类云
   ============================================================ */
.pt-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.pt-tag {
    background: rgba(0, 255, 136, 0.08);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    transition: all 0.3s;
}

.pt-tag:hover {
    background: var(--color-primary);
    color: #0a0e17;
    border-color: var(--color-primary);
    box-shadow: 0 0 12px var(--color-primary-glow);
    text-shadow: none;
}

/* ============================================================
   诗词列表（3列网格）
   ============================================================ */
.pt-poem-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.pt-poem-item {
    padding: 10px 12px;
    border: 1px solid var(--color-border-card);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.3s;
    background: rgba(255,255,255,0.02);
}

.pt-poem-item:hover {
    border-color: var(--color-border-hover);
    background: rgba(0, 255, 136, 0.05);
}

.pt-poem-item a {
    font-size: 13px;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pt-poem-item a:hover {
    color: var(--color-primary);
    text-shadow: none;
}

.pt-poem-item .pt-poem-meta {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* ============================================================
   诗人列表
   ============================================================ */
.pt-poet-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.pt-poet-tag {
    color: var(--color-text-secondary);
    font-size: 13px;
    padding: 5px 12px;
    border: 1px solid var(--color-border-card);
    border-radius: 20px;
    background: rgba(255,255,255,0.02);
    transition: all 0.3s;
}

.pt-poet-tag:hover {
    background: rgba(0, 255, 136, 0.1);
    color: var(--color-primary);
    border-color: var(--color-border-hover);
    text-shadow: none;
}

/* ============================================================
   面包屑
   ============================================================ */
.pt-breadcrumb {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-card);
}

.pt-breadcrumb a {
    color: var(--color-primary);
}

.pt-breadcrumb a:hover {
    text-shadow: none;
}

.pt-breadcrumb span {
    margin: 0 6px;
    color: var(--color-text-muted);
}

/* ============================================================
   诗词详情页
   ============================================================ */
.pt-poem-title {
    font-family: var(--font-kai);
    font-size: 26px;
    color: #fff;
    text-align: center;
    margin-bottom: 8px;
}

.pt-poem-author-line {
    text-align: center;
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.pt-poem-author-line a {
    color: var(--color-primary);
}

.pt-poem-body {
    background: rgba(0, 255, 136, 0.03);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px var(--space-lg);
    margin: var(--space-lg) 0;
    text-align: center;
}

.pt-poem-line {
    font-family: var(--font-kai);
    font-size: 18px;
    line-height: 2.4;
    color: var(--color-text);
    letter-spacing: 2px;
}

.pt-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-primary);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 8px;
    margin: var(--space-lg) 0 12px;
}

.pt-analysis p {
    line-height: 1.9;
    margin-bottom: 10px;
    color: var(--color-text-secondary);
    text-indent: 2em;
}

/* ============================================================
   侧边栏
   ============================================================ */
.pt-sidebar .pt-card {
    padding: var(--space-md);
}

.pt-sidebar .pt-card-title {
    font-size: 14px;
    margin-bottom: 10px;
}

.pt-sidebar-list li {
    border-bottom: 1px solid var(--color-border-card);
    padding: 7px 0;
}

.pt-sidebar-list li a {
    font-size: 13px;
    color: var(--color-text-secondary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pt-sidebar-list li a:hover {
    color: var(--color-primary);
    text-shadow: none;
}

/* ============================================================
   分页
   ============================================================ */
.pt-pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin: var(--space-lg) 0;
    flex-wrap: wrap;
}

.pt-pagination a,
.pt-pagination span {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--color-border-card);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--color-text-secondary);
    transition: all 0.3s;
}

.pt-pagination a:hover,
.pt-pagination .current {
    background: var(--color-primary);
    color: #0a0e17;
    border-color: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary-glow);
    text-shadow: none;
}

/* ============================================================
   Footer - 深色科技风
   ============================================================ */
.pt-footer {
    background: linear-gradient(135deg, #060a12 0%, #0a0e17 100%);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    padding: 30px var(--space-md) 20px;
    margin-top: var(--space-xl);
    position: relative;
    z-index: 1;
}

.pt-footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.pt-footer-brand {
    font-size: 13px;
    line-height: 1.8;
}

.pt-footer-brand .brand-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.pt-footer-brand .brand-name::before {
    content: '◈';
    color: var(--color-primary);
}

.pt-footer-col h4 {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.pt-footer-col ul li {
    margin-bottom: 6px;
}

.pt-footer-col ul li a {
    color: var(--color-text-muted);
    font-size: 13px;
}

.pt-footer-col ul li a:hover {
    color: var(--color-primary);
    text-shadow: none;
}

.pt-footer-bottom {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-card);
    font-size: 12px;
}

.pt-footer-bottom a {
    color: var(--color-text-muted);
}

.pt-footer-bottom a:hover {
    color: var(--color-primary);
    text-shadow: none;
}

/* 旧版 footer 兼容 */
.pt-footer > .pt-container > p {
    text-align: center;
    font-size: 12px;
}

.pt-footer > .pt-container > p a {
    color: var(--color-text-muted);
}

/* ============================================================
   文章内容（WordPress 编辑器输出）
   ============================================================ */
.pt-entry-content {
    line-height: 1.9;
    color: var(--color-text-secondary);
}

.pt-entry-content p {
    margin-bottom: 12px;
    text-indent: 2em;
}

.pt-entry-content h2 {
    font-size: 18px;
    color: var(--color-primary);
    margin: var(--space-lg) 0 10px;
    border-left: 3px solid var(--color-primary);
    padding-left: 8px;
}

.pt-entry-content h3 {
    font-size: 16px;
    color: #fff;
    margin: 12px 0 8px;
}

.pt-entry-content blockquote {
    background: rgba(0, 255, 136, 0.05);
    border-left: 4px solid var(--color-primary);
    padding: 12px 16px;
    margin: 12px 0;
    font-family: var(--font-kai);
    font-size: 16px;
    color: var(--color-text-secondary);
}

/* ============================================================
   KOL 时间轴列表页
   ============================================================ */
.pt-kol-timeline {
    position: relative;
    padding-left: 30px;
}

.pt-kol-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--color-primary), transparent);
}

.pt-kol-item {
    position: relative;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-card);
    border-radius: var(--radius-md);
    transition: all 0.3s;
}

.pt-kol-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 20px;
    width: 10px;
    height: 10px;
    background: var(--color-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--color-primary-glow);
}

.pt-kol-item:hover {
    border-color: var(--color-border-hover);
    box-shadow: 0 0 16px var(--color-primary-glow);
}

.pt-kol-item .kol-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.pt-kol-item .kol-time {
    font-size: 12px;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.pt-kol-item .kol-content {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.8;
    word-break: break-word;
}

.pt-kol-item .kol-tags {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pt-kol-item .kol-tags span {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 255, 136, 0.1);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
}

/* ============================================================
   泛目录列表页
   ============================================================ */
.pt-fandir-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.pt-fandir-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s;
}

.pt-fandir-card:hover {
    border-color: var(--color-border-hover);
    box-shadow: 0 0 16px var(--color-primary-glow);
    transform: translateY(-2px);
}

.pt-fandir-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.pt-fandir-card .card-body {
    padding: 12px;
}

.pt-fandir-card .card-label {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 255, 136, 0.1);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    margin-bottom: 6px;
}

.pt-fandir-card .card-num {
    display: inline-block;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-muted);
    margin-left: 4px;
}

.pt-fandir-card .card-title {
    font-size: 13px;
    color: var(--color-text);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pt-fandir-card .card-title:hover {
    color: var(--color-primary);
}

/* 泛目录侧边栏 */
.pt-fandir-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-card);
}

.pt-fandir-sidebar-item img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.pt-fandir-sidebar-item .name {
    flex: 1;
    font-size: 13px;
    color: var(--color-text);
}

.pt-fandir-sidebar-item .code {
    font-size: 12px;
    color: var(--color-text-muted);
}

.pt-fandir-sidebar-item .btn-buy {
    font-size: 12px;
    padding: 3px 12px;
    border-radius: 4px;
    background: var(--color-primary);
    color: #0a0e17;
    font-weight: 600;
    transition: all 0.3s;
}

.pt-fandir-sidebar-item .btn-buy:hover {
    box-shadow: 0 0 10px var(--color-primary-glow);
    text-shadow: none;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1024px) {
    .pt-footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .pt-layout {
        flex-direction: column;
    }

    .pt-sidebar {
        width: 100%;
    }

    .pt-poem-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pt-header-right .pt-search-form {
        display: none;
    }

    .pt-poem-title {
        font-size: 20px;
    }

    .pt-poem-line {
        font-size: 16px;
    }

    .pt-hero-title {
        font-size: 24px;
    }

    .pt-hero-stats {
        gap: 20px;
        flex-wrap: wrap;
    }

    .pt-hero-stat .num {
        font-size: 22px;
    }

    .pt-nav-inner {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .pt-nav-inner::-webkit-scrollbar {
        display: none;
    }

    .pt-footer-inner {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .pt-fandir-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 移动端汉堡菜单按钮 */
    .pt-mobile-menu-btn {
        display: block;
    }
}

@media (max-width: 480px) {
    .pt-poem-grid {
        grid-template-columns: 1fr;
    }

    .pt-hero-title {
        font-size: 20px;
    }

    .pt-hero-subtitle {
        font-size: 14px;
    }

    .pt-fandir-grid {
        grid-template-columns: 1fr;
    }
}

/* 移动端菜单按钮（默认隐藏） */
.pt-mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}
