/* 自定义CSS样式 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background-color: #0f0f0f;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #ff6b35;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff8c42;
}

/* 自定义选择文本样式 */
::selection {
    background-color: #ff6b35;
    color: #ffffff;
}

/* 焦点样式 */
:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

/* 链接样式 */
a {
    color: #ff6b35;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #ff8c42;
}

/* 动画定义 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 动画类 */
.animate-fadeInUp {
    animation: fadeInUp 0.8s ease-out;
}

.animate-fadeIn {
    animation: fadeIn 0.6s ease-out;
}

.animate-slideInRight {
    animation: slideInRight 0.6s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* 渐变背景 */
.hero-gradient {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
}

.section-gradient {
    background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(255, 107, 53, 0.2);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: #ff6b35;
    color: white;
}

.btn-primary:hover {
    background-color: #ff8c42;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: #ff6b35;
    border: 2px solid #ff6b35;
}

.btn-secondary:hover {
    background-color: #ff6b35;
    color: white;
}

/* 导航样式 */
.site-header {
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.nav-link {
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #ff6b35;
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* 代码块样式 */
.code-block {
    background-color: #1e1e1e;
    border: 1px solid #333333;
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.code-block pre {
    margin: 0;
    white-space: pre;
    word-wrap: normal;
}

.inline-code {
    background-color: #ff6b3520;
    color: #ff6b35;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.875rem;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #333333;
}

.table th {
    background-color: #1a1a1a;
    font-weight: 600;
    color: #ff6b35;
}

.table tbody tr:hover {
    background-color: #1a1a1a;
}

/* 引用样式 */
blockquote {
    border-left: 4px solid #ff6b35;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #b0b0b0;
}

/* 分割线样式 */
hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, #ff6b35, transparent);
    margin: 2rem 0;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: #ff6b3520;
    color: #ff6b35;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.tag:hover {
    background-color: #ff6b3530;
}

/* 提示框样式 */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    border-left: 4px solid;
}

.alert-info {
    background-color: #2196f320;
    border-left-color: #2196f3;
    color: #90caf9;
}

.alert-success {
    background-color: #4caf5020;
    border-left-color: #4caf50;
    color: #a5d6a7;
}

.alert-warning {
    background-color: #ff980020;
    border-left-color: #ff9800;
    color: #ffcc02;
}

.alert-error {
    background-color: #f4433620;
    border-left-color: #f44336;
    color: #ef5350;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 107, 53, 0.3);
    border-radius: 50%;
    border-top-color: #ff6b35;
    animation: spin 1s ease-in-out infinite;
}

/* 响应式工具类 */
.mobile-only {
    display: none;
}

.tablet-only {
    display: none;
}

.desktop-only {
    display: block;
}

/* 深色主题变量 */
:root {
    --primary-bg: #0f0f0f;
    --secondary-bg: #1a1a1a;
    --tertiary-bg: #252525;
    --primary-text: #ffffff;
    --secondary-text: #b0b0b0;
    --muted-text: #808080;
    --accent-color: #ff6b35;
    --accent-hover: #ff8c42;
    --border-color: #333333;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --info-color: #2196f3;
}

/* 响应式断点 */
@media (max-width: 767px) {
    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none;
    }

    .text-responsive {
        font-size: 0.875rem;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .tablet-only {
        display: block;
    }

    .mobile-only {
        display: none;
    }

    .desktop-only {
        display: none;
    }
}

@media (min-width: 1024px) {
    .desktop-only {
        display: block;
    }

    .mobile-only {
        display: none;
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        color: #000000;
        background-color: #ffffff;
    }

    a {
        color: #000000;
        text-decoration: underline;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --primary-text: #ffffff;
        --secondary-text: #e0e0e0;
        --border-color: #ffffff;
        --accent-color: #ff6b35;
    }
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* 实用工具类 */
.text-gradient {
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-glow {
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
}

.border-gradient {
    border: 1px solid transparent;
    background: linear-gradient(#0f0f0f, #0f0f0f) padding-box,
                linear-gradient(135deg, #ff6b35, #ff8c42) border-box;
}

/* 内容容器 */
.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 文章内容样式 */
.article-content {
    line-height: 1.8;
    color: #e0e0e0;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin: 2rem 0 1rem 0;
    color: #ffffff;
    font-weight: 600;
    position: relative;
}

.article-content h1 { font-size: 2.5rem; }
.article-content h2 { font-size: 2rem; }
.article-content h3 { font-size: 1.5rem; }
.article-content h4 { font-size: 1.25rem; }
.article-content h5 { font-size: 1.125rem; }
.article-content h6 { font-size: 1rem; }

.article-content h2::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    border-radius: 50%;
    opacity: 0.8;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content ul,
.article-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.article-content img:hover {
    transform: scale(1.02);
}

/* 增强的视觉效果 */
.glass-effect {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glow-effect {
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.3);
}

/* 现代卡片样式 */
.modern-card {
    background: linear-gradient(145deg, #1a1a1a, #0f0f0f);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 20px 20px 60px #0a0a0a, -20px -20px 60px #1a1a1a;
    transition: all 0.3s ease;
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 25px 25px 70px #0a0a0a, -25px -25px 70px #1a1a1a;
}

/* 动态背景 */
.animated-bg {
    background: linear-gradient(-45deg, #0f0f0f, #1a1a1a, #252525, #1a1a1a);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 交互式按钮 */
.interactive-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.interactive-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.interactive-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* 高级滚动条 */
.custom-scrollbar::-webkit-scrollbar {
    width: 10px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 5px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff8c42, #ffa652);
}

/* 响应式网格布局 */
.responsive-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

@media (max-width: 768px) {
    .responsive-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* 高级动画 */
.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 文字渐变效果 */
.gradient-text {
    background: linear-gradient(135deg, #ff6b35, #ff8c42, #ffa652);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: textGradient 3s ease infinite;
}

@keyframes textGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 悬停阴影效果 */
.hover-shadow {
    transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 20px 40px rgba(255, 107, 53, 0.2);
}

/* 加载骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #1a1a1a 25%, #252525 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
    transition: all 0.3s ease;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.4);
}

.back-to-top-btn {
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.back-to-top-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.back-to-top:hover .back-to-top-btn::before {
    width: 100%;
    height: 100%;
}

.back-to-top svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s ease;
}

.back-to-top:hover svg {
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .back-to-top-btn {
        width: 3rem;
        height: 3rem;
    }

    .back-to-top svg {
        width: 1rem;
        height: 1rem;
    }
}