/* DeepSites - 通用样式文件 */

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

/* 字体与基础排版 */
body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fafafa;
}

/* 容器和布局 */
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
}

.content-container {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

/* 标题样式 */
h1 { 
    font-size: 2.5rem; 
    font-weight: 600; 
    color: #24292e; 
    margin-bottom: 8px; 
}

h2, h3, h4 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 1rem;
}

h2 { font-size: 1.5rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

/* 页面头部 */
header { 
    background: #fff; 
    border-bottom: 1px solid #e1e5e9; 
    padding: 40px 0; 
}

.subtitle { 
    font-size: 1.1rem; 
    color: #586069; 
}

/* 页脚 */
footer {
    background: #24292e;
    color: #fff;
    text-align: center;
    padding: 40px 0;
    margin-top: 80px;
}

/* 导航和卡片 */
.nav-section { 
    margin: 60px 0; 
}

.section-title { 
    font-size: 1.5rem; 
    font-weight: 600; 
    color: #24292e; 
    margin-bottom: 24px;
    border-bottom: 2px solid #e1e5e9;
    padding-bottom: 8px;
}

.tech-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 20px; 
    margin-bottom: 40px;
}

.tech-card {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 20px;
    transition: border-color 0.2s;
}

.tech-card:hover { 
    border-color: #0366d6; 
}

.card-title { 
    font-size: 1.1rem; 
    font-weight: 600; 
    color: #24292e; 
    margin-bottom: 8px;
}

.card-title a { 
    color: #0366d6; 
    text-decoration: none; 
}

.card-title a:hover { 
    text-decoration: underline; 
}

.card-desc { 
    font-size: 0.9rem; 
    color: #586069; 
    margin-bottom: 12px; 
}

/* 状态标签 */
.status-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-published { 
    background: #dcffe4; 
    color: #28a745; 
}

.status-dev { 
    background: #fff5b4; 
    color: #b08800; 
}

.status-planned { 
    background: #f1f8ff; 
    color: #0366d6; 
}

.category-label {
    display: inline-block;
    padding: 2px 6px;
    background: #f6f8fa;
    color: #586069;
    border-radius: 3px;
    font-size: 0.7rem;
    margin-left: 8px;
}

/* 信息框和提示 */
.info {
    font-size: 0.95em;
    padding: 15px;
    background-color: #eaf2f8;
    border-left: 4px solid #3498db;
    margin: 20px 0;
    border-radius: 4px;
}

/* 代码样式增强 - 兼容 Prism.js */
code, pre {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    background-color: #f6f8fa;
    border-radius: 4px;
    font-size: 0.875rem;
}

code {
    padding: 0.2em 0.4em;
    color: #24292e;
}

pre {
    padding: 1rem;
    overflow-x: auto;
    line-height: 1.45;
    background-color: #f6f8fa;
    border: 1px solid #e1e5e9;
}

/* Prism.js 代码高亮样式增强 */
pre[class*="language-"] {
    background: #2d3748;
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: none;
}

code[class*="language-"] {
    color: #e2e8f0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    background: none;
    padding: 0;
}

/* 代码容器样式 */
.code-container {
    background: #fff;
    border-radius: 12px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
}

.code-title {
    background: linear-gradient(135deg, #4a5568, #2d3748);
    color: #e2e8f0;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
    border-bottom: 1px solid #4a5568;
}

.code-title + pre[class*="language-"] {
    margin-top: 0;
    border-radius: 0;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9rem;
}

th, td {
    border: 1px solid #e1e5e9;
    padding: 12px;
    text-align: left;
}

th {
    background-color: #f6f8fa;
    font-weight: 600;
    color: #24292e;
}

td:first-child { 
    font-weight: 500; 
    background-color: #fafbfc;
}

/* 公式样式 */
.formula {
    text-align: center;
    font-size: 1.1em;
    margin: 20px 0;
    padding: 15px;
    background-color: #f6f8fa;
    border-radius: 6px;
    border: 1px solid #e1e5e9;
    font-family: 'Times New Roman', serif;
}

/* 高亮样式 */
.highlight-red { 
    color: #d73a49; 
    font-weight: 600; 
}

.highlight-green { 
    color: #28a745; 
    font-weight: 600; 
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #0366d6;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn:hover {
    background-color: #0256cc;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .tech-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    header {
        padding: 20px 0;
    }
    
    .nav-section {
        margin: 30px 0;
    }
}

/* 无障碍和动画 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 焦点样式 */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid #0366d6;
    outline-offset: 2px;
}

/* Prism.js 行号插件样式 */
pre.line-numbers {
    position: relative;
    padding-left: 3.8em;
    counter-reset: linenumber;
}

pre.line-numbers > code {
    position: relative;
    white-space: inherit;
}

.line-numbers .line-numbers-rows {
    position: absolute;
    pointer-events: none;
    top: 0;
    font-size: 100%;
    left: -3.8em;
    width: 3em;
    letter-spacing: -1px;
    border-right: 1px solid #999;
    user-select: none;
}

.line-numbers-rows > span {
    pointer-events: none;
    display: block;
    counter-increment: linenumber;
}

.line-numbers-rows > span:before {
    content: counter(linenumber);
    color: #999;
    display: block;
    padding-right: 0.8em;
    text-align: right;
}

/* 打印样式 */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .tech-card {
        border: 1px solid #ccc;
        break-inside: avoid;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}