:root {
    --theme-color: #3b82f6;
    --theme-color-light: rgba(59,130,246,.1);
    --theme-color-medium: rgba(59,130,246,.2);
    --theme-color-strong: rgba(59,130,246,.3);
    --theme-color-decor: rgba(59,130,246,.12);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    font-family: 'Noto Sans SC Sliced', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-weight: 300;
    color: #1a1a2e;
    background: #ffffff;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

.bg-decor {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.circle {
    position: absolute;
    border-radius: 50%;
    z-index: 1;
}

.circle-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--theme-color-light) 0%, transparent 70%);
    top: -100px;
    right: -80px;
}

.circle-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
    bottom: -50px;
    left: -60px;
}

.circle-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--theme-color-light) 0%, transparent 70%);
    top: 40%;
    left: 60%;
}

.dot-grid {
    position: absolute;
    width: 120px;
    height: 120px;
    background-image: radial-gradient(circle, var(--theme-color-decor) 1px, transparent 1px);
    background-size: 16px 16px;
    z-index: -1;
}

.dot-grid-1 {
    top: 15%;
    right: 8%;
}

.dot-grid-2 {
    bottom: 20%;
    left: 5%;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0);
    z-index: 0;
    pointer-events: none;
    transition: background 0.3s ease;
}

.container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px 20px;
}

.logo-area {
    margin-bottom: 48px;
}

.logo {
    height: 120px;
    width: auto;
    opacity: 0.9;
}

.search-wrapper {
    width: 100%;
    max-width: 620px;
    position: relative;
}

.engine-tabs {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
}

.engine-tab {
    padding: 6px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    border-radius: 20px;
    transition: all 0.25s ease;
    letter-spacing: 0.5px;
}

.engine-tab:hover {
    color: var(--theme-color);
    background: var(--theme-color-light);
}

.engine-tab.active {
    color: #ffffff;
    background: var(--theme-color);
    font-weight: 500;
    box-shadow: 0 2px 8px var(--theme-color-medium);
}

.search-form {
    position: relative;
    width: 100%;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 4px 6px 4px 18px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--theme-color);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--theme-color-light), 0 4px 16px var(--theme-color-light);
}

.search-icon {
    color: #94a3b8;
    font-size: 15px;
    margin-right: 12px;
    transition: color 0.25s;
}

.input-wrapper:focus-within .search-icon {
    color: var(--theme-color);
}

.search-input {
    flex: 1;
    height: 48px;
    border: none;
    background: transparent;
    font-size: 16px;
    color: #1e293b;
    outline: none;
    font-family: inherit;
    font-weight: 400;
}

.search-input::placeholder {
    color: #94a3b8;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.search-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--theme-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.search-btn:hover {
    background: var(--theme-color);
    filter: brightness(0.9);
    transform: scale(1.04);
    box-shadow: 0 4px 12px var(--theme-color-strong);
}

.search-btn:active {
    transform: scale(0.96);
}

.suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    display: none;
    overflow: hidden;
    z-index: 100;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 14px;
    color: #475569;
}

.suggestion-item:hover {
    background: #f1f5f9;
}

.suggestion-item i {
    color: #94a3b8;
    font-size: 12px;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 56px;
    max-width: 620px;
}

.quick-link {
    position: relative;
    min-width: 90px;
    text-align: center;
}

.quick-link-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border-radius: 16px;
    transition: all 0.25s ease;
    text-decoration: none;
    color: inherit;
}

.quick-link:hover .quick-link-inner {
    background: var(--theme-color-light);
    transform: translateY(-2px);
}

.quick-link:active .quick-link-inner {
    transform: translateY(0);
}

.quick-link-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #f0f4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.quick-link:hover .quick-link-inner .quick-link-icon {
    background: var(--theme-color-light);
    box-shadow: 0 4px 12px var(--theme-color-decor);
}

.quick-link-icon i {
    display: block;
    width: 26px;
    height: 26px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.quick-link-icon img.ql-favicon {
    display: block;
    width: 26px;
    height: 26px;
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 4px;
}

.quick-link span {
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.quick-link:hover .quick-link-inner span {
    color: var(--theme-color);
}

.footer {
    margin-top: auto;
    text-align: center;
    padding: 12px 20px 20px;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    z-index: 1;
}

.footer a {
    color: #64748b;
    transition: color 0.2s;
}

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

.sidebar-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.25s ease;
    padding: 0;
}

.sidebar-toggle:hover {
    background: #ffffff;
    box-shadow: 0 2px 12px var(--theme-color-light);
    border-color: var(--theme-color-medium);
}

.sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #64748b;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover span {
    background: var(--theme-color);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.2);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: #ffffff;
    z-index: 1200;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.04);
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 2px solid var(--theme-color-light);
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: 0.3px;
}

.sidebar-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 13px;
    transition: all 0.2s ease;
}

.sidebar-close:hover {
    background: var(--theme-color-light);
    color: var(--theme-color);
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.sidebar-body::-webkit-scrollbar {
    width: 3px;
}

.sidebar-body::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 3px;
}

.sidebar-section {
    padding: 4px 12px;
    margin-bottom: 4px;
}

.sidebar-section-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--theme-color);
    letter-spacing: 1px;
    padding: 12px 10px 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-section-title i {
    color: var(--theme-color);
    font-size: 11px;
}

.sidebar-link {
    display: block;
    padding: 9px 10px;
    margin: 1px 0;
    font-size: 14px;
    color: #475569;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.sidebar-link:hover {
    background: #f8fafc;
    color: var(--theme-color);
}

.sidebar-link:active {
    background: var(--theme-color-light);
}

@media (max-width: 640px) {
    .sidebar {
        width: 260px;
    }

    .sidebar-toggle {
        top: 14px;
        right: 14px;
        width: 40px;
        height: 40px;
    }

    .sidebar-toggle span {
        width: 18px;
    }

    .sidebar-header {
        padding: 14px 16px;
    }

    .sidebar-section {
        padding: 4px 10px;
    }

    .sidebar-link {
        padding: 8px 10px;
        font-size: 13px;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 60px 16px 80px;
    }

    .logo {
        height: 80px;
    }

    .logo-area {
        margin-bottom: 36px;
    }

    .engine-tab {
        padding: 5px 14px;
        font-size: 12px;
    }

    .input-wrapper {
        border-radius: 14px;
        padding: 3px 5px 3px 14px;
    }

    .search-input {
        height: 44px;
        font-size: 15px;
    }

    .search-btn {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        font-size: 14px;
    }

    .quick-links {
        gap: 12px;
        margin-top: 40px;
    }

    .quick-link {
        min-width: 76px;
    }

    .quick-link-inner {
        padding: 14px 10px;
    }

    .quick-link-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .quick-link-icon i {
        width: 22px;
        height: 22px;
    }

    .quick-link-icon img.ql-favicon {
        width: 22px;
        height: 22px;
    }

    .quick-link-inner span {
        font-size: 11px;
    }

    .circle-1 { width: 250px; height: 250px; }
    .circle-2 { width: 200px; height: 200px; }
    .circle-3 { width: 140px; height: 140px; }
    .dot-grid { width: 80px; height: 80px; background-size: 12px 12px; }
}

@media (max-height: 600px) {
    .container {
        padding: 30px 16px 60px;
    }

    .logo-area {
        margin-bottom: 24px;
    }

    .logo {
        height: 48px;
    }

    .quick-links {
        margin-top: 28px;
        gap: 10px;
    }

    .quick-link {
        min-width: 66px;
    }

    .quick-link-inner {
        padding: 10px 8px;
    }

    .quick-link-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .quick-link-icon i {
        width: 18px;
        height: 18px;
    }

    .quick-link-icon img.ql-favicon {
        width: 18px;
        height: 18px;
    }
}

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast-item {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    color: #fff;
    background: rgba(30,30,30,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.toast-item.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast-item.toast-success {
    background: rgba(34,197,94,0.9);
}

.toast-item.toast-error {
    background: rgba(239,68,68,0.9);
}
