:root {
    --brand: #1f6fb2;
    --brand-deep: #174f7f;
    --accent: #f59f0b;
    --text: #1f2937;
    --muted: #667085;
    --line: #d9e2ec;
    --panel: #ffffff;
    --panel-soft: #f7f9fc;
    --page: #f3f6fb;
    --success: #198754;
    --danger: #d9485f;
    --shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    --radius: 18px;
    --header-height: 72px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    color: var(--text);
    background: var(--page);
    min-width: 320px;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--brand);
    text-decoration: none;
}

img {
    max-width: 100%;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: none !important;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1100;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(217, 226, 236, 0.9);
}

.site-header-inner {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: #12263f;
}

.site-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #fff;
    font-size: 18px;
    box-shadow: 0 10px 24px rgba(31, 111, 178, 0.24);
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.top-nav a {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    color: #344054;
    transition: all 0.2s ease;
}

.top-nav a:hover,
.top-nav a.is-active {
    background: rgba(31, 111, 178, 0.1);
    color: var(--brand-deep);
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #eef4fb;
    color: var(--brand-deep);
    font-size: 14px;
    font-weight: 600;
}

.header-cta:hover {
    background: #e5f0fb;
}

.menu-toggle {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: #213547;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
}

.drawer-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.36);
    opacity: 0;
    visibility: hidden;
    transition: all 0.24s ease;
    z-index: 1180;
}

.drawer-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 360px;
    max-width: calc(100vw - 24px);
    height: 100vh;
    background: #fff;
    z-index: 1190;
    box-shadow: -24px 0 54px rgba(15, 23, 42, 0.12);
    transition: right 0.24s ease;
    padding: 24px;
    overflow-y: auto;
}

body.drawer-open .drawer-mask {
    opacity: 1;
    visibility: visible;
}

body.drawer-open .drawer-panel {
    right: 0;
}

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.drawer-title {
    font-size: 18px;
    font-weight: 700;
}

.drawer-close {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: #334155;
    cursor: pointer;
}

.drawer-group {
    margin-bottom: 22px;
}

.drawer-group h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.drawer-links {
    display: grid;
    gap: 10px;
}

.drawer-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: var(--panel-soft);
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 14px;
    color: #243b53;
}

.drawer-links a:hover,
.drawer-links a.is-active {
    border-color: rgba(31, 111, 178, 0.2);
    background: rgba(31, 111, 178, 0.06);
}

.drawer-note {
    padding: 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
}

.hero-block {
    padding: 52px 0 30px;
}

.hero-shell {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid rgba(31, 111, 178, 0.1);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: 48px;
}

.hero-eyebrow,
.page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--brand);
    letter-spacing: 0.04em;
    margin-bottom: 18px;
}

.hero-shell h1,
.page-banner h1 {
    font-size: 40px;
    line-height: 1.18;
    margin-bottom: 18px;
    color: #102a43;
    font-weight: 700;
}

.hero-shell p,
.page-banner p {
    font-size: 16px;
    line-height: 1.9;
    color: var(--muted);
    margin-bottom: 0;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.hero-points,
.summary-list,
.info-list,
.faq-list,
.editor-tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hero-points {
    display: grid;
    gap: 12px;
    margin-top: 28px;
}

.hero-points li,
.summary-list li,
.editor-tips-list li {
    position: relative;
    padding-left: 24px;
    color: #344054;
    line-height: 1.8;
}

.hero-points li::before,
.summary-list li::before,
.editor-tips-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 11px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
}

.summary-card,
.info-card,
.metric-card,
.tool-card,
.faq-card,
.panel-card,
.workspace-sidebar,
.editor-shell,
.workspace-panel,
.workspace-toolbar,
.matrix-table-wrap {
    background: var(--panel);
    border: 1px solid rgba(217, 226, 236, 0.9);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.summary-card {
    padding: 26px;
    height: 100%;
}

.summary-card h2,
.section-head h2,
.panel-card h3,
.workspace-sidebar h2,
.editor-title h2,
.workspace-panel h3,
.info-card h3,
.tool-card h3,
.faq-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: #102a43;
    margin-bottom: 14px;
}

.section-block {
    padding: 14px 0 26px;
}

.section-head {
    margin-bottom: 20px;
}

.section-head p {
    margin: 0;
    font-size: 15px;
    line-height: 1.8;
    color: var(--muted);
}

.metric-grid,
.tool-grid,
.info-grid,
.faq-grid,
.panel-grid {
    display: grid;
    gap: 18px;
}

.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.info-grid,
.faq-grid,
.tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card,
.info-card,
.tool-card,
.faq-card,
.panel-card {
    padding: 24px;
}

.metric-card strong {
    display: block;
    font-size: 34px;
    line-height: 1;
    color: var(--brand-deep);
    margin-bottom: 12px;
}

.metric-card p,
.info-card p,
.tool-card p,
.faq-card p,
.panel-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.tool-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tool-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--brand-deep);
    background: #eef5fb;
}

.tool-card-tags,
.page-tags,
.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool-card-tags span,
.page-tags span,
.hero-tags span,
.file-ext,
.badge-soft {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef4fb;
    color: var(--brand-deep);
    font-size: 12px;
    font-weight: 600;
}

.tool-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--brand);
    font-weight: 600;
}

.matrix-table-wrap {
    overflow: hidden;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
}

.matrix-table th,
.matrix-table td {
    padding: 16px 18px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
    font-size: 14px;
    line-height: 1.8;
}

.matrix-table th {
    background: #f8fbfe;
    color: #1e293b;
    font-weight: 700;
}

.matrix-table tr:last-child td {
    border-bottom: 0;
}

.faq-card p + p {
    margin-top: 10px;
}

.site-footer {
    padding: 26px 0 40px;
}

.site-footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px;
    padding-top: 18px;
    border-top: 1px solid rgba(217, 226, 236, 0.9);
    color: var(--muted);
    font-size: 14px;
}

.page-banner {
    padding: 34px 0 18px;
}

.page-banner-shell {
    padding: 34px 38px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid rgba(217, 226, 236, 0.96);
    border-radius: 24px;
}

.wide-container {
    padding-left: 24px;
    padding-right: 24px;
}

.workspace-section {
    padding: 0 0 28px;
}

.workspace {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.workspace-toolbar {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-group .btn,
.toolbar-group .form-control {
    height: 38px;
    border-radius: 10px;
    font-size: 14px;
}

.toolbar-group .btn-light,
.toolbar-group .btn-outline-secondary,
.toolbar-group .btn-outline-primary {
    border-color: #d0dae5;
    color: #243b53;
}

.toolbar-group .btn-light:hover,
.toolbar-group .btn-outline-secondary:hover,
.toolbar-group .btn-outline-primary:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: #f5faff;
}

.workspace-body {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: stretch;
}

.workspace-sidebar,
.editor-shell,
.workspace-panel {
    min-height: 720px;
}

.workspace-sidebar {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-head,
.panel-head,
.editor-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sidebar-head strong,
.panel-head strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 0 10px;
    height: 28px;
    border-radius: 999px;
    background: #eef4fb;
    color: var(--brand);
    font-size: 12px;
}

.drop-zone {
    border: 1px dashed #bfd0e0;
    border-radius: 14px;
    background: #f9fbfd;
    padding: 16px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--muted);
    transition: all 0.2s ease;
}

.drop-zone.is-dragover {
    border-color: var(--brand);
    background: #eef5fb;
    color: var(--brand-deep);
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 240px;
    overflow-y: auto;
}

.file-item {
    padding: 13px 14px;
    border: 1px solid #e5edf5;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.18s ease;
}

.file-item:hover,
.file-item.is-active {
    border-color: rgba(31, 111, 178, 0.22);
    background: #f8fbff;
}

.file-item-top,
.file-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.file-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #243b53;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-meta {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
}

.file-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    flex: 0 0 auto;
}

.file-item.is-active .file-dot,
.file-item.is-dirty .file-dot {
    background: var(--brand);
}

.sidebar-note,
.panel-note,
.page-note {
    padding: 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #ebf0f6;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.8;
}

.editor-shell {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.editor-topline {
    align-items: flex-start;
}

.editor-title h2 {
    margin-bottom: 6px;
}

.editor-title span {
    display: block;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.7;
}

.editor-stage {
    flex: 1;
    border: 1px solid #e6edf5;
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
    display: flex;
    min-height: 560px;
}

.code-stage,
.quill-stage,
.preview-box,
.source-box {
    width: 100%;
    height: 100%;
}

.quill-stage {
    display: flex;
    flex-direction: column;
}

.quill-stage [data-role="quill-editor"] {
    flex: 1;
    min-height: 0;
}

.quill-stage .ql-container {
    flex: 1;
    overflow: auto;
}

.code-stage textarea {
    display: none;
}

.CodeMirror {
    width: 100%;
    height: 100%;
    min-height: 560px;
    font-size: 14px;
    line-height: 1.7;
    color: #1e293b;
}

.ql-toolbar.ql-snow {
    border: 0;
    border-bottom: 1px solid #edf2f7;
    padding: 12px 14px;
}

.ql-container.ql-snow {
    border: 0;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 15px;
}

.ql-editor {
    min-height: 560px;
    line-height: 1.9;
    color: #1f2937;
}

.word-shell .ql-editor {
    width: min(840px, calc(100% - 40px));
    margin: 24px auto;
    padding: 56px 62px;
    background: #fff;
    border: 1px solid #dde6ef;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    min-height: 960px;
}

.status-bar {
    padding: 12px 14px;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    background: #fafcff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
}

.workspace-panel {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-box,
.source-box {
    border: 1px solid #e6edf5;
    border-radius: 14px;
    background: #fff;
    overflow: auto;
}

.preview-box {
    padding: 18px;
    line-height: 1.85;
    color: #334155;
}

.preview-box h1,
.preview-box h2,
.preview-box h3,
.preview-box h4,
.preview-box h5,
.preview-box h6 {
    margin-top: 1.4em;
    margin-bottom: 0.6em;
    color: #102a43;
    font-weight: 700;
}

.preview-box h1:first-child,
.preview-box h2:first-child,
.preview-box h3:first-child {
    margin-top: 0;
}

.preview-box p,
.preview-box li,
.preview-box blockquote {
    margin-bottom: 0.9em;
}

.preview-box pre,
.preview-box code {
    font-family: Consolas, Monaco, monospace;
}

.preview-box pre {
    padding: 14px;
    background: #f6f8fb;
    border-radius: 12px;
    overflow: auto;
}

.preview-box table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

.preview-box th,
.preview-box td {
    border: 1px solid #dce6ef;
    padding: 10px 12px;
}

.preview-box blockquote {
    padding: 12px 16px;
    background: #f8fbfe;
    border-left: 4px solid var(--brand);
    color: #52606d;
}

.source-box {
    padding: 16px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    color: #1e293b;
    white-space: pre-wrap;
    line-height: 1.7;
}

.snippet-list {
    display: grid;
    gap: 10px;
}

.snippet-item {
    width: 100%;
    padding: 14px;
    border: 1px solid #e3ebf3;
    border-radius: 14px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: all 0.18s ease;
}

.snippet-item:hover {
    border-color: rgba(31, 111, 178, 0.3);
    background: #f7fbff;
}

.snippet-item strong {
    display: block;
    margin-bottom: 6px;
    color: #102a43;
    font-size: 14px;
}

.snippet-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.markdown-cheatsheet {
    display: grid;
    gap: 10px;
}

.markdown-cheatsheet code {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 12px;
    font-family: Consolas, Monaco, monospace;
}

.empty-state {
    color: var(--muted);
}

@media (max-width: 1399px) {
    .workspace-body {
        grid-template-columns: 250px minmax(0, 1fr) 300px;
    }
}

@media (max-width: 1199px) {
    .top-nav {
        display: none;
    }

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

    .info-grid,
    .faq-grid,
    .tool-grid,
    .workspace-body {
        grid-template-columns: 1fr;
    }

    .workspace-sidebar,
    .workspace-panel,
    .editor-shell {
        min-height: auto;
    }

    .workspace-panel {
        order: 3;
    }
}

@media (max-width: 991px) {
    .hero-shell,
    .page-banner-shell {
        padding: 28px;
    }

    .hero-shell h1,
    .page-banner h1 {
        font-size: 32px;
    }

    .header-cta {
        display: none;
    }

    .metric-grid,
    .info-grid,
    .faq-grid,
    .tool-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    :root {
        --header-height: 64px;
        --radius: 16px;
    }

    .site-brand {
        font-size: 17px;
    }

    .site-brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        font-size: 16px;
    }

    .hero-block {
        padding-top: 28px;
    }

    .hero-shell,
    .page-banner-shell,
    .workspace-toolbar,
    .workspace-sidebar,
    .editor-shell,
    .workspace-panel,
    .summary-card,
    .metric-card,
    .tool-card,
    .info-card,
    .faq-card,
    .panel-card {
        padding: 20px;
    }

    .hero-shell h1,
    .page-banner h1 {
        font-size: 28px;
    }

    .hero-shell p,
    .page-banner p {
        font-size: 15px;
    }

    .toolbar-group {
        width: 100%;
    }

    .toolbar-group .btn,
    .toolbar-group .form-control {
        flex: 1 1 calc(50% - 10px);
    }

    .status-bar,
    .site-footer-inner,
    .sidebar-head,
    .panel-head,
    .editor-topline {
        align-items: flex-start;
        flex-direction: column;
    }

    .wide-container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .drawer-panel {
        width: calc(100vw - 12px);
        max-width: calc(100vw - 12px);
        padding: 20px;
    }

    .word-shell .ql-editor {
        width: calc(100% - 24px);
        margin: 12px auto;
        padding: 28px 20px;
        min-height: 700px;
    }
}
