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

:root {
    --primary-color: #1f2937;
    --primary-dark: #111827;
    --secondary-color: #374151;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #e9ecef 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    color: var(--text-primary);
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 背景动画 */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -100px;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.1), rgba(55, 65, 81, 0.1));
    border: 1px solid rgba(31, 41, 55, 0.2);
    border-radius: 50%;
    animation: rise 15s infinite ease-in;
}

.bubble:nth-child(1) {
    width: 80px;
    height: 80px;
    left: 10%;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    width: 60px;
    height: 60px;
    left: 30%;
    animation-delay: 2s;
}

.bubble:nth-child(3) {
    width: 100px;
    height: 100px;
    left: 50%;
    animation-delay: 4s;
}

.bubble:nth-child(4) {
    width: 70px;
    height: 70px;
    left: 70%;
    animation-delay: 6s;
}

.bubble:nth-child(5) {
    width: 90px;
    height: 90px;
    left: 85%;
    animation-delay: 8s;
}

@keyframes rise {
    to {
        bottom: 110%;
        transform: translateX(100px);
        opacity: 0;
    }
}

/* 星星效果 */
.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(31, 41, 55, 0.6);
    animation: twinkle 3s ease-in-out infinite;
}

.star:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.star:nth-child(2) { top: 20%; left: 80%; animation-delay: 0.5s; }
.star:nth-child(3) { top: 30%; left: 40%; animation-delay: 1s; }
.star:nth-child(4) { top: 40%; left: 60%; animation-delay: 1.5s; }
.star:nth-child(5) { top: 50%; left: 10%; animation-delay: 2s; }
.star:nth-child(6) { top: 60%; left: 90%; animation-delay: 2.5s; }
.star:nth-child(7) { top: 70%; left: 30%; animation-delay: 0.3s; }
.star:nth-child(8) { top: 80%; left: 70%; animation-delay: 0.8s; }
.star:nth-child(9) { top: 15%; left: 50%; animation-delay: 1.3s; }
.star:nth-child(10) { top: 85%; left: 50%; animation-delay: 1.8s; }

@keyframes twinkle {
    0%, 100% { 
        opacity: 0.3;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.5);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-icon {
    width: 50px;
    height: 50px;
    color: var(--primary-color);
    filter: drop-shadow(0 4px 6px rgba(31, 41, 55, 0.3));
    animation: float 3s ease-in-out infinite;
}

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

.header h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    animation: glow 2s ease-in-out infinite alternate;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}

@keyframes glow {
    from { filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1)) brightness(1); }
    to { filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1)) brightness(1.2); }
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 10px;
}

/* 搜索区域 */
.search-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-xl), 0 0 40px rgba(31, 41, 55, 0.1);
    animation: fadeInUp 0.8s ease;
    border: 1px solid rgba(31, 41, 55, 0.1);
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#searchInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    background: white;
}

#searchInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(31, 41, 55, 0.1), 0 0 20px rgba(31, 41, 55, 0.1);
    transform: translateY(-1px);
}

#searchInput::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.search-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.search-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.search-btn:hover::before {
    width: 300px;
    height: 300px;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(31, 41, 55, 0.5);
}

.search-btn:active {
    transform: translateY(0);
}

.clear-btn {
    padding: 15px 25px;
    background: white;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* 快速查询标签 */
.quick-search {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.quick-tag {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.quick-tag::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.quick-tag:hover::after {
    opacity: 1;
}

.quick-tag:hover {
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(31, 41, 55, 0.3);
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-xl), 0 0 40px rgba(31, 41, 55, 0.15);
    animation: fadeIn 0.3s ease, pulse 2s ease-in-out infinite;
    border: 1px solid rgba(31, 41, 55, 0.1);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid transparent;
    border-top: 4px solid var(--primary-color);
    border-right: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(31, 41, 55, 0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 结果展示区 */
.result-section {
    animation: fadeInUp 0.8s ease;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.result-header h2 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.8rem;
}


.word-display {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg), 0 0 30px rgba(31, 41, 55, 0.15);
    border: 1px solid rgba(31, 41, 55, 0.1);
}

.word-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.current-word {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-left: 10px;
    display: inline-block;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
    100% { filter: brightness(1); }
}

/* 结果网格 */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.result-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow-lg);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(31, 41, 55, 0.1);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.result-card:hover::before {
    left: 100%;
}

.result-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl), 0 10px 40px rgba(31, 41, 55, 0.2);
}

.synonym-card {
    border-top: 4px solid var(--success-color);
    animation: slideInLeft 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.antonym-card {
    border-top: 4px solid var(--warning-color);
    animation: slideInRight 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-secondary);
}

.card-header svg {
    color: var(--primary-color);
}

.card-header h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
}

.card-content {
    line-height: 2;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.card-content .word-item {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin: 5px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    border: 1px solid transparent;
    animation: fadeInScale 0.4s ease backwards;
}

.card-content .word-item:nth-child(1) { animation-delay: 0.05s; }
.card-content .word-item:nth-child(2) { animation-delay: 0.1s; }
.card-content .word-item:nth-child(3) { animation-delay: 0.15s; }
.card-content .word-item:nth-child(4) { animation-delay: 0.2s; }
.card-content .word-item:nth-child(5) { animation-delay: 0.25s; }
.card-content .word-item:nth-child(6) { animation-delay: 0.3s; }
.card-content .word-item:nth-child(7) { animation-delay: 0.35s; }
.card-content .word-item:nth-child(8) { animation-delay: 0.4s; }
.card-content .word-item:nth-child(9) { animation-delay: 0.45s; }
.card-content .word-item:nth-child(10) { animation-delay: 0.5s; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.card-content .word-item::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.card-content .word-item:hover::before {
    opacity: 1;
}

.card-content .word-item:hover {
    color: white;
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 5px 15px rgba(31, 41, 55, 0.4);
}

.empty-hint {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* 统计信息 */
.statistics {
    display: flex;
    justify-content: center;
    gap: 40px;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow-lg), 0 0 30px rgba(31, 41, 55, 0.1);
    border: 1px solid rgba(31, 41, 55, 0.1);
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), #4b5563);
    background-size: 200% 200%;
    animation: gradientMove 3s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 历史记录区 */
.history-section {
    margin-top: 30px;
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow-xl), 0 0 40px rgba(31, 41, 55, 0.1);
    animation: fadeInUp 0.8s ease;
    border: 1px solid rgba(31, 41, 55, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-secondary);
}

.section-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.section-header svg {
    color: var(--primary-color);
}

.clear-history-btn {
    padding: 8px 16px;
    background: white;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.clear-history-btn:hover {
    background: var(--danger-color);
    color: white;
}

.history-list,
.favorites-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.history-item,
.favorite-item {
    padding: 10px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.history-item::before,
.favorite-item::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.history-item:hover::before {
    opacity: 1;
}

.history-item:hover {
    color: white;
    border-color: transparent;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(31, 41, 55, 0.3);
}

/* 页脚 */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    font-size: 0.9rem;
}

.footer-link {
    color: #a78bfa;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.footer-link:hover {
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.1);
    transform: translateY(-1px);
}

.footer-separator {
    color: rgba(255, 255, 255, 0.3);
}

/* 隐藏SEO工具推荐区域 */
.related-tools-seo {
    display: none;
    /* SEO优化：保留HTML中的链接供搜索引擎抓取，但不在页面上显示 */
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-xl), 0 0 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 300px;
    border: 1px solid rgba(31, 41, 55, 0.1);
}

.toast.success {
    border-left: 4px solid var(--success-color);
    box-shadow: var(--shadow-xl), 0 0 30px rgba(16, 185, 129, 0.2);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
    box-shadow: var(--shadow-xl), 0 0 30px rgba(239, 68, 68, 0.2);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
    box-shadow: var(--shadow-xl), 0 0 30px rgba(245, 158, 11, 0.2);
}

/* 工具类 */
.hidden {
    display: none !important;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .search-box {
        flex-direction: column;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .statistics {
        flex-direction: column;
        gap: 20px;
    }

    .current-word {
        font-size: 1.4rem;
        display: block;
        margin-left: 0;
        margin-top: 10px;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

