@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyN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wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

select:focus {
    outline: none !important;
    box-shadow: none !important;
}

input:focus {
    outline: none !important;
    box-shadow: none !important;
}

button:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* —— 导航主题（浅色、侧栏标题、卡片网格） —— */
:root {
    --lm-bg: #eef0f4;
    --lm-card: #ffffff;
    --lm-border: rgba(0, 0, 0, 0.08);
    --lm-text: #1c1f26;
    --lm-muted: #6b7280;
    --lm-accent: #e85d04;
    --lm-accent-soft: rgba(232, 93, 4, 0.12);
    --lm-radius: 12px;
    --lm-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

html, body {
    background: var(--lm-bg);
    color: var(--lm-text);
}

a {
    color: #2563eb;
}

/* 侧栏：覆盖全局 a 色与下划线；选中为蓝字 + 浅灰圆角条（见 NavMenu.razor.css） */
.lm-sidebar a.lm-nav-title-link,
.lm-sidebar a.lm-nav-title-link:visited,
.lm-sidebar a.lm-nav-title-link:hover,
.lm-sidebar a.lm-nav-title-link:focus,
.lm-sidebar a.lm-nav-title-link:active {
    color: inherit !important;
    text-decoration: none !important;
}

.lm-sidebar a.lm-nav-link,
.lm-sidebar a.lm-nav-link:visited {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
    color: #4b5563 !important;
    text-decoration: none !important;
}

.lm-sidebar a.lm-nav-link:hover,
.lm-sidebar a.lm-nav-link:focus,
.lm-sidebar a.lm-nav-link:focus-visible,
.lm-sidebar a.lm-nav-link:active {
    color: #111827 !important;
    text-decoration: none !important;
}

.lm-sidebar a.lm-nav-link.active {
    background: #e5e7eb !important;
    color: #2563eb !important;
    text-decoration: none !important;
}

.lm-sidebar a.lm-nav-link.active .lm-nav-ico {
    color: #2563eb !important;
}

.lm-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem 1.25rem;
    font-size: 0.82rem;
    color: var(--lm-muted);
    border-top: 1px solid var(--lm-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(248, 250, 252, 0.9));
}

.lm-footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    max-width: 56rem;
    text-align: center;
}

.lm-footer-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.lm-footer-line--sub {
    font-size: 0.78rem;
    color: #64748b;
}

.lm-footer a {
    color: var(--lm-muted);
    text-decoration: none;
}

.lm-footer a:hover {
    color: var(--lm-accent);
}

.lm-footer-sep {
    color: #d1d5db;
    user-select: none;
}

/* 静态页：更新日志、联系我们 */
.lm-static-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 0.75rem 1.5rem;
    box-sizing: border-box;
}

.lm-static-card {
    padding: 1.25rem 1.35rem 1.5rem;
}

.lm-static-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: var(--lm-text);
}

.lm-changelog {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.lm-changelog-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.lm-changelog-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

@media (min-width: 576px) {
    .lm-changelog-item:not(.lm-changelog-item--stacked) {
        flex-direction: row;
        align-items: flex-start;
        gap: 1.25rem;
    }
}

.lm-changelog-item--stacked {
    flex-direction: column;
    align-items: stretch;
}

.lm-changelog-bullets {
    margin: 0;
    padding-left: 1.15rem;
}

.lm-changelog-bullets > li {
    margin-bottom: 0.5rem;
}

.lm-changelog-bullets > li:last-child {
    margin-bottom: 0;
}

.lm-changelog-date {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--lm-accent);
    min-width: 6.5rem;
}

.lm-changelog-body {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--lm-text);
}

.lm-changelog-body ul {
    margin: 0.35rem 0 0;
    padding-left: 1.15rem;
}

.lm-changelog-body li {
    margin-bottom: 0.25rem;
}

.lm-contact-list {
    margin: 0;
}

.lm-contact-row {
    display: grid;
    grid-template-columns: 5rem 1fr;
    gap: 0.5rem 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
    font-size: 0.92rem;
}

.lm-contact-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.lm-contact-row dt {
    margin: 0;
    font-weight: 600;
    color: var(--lm-muted);
}

.lm-contact-row dd {
    margin: 0;
    word-break: break-word;
}

.lm-home {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 1rem;
}

.lm-card {
    background: var(--lm-card);
    border: 1px solid var(--lm-border);
    border-radius: var(--lm-radius);
    box-shadow: var(--lm-shadow);
}

.lm-search-card {
    padding: 0.85rem 1rem;
}

.lm-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: stretch;
}

.lm-search-select {
    flex: 0 0 auto;
    width: 7.5rem;
    border: 1px solid var(--lm-border);
    border-radius: 10px;
    background: #f9fafb;
}

.lm-search-input {
    flex: 1 1 200px;
    min-width: 0;
    border: 1px solid var(--lm-border);
    border-radius: 10px;
    background: #f9fafb;
}

.lm-search-btn {
    flex: 0 0 auto;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    font-weight: 600;
    padding: 0 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.lm-search-btn:hover {
    filter: brightness(1.03);
    color: #fff;
}

.lm-rec-wrap {
    margin-top: 0.25rem;
}

.lm-section-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.lm-section-icon {
    color: var(--lm-accent);
    font-size: 1.1rem;
}

.lm-section-heading {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    flex: 1;
}

.lm-section-more {
    font-size: 0.85rem;
    color: var(--lm-muted);
    text-decoration: none;
}

.lm-section-more:hover {
    color: var(--lm-accent);
}

.lm-rec-wrap--legacy .lm-rec-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0.35rem 0 0;
}

.lm-rec-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.5;
}

.lm-rec-vip-icon {
    flex-shrink: 0;
    display: block;
}

.lm-rec-link {
    color: #dc2626;
    text-decoration: none;
    font-weight: 500;
}

.lm-rec-link:hover {
    text-decoration: underline;
    color: #b91c1c;
}

.lm-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 0.75rem;
}

.lm-subnav-pill {
    font-size: 0.82rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: #e5e7eb;
    color: var(--lm-muted);
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
}

button.lm-subnav-pill {
    font-family: inherit;
}

a.lm-subnav-pill:hover {
    color: #4b5563;
}

button.lm-subnav-pill:hover {
    color: #4b5563;
}

.lm-subnav-pill.active {
    background: var(--lm-accent-soft);
    color: #c2410c;
    font-weight: 600;
}

.lm-sites-wrap {
    padding-bottom: 0.5rem;
}

.lm-site-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: stretch;
}

@media (max-width: 991.98px) {
    .lm-site-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .lm-site-grid {
        grid-template-columns: 1fr;
    }
}

.lm-site-block {
    background: var(--lm-card);
    border: 1px solid var(--lm-border);
    border-radius: var(--lm-radius);
    padding: 0.65rem 0.85rem 0.85rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
    height: 100%;
    min-width: 0;
}

.lm-site-block-head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
}

.lm-site-block-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.lm-site-block-sep {
    color: #cbd5e1;
    font-size: 0.9rem;
    user-select: none;
}

.lm-site-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
}

.lm-site-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.45rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--lm-text);
    font-size: 0.88rem;
}

.lm-site-link:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #111827;
}

.lm-site-favicon {
    border-radius: 4px;
    flex-shrink: 0;
}

.lm-category-page {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 0.5rem 1.5rem;
    box-sizing: border-box;
}

/* 分类页：中间单列铺满主区域 + 右侧目录；主区左右留白 */
.lm-category-inner {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.25rem 2rem;
    width: 100%;
}

.lm-category-main {
    flex: 1;
    min-width: 0;
    padding: 0 1.25rem;
    box-sizing: border-box;
}

.lm-site-grid--category {
    width: 100%;
    max-width: none;
    grid-template-columns: 1fr !important;
    gap: 0.85rem;
}

.lm-site-block--section {
    scroll-margin-top: 0.85rem;
}

.lm-category-toc {
    width: 11.25rem;
    flex-shrink: 0;
    position: sticky;
    top: 0.65rem;
    align-self: flex-start;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.7rem 0.8rem;
    background: var(--lm-card);
    border: 1px solid var(--lm-border);
    border-radius: var(--lm-radius);
    box-shadow: var(--lm-shadow);
}

.lm-toc-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--lm-muted);
    margin-bottom: 0.55rem;
}

.lm-toc-nav {
    margin: 0;
}

.lm-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.lm-toc-list a {
    display: block;
    padding: 0.38rem 0.45rem;
    border-radius: 8px;
    font-size: 0.84rem;
    color: #475569;
    text-decoration: none;
    line-height: 1.35;
}

.lm-toc-list a:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #2563eb;
}

@media (max-width: 991.98px) {
    .lm-category-page {
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }

    .lm-category-inner {
        flex-direction: column;
        gap: 1rem;
    }

    .lm-category-main {
        padding: 0 0.75rem;
    }

    .lm-category-toc {
        width: 100%;
        max-height: none;
        position: relative;
        top: auto;
        order: -1;
    }
}

.lm-custom-section {
    width: 100%;
}

/* 自定义网站：瀑布流（多列自上而下填充，卡片高度随内容） */
.lm-site-grid--custom-masonry {
    display: block;
    column-count: 3;
    column-gap: 0.75rem;
}

.lm-site-grid--custom-masonry > .lm-site-block {
    display: inline-block;
    width: 100%;
    vertical-align: top;
    margin-bottom: 0.75rem;
    height: auto;
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
}

@media (max-width: 991.98px) {
    .lm-site-grid--custom-masonry {
        column-count: 2;
    }
}

@media (max-width: 575.98px) {
    .lm-site-grid--custom-masonry {
        column-count: 1;
    }
}

.lm-custom-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.lm-toolbar-btn {
    white-space: nowrap;
}

.lm-custom-form-card {
    padding: 0.75rem 1rem;
}

.lm-custom-tile-head {
    flex-wrap: nowrap;
    gap: 0.35rem;
    min-width: 0;
}

.lm-custom-cat-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-width: 0;
}

.lm-custom-del-cat {
    font-size: 0.75rem;
    text-decoration: none;
    white-space: nowrap;
}

.lm-custom-site-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.35rem;
    margin-bottom: 0.25rem;
}

.lm-custom-check {
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.lm-custom-url {
    font-size: 0.78rem;
    word-break: break-all;
}

.lm-custom-msg {
    border-radius: var(--lm-radius);
}
