/* 基础样式 */
:root {
    --primary-color: #2db67c; /* Microchip green */
    --secondary-color: #e6a8b8; /* Pearlescent rose */
    --accent-color: #d4af37; /* Digital brass */
    --text-color: #1f2937;
    --light-text: #6b7280;
    --bg-color: #f9fafb; /* Plasma white */
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --code-bg: #f3f4f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    background-image: linear-gradient(to bottom right, rgba(255,255,255,0.9), rgba(249,250,251,0.95));
    background-attachment: fixed;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(45deg, transparent 45%, rgba(255,255,255,0.1) 45%, rgba(255,255,255,0.1) 55%, transparent 55%);
    background-size: 10px 10px;
    opacity: 0.3;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
}

/* 导航样式 */
nav {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

nav ul {
    display: flex;
    list-style: none;
    overflow-x: auto;
}

nav li {
    flex-shrink: 0;
}

nav a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-color);
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

nav a:hover, nav a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    text-decoration: none;
}

/* 主内容区域 */
main {
    padding: 2rem 0;
}

/* 文章内容 */
article.full-width {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

section {
    margin-bottom: 3rem;
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    border-left: 3px solid var(--primary-color);
}

section::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background-image: radial-gradient(circle, var(--secondary-color) 0%, transparent 70%);
    opacity: 0.1;
    pointer-events: none;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

h3 {
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem;
    color: var(--secondary-color);
}

h4 {
    font-size: 1.2rem;
    margin: 1.2rem 0 0.8rem;
    color: var(--accent-color);
}

p, ul, ol {
    margin-bottom: 1rem;
}

ul, ol {
    margin-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* 代码样式 */
code {
    font-family: 'Consolas', 'Menlo', 'Monaco', monospace;
    background-color: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.code-box {
    margin: 1.5rem 0;
    background-color: var(--code-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
    position: relative;
}

.code-box h4 {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.5rem 1rem;
    margin: 0;
}

.code-box pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
}

.code-box code {
    background-color: transparent;
    padding: 0;
}

/* 示例框 */
.example-box {
    margin: 1.5rem 0;
    background-color: rgba(212, 175, 55, 0.05); /* Digital brass with opacity */
    border-left: 4px solid var(--accent-color);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

.example-box h4 {
    margin-top: 0;
    color: var(--accent-color);
}

/* 算法卡片 */
.algorithm-card, .language-card, .special-text-card {
    margin: 1.5rem 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.algorithm-card::before, .language-card::before, .special-text-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.algorithm-card:hover, .language-card:hover, .special-text-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.algorithm-card h4 {
    color: var(--primary-color);
    margin-top: 0;
}

.pros-cons {
    display: flex;
    gap: 1.5rem;
    margin: 1rem 0;
}

.pros, .cons {
    flex: 1;
    padding: 1rem;
    border-radius: 8px;
}

.pros {
    background-color: rgba(45, 182, 124, 0.1); /* Microchip green with opacity */
}

.cons {
    background-color: rgba(230, 168, 184, 0.1); /* Pearlescent rose with opacity */
}

.pros h5 {
    color: var(--success-color);
}

.cons h5 {
    color: var(--warning-color);
}

/* 语言卡片 */
.language-card h4 {
    color: var(--secondary-color);
    margin-top: 0;
}

/* 特殊文本卡片 */
.special-text-card h4 {
    color: var(--accent-color);
    margin-top: 0;
}

/* 页面导航 */
.section-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

.back-to-top {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s;
}

.back-to-top:hover {
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
}

.page-nav {
    display: flex;
    gap: 1rem;
}

.next-page, .prev-page {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s;
    position: relative;
    overflow: hidden;
}

.next-page::after, .prev-page::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 45%, rgba(255,255,255,0.1) 45%, rgba(255,255,255,0.1) 55%, transparent 55%);
    background-size: 10px 10px;
    opacity: 0.3;
}

.next-page:hover, .prev-page:hover {
    background-color: var(--secondary-color);
    text-decoration: none;
    color: white;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

th, td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: rgba(45, 182, 124, 0.05); /* Microchip green with opacity */
}

/* 页脚样式 */
footer {
    background-color: var(--text-color);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background-image: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
    opacity: 0.1;
    pointer-events: none;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: white;
    font-size: 1.2rem;
    opacity: 0.8;
    transition: opacity 0.3s, transform 0.3s;
}

.social-links a:hover {
    opacity: 1;
    transform: translateY(-3px);
}

/* 复制按钮样式 */
.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.copy-button:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 发光边缘效果 */
section:hover {
    box-shadow: 0 0 15px rgba(45, 182, 124, 0.2); /* Microchip green glow */
}

.algorithm-card:hover::before, .language-card:hover::before, .special-text-card:hover::before {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color), var(--accent-color));
    animation: glow-seam 2s infinite alternate;
}

@keyframes glow-seam {
    0% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    nav a {
        padding: 0.8rem 1rem;
    }
    
    .pros-cons {
        flex-direction: column;
    }
    
    section {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    section {
        padding: 1rem;
    }
    
    footer .container {
        flex-direction: column;
        gap: 1rem;
    }
} 