:root {
    --bg: #0d0d0d;
    --bg-light: #1a1a1a;
    --text: #ffffff;
    --text-muted: #a0a0a0;
    --accent: #1a73e8;
    --border: #333333;
    --ed-bg: #0f0f10;
    --ed-surface: #1a1a1c;
    --ed-surface2: #242426;
    --ed-text2: #6b6860;
    --ed-text3: #9e9b94;
    --ed-accent: #1a6b3a;
    --ed-accent-s: #e8f5ee;
    --ed-accent2: #0f4d28;
    --ed-mono: 'DM Mono', monospace;
    --ed-sans: 'DM Sans', sans-serif;
    --ed-radius: 6px;
}

body {
    margin: 0;
    font-family: 'Google Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
}

.article-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 120px 3rem 80px 3rem;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 5rem;
    align-items: start;
}

.content-left {
    max-width: 800px;
    min-width: 0;
}

.breadcrumb {
    font-family: 'Roboto Mono', monospace;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.breadcrumb span {
    color: var(--text);
}

.article-title {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 2rem;
    font-weight: 700;
}

.article-body {
    font-size: 1rem;
    line-height: 1.6;
    color: #d1d1d1;
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body h2 {
    font-size: 2rem;
    color: var(--text);
    margin: 3rem 0 1.5rem;
}

.sidebar-right {
    position: sticky;
    top: 120px;
}

.meta-box {
    border-top: 2px solid var(--text);
    padding-top: 1.5rem;
}

.meta-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.meta-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-bottom: 2.5rem;
}

.meta-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: start;
}

.meta-label {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    padding-top: 2px;
}

.meta-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
}

.meta-tag {
    display: inline-block;
    background: #1e1e1e;
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text);
    margin-right: 5px;
    margin-bottom: 5px;
    font-family: 'Roboto Mono', monospace;
}

.share-links {
    display: flex;
    gap: 10px;
}

.share-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 0.95rem;
    font-weight: 500;
    background-color: #1a1a1a;
    border: 1px solid #333;
    color: #d1d1d1;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}

.share-btn:hover {
    background-color: #2a2a2a;
    color: #ffffff;
    border-color: #555555;
}

.share-wrapper {
    position: relative;
    flex: 1;
}

.share-menu {
    display: none;
    position: absolute;
    left: 3rem;
    right: 3rem;
    margin-top: 10px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    overflow: hidden;
    z-index: 999;
}

.share-menu a {
    display: block;
    padding: 12px;
    color: #d1d1d1;
    text-decoration: none;
    cursor: pointer;
}

.share-menu a:hover {
    background: #2a2a2a;
    color: #fff;
}

.share-menu.show {
    display: block;
}

.md-preview {
    width: 100%;
    overflow-x: hidden;
}

.md-preview td {
    border: 1px solid var(--border);
    padding: 6px 11px;
}

.md-preview tr:nth-child(even) td {
    background: var(--ed-surface2);
}

.md-preview img {
    max-width: 100%;
    border-radius: var(--ed-radius);
}

.md-preview input[type=checkbox] {
    margin-right: 5px;
    accent-color: var(--ed-accent);
}

.math-block {
    display: block;
    overflow-x: auto;
    margin: 1.2em 0;
    padding: 10px 0;
    text-align: center;
}

.math-inline {
    display: inline;
}

.katex-display {
    margin: 0;
}

.article-body pre {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1rem;
    box-sizing: border-box;
    background: #151515;
    border: 1px solid #2b2b2b;
    border-radius: 10px;
    white-space: pre;
}

.article-body code {
    white-space: pre;
    word-break: normal;
}

.article-body table {
    display: block;
    width: 100%;
    overflow-x: auto;
}

@media (max-width: 1024px) {
    .article-wrapper {
        grid-template-columns: 1fr;
        padding: 120px 2rem 50px 2rem;
        gap: 3rem;
    }
    .sidebar-right {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .article-wrapper {
        padding: 90px 1rem 40px 1rem;
        gap: 2rem;
    }
    .article-title {
        font-size: 1.6rem;
    }
    .article-body {
        font-size: 0.95rem;
    }
    .meta-item {
        grid-template-columns: 100px 1fr;
    }
}

@media (max-width: 480px) {
    .meta-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .meta-label {
        padding-top: 0;
    }
}
