:root {
    --bg-color: #f4f4f7;
    --particle-color: rgba(170, 170, 185, 0.45);
    --particle-color-hover: rgba(140, 140, 160, 0.7);
    --text-color: #333;
    --placeholder-color: #aaa;
    --border-before-color: #d5d5d8;
    --border-height: 2px;
    --border-after-color: #FF6464;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-color);
    font-family: 'Inter', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body::-webkit-scrollbar {
    display: none;
}

/* ========== Canvas 粒子背景 ========== */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ========== 左上角 Logo ========== */
.logo {
    position: fixed;
    top: 28px;
    left: 32px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: default;
    transition: opacity 0.3s ease;
}
.logo:hover {
    opacity: 0.8;
}
.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #5b6af0, #8b5cf6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(91, 106, 240, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.logo:hover .logo-icon {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(91, 106, 240, 0.4);
}
.logo-icon svg {
    width: 20px;
    height: 20px;
}
.logo-icon svg path {
    fill: #fff;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #3a3a4a;
    letter-spacing: -0.3px;
}

/* ========== 搜索框容器 ========== */
.search-wrapper {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 16px;
    padding: 6px 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.07), 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.4s ease;
    max-width: 560px;
    width: 90vw;
}
.search-wrapper:focus-within {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.11), 0 3px 12px rgba(0, 0, 0, 0.06);
}

/* ========== 搜索引擎选择器 ========== */
.engine-select-wrap {
    position: relative;
    flex-shrink: 0;
    margin-right: 4px;
}
.engine-select {
    display: none;
}
.engine-select-trigger {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #f7f7fa;
    border: 2px solid transparent;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    outline: none;
    letter-spacing: 0.2px;
    min-width: 96px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.engine-select-trigger:hover {
    background: #efeff3;
    border-color: #e0e0e8;
}
.engine-select-trigger:focus-visible {
    border-color: #c5c5d8;
    background: #efeff3;
    box-shadow: 0 0 0 3px rgba(140, 140, 180, 0.1);
}
.engine-select-content {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.engine-option-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
}
.engine-select-arrow {
    width: 8px;
    height: 8px;
    border-right: 2px solid #999;
    border-bottom: 2px solid #999;
    transform: translateY(-2px) rotate(45deg);
    transition: border-color 0.25s ease;
    flex-shrink: 0;
}
.engine-select-trigger:hover .engine-select-arrow {
    border-color: #666;
}
.engine-select-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 140px;
    padding: 6px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e8e8ee;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    display: none;
    z-index: 30;
}
.engine-select-dropdown.open {
    display: block;
}
.engine-option {
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #444;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease;
}
.engine-option:hover,
.engine-option.active {
    background: #f7f7fa;
}

/* ========== 随机提示文字 ========== */
.random-text {
    position: fixed;
    top: 20px;
    right: 20px;
    left: auto;
    transform: translateY(-12px);
    z-index: 5;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    color: #666;
    font-size: 0.8rem;
    letter-spacing: 0.3px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
    backdrop-filter: blur(6px);
    max-width: min(280px, calc(100vw - 32px));
    text-align: right;
}
.random-text.show {
    opacity: 1;
    transform: translateY(0);
}

/* ========== 搜索输入框区域 ========== */
.form-control {
    position: relative;
    flex: 1;
    --width-of-input: 100%;
    --border-height: 2px;
    --border-before-color: #e0e0e6;
    --border-after-color: #FF6464;
    min-width: 0;
}
.input {
    color: #333;
    font-size: 0.95rem;
    background-color: transparent;
    width: 100%;
    box-sizing: border-box;
    padding-inline: 0.5em;
    padding-block: 0.75em;
    border: none;
    border-bottom: var(--border-height) solid var(--border-before-color);
    box-shadow: none;
    font-family: inherit;
    letter-spacing: 0.2px;
    transition: border-bottom-color 0.3s ease;
}
.input::placeholder {
    color: #bbb;
    font-weight: 400;
}
.input-alt {
    font-size: 1.05rem;
    padding-inline: 0.6em;
    padding-block: 0.75em;
    box-shadow: none;
}
.input-border {
    position: absolute;
    background: var(--border-after-color);
    width: 0%;
    height: 2px;
    bottom: 0;
    left: 0;
    transition: width 0.3s cubic-bezier(0.6, -0.28, 0.735, 0.045);
    border-radius: 0 0 2px 2px;
}
.input:focus {
    outline: none;
}
.input:focus+.input-border {
    width: 100%;
}
.input-border-alt {
    height: 3px;
    background: linear-gradient(90deg, #FF6464 0%, #FFBF59 50%, #47C9FF 100%);
    transition: width 0.4s cubic-bezier(0.42, 0, 0.58, 1);
    border-radius: 0 0 3px 3px;
}
.input-alt:focus+.input-border-alt {
    width: 100%;
}

/* ========== 搜索提示小标签 ========== */
.hint-tag {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #bbb;
    letter-spacing: 0.3px;
    pointer-events: none;
    transition: opacity 0.4s ease;
    white-space: nowrap;
}
.search-wrapper:focus-within .hint-tag {
    opacity: 0.5;
}

/* ========== 响应式 ========== */
@media (max-width: 640px) {
    .search-wrapper {
        width: 92vw;
        padding: 5px 6px;
        border-radius: 14px;
    }
    .engine-select {
        padding: 9px 28px 9px 10px;
        font-size: 0.8rem;
        min-width: 70px;
        border-radius: 8px;
    }
    .engine-select-wrap::after {
        right: 7px;
        width: 6px;
        height: 6px;
    }
    .input {
        font-size: 0.85rem;
        padding-block: 0.65em;
    }
    .input-alt {
        font-size: 0.9rem;
        padding-block: 0.65em;
    }
    .logo {
        top: 16px;
        left: 16px;
        gap: 6px;
    }
    .logo-icon {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }
    .logo-icon svg {
        width: 16px;
        height: 16px;
    }
    .logo-text {
        font-size: 1rem;
    }
    .hint-tag {
        bottom: -24px;
        font-size: 0.7rem;
    }
}
@media (max-width: 380px) {
    .search-wrapper {
        width: 95vw;
        padding: 4px 4px;
        border-radius: 12px;
    }
    .engine-select {
        padding: 8px 24px 8px 8px;
        font-size: 0.75rem;
        min-width: 60px;
        border-radius: 7px;
    }
    .engine-select-wrap::after {
        right: 5px;
        width: 5px;
        height: 5px;
    }
    .input {
        font-size: 0.8rem;
        padding-block: 0.6em;
        padding-inline: 0.3em;
    }
    .input-alt {
        font-size: 0.82rem;
        padding-block: 0.6em;
        padding-inline: 0.35em;
    }
    .logo {
        top: 10px;
        left: 10px;
        gap: 4px;
    }
    .logo-icon {
        width: 26px;
        height: 26px;
        border-radius: 6px;
    }
    .logo-icon svg {
        width: 14px;
        height: 14px;
    }
    .logo-text {
        font-size: 0.85rem;
    }
}
