:root {
    --home-bg: #ffffff;
    --home-surface: #ffffff;
    --home-border: #e8ecf1;
    --home-text: #1a2332;
    --home-muted: #6b7a90;
    --home-accent: #2563eb;
    --home-accent-soft: #eff6ff;
    --home-radius: 12px;
    --home-radius-lg: 16px;
    --home-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    --home-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
}

body.letools-home-page,
body.letools-portal-list-page {
    background: var(--home-bg);
    color: var(--home-text);
    font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.home-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero */
.home-hero {
    text-align: center;
    padding: 48px 0 36px;
}

.home-brand {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    margin-bottom: 28px;
}

.home-brand:hover {
    color: inherit;
}

.home-brand-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.25);
}

.home-brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 18px;
}

.home-brand-name {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--home-text);
}

.home-brand-tagline {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--home-accent);
}

.home-search {
    max-width: 640px;
    margin: 0 auto;
    position: relative;
}

.home-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
    pointer-events: none;
}

.home-search-input {
    width: 100%;
    height: 52px;
    padding: 0 20px 0 48px;
    border: 1px solid var(--home-border);
    border-radius: 999px;
    background: var(--home-surface);
    font-size: 0.95rem;
    color: var(--home-text);
    box-shadow: var(--home-shadow);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-search-input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.home-search-input::placeholder {
    color: #94a3b8;
}

/* Section headers */
.home-section {
    padding: 28px 0 12px;
}

.home-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.home-section-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--home-text);
}

.home-section-sub {
    margin: 0;
    font-size: 0.88rem;
    color: var(--home-muted);
}

/* Browse categories */
.home-browse-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.home-browse-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius);
    background: var(--home-surface);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--home-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a.home-browse-card:hover {
    color: inherit;
    transform: translateY(-2px);
    box-shadow: var(--home-shadow-md);
    border-color: #dbeafe;
}

.home-browse-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--home-accent-soft);
    color: var(--home-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.home-browse-label {
    font-size: 0.82rem;
    font-weight: 600;
    text-align: left;
    line-height: 1.35;
    flex: 1;
    min-width: 0;
}

/* Featured grid */
.home-featured-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    padding-bottom: 40px;
}

.home-featured-card {
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius-lg);
    background: var(--home-surface);
    overflow: hidden;
    box-shadow: var(--home-shadow);
    display: flex;
    flex-direction: column;
}

.home-featured-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}

.home-featured-head-title {
    min-width: 0;
}

.home-featured-more-link {
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.home-featured-more-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.55);
}

.home-featured-body {
    padding: 16px 18px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.home-featured-desc {
    margin: 0 0 14px;
    font-size: 0.84rem;
    line-height: 1.65;
    color: var(--home-muted);
}

.home-featured-highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.home-highlight {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--home-border);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    background: #fafbfc;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.home-highlight:hover {
    color: inherit;
    border-color: #cbd5e1;
    background: #fff;
}

.home-highlight-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.home-highlight-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    color: var(--home-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.home-highlight-title {
    display: block;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--home-text);
    min-width: 0;
}

.home-highlight-desc {
    display: block;
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--home-muted);
}

.home-featured-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    margin-top: auto;
}

.home-featured-link {
    font-size: 0.8rem;
    color: var(--home-accent);
    text-decoration: none;
    padding: 2px 0;
    line-height: 1.45;
}

.home-featured-link:hover {
    text-decoration: underline;
}

/* Home footer */
.home-footer {
    border-top: 1px solid var(--home-border);
    padding: 40px 0 24px;
    margin-top: 12px;
}

.home-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
    margin-bottom: 28px;
}

.home-about-title {
    margin: 0 0 12px;
    font-size: 1.1rem;
    font-weight: 700;
}

.home-about-text {
    margin: 0 0 10px;
    font-size: 0.88rem;
    line-height: 1.75;
    color: var(--home-muted);
}

.home-share-box {
    background: #f8fafc;
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius-lg);
    padding: 22px;
}

.home-share-title {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 700;
}

.home-share-sub {
    margin: 0 0 16px;
    font-size: 0.84rem;
    color: var(--home-muted);
}

.home-share-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.home-share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--home-border);
    background: #fff;
    color: var(--home-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.home-share-btn:hover {
    color: var(--home-accent);
    border-color: #bfdbfe;
    transform: translateY(-1px);
}

.home-share-btn.is-copied {
    color: #16a34a;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.home-share-weibo {
    display: block;
}

.home-copyright {
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
    padding-top: 8px;
}

@media (max-width: 991.98px) {
    .home-browse-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-featured-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .home-hero {
        padding: 32px 0 24px;
    }

    .home-browse-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-featured-grid {
        grid-template-columns: 1fr;
    }

    .home-featured-highlights {
        grid-template-columns: 1fr;
    }

    .home-footer-grid {
        grid-template-columns: 1fr;
    }

    .home-section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

@media (max-width: 379.98px) {
    .home-browse-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== Archive / List pages ===== */

.portal-topbar {
    border-bottom: 1px solid var(--home-border);
    background: var(--home-surface);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 30;
}

.portal-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.portal-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.portal-brand:hover {
    color: inherit;
}

.portal-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.portal-brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.portal-brand-name {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-search {
    max-width: 360px;
    width: 100%;
    position: relative;
    flex-shrink: 1;
}

.portal-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.portal-search-input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 40px;
    border: 1px solid var(--home-border);
    border-radius: 999px;
    background: #fafbfc;
    font-size: 0.88rem;
}

.portal-search-input:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #fff;
}

.archive-main {
    padding: 28px 0 48px;
}

.archive-hero {
    margin-bottom: 24px;
}

.archive-badge {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--home-accent-soft);
    color: var(--home-accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.archive-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.archive-title-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.archive-title {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.archive-lead {
    margin: 0 0 8px;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--home-muted);
    max-width: 720px;
}

.archive-meta {
    font-size: 0.84rem;
    color: var(--home-muted);
}

.archive-section {
    margin-bottom: 28px;
}

.archive-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.archive-section-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.archive-section-sub {
    margin: 0;
    font-size: 0.84rem;
    color: var(--home-muted);
}

.home-browse-card.is-current {
    border-color: var(--home-accent);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
    pointer-events: none;
}

.archive-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.archive-tool-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius-lg);
    background: var(--home-surface);
    text-decoration: none;
    color: inherit;
    box-shadow: var(--home-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    min-height: 100%;
}

.archive-tool-card:hover {
    color: inherit;
    transform: translateY(-2px);
    box-shadow: var(--home-shadow-md);
    border-color: #dbeafe;
}

.archive-tool-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.archive-tool-body {
    flex: 1;
    min-width: 0;
}

.archive-tool-title {
    display: block;
    font-size: 0.98rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--home-text);
}

.archive-tool-desc {
    display: block;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--home-muted);
}

.archive-tool-action {
    align-self: center;
    color: var(--home-accent);
    font-size: 1rem;
    opacity: 0.7;
    flex-shrink: 0;
}

.archive-tool-card:hover .archive-tool-action {
    opacity: 1;
}

.archive-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.archive-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--home-border);
    border-radius: 999px;
    background: #fafbfc;
    color: var(--home-text);
    font-size: 0.82rem;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.archive-tag:hover {
    color: var(--home-accent);
    border-color: #bfdbfe;
    background: #fff;
}

.archive-tag-count {
    color: var(--home-muted);
    font-size: 0.75rem;
}

.archive-empty {
    padding: 40px 20px;
    text-align: center;
    border: 1px dashed var(--home-border);
    border-radius: var(--home-radius-lg);
    background: #fafbfc;
    color: var(--home-muted);
}

.archive-empty-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #cbd5e1;
}

.archive-pagination {
    margin-top: 28px;
    display: flex;
    justify-content: center;
}

.archive-pagination .nav-links,
.archive-pagination ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.archive-pagination a,
.archive-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--home-border);
    border-radius: 999px;
    background: #fff;
    color: var(--home-muted);
    text-decoration: none;
    font-size: 0.84rem;
}

.archive-pagination a:hover {
    color: var(--home-accent);
    border-color: #bfdbfe;
}

.archive-pagination .current {
    color: #fff;
    background: var(--home-accent);
    border-color: var(--home-accent);
}

.portal-footer {
    border-top: 1px solid var(--home-border);
    padding: 24px 0;
    margin-top: 12px;
}

.portal-footer-copy {
    margin: 0;
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
}

@media (max-width: 991.98px) {
    .archive-tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .portal-topbar-inner {
        flex-wrap: wrap;
    }

    .portal-search {
        max-width: none;
        order: 3;
        flex-basis: 100%;
    }

    .archive-tools-grid {
        grid-template-columns: 1fr;
    }

    .archive-title-row {
        align-items: flex-start;
    }
}

.page-article {
    background: var(--home-surface);
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius-lg);
    box-shadow: var(--home-shadow);
    padding: 28px 32px;
}

.page-article-content {
    font-size: 0.95rem;
    line-height: 1.85;
    color: var(--home-text);
}

.page-article-content > *:first-child {
    margin-top: 0;
}

.page-article-content > *:last-child {
    margin-bottom: 0;
}

.page-article-content h2,
.page-article-content h3,
.page-article-content h4 {
    margin: 1.6em 0 0.7em;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-article-content p {
    margin: 0 0 1em;
}

.page-article-content a {
    color: var(--home-accent);
    text-decoration: none;
}

.page-article-content a:hover {
    text-decoration: underline;
}

.page-article-content ul,
.page-article-content ol {
    margin: 0 0 1em;
    padding-left: 1.4em;
}

.page-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--home-radius);
}

@media (max-width: 767.98px) {
    .page-article {
        padding: 20px 18px;
    }
}

