:root {
    --yuke-primary: #2563eb;
    --yuke-primary-dark: #1d4ed8;
    --yuke-primary-soft: #eff6ff;
    --yuke-accent: #0f766e;
    --yuke-warning: #f59e0b;
    --yuke-danger: #dc2626;
    --yuke-info: #0284c7;
    --yuke-ink: #0f172a;
    --yuke-muted: #64748b;
    --yuke-line: #e2e8f0;
    --yuke-surface: #ffffff;
    --yuke-page: #f8fafc;
    --yuke-radius: 8px;
    --yuke-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --primary-gradient: linear-gradient(135deg, var(--yuke-primary) 0%, #0f766e 100%);
    --secondary-gradient: linear-gradient(135deg, #0f766e 0%, #0284c7 100%);
    --success-gradient: linear-gradient(135deg, #0f766e 0%, #16a34a 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    --info-gradient: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    --dark-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

html {
    font-size: 14px;
    min-height: 100%;
}

@media (min-width: 768px) {
    html { font-size: 16px; }
}

body {
    min-height: 100%;
    margin: 0;
    background: var(--yuke-page);
    color: var(--yuke-ink);
    font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.65;
}

a { color: var(--yuke-primary); }
a:hover { color: var(--yuke-primary-dark); }

.container { max-width: 1180px; }

.btn {
    border-radius: var(--yuke-radius);
    font-weight: 600;
}

.btn-primary,
.btn-gradient {
    border-color: var(--yuke-primary);
    background: var(--yuke-primary);
    color: #fff;
}

.btn-primary:hover,
.btn-gradient:hover {
    border-color: var(--yuke-primary-dark);
    background: var(--yuke-primary-dark);
    color: #fff;
}

.btn-gradient-secondary {
    border-color: var(--yuke-accent);
    background: var(--yuke-accent);
    color: #fff;
}

.btn-gradient-secondary:hover,
.btn-gradient-secondary:focus {
    border-color: #115e59;
    background: #115e59;
    color: #fff;
}

.btn-outline-primary {
    border-color: var(--yuke-primary);
    color: var(--yuke-primary);
}

.btn-outline-primary:hover {
    border-color: var(--yuke-primary);
    background: var(--yuke-primary);
    color: #fff;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.2);
}

.text-primary-custom,
.text-gradient {
    color: var(--yuke-primary) !important;
    background: none;
    -webkit-text-fill-color: currentColor;
}

.bg-light { background: #f8fafc !important; }
.bg-white { background: #fff !important; }

.navbar {
    background: rgba(255, 255, 255, 0.96) !important;
    border-bottom: 1px solid var(--yuke-line);
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.navbar.scrolled { box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08); }

.navbar-brand {
    font-weight: 800;
    font-size: 1.25rem;
}

.logo-icon,
.navbar-brand .logo-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    border-radius: var(--yuke-radius);
    background: var(--yuke-primary);
    color: #fff;
}

.navbar-nav .nav-link {
    margin: 0 4px;
    color: #334155 !important;
    font-weight: 600;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus { color: var(--yuke-primary) !important; }

.dropdown-menu {
    border: 1px solid var(--yuke-line);
    border-radius: var(--yuke-radius);
    box-shadow: var(--yuke-shadow);
}

.tool-dropdown {
    position: relative;
}

.tool-dropdown-menu {
    width: min(720px, calc(100vw - 48px));
    max-height: min(70vh, 640px);
    overflow-y: auto;
    padding: 16px;
    columns: 2;
    column-gap: 16px;
}

.tool-dropdown-menu.dropdown-menu-end {
    right: 0;
    left: auto;
}

.tool-dropdown-menu li {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 6px;
}

.tool-dropdown-menu .dropdown-item {
    white-space: normal;
    padding: 12px 16px;
    margin: 0;
    line-height: 1.45;
}

.tool-dropdown-menu .dropdown-view-all {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid rgba(37, 99, 235, 0.14);
    color: var(--yuke-primary-dark);
    font-weight: 600;
}

.dropdown-item {
    border-radius: 6px;
    color: #334155;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--yuke-primary-soft);
    color: var(--yuke-primary);
}

.mobile-menu-btn,
.mobile-menu-close {
    border: 0;
    border-radius: var(--yuke-radius);
    background: var(--yuke-primary);
    color: #fff;
}

.mobile-menu-btn {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mobile-menu-close {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
}

.hamburger {
    display: flex;
    flex-direction: column;
    width: 24px;
    height: 18px;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: #fff;
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.mobile-menu-overlay.show {
    visibility: visible;
    opacity: 1;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    width: min(86vw, 360px);
    height: 100%;
    background: #fff;
    box-shadow: -16px 0 40px rgba(15, 23, 42, 0.18);
    transform: translateX(100%);
    transition: transform 0.2s ease;
}

.mobile-menu-overlay.show .mobile-menu-content { transform: translateX(0); }

.mobile-menu-header,
.mobile-menu-footer {
    padding: 16px 18px;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--yuke-line);
}

.mobile-menu-footer {
    border-top: 1px solid var(--yuke-line);
}

.mobile-menu-footer .btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-logo,
.menu-item-content {
    display: flex;
    align-items: center;
}

.mobile-menu-logo {
    min-width: 0;
}

.mobile-menu-logo .text-gradient {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px 18px;
}

.mobile-menu-section {
    margin-bottom: 6px;
}

.mobile-menu-item,
.mobile-submenu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 8px 10px;
    border-radius: var(--yuke-radius);
    color: #334155;
    text-decoration: none;
}

.mobile-menu-item {
    justify-content: space-between;
    border: 1px solid transparent;
    cursor: pointer;
}

.mobile-menu-link {
    width: 100%;
}

.mobile-menu-item:hover,
.mobile-menu-item.active,
.mobile-submenu-item:hover {
    background: var(--yuke-primary-soft);
    color: var(--yuke-primary);
}

.mobile-menu-item.active {
    border-color: #bfdbfe;
}

.menu-item-content {
    flex: 1 1 auto;
    min-width: 0;
    gap: 10px;
}

.menu-item-icon,
.tool-icon-small,
.icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: var(--yuke-radius);
    background: var(--yuke-primary);
    color: #fff;
}

.menu-item-text {
    min-width: 0;
    overflow: hidden;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-item-arrow {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    border-radius: 999px;
    color: #334155;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.mobile-menu-item.active .menu-item-arrow {
    transform: rotate(180deg);
    background: #dbeafe;
    color: var(--yuke-primary);
}

.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    margin: 0 0 8px 50px;
    padding: 0;
    border: 0 solid transparent;
    border-radius: var(--yuke-radius);
    background: #f8fafc;
    transition: max-height 0.2s ease, padding 0.2s ease, border-width 0.2s ease;
}

.mobile-submenu.show {
    max-height: 540px;
    padding: 6px;
    border-width: 1px;
    border-color: var(--yuke-line);
}

.mobile-submenu-item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    justify-content: start;
    min-height: 40px;
    padding: 8px 12px;
    gap: 10px;
    font-size: 0.95rem;
}

.mobile-submenu-item i {
    width: 24px;
    text-align: center;
    color: #475569;
}

.mobile-submenu-item span {
    min-width: 0;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hero-section {
    position: relative;
    overflow: hidden;
    padding: 56px 0;
    background: linear-gradient(135deg, #1e40af 0%, #0f766e 100%);
    color: #fff;
}

.hero-section > .container {
    position: relative;
    z-index: 1;
}

.hero-section .lead { color: rgba(255, 255, 255, 0.88); }

.feature-badge,
.hero-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.feature-badge {
    min-height: 32px;
    padding: 6px 12px;
    margin: 3px;
    font-weight: 600;
}

.hero-meta {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.section-title { margin-bottom: 1.25rem; }

.card,
.tool-card,
.tool-panel,
.stats-card {
    border: 1px solid var(--yuke-line);
    border-radius: var(--yuke-radius);
    background: var(--yuke-surface);
    box-shadow: none;
}

.card-hover,
.tool-card {
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.card-hover:hover,
.tool-card:hover {
    transform: translateY(-3px);
    border-color: rgba(37, 99, 235, 0.32);
    box-shadow: var(--yuke-shadow);
}

.gradient-bg-primary { background: var(--yuke-primary); }
.gradient-bg-secondary { background: var(--yuke-accent); }
.gradient-bg-success { background: #16a34a; }
.gradient-bg-warning { background: var(--yuke-warning); }
.gradient-bg-info { background: var(--yuke-info); }
.gradient-bg-dark { background: #334155; }

.footer {
    position: relative;
    overflow: hidden;
    background: #0f172a;
    color: #e2e8f0;
}

.footer a {
    color: #bfdbfe;
    text-decoration: none;
}

.footer a:hover { color: #fff; }

.footer .text-gray-600,
.footer .text-gray-500,
.footer .text-light {
    color: #cbd5e1 !important;
}

.loading {
    opacity: 1;
    transform: none;
}

@media (max-width: 991.98px) {
    .navbar { padding: 10px 0; }
    .navbar-collapse { display: none; }

    .tool-dropdown-menu {
        width: auto;
        max-height: none;
        overflow: visible;
        padding: 12px 0;
        columns: 1;
    }

    .hero-section {
        padding: 42px 0;
        text-align: center;
    }

    .hero-section h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
}

@media (max-width: 575.98px) {
    .display-4,
    .display-5 { font-size: 1.8rem; }
    .lead { font-size: 1rem; }

    .tool-icon-small,
    .icon-wrapper,
    .menu-item-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .mobile-menu-content {
        width: min(88vw, 340px);
    }

    .mobile-menu-header,
    .mobile-menu-footer {
        padding-right: 14px;
        padding-left: 14px;
    }

    .mobile-menu-body {
        padding: 10px 10px 16px;
    }

    .mobile-menu-item {
        min-height: 50px;
        padding: 7px 8px;
    }

    .mobile-submenu {
        margin-left: 48px;
    }
}

@media (min-width: 992px) {
    .mobile-menu-overlay { display: none !important; }
}
