:root {
    --feishu-primary: #0066ff;
    --feishu-hover: #e8f3ff;
    --feishu-active: #d0e0ff;
    --feishu-gray: #f9fafc;
    --feishu-text: #333f51;
    --feishu-muted: #86909c;
    --feishu-border: #e5e6eb;
    --feishu-soft: #ecfdf5;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--feishu-text);
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
figure,
blockquote {
    margin: 0;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

button {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

img,
video {
    display: block;
    max-width: 100%;
}

.feishu-app {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: #fff;
}

.sidebar {
    position: relative;
    z-index: 30;
    display: flex;
    flex: 0 0 256px;
    flex-direction: column;
    width: 256px;
    height: 100%;
    border-right: 1px solid var(--feishu-border);
    background: var(--feishu-gray);
    transition: transform 0.3s ease;
}

.sidebar-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 57px;
    padding: 16px;
    border-bottom: 1px solid var(--feishu-border);
}

.sidebar-title h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--feishu-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
}

.sidebar-title .fa-book {
    color: var(--feishu-primary);
}

.side-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--feishu-muted);
}

.side-button:hover,
.side-button:focus-visible {
    background: var(--feishu-hover);
    color: var(--feishu-primary);
    outline: 0;
}

.side-close,
.open-side {
    display: none;
}

.menu-tap-hint {
    display: none;
}

@keyframes menuTapHint {
    0%,
    100% {
        opacity: 0.48;
        transform: translateX(4px) scale(0.92);
    }

    45% {
        opacity: 1;
        transform: translateX(-4px) scale(1.08);
    }
}

@keyframes menuTapRipple {
    0% {
        opacity: 0.46;
        transform: scale(0.62);
    }

    100% {
        opacity: 0;
        transform: scale(1.42);
    }
}

.catalog {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: none;
}

.catalog::-webkit-scrollbar,
.doc-scroll::-webkit-scrollbar,
.toc-panel::-webkit-scrollbar {
    display: none;
}

.cate-block {
    margin-bottom: 4px;
}

.cate-item,
.doc-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    border-radius: 6px;
    text-align: left;
    transition: background 0.16s ease, color 0.16s ease;
}

.cate-item {
    min-height: 34px;
    padding: 6px 8px;
    color: var(--feishu-text);
    font-size: 14px;
    line-height: 1.5;
}

.cate-item:hover,
.doc-item:hover {
    background: var(--feishu-hover);
}

.cate-arrow {
    margin-right: 4px;
    color: var(--feishu-text);
    font-size: 12px;
    transition: transform 0.2s ease;
}

.cate-block.open .cate-arrow {
    transform: rotate(90deg);
}

.cate-folder {
    margin-right: 6px;
    color: var(--feishu-text);
    font-size: 14px;
}

.cate-item span,
.doc-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-group {
    display: none;
    margin-left: 20px;
}

.cate-block.open .doc-group {
    display: block;
}

.doc-item {
    min-height: 34px;
    padding: 6px 8px;
    color: #566274;
    font-size: 14px;
    line-height: 1.5;
}

.home-nav-item {
    margin-bottom: 8px;
}

.doc-item .fa {
    margin-right: 6px;
    color: var(--feishu-muted);
    font-size: 14px;
}

.doc-item.active {
    background: var(--feishu-active);
    color: var(--feishu-primary);
    font-weight: 500;
}

.doc-item.active .fa {
    color: var(--feishu-primary);
}

.catalog-empty {
    display: grid;
    min-height: 180px;
    place-items: center;
    gap: 10px;
    color: var(--feishu-muted);
    font-size: 14px;
    text-align: center;
}

.catalog-empty .fa {
    color: var(--feishu-primary);
    font-size: 32px;
}

.main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

.main-header {
    display: flex;
    flex: 0 0 48px;
    align-items: center;
    height: 48px;
    padding: 0 16px;
    border-bottom: 1px solid var(--feishu-border);
    background: #fff;
}

.breadcrumb {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 4px;
    color: var(--feishu-muted);
    font-size: 14px;
    line-height: 1.5;
}

.breadcrumb .fa-home {
    color: var(--feishu-muted);
    font-size: 12px;
}

.crumb-separator {
    margin: 0 4px;
    color: var(--feishu-muted);
    font-size: 12px;
}

.crumb-current {
    overflow: hidden;
    color: var(--feishu-text);
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reader-layout {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.doc-scroll {
    flex: 1 1 auto;
    min-width: 0;
    overflow-y: auto;
    padding: 40px;
    background: #fff;
    scrollbar-width: none;
}

.doc-shell {
    width: min(960px, 100%);
    margin: 0 auto;
}

.doc-prose {
    overflow-x: auto;
    color: var(--feishu-text);
    font-size: 16px;
    line-height: 1.5;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}

.doc-prose h1,
.doc-prose h2,
.doc-prose h3,
.doc-prose h4,
.doc-prose h5,
.doc-prose h6 {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

.doc-prose h1 {
    width: 100%;
    margin: 0 0 16px;
    padding: 15px 16px;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    background: #fff7ed;
    color: #172033;
    box-shadow: none;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.5;
}

.doc-prose p {
    color: inherit;
}

.doc-prose a {
    color: var(--feishu-primary);
    text-decoration: none;
}

.doc-prose a:hover {
    text-decoration: underline;
}

.doc-prose .glow-button-wrap {
    display: block;
    width: 100%;
    margin: 16px 0;
}

.doc-prose .glow-link-button {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 136px;
    max-width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 12px 28px;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 999px;
    background:
        linear-gradient(135deg, #111827, #1d4ed8 55%, #0f766e) padding-box,
        linear-gradient(90deg, #22d3ee, #2563eb, #7c3aed, #f59e0b, #22c55e, #22d3ee) border-box;
    background-size: auto, 300% 100%;
    color: #fff !important;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.24), 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    text-decoration: none !important;
    text-shadow: 0 1px 10px rgba(255, 255, 255, 0.22);
    vertical-align: middle;
    animation: glowButtonFlow 2.8s linear infinite;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.doc-prose .glow-link-button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0 30%, rgba(255, 255, 255, 0.34) 44%, transparent 58%);
    pointer-events: none;
    transform: translateX(-130%);
    animation: glowButtonSheen 2.4s ease-in-out infinite;
}

.doc-prose .glow-link-button:hover,
.doc-prose .glow-link-button:focus-visible {
    color: #fff !important;
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.32), 0 0 22px rgba(45, 212, 191, 0.34);
    outline: 0;
    text-decoration: none;
    transform: translateY(-1px);
}

.doc-prose .glow-link-button:active {
    transform: translateY(0);
}

@keyframes glowButtonFlow {
    0% {
        background-position: 0 0, 0 0;
    }

    100% {
        background-position: 0 0, 300% 0;
    }
}

@keyframes glowButtonSheen {
    0% {
        transform: translateX(-130%);
    }

    46%,
    100% {
        transform: translateX(130%);
    }
}

.doc-prose strong,
.doc-prose b {
    font-weight: 600;
}

.doc-prose small {
    color: var(--feishu-muted);
    font-size: 13px;
}

.doc-prose img,
.doc-prose video,
.doc-prose .video-frame {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 16px 0;
    border-radius: 8px;
}

.doc-prose img {
    border: 1px solid #edf0f5;
    cursor: zoom-in;
    pointer-events: auto;
    -webkit-user-drag: none;
    user-drag: none;
}

.doc-prose .video-frame {
    padding: 8px;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
}

.doc-prose .video-frame video {
    margin: 0;
    border-radius: 3px;
    background: #000;
}

.doc-scroll.video-layer-suppressed .doc-prose .video-frame {
    display: none !important;
}

.doc-prose table {
    width: max-content;
    min-width: 100%;
    margin: 16px 0;
    border-collapse: collapse;
    border: 1px solid var(--feishu-border);
    background: #fff;
    color: var(--feishu-text);
    font-size: 15px;
    line-height: 1.55;
}

.doc-prose th,
.doc-prose td {
    min-width: 128px;
    padding: 10px 12px;
    border: 1px solid var(--feishu-border);
    text-align: left;
    vertical-align: top;
}

.doc-prose th {
    background: #f7f8fa;
    color: #172033;
    font-weight: 600;
}

.doc-prose tbody tr:nth-child(even) td {
    background: #fbfcff;
}

.doc-prose .notice,
.doc-prose .empty-doc {
    width: 100%;
    margin: 12px 0;
    border: 1px solid #d6f5e1;
    border-radius: 8px;
    background: var(--feishu-soft);
}

.doc-prose .notice {
    padding: 8px 16px;
}

.doc-prose .empty-doc {
    padding: 16px;
}

.doc-prose .notice strong {
    line-height: 1.4;
}

.doc-prose .notice p {
    margin-top: 4px;
    color: #45655a;
    font-size: 14px;
    line-height: 1.4;
}

.empty-tip {
    display: flex;
    height: 100%;
    min-height: 260px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--feishu-muted);
    text-align: center;
}

.empty-tip-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.empty-tip-content .fa {
    margin-bottom: 16px;
    color: var(--feishu-muted);
    font-size: 48px;
}

.front-qrcode-panel {
    width: 100%;
    padding: 18px 24px;
    border: 1px solid #e5edf7;
    border-radius: 8px;
    background: #f8fbff;
}

.front-qrcode-doc {
    margin-top: 40px;
}

.front-qrcode-heading {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.front-qrcode-heading strong {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #172033;
    font-size: 15px;
    font-weight: 700;
}

.front-qrcode-heading .fa {
    color: var(--feishu-primary);
}

.front-qrcode-heading small {
    color: var(--feishu-muted);
    font-size: 13px;
}

.front-qrcode-list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(36px, 10vw, 160px);
}

.front-qrcode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: clamp(96px, 7vw, 118px);
}

.front-qrcode-card img {
    width: 100%;
    aspect-ratio: 1;
    padding: 6px;
    border: 1px solid #edf0f5;
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
    -webkit-user-drag: none;
    user-drag: none;
}

.front-qrcode-card span {
    color: #566274;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.toc-panel {
    display: block;
    flex: 0 0 224px;
    width: 224px;
    overflow-y: auto;
    padding: 16px;
    border-left: 1px solid var(--feishu-border);
    background: #fff;
    scrollbar-width: none;
}

.toc-title {
    margin-bottom: 12px;
    color: var(--feishu-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}

.toc-link {
    display: block;
    width: 100%;
    padding: 4px 0;
    color: var(--feishu-muted);
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
    transition: color 0.16s ease;
}

.toc-link:hover,
.toc-link:focus-visible {
    color: var(--feishu-primary);
    outline: 0;
}

.toc-h1 {
    margin-top: 8px;
    margin-bottom: 6px;
    color: var(--feishu-text);
    font-weight: 500;
}

.toc-h2 {
    padding-left: 12px;
}

.mobile-mask {
    display: none;
}

.image-preview {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 4vw, 48px);
    background: rgba(12, 18, 28, 0.86);
}

.image-preview.open {
    display: flex;
}

.image-preview img {
    width: auto;
    max-width: 96vw;
    max-height: 90vh;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
    cursor: zoom-out;
    object-fit: contain;
}

.image-preview-close {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 121;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    color: #fff;
    background: rgba(10, 18, 30, 0.68);
    font-size: 28px;
    line-height: 1;
}

.image-preview-close:hover,
.image-preview-close:focus-visible {
    background: rgba(0, 102, 255, 0.92);
    outline: 0;
}

.access-modal {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(18, 27, 43, 0.54);
}

.access-modal.open {
    display: flex;
}

.access-dialog {
    width: min(380px, 100%);
    padding: 28px;
    border: 1px solid var(--feishu-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(16, 31, 56, 0.22);
}

.access-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 16px;
    border-radius: 8px;
    background: var(--feishu-hover);
    color: var(--feishu-primary);
    font-size: 18px;
}

.access-dialog h2 {
    color: #172033;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.5;
}

.access-dialog p {
    margin-top: 6px;
    color: var(--feishu-muted);
    font-size: 14px;
    line-height: 1.5;
}

.access-dialog .access-vip-tip {
    color: #dc2626;
    font-weight: 700;
}

.access-dialog form {
    margin-top: 18px;
}

.access-dialog input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--feishu-border);
    border-radius: 6px;
    color: var(--feishu-text);
    font: inherit;
    outline: 0;
}

.access-dialog input:focus {
    border-color: var(--feishu-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}

.access-error {
    min-height: 22px;
    margin-top: 8px;
    color: #d92d20;
    font-size: 13px;
    line-height: 1.5;
}

.access-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.access-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    height: 38px;
    padding: 0 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.access-cancel {
    border: 1px solid var(--feishu-border);
    background: #fff;
    color: var(--feishu-text);
}

.access-cancel:hover,
.access-cancel:focus-visible {
    background: var(--feishu-hover);
    color: var(--feishu-primary);
    outline: 0;
}

.access-submit {
    background: var(--feishu-primary);
    color: #fff;
}

.access-submit:hover,
.access-submit:focus-visible {
    background: #0057d9;
    outline: 0;
}

.access-submit:disabled {
    cursor: wait;
    opacity: 0.72;
}

body.preview-open,
body.access-open {
    overflow: hidden;
}

.doc-prose .rounded-lg {
    border-radius: 8px;
}

.doc-prose .my-4 {
    margin-top: 16px;
    margin-bottom: 16px;
}

.doc-prose .w-full {
    width: 100%;
}

.doc-prose .max-w-2xl {
    max-width: 100%;
}

.doc-prose .max-w-3xl {
    max-width: 100%;
}

.doc-prose .pl-6 {
    padding-left: 24px;
}

.doc-prose .space-y-1 > * + * {
    margin-top: 4px;
}

.doc-prose .p-4 {
    width: 100%;
    padding: 16px;
}

.doc-prose .font-medium {
    font-weight: 500;
}

.doc-prose .text-sm {
    font-size: 14px;
}

.doc-prose .mt-1 {
    margin-top: 4px;
}

.doc-prose .text-feishu-muted {
    color: var(--feishu-muted);
}

.doc-prose .bg-\[\#F7F8FA\] {
    background: var(--feishu-soft);
}

@media (max-width: 1023px) {
    .toc-panel {
        display: none;
    }
}

@media (max-width: 767px) {
    .sidebar {
        position: absolute;
        inset: 0 auto 0 0;
        z-index: 140;
        transform: translateX(-100%);
        box-shadow: 0 18px 55px rgba(21, 43, 74, 0.16);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .side-close,
    .open-side {
        display: inline-flex;
    }

    .open-side {
        margin-right: 12px;
    }

    .menu-tap-hint {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        margin-left: -8px;
        margin-right: 8px;
        color: #ff9f1a;
        font-size: 24px;
        line-height: 1;
        pointer-events: none;
        filter: drop-shadow(0 2px 5px rgba(255, 159, 26, 0.34));
        animation: menuTapHint 1.05s ease-in-out infinite;
    }

    .menu-tap-hint::after {
        content: "";
        position: absolute;
        inset: 4px;
        border: 2px solid rgba(255, 159, 26, 0.42);
        border-radius: 50%;
        animation: menuTapRipple 1.05s ease-out infinite;
    }

    .mobile-mask.show {
        position: fixed;
        inset: 0;
        z-index: 130;
        display: block;
        background: rgba(0, 0, 0, 0.2);
    }

    .doc-scroll {
        padding: 24px 12px;
    }

    .doc-prose .glow-link-button {
        display: flex;
        width: 100%;
        padding-right: 18px;
        padding-left: 18px;
    }

    .front-qrcode-panel {
        padding: 16px;
    }

    .front-qrcode-doc {
        margin-top: 24px;
    }

    .front-qrcode-heading {
        display: block;
        margin-bottom: 14px;
        text-align: center;
    }

    .front-qrcode-heading strong {
        justify-content: center;
    }

    .front-qrcode-heading small {
        display: block;
        margin-top: 4px;
    }

    .front-qrcode-list {
        flex-wrap: wrap;
        gap: 18px;
    }

    .front-qrcode-card {
        width: min(34vw, 112px);
    }

    .front-qrcode-card img {
        padding: 5px;
    }

    .access-dialog {
        padding: 24px;
    }
}
