/* 妙趣AI 详情页统一样式 - 与首页保持一致的暗黑风格 */
/* 基于 index.html 样式系统，适配详情页布局 */

:root {
    --bg-primary: #0c0c0c;
    --bg-secondary: #141414;
    --bg-tertiary: #1c1c1c;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent: #e8c547;
    --accent-hover: #d4b33d;
    --border: #27272a;
    --border-light: #3f3f46;
    --success: #10b981;
    --error: #ef4444;
    --info: #3b82f6;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.8;
    min-height: 100vh;
}

/* 导入字体 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============ Header ============ */
header {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    background: rgba(12, 12, 12, 0.95);
    backdrop-filter: blur(12px);
    z-index: 100;
}

header nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.25rem;
    font-family: 'Noto Serif SC', serif;
}

header .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #f59e0b);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

header .nav-links {
    display: flex;
    gap: 32px;
}

header .nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s;
}

header .nav-links a:hover,
header .nav-links a.active {
    color: var(--accent);
}

/* ============ Main Container ============ */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 24px;
}

/* ============ Article Styles ============ */
article {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
}

article h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    font-family: 'Noto Serif SC', serif;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

article .tagline {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

article h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 16px;
    font-family: 'Noto Serif SC', serif;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

article h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 28px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

article p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

article ul,
article ol {
    margin-bottom: 16px;
    padding-left: 24px;
    color: var(--text-secondary);
}

article li {
    margin-bottom: 8px;
}

article a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* ============ Section Cards ============ */
section {
    margin-top: 32px;
    padding: 24px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

section:first-child {
    margin-top: 0;
    background: transparent;
    border: none;
    padding: 0;
}

section h2 {
    margin-top: 0;
}

/* ============ Pros & Cons ============ */
.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 32px;
}

.pros,
.cons {
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.pros {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.cons {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.pros h3 {
    color: var(--success);
    margin-top: 0;
}

.cons h3 {
    color: var(--error);
    margin-top: 0;
}

/* ============ Code Blocks ============ */
code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.875em;
    color: var(--accent);
}

pre {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin: 24px 0;
}

pre code {
    background: transparent;
    padding: 0;
    color: var(--text-primary);
}

/* ============ Blockquote ============ */
blockquote {
    border-left: 4px solid var(--accent);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--bg-tertiary);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-style: italic;
}

blockquote p {
    margin-bottom: 0;
}

/* ============ Tables ============ */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
}

th,
td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

td {
    color: var(--text-secondary);
}

tr:last-child td {
    border-bottom: none;
}

/* ============ Buttons ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    text-decoration: none;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--border-light);
    background: var(--bg-secondary);
    text-decoration: none;
}

/* ============ Tags ============ */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-decoration: none;
    transition: all 0.2s;
}

.tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

/* ============ Cross Links ============ */
.cross-links {
    margin-top: 40px;
    padding: 28px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.cross-links h3 {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.125rem;
    margin-top: 0;
}

.cross-links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.cross-link {
    background: var(--bg-tertiary);
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.cross-link:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.cross-link a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9375rem;
}

.cross-link a:hover {
    color: var(--accent);
}

/* ============ Related Reading (旧版兼容) ============ */
.related-reading {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 2rem;
}

.related-reading h3 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.related-reading .links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.related-reading a {
    background: var(--bg-tertiary);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.related-reading a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ============ Aside Sidebar ============ */
aside {
    margin-top: 40px;
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
}

aside h3 {
    font-size: 1.125rem;
    margin-bottom: 16px;
    color: var(--accent);
    margin-top: 0;
}

aside ul {
    list-style: none;
    padding: 0;
}

aside li {
    margin-bottom: 12px;
}

aside a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

aside a:hover {
    background: var(--bg-primary);
    color: var(--accent);
    transform: translateX(4px);
}

/* ============ Footer ============ */
footer {
    border-top: 1px solid var(--border);
    padding: 32px 24px;
    margin-top: 64px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

footer a:hover {
    color: var(--accent);
}

/* ============ Animations ============ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

article,
aside,
.cross-links {
    animation: fadeIn 0.4s ease-out;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    header .nav-links {
        display: none;
    }

    main {
        padding: 24px 16px;
    }

    article {
        padding: 24px;
    }

    article h1 {
        font-size: 1.75rem;
    }

    article h2 {
        font-size: 1.25rem;
    }

    .pros-cons {
        grid-template-columns: 1fr;
    }

    .cross-links-grid {
        flex-direction: column;
    }

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

/* ============ Glossary/术语页面专用 ============ */
.term-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.term-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s;
}

.term-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.term-card h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.term-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.term-card h3 a:hover {
    color: var(--accent);
}

.term-card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 12px;
}

.term-card .tag {
    margin-top: 0;
}

/* ============ Story/踩坑实录专用 ============ */
.story-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.story-meta .author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-meta .author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
}

.story-meta .date {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============ Print Styles ============ */
@media print {
    header,
    footer,
    .cross-links,
    aside {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    article {
        border: none;
        padding: 0;
    }
}
