:root {
    --page-bg: #f6f7f8;
    --surface: #ffffff;
    --surface-soft: #fbfbfb;
    --text-primary: #111827;
    --text-muted: #6b7280;
    --line-color: #e5e7eb;
    --accent: #6b7280;
    --accent-hover: #4b5563;
    --action: #2563eb;
    --action-hover: #1d4ed8;
    --action-active: #1e40af;
    --action-shadow: rgba(37, 99, 235, 0.24);
}
body {
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.96), rgba(246, 247, 248, 0.96) 48%), var(--page-bg);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.navbar-clean {
    background-color: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.92);
}
.navbar-clean .navbar-brand,
.navbar-clean .nav-link {
    color: var(--text-primary);
}
.navbar-clean .nav-link {
    font-weight: 500;
}
.navbar-clean .nav-link.active,
.navbar-clean .nav-link:hover {
    color: var(--action);
}
.page-main {
    flex: 1 0 auto;
    padding-top: 5.4rem;
    padding-bottom: 4rem;
}
.page-main.compact {
    padding-top: 5.4rem;
}
.page-shell {
    margin-top: 5rem;
    padding-bottom: 3rem;
    flex: 1 0 auto;
}
.hero-card,
.section-card,
.tool-card,
.info-card,
.step-card,
.card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(229, 231, 235, 0.88) !important;
    box-shadow: 0 18px 44px rgba(17, 24, 39, 0.06) !important;
}
.hero-card,
.section-card,
.tool-card,
.info-card,
.step-card {
    border-radius: 24px;
}
.hero-card {
    overflow: hidden;
}
.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--action);
    font-size: 0.86rem;
    font-weight: 600;
}
.hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.12;
    letter-spacing: -0.04em;
}
.hero-text,
.section-muted,
.step-card p,
.tool-meta,
.helper-text,
.footer-note,
.list-note,
.faq-answer,
.feature-list li,
.step-list li,
.map-list li,
.support-list li {
    color: var(--text-muted);
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}
.stat-tile {
    border: 1px solid var(--line-color);
    border-radius: 18px;
    padding: 1rem;
    background: var(--surface);
}
.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
}
.section-card,
.info-card,
.step-card,
.tool-card {
    padding: 1.35rem;
}
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}
.tool-card {
    height: 100%;
}
.tool-icon,
.page-icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #eff6ff;
    color: var(--action);
    font-size: 1.35rem;
}
.tool-badges,
.quick-links,
.support-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tool-chip,
.link-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    border: 1px solid #dbe3ef;
    background: #f8fbff;
    color: #1f2937;
    font-size: 0.86rem;
    text-decoration: none;
}
.tool-chip:hover,
.link-chip:hover {
    color: var(--action);
    border-color: #bfd3ff;
    text-decoration: none;
}
.tool-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1rem;
}
.sponsor-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid #f1ddab;
    border-radius: 18px;
    background: #fff8e6;
    color: #7c5d00;
}
.sponsor-strip a {
    color: #7c5d00;
    font-weight: 600;
    text-decoration: none;
}
.sponsor-strip a:hover {
    text-decoration: underline;
}
.detail-grid {
    display: grid;
    gap: 1rem;
}
.section-box {
    border: 1px solid var(--line-color);
    border-radius: 14px;
    background: var(--surface);
    padding: 1rem;
    height: 100%;
}
.section-box p,
.section-box li,
.step-item p {
    color: var(--text-muted);
}
.info-list,
.step-list,
.map-list,
.support-list,
.feature-list {
    margin: 0;
    padding-left: 1.1rem;
}
.faq-item + .faq-item {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line-color);
}
.faq-question {
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.step-item {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
}
.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    flex: 0 0 32px;
}
.step-item h3,
.section-box h2 {
    margin-bottom: 0.4rem;
}
.site-list a,
.page-link {
    color: var(--text-primary);
    text-decoration: none;
}
.site-list a:hover,
.page-link:hover {
    color: var(--text-primary);
}
.list-group-item {
    background: #fff;
}
.list-group-item:hover {
    background: #f9fafb;
}
.format-link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.format-link-list a {
    display: inline-flex;
    align-items: center;
    padding: 0.48rem 0.78rem;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid var(--line-color);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
}
.format-link-list a:hover {
    background: #f3f4f6;
    border-color: #c7cdd4;
    color: var(--text-primary);
}
.format-link-list a.is-hidden {
    display: none;
}
.format-search-empty {
    margin-top: 1rem;
    color: var(--text-muted);
}
.search-bar {
    margin-bottom: 1rem;
}
.search-input-wrap {
    position: relative;
}
.search-input-wrap .bi-search {
    position: absolute;
    top: 50%;
    left: 0.95rem;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.search-bar .form-control {
    border-color: #d1d5db;
    border-radius: 999px;
    padding-left: 2.5rem;
}
.search-bar .form-control:focus {
    border-color: #9ca3af;
    box-shadow: 0 0 0 0.2rem rgba(17, 24, 39, 0.08);
}
.search-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.table-soft {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: #fafafa;
    --bs-table-color: var(--text-primary);
    margin-bottom: 0;
}
.table-soft th,
.table-soft td {
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
    border-color: var(--line-color);
}
.empty-404 {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
}
.footer-links a,
.footer-muted-link {
    color: var(--text-primary);
    text-decoration: none;
}
.footer-links a:hover,
.footer-muted-link:hover {
    color: var(--action);
    text-decoration: none;
}
.bi {
    line-height: 1;
    vertical-align: -0.125em;
}
.card-header {
    background: transparent !important;
    border-bottom-color: var(--line-color) !important;
}
.card-footer {
    background: transparent !important;
    border-top-color: var(--line-color) !important;
}
.card-header-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.upload-area {
    border: 1px dashed #cfd4dc;
    border-radius: 12px;
    padding: 0.85rem;
    min-height: 96px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
}
.upload-area:hover {
    border-color: #9ca3af;
    background-color: #f9fafb;
}
.upload-area-inner {
    width: 100%;
}
.upload-icon {
    font-size: 1.5rem;
    color: var(--text-primary);
}
.action-btn,
.btn-dark {
    background-color: var(--action) !important;
    border-color: var(--action) !important;
    color: #fff !important;
    box-shadow: 0 10px 24px var(--action-shadow);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.action-btn:hover,
.btn-dark:hover {
    background-color: var(--action-hover) !important;
    border-color: var(--action-hover) !important;
    color: #fff !important;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}
.action-btn:focus,
.action-btn:focus-visible,
.btn-dark:focus,
.btn-dark:focus-visible {
    background-color: var(--action-hover) !important;
    border-color: var(--action-hover) !important;
    color: #fff !important;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.2), 0 10px 24px var(--action-shadow);
}
.action-btn:active,
.action-btn.active,
.btn-dark:active,
.btn-dark.active,
.show > .btn-dark.dropdown-toggle {
    background-color: var(--action-active) !important;
    border-color: var(--action-active) !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.24) !important;
    transform: translateY(1px);
}
.form-label {
    font-weight: 600;
    color: var(--text-primary);
}
.form-select,
.btn-outline-secondary,
.form-check-input,
.list-group-item {
    border-color: #d1d5db;
}
.form-select:focus,
.btn-outline-secondary:focus,
.form-check-input:focus {
    border-color: #9ca3af;
    box-shadow: 0 0 0 0.2rem rgba(17, 24, 39, 0.08);
}
.btn-outline-secondary {
    color: var(--text-primary);
    background: #fff;
}
.btn-outline-secondary:hover {
    color: var(--text-primary);
    background: #f3f4f6;
    border-color: #c7cdd4;
}
.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}
.file-input-hidden {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}
.file-preview-card {
    border: 1px solid var(--line-color);
    border-radius: 12px;
    background: var(--surface);
    padding: 0.6rem 0.7rem;
    overflow: hidden;
}
.file-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}
.file-preview-head > div {
    min-width: 0;
}
.file-preview-head .btn {
    flex-shrink: 0;
    padding: 0.22rem 0.42rem;
    line-height: 1.1;
    white-space: nowrap;
}
.file-preview-name {
    display: block;
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-preview-meta,
.result-file-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.file-preview-meta {
    margin-top: 0.1rem;
}
.file-list {
    display: grid;
    gap: 0.5rem;
    max-height: 240px;
    overflow-y: auto;
}
.file-list-item {
    border: 1px solid var(--line-color);
    border-radius: 10px;
    background: #fff;
    padding: 0.55rem 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.file-list-item.is-processing {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.file-list-item.is-success {
    background: #ecfdf5;
    border-color: #bbf7d0;
}
.file-list-item.is-failed {
    background: #fef2f2;
    border-color: #fecaca;
}
.file-list-name {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-list-thumb {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    border: 1px solid #dbe3ee;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    overflow: hidden;
    flex: 0 0 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: zoom-in;
    appearance: none;
    -webkit-appearance: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.file-list-thumb:hover,
.file-list-thumb:focus {
    border-color: #93c5fd;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
    transform: translateY(-1px);
    outline: none;
}
.file-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.file-list-thumb-icon {
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1;
}
.file-list-body {
    min-width: 0;
    flex: 1 1 auto;
}
.file-list-meta {
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}
.file-list-side-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    flex: 0 0 auto;
    align-self: center;
    justify-content: flex-end;
}
.file-list-side-actions .btn {
    padding: 0.2rem 0.62rem;
    line-height: 1.25;
    border-radius: 999px;
    white-space: nowrap;
}
.result-box {
    border: 1px solid var(--line-color);
    border-radius: 14px;
    background: var(--surface);
    padding: 0.8rem;
    overflow: hidden;
}
.result-file-name {
    display: block;
    max-width: 100%;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.result-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.55rem;
}
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding-top: 0.1rem;
}
.progress-track {
    border-radius: 999px;
    overflow: hidden;
    background: linear-gradient(90deg, #eceff3 0%, #e5e7eb 100%);
}
#progressBar {
    background-color: var(--accent) !important;
    transition: width 0.28s ease;
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}
.progress-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    min-height: 1.4rem;
}
.promo-tip .alert {
    padding: 0.6rem 0.8rem;
    font-size: 0.88rem;
}
.card-foot-ad {
    font-size: 0.9rem;
}
.card-foot-ad a {
    text-decoration: none;
}
.card-foot-ad a:hover {
    text-decoration: underline;
}
.component-state .card-body,
.component-state.card-body {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.component-state-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}
.component-state-text {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}
.component-action {
    margin-top: 1rem;
}
.page-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(209, 213, 219, 0.9), transparent);
    margin: 1rem 0 1.5rem;
}
@media (max-width: 991.98px) {
    .hero-stats {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 576px) {
    .page-main {
        padding-top: 5rem;
    }
    .hero-actions {
        flex-direction: column;
    }
    .hero-actions .btn {
        width: 100%;
    }
    .sponsor-strip {
        align-items: flex-start;
        flex-direction: column;
    }
    .file-preview-head {
        align-items: center;
    }
    .file-list-item {
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .file-list-side-actions {
        width: 100%;
        margin-left: 0;
        padding-left: 3.25rem;
        justify-content: flex-start;
    }
}
.file-list-thumb.is-doc {
    cursor: default;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
}
.file-list-thumb.is-doc .file-list-thumb-icon {
    color: #2563eb;
    font-size: 1.15rem;
}
.text-preview-shell {
    padding: 12px;
    background: #f8fafc;
}
.text-preview-toolbar {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.text-preview-box {
    max-height: calc(80vh - 120px);
    overflow: auto;
    border: 1px solid var(--line-color);
    border-radius: 12px;
    background: #ffffff;
    padding: 1rem;
    color: var(--text-primary);
    line-height: 1.75;
    word-break: break-word;
}
.doc-render-stage {
    position: fixed;
    left: -100000px;
    top: 0;
    width: 1400px;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}
.doc-render-stage .docx-wrapper {
    padding: 18px;
    background: #f3f4f6;
}
.doc-render-stage .docx-wrapper > section.docx,
.doc-render-stage section.docx {
    box-shadow: none !important;
}
.card-foot-ad [data-sponsor-note] {
    display: block;
    margin-top: 0.3rem;
    color: var(--text-muted);
}
@media (max-width: 576px) {
    .doc-render-stage {
        width: 1080px;
    }
    .text-preview-box {
        max-height: calc(76vh - 120px);
    }
}

.min-w-0 {
    min-width: 0;
}
.file-list-thumb.is-gallery {
    cursor: default;
    background: linear-gradient(180deg, #fefce8 0%, #fef3c7 100%);
    border-color: #fcd34d;
}
.file-list-thumb.is-gallery .file-list-thumb-icon {
    color: #b45309;
    font-size: 1.12rem;
}
.extract-preview-shell {
    padding: 12px;
    background: #f8fafc;
}
.extract-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.extract-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.8rem;
    max-height: calc(82vh - 146px);
    overflow: auto;
}
.extract-preview-card {
    border: 1px solid var(--line-color);
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
}
.extract-preview-figure {
    aspect-ratio: 4 / 3;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    padding: 0.75rem;
}
.extract-preview-figure img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}
.extract-preview-meta {
    padding: 0.75rem;
}
.extract-preview-name {
    display: block;
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.35;
    word-break: break-word;
}
.extract-preview-size {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.76rem;
}
@media (max-width: 576px) {
    .extract-preview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: calc(78vh - 140px);
    }
    .extract-preview-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
}
