* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow-y: auto;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Noto Sans', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
    background: #fefefe;
    color: #0b1e33;
    line-height: 1.6;
    min-height: 100%;
    height: auto;
    padding: 0;
    margin: 0;
    overflow-y: auto;
}

.top-nav {
    background: #eef3f8;
    color: #1e3a5a;
    padding: 0 1.5rem;
    height: 56px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #c8d8e8;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.top-nav .nav-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    flex-wrap: wrap;
}

.top-nav .nav-breadcrumb a {
    color: #1e4a6b;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.top-nav .nav-breadcrumb a:hover {
    color: #0a2a40;
    text-decoration: underline;
}

.top-nav .nav-breadcrumb .separator {
    color: #6f8aa5;
    margin: 0 0.1rem;
}

.top-nav .type,
.top-nav .nav-breadcrumb .current {
    color: #0b1e33;
    font-weight: 500;
    background: #d4e2f0;
    padding: 0.15rem 0.8rem;
    border-radius: 30px;
    font-size: 0.75rem;
}

.top-nav .nav-right {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.main-container {
    flex: 1 0 auto;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 1rem;
    width: 100%;
}

.element-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #dde4ec;
    padding-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}

.element-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.element-title h2 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: #0b1e33;
    font-family: 'Inter', monospace;
    padding: 0.1rem 0.8rem;
    display: inline-block;
}

.narrow-col {
    width: 25ch;
    min-width: 25ch;
    word-break: break-all;
}
.wide-col {
    width: 40ch;
    min-width: 40ch;
    word-break: break-all;
}
.last-col {
    word-break: break-all;
}

.jump-links-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.8rem;
    margin-left: auto;
}

.element-jump-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    background: #eef3f8;
    padding: 0.3rem 1rem;
    border-radius: 30px;
    font-size: 0.8rem;
}

.element-jump-links a {
    color: #1e4a6b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.element-jump-links a:hover {
    color: #0b2b40;
    text-decoration: underline;
}

.element-jump-links .jump-sep {
    color: #a0b8ce;
}

.element-comment {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: #1f3b54;
    background: #eef3f8;
    padding: 0.6rem 1.2rem;
    border-left: 5px solid #6a8fa8;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
}

.return-row {
    margin: 0.3rem 0;
    padding: 0.4rem 1.2rem;
    background: #eef3f8;
    border-radius: 30px;
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #1b3a57;
    border: 1px solid #d4e2f0;
}

.return-row code {
    background: #dce6f0;
    padding: 0.1rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.prototype-section {
    background: #1e2a3a;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
}

.prototype-section .proto-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #a5c1d9;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.prototype-code {
    margin-left: 4rem;
    font-size: 1rem;
    color: #e6edf5;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
}

.ty { color: #82aaff; }
.fn { color: #c3e88d; }
.pm { color: #f78c6c; }

.ty a {
    color: #82aaff;
    text-decoration: none;
    transition: color 0.2s;
}

.ty a:hover {
    color: #6e94e9;
    text-decoration: underline;
}

.table-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.table-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 0 0 1px #e9edf3;
    overflow: hidden;
    width: 100%;
}

.table-card .card-header {
    background: #eef3f8;
    padding: 0.7rem 1.2rem;
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 1px solid #dde4ec;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1b3a57;
}

.table-card table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table-card th {
    text-align: left;
    padding: 0.6rem 1.2rem;
    background: #e2ebf5;
    color: #1a3a55;
    border-bottom: 2px solid #c8d8e8;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}

blockquote {
  margin-left: 20px;
}

.submember-category {
    background: #e2ebf5;
    font-weight: 600;
    color: #1a3a55;
    border-top: 1px solid #c8d8e8;
    border-bottom: 1px solid #c8d8e8;
}
.submember-category td {
    padding: 0.4rem 1.2rem;
    background: #e2ebf5;
    font-size: 0.8rem;
    letter-spacing: 0.3px;
}

.table-card td {
    padding: 0.6rem 1.2rem;
    border-bottom: 1px solid #eef2f7;
    vertical-align: top;
    font-size: 0.85rem;
}

.table-card tr:last-child td {
    border-bottom: none;
}

.param-name,
.attr-name,
.member-name {
    font-weight: 500;
    color: #1d4b6e;
    font-size: 0.85rem;
}

.data-type {
    color: #2c5778;
    display: inline-block;
}

.element-type {
    color: #2c5778;
    font-style: italic;
    display: inline-block;
}

.data-type-sufix {
    color: #808080;
    display: inline-block;
    margin-left: 0.2rem;
}

.ty .data-type-sufix {
    color: #b0b0b0;
    font-style: italic;
    font-size: 0.8em;
}

.param-name a,
.attr-name a,
.member-name a,
.data-type a {
    color: #0066cc;
    text-decoration: none;
    display: inline-block;
    transition: color 0.2s;
}

.param-name a:hover,
.attr-name a:hover,
.member-name a:hover,
.data-type a:hover {
    color: #004499;
    text-decoration: underline;
}

.param-desc,
.attr-desc,
.member-desc {
    color: #1e384f;
    font-size: 0.85rem;
    word-break: break-all;
}

.member-value,
.param-value,
.attr-value {
    color: #1d4b6e;
    display: inline-block;
}

.default-value {
    color: #c3e88d;
    display: inline-block;
}

.submember-item td:first-child {
    padding-left: 2.2rem;
}
.submember-item .member-name {
    font-weight: 500;
}

.related-links-section {
    margin-bottom: 1.5rem;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 0 0 1px #e9edf3;
    overflow: hidden;
}

.related-links-section .card-header {
    background: #eef3f8;
    padding: 0.7rem 1.2rem;
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 1px solid #dde4ec;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1b3a57;
}

.related-links-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem 1.2rem;
}

.related-links-vertical .link-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-bottom: 1px solid #eef2f7;
    padding-bottom: 0.6rem;
}

.related-links-vertical .link-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.group-label a,
.related-links-vertical .link-group .group-label {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #2d7fc1;
    margin-bottom: 0.15rem;
}

.group-label a {
    text-decoration: none;
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 20px;
    background: #e2ebf5;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.group-label a:hover {
    color: #1d6fb1;
    background: #c0d4e7;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(45, 127, 193, 0.25);
}

.related-links-vertical .link-group .group-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.2rem;
    align-items: center;
}

.related-links-vertical .link-group .group-items .group-item {
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
    padding: 0.1rem 0;
    white-space: nowrap;
}

.group-item a {
    color: #1e4a6b;
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.group-item a:hover {
    color: #0f2d44;
    text-decoration: underline;
}

.guide-icon {
    color: #2d7fc1;
    width: 1.2rem;
    text-align: center;
    flex-shrink: 0;
}

.bottom-nav {
    background: #ffffff;
    border-top: 1px solid #dde4ec;
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0;
    flex-shrink: 0;
    position: relative;
    width: 100%;
    clear: both;
    min-height: 60px;
}

.bottom-nav .nav-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.bottom-nav .nav-left a {
    color: #1e4a6b;
    text-decoration: none;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.bottom-nav .nav-left a:hover {
    color: #0a2a40;
    text-decoration: underline;
}

.bottom-nav .nav-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #3d5e7a;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.bottom-nav .nav-right .version-badge {
    background: #e2ebf5;
    padding: 0.15rem 0.8rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 500;
}

@media (max-width: 1024px) {
    .narrow-col {
        width: 100px;
        min-width: 100px;
    }
    .wide-col {
        width: 120px;
        min-width: 120px;
    }

    .element-title h2 {
        font-size: 1.3rem;
    }
    .main-container {
        padding: 1.2rem 1.2rem 0.8rem;
    }
    .top-nav {
        padding: 0 1.2rem;
        height: 50px;
        min-height: 50px;
    }
    .top-nav .nav-breadcrumb {
        font-size: 0.8rem;
    }
}

/* 到768后页面布局会自动切换为上下布局 */
@media (max-width: 768px) {
    html,
    body {
        height: auto;
        min-height: 100%;
        overflow-y: auto !important;
    }

    .main-container {
        min-height: auto;
        padding: 0.8rem 0.8rem 0.5rem;
    }

    .top-nav {
        padding: 0 0.8rem;
        height: auto;
        min-height: 48px;
        gap: 0.3rem;
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
    }
    .top-nav .nav-breadcrumb {
        font-size: 0.75rem;
        gap: 0.2rem;
    }

    .top-nav .type,
    .top-nav .nav-breadcrumb .current {
        font-size: 0.7rem;
        padding: 0.1rem 0.5rem;
    }

    .top-nav .nav-right {
        gap: 0.15rem;
    }

    .jump-links-wrapper {
        margin-left: 0;
        justify-content: flex-start;
    }

    .element-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding-bottom: 0.6rem;
        margin-bottom: 0.8rem;
    }
    .element-title h2 {
        font-size: 1.2rem;
        padding: 0.05rem 0.5rem;
    }
    .element-jump-links {
        justify-content: flex-start;
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
        gap: 0.2rem 0.3rem;
        border-radius: 30px;
        background: #eef3f8;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }
    .element-jump-links a {
        font-size: 0.75rem;
        padding: 0.2rem 0.3rem;
        white-space: nowrap;
    }
    .element-jump-links .jump-sep {
        display: inline;
        color: #a0b8ce;
        font-size: 0.7rem;
        padding: 0 0.1rem;
    }
    .element-comment {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    .return-row {
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
        flex-wrap: wrap;
        margin: 0.3rem 0 0.8rem;
    }
    .return-row code {
        font-size: 0.7rem;
    }

    .prototype-section {
        padding: 0.6rem 0.8rem;
        margin-bottom: 1.0rem;
    }
    .prototype-code {
        font-size: 0.85rem;
    }

    .table-section {
        gap: 1.2rem;
        margin: 1rem 0 0.8rem;
    }
    .table-card .card-header {
        font-size: 0.9rem;
        padding: 0.5rem 0.8rem;
    }
    .table-card th,
    .table-card td {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    .submember-category td {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    .submember-item td:first-child {
        padding-left: 1.2rem;
    }

    .related-links-section {
        margin-top: 1rem;
    }
    .related-links-section .card-header {
        font-size: 0.9rem;
        padding: 0.5rem 0.8rem;
    }
    .related-links-vertical {
        padding: 0.6rem 0.8rem;
        gap: 0.5rem;
    }
    .related-links-vertical .link-group {
        padding-bottom: 0.4rem;
    }
    .related-links-vertical .link-group .group-label {
        font-size: 0.75rem;
    }
    .related-links-vertical .link-group .group-items {
        gap: 0.2rem 0.8rem;
    }
    .related-links-vertical .link-group .group-items .group-item {
        font-size: 0.7rem;
        white-space: normal;
    }
    .guide-icon {
        width: 1rem;
    }

    .bottom-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.6rem 0.8rem;
        margin-top: 1rem;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative;
        clear: both;
        width: 100%;
        border-top: 1px solid #dde4ec;
        background: #ffffff;
        min-height: 80px;
    }

    .bottom-nav .nav-left,
    .bottom-nav .nav-right {
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
        display: flex;
        font-size: 0.8rem;
        gap: 0.5rem;
    }

    .bottom-nav .nav-left a {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }

    .bottom-nav .nav-right {
        font-size: 0.8rem;
        gap: 0.5rem;
        justify-content: center;
    }

    .bottom-nav .nav-right .version-badge {
        font-size: 0.7rem;
        padding: 0.1rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .narrow-col {
        width: 60px;
        min-width: 60px;
    }
    .wide-col {
        width: 75px;
        min-width: 75px;
    }

    .top-nav {
        padding: 0 0.5rem;
        padding-top: 0.3rem;
        padding-bottom: 0.3rem;
        min-height: 42px;
    }
    .top-nav .nav-breadcrumb {
        font-size: 0.65rem;
        gap: 0.15rem;
    }

    .top-nav .type,
    .top-nav .nav-breadcrumb .current {
        font-size: 0.6rem;
        padding: 0.05rem 0.4rem;
    }

    .top-nav .nav-right {
        gap: 0.1rem;
    }

    .main-container {
        padding: 0.5rem 0.5rem 0.3rem;
    }

    .element-title h2 {
        font-size: 1.1rem;
        padding: 0.05rem 0.4rem;
    }
    .element-jump-links {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
        gap: 0.15rem 0.2rem;
    }
    .element-jump-links a {
        font-size: 0.7rem;
        padding: 0.15rem 0.2rem;
    }
    .element-jump-links .jump-sep {
        font-size: 0.6rem;
        padding: 0 0.05rem;
    }
    .element-comment {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
        border-left-width: 3px;
    }
    .return-row {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
    .return-row code {
        font-size: 0.6rem;
    }
}
