﻿:root {
    --bg: #f3f6fb;
    --bg-soft: #eef3f9;
    --card: #ffffff;
    --card-soft: #f8fbff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #d9e2ec;
    --line-strong: #c7d3e0;
    --brand: #1678d3;
    --brand-dark: #0f5ea8;
    --brand-soft: #e7f1fb;
    --accent: #00a88f;
    --danger: #d83b01;
    --shadow: 0 8px 24px rgba(15, 23, 42, .08);
    --maxw: 730px;
    --fs: 17px;
    --lh: 1.9;
    --radius:4px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #f7f9fc 0%, #f3f6fb 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

.app {
    max-width: var(--maxw);
    margin: 0 auto;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(243,246,251,.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.back-btn {
    min-height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--brand);
    background: #fff;
    color: var(--brand);
    cursor: pointer;
    border-radius: var(--radius);
}

.top-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn {
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--brand);
    background: #fff;
    color: var(--brand);
    cursor: pointer;
    transition: all .16s ease;
    border-radius: var(--radius);
}

.btn.primary {
    background: var(--brand);
    color: #fff;
}

.section {
    padding: 16px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.hero-cover {
    width: 100%;
    height: 220px;
    background: #e8eef5;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero-cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.hero-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #8a97a6;
    font-size: 13px;
    background: linear-gradient(135deg, #edf3f9, #e3ebf4);
}

.hero-body {
    padding: 16px;
}

.cat-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    font-size: 12px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border: 1px solid #cde1f7;
    border-radius: var(--radius);
}

.title {
    margin: 12px 0 10px;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: .2px;
}

.summary {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--muted);
    background: var(--card-soft);
    border-left: 4px solid var(--brand);
    padding: 10px 12px;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meta-item {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    font-size: 12px;
    color: #526172;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.action-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.font-tools,
.quick-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.hint {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    font-size: 13px;
    color: var(--muted);
    background: var(--bg-soft);
    border: 1px solid var(--line);
}

.article-wrap {
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

article {
    padding: 16px;
    font-size: var(--fs);
    line-height: var(--lh);
    color: var(--text);
    word-break: break-word;
}
article h1,
article h2,
article h3,
article h4 {
    color: #0f172a;
    line-height: 1.45;
    margin: 1.2em 0 .55em;
    font-weight: 700;
    font-size:1.2em;
}

article h2 {
    font-size: 22px;
}

article h3 {
    font-size: 19px;
}

article p {
    margin: 0 0 1em;
    color: #334155;
}

article ul,
article ol {
    margin: 0 0 1em 1.25em;
    padding: 0;
    color: #334155;
}

article li {
    margin: .45em 0;
}

article img {
    max-width: 100%;
    height: auto;
}

article table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    overflow-x: auto;
    display: block;
}

article th,
article td {
    border: 1px solid var(--line);
    padding: 10px 8px;
    text-align: left;
    white-space: nowrap;
}

article blockquote {
    margin: 1em 0;
    padding: 12px 14px;
    background: var(--card-soft);
    border-left: 4px solid var(--brand);
    color: #475569;
}

article code {
    font-family: Consolas, Monaco, monospace;
    font-size: .95em;
    padding: .14em .34em;
    background: #eff4fb;
    border: 1px solid #d7e2ef;
    color: #0f5ea8;
}

article pre {
    overflow: auto;
    padding: 12px;
    background: #f4f8fc;
    border: 1px solid var(--line);
}

.nav-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.nav-link {
    display: block;
    padding: 14px 12px;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    min-width: 0;
}

.nav-k {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
    border-radius: var(--radius);
}

.nav-v {
    display: block;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    border-radius: var(--radius);
}

.loading,
.error {
    padding: 30px 16px;
    text-align: center;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    color: var(--muted);
    line-height: 1.7;
}

.error {
    color: var(--danger);
}

.footer-space {
    height: 20px;
}

@media (max-width: 560px) {
    .title {
        font-size: 23px;
    }

    .hero-cover {
        height: 190px;
    }

    .nav-box {
        grid-template-columns: 1fr;
    }

    article {
        padding: 14px;
    }
}
