/**
 * AI + 黑客 赛博朋克主题样式
 * www.黑客.wang
 * 版本: 2.0
 */

/* ==================== CSS变量定义 ==================== */
:root {
    /* 核心配色 - 赛博朋克风格 */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a24;
    --bg-hover: #252538;
    
    /* 霓虹色彩 */
    --neon-green: #00ff88;
    --neon-green-dim: #00cc6a;
    --neon-blue: #00d4ff;
    --neon-purple: #b829ff;
    --neon-pink: #ff2d95;
    --neon-orange: #ff9500;
    
    /* 文字颜色 */
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    
    /* 边框和阴影 */
    --border-color: #2a2a3a;
    --glow-green: 0 0 10px rgba(0, 255, 136, 0.5);
    --glow-blue: 0 0 10px rgba(0, 212, 255, 0.5);
    --glow-purple: 0 0 10px rgba(184, 41, 255, 0.5);
    
    /* 字体 */
    --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
    --font-main: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

/* ==================== 全局重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    line-height: 1.6;
}

/* 代码雨背景层 */
#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

/* 扫描线效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 136, 0.03),
        rgba(0, 255, 136, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 9999;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(100vh); }
}

/* ==================== 头部区域 ==================== */
.site-header {
    width: 100%;
    padding: 40px 20px 20px;
    text-align: center;
    position: relative;
}

/* Logo黑客风格 */
.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    position: relative;
}

.logo::before {
    content: '>';
    font-family: var(--font-mono);
    font-size: 2em;
    color: var(--neon-green);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.site-title {
    margin: 0;
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(135deg, var(--neon-green) 0%, var(--neon-blue) 50%, var(--neon-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: var(--glow-green);
    letter-spacing: 2px;
}

.site-title a {
    text-decoration: none;
    color: inherit;
}

/* 副标题 */
.site-subtitle {
    font-family: var(--font-mono);
    color: var(--neon-green);
    font-size: 0.9em;
    margin-top: 10px;
    opacity: 0.8;
}

/* ==================== 终端风格搜索框 ==================== */
.search-section-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.search-box {
    position: relative;
    width: 100%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    min-height: 140px;
}

.search-box::before {
    content: 'root@black:~$';
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--bg-primary);
    padding: 0 10px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--neon-green);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.search-box:hover {
    border-color: var(--neon-green);
    box-shadow: var(--glow-green);
}

.search-box:focus-within {
    border-color: var(--neon-blue);
    box-shadow: var(--glow-blue);
}

.search-box input {
    width: 100%;
    border: none;
    outline: none;
    padding: 15px 60px 15px 10px;
    font-size: 1.1em;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

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

/* 终端光标 */
.search-box input:focus::after {
    content: '▋';
    color: var(--neon-green);
    animation: cursor-blink 1s infinite;
}

@keyframes cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.search-box button {
    position: absolute;
    right: 20px;
    bottom: 20px;
    background: transparent;
    border: 2px solid var(--neon-green);
    color: var(--neon-green);
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box button:hover {
    background: var(--neon-green);
    color: var(--bg-primary);
    box-shadow: var(--glow-green);
}

.search-box button svg {
    height: 18px;
    fill: currentColor;
}

/* ==================== 内容区块 - 卡片风格 ==================== */
.content-section {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.search-sections {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* 卡片容器 */
article.search-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    position: relative;
    overflow: hidden;
}

article.search-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--neon-green), var(--neon-blue));
}

/* 区块标题 - 终端风格 */
.section-title {
    font-size: 1.1em;
    font-family: var(--font-mono);
    color: var(--neon-green);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '#';
    color: var(--neon-purple);
}

/* 文章标签样式 */
.search-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.search-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px 18px;
    font-size: 0.9em;
    font-family: var(--font-mono);
    transition: all 0.3s ease;
    cursor: pointer;
}

.search-item a {
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.search-item:hover {
    border-color: var(--neon-green);
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--glow-green);
}

.search-item:hover a {
    color: var(--neon-green);
}

/* ==================== 面包屑导航 ==================== */
.breadcrumb-nav {
    width: 100%;
    max-width: 900px;
    margin: 10px auto 20px;
    padding: 0 20px;
}

.breadcrumb-nav ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.85em;
}

.breadcrumb-nav li {
    display: flex;
    align-items: center;
    color: var(--text-muted);
}

.breadcrumb-nav li:not(:last-child)::after {
    content: '→';
    margin-left: 8px;
    color: var(--neon-green);
}

.breadcrumb-nav a {
    color: var(--neon-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-nav a:hover {
    color: var(--neon-green);
    text-shadow: var(--glow-green);
}

/* ==================== 友情链接 ==================== */
.friend-links {
    width: 100%;
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.friend-links h3 {
    font-family: var(--font-mono);
    font-size: 1em;
    color: var(--neon-purple);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.friend-links h3::before {
    content: '☆';
}

.friend-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    list-style: none;
}

.friend-links li {
    transition: transform 0.3s ease;
}

.friend-links a {
    display: block;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.85em;
    text-decoration: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    transition: all 0.3s ease;
}

.friend-links a:hover {
    border-color: var(--neon-purple);
    color: var(--neon-purple);
    box-shadow: var(--glow-purple);
    transform: translateY(-2px);
}

/* ==================== 页脚 ==================== */
.blog-footer {
    width: 100%;
    margin-top: 60px;
    padding: 40px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-bottom {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--text-muted);
}

.footer-bottom a {
    color: var(--neon-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: var(--neon-green);
    text-shadow: var(--glow-green);
}

.footer-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.copyright-info {
    color: var(--neon-green);
    margin-top: 10px;
}

/* ==================== 加载动画 - 黑客风格 ==================== */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

#loading-content {
    text-align: center;
    font-family: var(--font-mono);
}

#loading-content p {
    color: var(--neon-green);
    font-size: 1.2em;
    margin-bottom: 20px;
}

#loading-content p::before {
    content: '[*]';
    margin-right: 10px;
    color: var(--neon-blue);
}

#loading-progress {
    width: 300px;
    height: 4px;
    background: var(--bg-card);
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

#loading-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--neon-green), var(--neon-blue));
    transition: width 0.3s ease;
    box-shadow: var(--glow-green);
}

/* ==================== 验证码弹窗 - 终端风格 ==================== */
#captcha-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.9);
    align-items: center;
    justify-content: center;
    z-index: 1001;
    backdrop-filter: blur(5px);
}

#captcha-content {
    background: var(--bg-card);
    border: 2px solid var(--neon-green);
    border-radius: 8px;
    padding: 30px;
    max-width: 380px;
    width: 90%;
    box-shadow: var(--glow-green);
}

#captcha-title {
    font-family: var(--font-mono);
    color: var(--neon-green);
    font-size: 1.1em;
    margin-bottom: 20px;
    text-align: center;
}

.captcha-input-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

#verifyImage {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#verifyImage:hover {
    border-color: var(--neon-green);
    box-shadow: var(--glow-green);
}

#verifyCodeInput {
    flex: 1;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1em;
    outline: none;
    transition: all 0.3s ease;
}

#verifyCodeInput:focus {
    border-color: var(--neon-green);
    box-shadow: var(--glow-green);
}

#captcha-content button {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 2px solid var(--neon-green);
    color: var(--neon-green);
    font-family: var(--font-mono);
    font-size: 1em;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

#captcha-content button:hover {
    background: var(--neon-green);
    color: var(--bg-primary);
    box-shadow: var(--glow-green);
}

/* ==================== 错误弹窗 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.9);
    align-items: center;
    justify-content: center;
    z-index: 1002;
}

.modal-content {
    background: var(--bg-card);
    border: 2px solid var(--neon-pink);
    border-radius: 8px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 45, 149, 0.3);
}

#error-modal-title {
    font-family: var(--font-mono);
    color: var(--neon-pink);
    font-size: 1.2em;
    margin-bottom: 15px;
}

#error-modal-title::before {
    content: '[!]';
    margin-right: 8px;
}

#error-modal-message {
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-family: var(--font-mono);
}

#close-error-modal {
    padding: 10px 30px;
    background: transparent;
    border: 2px solid var(--neon-pink);
    color: var(--neon-pink);
    font-family: var(--font-mono);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

#close-error-modal:hover {
    background: var(--neon-pink);
    color: var(--bg-primary);
}

/* ==================== 登录按钮 ==================== */
.login-register-links {
    position: absolute;
    right: 20px;
    bottom: 20px;
}

.login-btn {
    display: inline-block;
    padding: 10px 25px;
    background: transparent;
    border: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    font-family: var(--font-mono);
    font-size: 0.9em;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: var(--neon-blue);
    color: var(--bg-primary);
    box-shadow: var(--glow-blue);
}

/* ==================== 建议滚动区域 ==================== */
.suggest-scroll {
    position: absolute;
    right: 20px;
    bottom: 65px;
    max-width: calc(100% - 40px);
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    gap: 10px;
    padding-bottom: 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-green) var(--bg-card);
}

.suggest-scroll::-webkit-scrollbar {
    height: 4px;
}

.suggest-scroll::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 2px;
}

.suggest-scroll::-webkit-scrollbar-thumb {
    background: var(--neon-green);
    border-radius: 2px;
}

.suggest-item {
    flex: 0 0 auto;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.8em;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.suggest-item:hover {
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: var(--glow-green);
}

/* ==================== 加载动画 ==================== */
.submit-spinner {
    display: none;
    border: 3px solid var(--bg-card);
    border-top: 3px solid var(--neon-green);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== 工具类 ==================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* 焦点样式 */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--neon-green);
    outline-offset: 2px;
}

/* 选择文字颜色 */
::selection {
    background: var(--neon-green);
    color: var(--bg-primary);
}

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-green);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .site-title {
        font-size: 1.8em;
    }
    
    .search-box {
        min-height: 120px;
        padding: 15px;
    }
    
    .search-box input {
        font-size: 1em;
        padding: 12px 50px 12px 8px;
    }
    
    .search-box button {
        padding: 8px 15px;
        font-size: 0.85em;
    }
    
    article.search-section {
        padding: 20px;
    }
    
    .search-item {
        padding: 8px 14px;
        font-size: 0.85em;
    }
    
    .section-title {
        font-size: 1em;
    }
    
    .suggest-scroll {
        right: 15px;
        bottom: 55px;
        max-width: calc(100% - 30px);
    }
}

@media (max-width: 480px) {
    .site-header {
        padding: 30px 15px 15px;
    }
    
    .logo::before {
        font-size: 1.5em;
    }
    
    .site-title {
        font-size: 1.5em;
    }
    
    .search-box::before {
        font-size: 0.75em;
    }
    
    .breadcrumb-nav {
        font-size: 0.8em;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    #matrix-bg,
    body::before,
    .blog-footer,
    #loading-overlay,
    #captcha-modal,
    .modal {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* ==================== 动画效果 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

article.search-section {
    animation: fadeIn 0.5s ease forwards;
}

article.search-section:nth-child(1) { animation-delay: 0.1s; }
article.search-section:nth-child(2) { animation-delay: 0.2s; }

/* 悬停光效 */
.search-item:hover,
.friend-links a:hover,
.breadcrumb-nav a:hover {
    position: relative;
}

.search-item:hover::after,
.friend-links a:hover::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: inherit;
    background: inherit;
    opacity: 0.3;
    filter: blur(8px);
    z-index: -1;
}
