.hero-bg {
    position: relative;
    overflow: hidden;
}

.hero-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(13, 148, 136, 0.06) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

.hero-bg::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 64px;
    background: #F0FDFA;
    clip-path: ellipse(55% 100% at 50% 100%);
    z-index: 1;
}

.hero-decor {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.12;
}

.hero-decor:nth-child(1) {
    width: 320px; height: 320px;
    background: radial-gradient(circle, #0D9488, transparent);
    top: -80px; left: -100px;
    opacity: 0.18;
    animation: heroFloat 8s ease-in-out infinite;
}

.hero-decor:nth-child(2) {
    width: 220px; height: 220px;
    background: radial-gradient(circle, #14B8A6, transparent);
    bottom: 30px; right: -60px;
    opacity: 0.15;
    animation: heroFloat 10s ease-in-out infinite reverse;
}

.hero-decor:nth-child(3) {
    width: 140px; height: 140px;
    background: radial-gradient(circle, #F97316, transparent);
    top: 35%; right: 10%;
    opacity: 0.1;
    animation: heroFloat 7s ease-in-out infinite 1s;
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-16px); }
}

.hero-entrance {
    opacity: 1;
}

.reveal {
    opacity: 1;
    transform: translateY(0);
}

.glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.92);
}


.qingpdf-logo-text {
    font-family: 'Noto Sans CJK', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.5px;
}

.relative-z-1 {
    position: relative;
    z-index: 1;
}

.section-icon-gradient {
    background: linear-gradient(135deg, #0D9488, #14B8A6);
}

.search-container {
    display: flex;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-input {
    width: 100%;
    padding: 12px 48px 12px 48px;
    border: 2px solid #E2E8F0;
    border-radius: 9999px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
    background-color: #ffffff;
    color: #1E293B;
    line-height: 1.5;
}

.search-input:focus {
    border-color: #0D9488;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    margin: auto 0;
    color: #94A3B8;
    pointer-events: none;
}

.search-clear-btn {
    position: absolute;
    right: 14px;
    top: 0;
    bottom: 0;
    width: 36px;
    height: 36px;
    margin: auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #94A3B8;
}

.filter-tab {
    padding: 10px 24px;
    border-radius: 9999px;
    border: 2px solid #E2E8F0;
    background: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #64748B;
    transition: all 0.2s ease;
}

.filter-tab:hover {
    border-color: #0D9488;
    color: #0D9488;
}

.filter-tab.is-active {
    border-color: #0D9488;
    background: #0D9488;
    color: white;
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    height: 100%;
    box-sizing: border-box;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    padding: 1.5rem !important;
}

.tool-card > * {
    position: relative;
    z-index: 1;
}

.tool-card .icon-wrapper {
    width: 56px;
    height: 56px;
    margin-bottom: 0.75rem;
}

.tool-card .icon-wrapper svg {
    width: 48px;
    height: 48px;
}

/* Larger icon wrapper for conversion-type cards (PDF↔Word, etc.) */
.tool-card .icon-wrapper.conv-lg {
    width: 80px;
    height: 80px;
}

.tool-card .icon-wrapper.conv-lg svg {
    width: 64px !important;
    height: 48px !important;
}

.tool-card .icon-wrapper.conv-lg svg[viewBox="0 0 60 48" i] {
    width: 60px !important;
    height: 48px !important;
}

.tool-card .icon-wrapper.conv-lg svg[viewBox="0 0 48 60" i] {
    width: 48px !important;
    height: 56px !important;
}

.tool-card .icon-wrapper.conv-lg svg[viewBox="0 0 48 40" i] {
    width: 64px !important;
    height: 64px !important;
}

.tool-card .icon-wrapper.conv-lg svg[viewBox="0 0 32 56" i] {
    width: 48px !important;
    height: 80px !important;
}

.tool-card .icon-wrapper.conv-lg svg[viewBox="0 0 48 48" i] {
    width: 48px !important;
    height: 48px !important;
}

.tool-card .icon-wrapper.conv-lg svg[viewBox="0 0 56 56" i] {
    width: 56px !important;
    height: 56px !important;
}

.tool-card .icon-wrapper.conv-lg svg[viewBox="0 0 24 24" i] {
    width: 48px !important;
    height: 48px !important;
}

.tool-card .icon-wrapper.conv-lg svg[viewBox="0 0 72 40" i] {
    width: 64px !important;
    height: 36px !important;
}

.tool-card .icon-wrapper.conv-lg svg[viewBox="0 0 76 40" i] {
    width: 68px !important;
    height: 36px !important;
}

.tool-card .icon-wrapper.conv-lg svg[viewBox="0 0 64 40" i] {
    width: 64px !important;
    height: 40px !important;
}

.tool-card .tool-title {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.tool-card p {
    font-size: 0.875rem;
}

.tool-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(105deg,
        transparent 40%,
        rgba(13, 148, 136, 0.15) 45%,
        rgba(20, 184, 166, 0.1) 50%,
        transparent 55%);
    z-index: 0;
    pointer-events: none;
}

.tool-card:hover::after {
    left: 100%;
}

.tool-card:hover {
    box-shadow: 0 15px 30px rgba(13, 148, 136, 0.18),
                0 0 0 2px rgba(13, 148, 136, 0.08);
    border-color: rgba(13, 148, 136, 0.3);
}

.tool-card:hover .tool-title {
    color: #0D9488;
}

.pdf-to-image-icon {
    gap: 8px;
}

.pdf-to-image-icon .fa-file-pdf {
    font-size: 26px !important;
    color: #EF4444 !important;
    transition: transform 0.2s ease-out;
}

.pdf-to-image-icon .fa-arrow-right {
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.85) !important;
    transition: transform 0.2s ease-out, color 0.2s ease-out;
}

.pdf-to-image-icon .fa-image {
    font-size: 26px !important;
    color: #F9A8D4 !important;
    transition: transform 0.2s ease-out;
}

.pdf-to-image-card {
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, border-color 0.2s ease-out;
}

.pdf-to-image-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(13, 148, 136, 0.15), 0 0 0 2px rgba(13, 148, 136, 0.1);
    border-color: rgba(13, 148, 136, 0.3);
}

.pdf-to-image-card:hover .pdf-to-image-icon {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.pdf-to-image-card:hover .pdf-to-image-icon .fa-file-pdf {
    transform: scale(1.12);
}

.pdf-to-image-card:hover .pdf-to-image-icon .fa-arrow-right {
    transform: translateX(3px);
    color: #ffffff !important;
}

.pdf-to-image-card:hover .pdf-to-image-icon .fa-image {
    transform: scale(1.12);
}

@media (prefers-reduced-motion: reduce) {
    .pdf-to-image-icon,
    .pdf-to-image-icon .fa-file-pdf,
    .pdf-to-image-icon .fa-arrow-right,
    .pdf-to-image-icon .fa-image,
    .pdf-to-image-card {
        transition: none;
    }
    .pdf-to-image-card:hover {
        transform: none;
    }
    .pdf-to-image-card:hover .pdf-to-image-icon .fa-file-pdf,
    .pdf-to-image-card:hover .pdf-to-image-icon .fa-image,
    .pdf-to-image-card:hover .pdf-to-image-icon .fa-arrow-right {
        transform: none;
    }
}

.tool-card.is-hidden {
    display: none;
}

.popular-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: linear-gradient(135deg, #F97316 0%, #FB923C 100%);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
    z-index: 2;
    line-height: 1.4;
    text-align: center;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3); }
    50% { box-shadow: 0 4px 16px rgba(249, 115, 22, 0.5); }
}

.tool-grid {
    display: grid;
    align-items: stretch;
}

.no-results {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    text-align: center;
}

/* Responsive: keep cards centered at every breakpoint */
@media (max-width: 640px) {
    .tool-card {
        padding: 1.25rem !important;
    }

    .tool-card .icon-wrapper {
        width: 56px;
        height: 56px;
    }

    .tool-card .icon-wrapper svg {
        width: 42px;
        height: 42px;
    }

    .tool-card .icon-wrapper.conv-lg {
        width: 72px;
        height: 72px;
    }

    .tool-card .icon-wrapper.conv-lg svg {
        width: 56px;
        height: 42px;
    }

    .tool-card h3 {
        font-size: 1rem;
    }

    .tool-card p {
        font-size: 0.8125rem;
    }

    .popular-badge {
        font-size: 10px;
        padding: 2px 8px;
    }
}

@media (max-width: 480px) {
    .tool-card {
        padding: 0.875rem !important;
    }

    .tool-card .icon-wrapper {
        width: 48px;
        height: 48px;
    }

    .tool-card .icon-wrapper svg {
        width: 36px;
        height: 36px;
    }

    .tool-card .icon-wrapper.conv-lg {
        width: 64px;
        height: 64px;
    }

    .tool-card .icon-wrapper.conv-lg svg {
        width: 48px;
        height: 36px;
    }

    .tool-card h3 {
        font-size: 0.9rem;
    }

    .tool-card p {
        font-size: 0.75rem;
    }

    .popular-badge {
        font-size: 9px;
        padding: 2px 6px;
        top: 6px;
        right: 6px;
    }
}

.faq-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.faq-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    opacity: 0;
}

.faq-item {
    border-radius: 12px;
    background: rgba(255,255,255,0.9);
    padding: 0 24px;
    transition: all 0.25s ease;
    border: 1px solid #E2E8F0;
    overflow: hidden;
}

.faq-item:hover {
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.2);
}

.faq-item.is-open {
    background: rgba(37, 99, 235, 0.05);
    border-color: rgba(37, 99, 235, 0.2);
}

.faq-question {
    width: 100%;
    padding: 20px 0;
    background: none;
    border: none;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    transition: color 0.2s;
}

.faq-question:hover {
    color: #2563eb;
}

.faq-question svg {
    transition: transform 0.3s;
    font-size: 12px;
    color: #94A3B8;
    flex-shrink: 0;
    margin-top: 4px;
}

.faq-item.is-open .faq-question svg {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s ease, padding 0.35s ease, opacity 0.3s ease;
    font-size: 14px;
    color: #64748B;
    line-height: 1.9;
    opacity: 0;
}

.faq-item.is-open .faq-answer {
    max-height: 600px;
    padding-bottom: 20px;
    opacity: 1;
}

.faq-item.is-open .faq-body {
    max-height: 600px;
    opacity: 1;
}

/* Dark mode support */
@media (prefers-color-scheme: dark), .dark, .dark-mode {
    .tool-card {
        background: rgba(30, 41, 59, 0.8);
        border-color: rgba(255, 255, 255, 0.08);
    }

    .tool-card:hover {
        background: rgba(47, 65, 85, 0.9);
        border-color: rgba(13, 148, 136, 0.3);
    }

    .tool-card .tool-title {
        color: #f1f5f9;
    }

    .tool-card:hover .tool-title {
        color: #14B8A6;
    }

    .tool-card p {
        color: #94a3b8;
    }

    .tool-card::after {
        background: linear-gradient(105deg,
            transparent 40%,
            rgba(20, 184, 166, 0.15) 45%,
            rgba(20, 184, 166, 0.1) 50%,
            transparent 55%);
    }

    .filter-tab {
        background: rgba(30, 41, 59, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
        color: #cbd5e1;
    }

    .filter-tab:hover {
        border-color: #14B8A6;
        color: #14B8A6;
        background: rgba(20, 184, 166, 0.1);
    }

    .filter-tab.is-active {
        background: linear-gradient(135deg, #0D9488 0%, #14B8A6 100%);
        color: white;
    }
}

.stat-card {
    position: relative;
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.1), rgba(20, 184, 166, 0.05));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-number {
    font-family: 'Noto Sans CJK', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 700;
    background: linear-gradient(135deg, #0D9488, #14B8A6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (max-width: 640px) {
    .stat-card {
        padding: 12px 8px;
    }

    .stat-number {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .stat-card {
        padding: 10px 6px;
    }
    
    .stat-number {
        font-size: 1.375rem;
    }
}

#pwa-install-btn.pwa-cta-btn {
    background: linear-gradient(135deg, #0D9488, #14B8A6) !important;
    position: relative;
    overflow: hidden;
    animation: pwaCtaPulse 2s ease-in-out infinite;
    color: #ffffff !important;
}

#pwa-install-btn.pwa-cta-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.6s ease;
}

#pwa-install-btn.pwa-cta-btn:hover::before {
    left: 100%;
}

#pwa-install-btn.pwa-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(249, 115, 22, 0.4);
    background: linear-gradient(135deg, #EA580C 0%, #F97316 100%) !important;
    color: #ffffff !important;
}

#pwa-install-btn.pwa-cta-btn:active {
    transform: translateY(-1px);
}

@keyframes pwaCtaPulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(13, 148, 136, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 30px rgba(13, 148, 136, 0.6);
        transform: scale(1.02);
    }
}
