/* 二次元风格主题样式 */
:root {
    --primary-color: #000000;
    --secondary-color: #333333;
    --accent-color: #555555;
    --bg-primary: #000000;
    --bg-secondary: #111111;
    --bg-card: #fffbf0;
    --text-primary: #5d4037;
    --text-secondary: #8d6e63;
    --glow-color: #333333;
    --border-radius: 15px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="orange"] {
    --primary-color: #000000;
    --secondary-color: #333333;
    --glow-color: #333333;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f5f5dc;
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

span {
    font-family: 'Segoe UI', Arial, sans-serif !important;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #ddd, transparent),
        radial-gradient(1px 1px at 50px 120px, #fff, transparent),
        radial-gradient(1px 1px at 80px 150px, rgba(255,255,255,0.7), transparent),
        radial-gradient(2px 2px at 110px 200px, #eee, transparent),
        radial-gradient(1px 1px at 140px 50px, #fff, transparent),
        radial-gradient(1px 1px at 170px 100px, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 190px 180px, #ddd, transparent),
        radial-gradient(1px 1px at 30px 220px, #fff, transparent),
        radial-gradient(1px 1px at 60px 250px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 100px 280px, #eee, transparent),
        radial-gradient(1px 1px at 150px 320px, #fff, transparent),
        radial-gradient(1px 1px at 180px 350px, rgba(255,255,255,0.7), transparent);
    background-repeat: repeat;
    background-size: 400px 400px;
    animation: twinkle 4s infinite;
    z-index: -1;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* 中央公告 - 图片背景 */
.center-announcement {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 20px;
    padding: 30px 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    animation: announcementSlideIn 0.5s ease-out;
    background-image: url('t.jpg');
    background-size: cover;
    background-position: center;
    color: white; /* 设置文字为白色以提供对比 */
    overflow: hidden; /* 确保伪元素在边框内 */
}

.center-announcement::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色遮罩 */
    border-radius: 20px;
    z-index: 1; /* 将遮罩置于内容之下 */
}

.announcement-content {
    position: relative; /* 确保内容在遮罩之上 */
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    font-size: 18px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4); /* 为白色文字添加轻微阴影以增强可读性 */
}

.announcement-ack-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.8);
    color: white;
    font-size: 16px;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.announcement-ack-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

@keyframes announcementSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* 背景装饰 - 樱花飞舞 */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.floating-card {
    display: none;
}





@keyframes sakura-float {
    0%, 100% { transform: translateY(0px) rotate(0deg) scale(1); }
    25% { transform: translateY(-8px) rotate(90deg) scale(1.2); }
    50% { transform: translateY(-20px) rotate(180deg) scale(1.4); }
    75% { transform: translateY(-8px) rotate(270deg) scale(1.2); }
}

/* 显示樱花按钮 */
.sakura-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    padding: 10px 15px;
    background: white;
    color: #ff69b4;
    border: 2px solid #ff69b4;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(255, 105, 180, 0.3);
}

.sakura-toggle-btn.active {
    background: #ff69b4;
    color: white;
    box-shadow: 0 2px 15px rgba(255, 105, 180, 0.5);
}

.sakura-toggle-btn:hover {
    transform: scale(1.05);
}

/* 樱花飘落系统 */
.cherry-blossom-system {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.petal {
    position: absolute;
    font-size: 24px;
    animation: fall linear forwards;
    pointer-events: none;
    z-index: 1000;
    color: #ff69b4;
    text-shadow: 0 0 15px rgba(255, 105, 180, 0.8);
    filter: drop-shadow(0 0 8px rgba(255, 182, 193, 1));
    opacity: 1;
    transform-origin: center;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

.petal.stop-near-text {
    animation-play-state: paused;
    opacity: 0.7;
}

/* 风力效果 */
.wind-effect {
    animation: wind-blow 3s ease-in-out infinite alternate;
}

@keyframes wind-blow {
    0% { transform: translateX(0px); }
    100% { transform: translateX(20px); }
}

/* 碰撞区域检测 */
.content-area {
    position: relative;
    z-index: 20; /* 提升层级，确保在花瓣上方 */
}

.petal.stopped {
    animation-play-state: paused !important;
    opacity: 0.6;
    filter: drop-shadow(0 0 2px rgba(64, 64, 64, 0.3));
}

/* 头部样式 */
.header {
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: transform 0.3s ease-in-out;
}

.header.hidden {
    transform: translateY(-100%);
}

.main {
    padding: 2rem 0;
    margin-top: 80px; /* 为固定头部留出空间 */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--glow-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.logo-star {
    font-size: 24px;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    margin-right: 15px;
    cursor: default;
    user-select: none;
}

/* 科技风搜索框 */
.search-container {
    flex: 1;
    max-width: 600px;
    margin: 0 auto 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.tech-search {
    position: relative;
    background: #000000;
    border-radius: 12px;
    padding: 2px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3), inset 0 0 5px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tech-search::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, #00ffff, #0080ff, #8000ff, #ff0080, #ff4000, #ffff00, #00ff00, #00ffff);
    background-size: 300% 300%;
    border-radius: 12px;
    z-index: -1;
    opacity: 0.8;
    animation: borderGlow 3s linear infinite, colorShift 4s ease-in-out infinite;
    filter: blur(2px);
}

.tech-search::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #00ffff, #0080ff, #8000ff, #ff0080, #ff4000, #ffff00, #00ff00, #00ffff);
    background-size: 400% 400%;
    border-radius: 13px;
    z-index: -2;
    opacity: 0.4;
    animation: borderGlow 2s linear infinite reverse, colorShift 3s ease-in-out infinite reverse;
    filter: blur(8px);
}

@keyframes borderGlow {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

@keyframes colorShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

.search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #00ffff;
    z-index: 2;
}

.tech-input {
    width: 100%;
    padding: 14px 45px 14px 35px;
    background: #000000;
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 15px;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-weight: 500;
    outline: none;
    transition: all 0.3s ease;
}

.tech-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.tech-input:focus {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2), inset 0 0 10px rgba(255, 255, 255, 0.1);
    background: #111111;
}



.search-status {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    font-size: 12px;
    color: #00ffff;
}

.status-indicator {
    animation: pulse 2s infinite, colorPulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes colorPulse {
    0% { color: #00ffff; text-shadow: 0 0 5px #00ffff; }
    25% { color: #0080ff; text-shadow: 0 0 8px #0080ff; }
    50% { color: #8000ff; text-shadow: 0 0 10px #8000ff; }
    75% { color: #ff0080; text-shadow: 0 0 8px #ff0080; }
    100% { color: #00ffff; text-shadow: 0 0 5px #00ffff; }
}

.status-indicator.valid {
    color: #00ff00;
}

.status-indicator.invalid {
    color: #ff0040;
}

.status-indicator.searching {
    color: #ffa500;
}

.tech-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(245, 245, 220, 0.95);
    border: 1px solid rgba(139, 69, 19, 0.3);
    border-radius: 0 0 15px 15px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 3000;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: none;
}

.tech-suggestions::-webkit-scrollbar {
    width: 6px;
}

.tech-suggestions::-webkit-scrollbar-track {
    background: rgba(255, 140, 66, 0.1);
    border-radius: 3px;
}

.tech-suggestions::-webkit-scrollbar-thumb {
    background: rgba(255, 140, 66, 0.4);
    border-radius: 3px;
}

.search-suggestion {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 140, 66, 0.2);
    color: #5d4037;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-suggestion:hover {
    background: rgba(255, 140, 66, 0.15);
    transform: translateX(2px);
}

.search-suggestion:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.search-suggestion strong {
    color: #ff8c42;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255, 140, 66, 0.3);
}

.search-suggestion.active {
    background: rgba(255, 140, 66, 0.25);
    transform: translateX(3px);
    border-left: 3px solid #ff8c42;
}

.search-suggestion.active strong {
    color: #5d4037;
    text-shadow: 0 0 10px rgba(255, 140, 66, 0.5);
}

/* 滚动条样式 */
.tech-suggestions::-webkit-scrollbar {
    width: 6px;
}

.tech-suggestions::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.tech-suggestions::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 3px;
}

.tech-suggestions::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 140, 66, 0.6);
}

.stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-card {
    background: linear-gradient(135deg, #fffbf0 0%, #ffeaa7 100%);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid rgba(255, 140, 66, 0.2);
    min-width: 80px;
    box-shadow: 0 4px 15px rgba(255, 140, 66, 0.2);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 140, 66, 0.3);
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: none;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    text-shadow: none;
    font-weight: 600;
}

/* 字母导航 */
.alphabet-nav {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(245, 245, 220, 0.9), rgba(250, 240, 230, 0.9));
    backdrop-filter: blur(15px);
    border: 1px solid rgba(245, 222, 179, 0.5);
    border-radius: 20px;
    padding: 15px;
    margin: 0 auto 20px auto;
    max-width: 600px;
    z-index: 50;
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.15);
}

.alphabet-nav::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, #f5deb3, #deb887, #daa520, #f5deb3);
    border-radius: 20px;
    z-index: -1;
    animation: warmGlow 4s ease-in-out infinite;
}

.alphabet-nav::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(245, 222, 179, 0.1), transparent);
    border-radius: 20px;
    z-index: -1;
}

@keyframes warmGlow {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.alphabet-container {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 0 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.alphabet-btn {
    background: rgba(245, 245, 220, 0.9);
    border: 1px solid rgba(218, 165, 32, 0.4);
    color: #8b4513;
    padding: 6px 10px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Segoe UI', Arial, sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
    position: relative;
    overflow: hidden;
    min-width: 32px;
    text-align: center;
}

.alphabet-btn:hover {
    background: rgba(245, 222, 179, 0.9);
    color: #a0522d;
    box-shadow: 0 0 15px rgba(218, 165, 32, 0.4);
    transform: scale(1.05);
    border-color: rgba(218, 165, 32, 0.8);
}

.alphabet-btn.active {
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.8), rgba(245, 222, 179, 0.9));
    color: #ffffff;
    box-shadow: 
        0 0 20px rgba(218, 165, 32, 0.6),
        inset 0 0 10px rgba(255, 255, 255, 0.3);
    transform: scale(1.08);
    border-color: #daa520;
    animation: activeWarmGlow 2s ease-in-out infinite alternate;
}

@keyframes activeWarmGlow {
    0% {
        box-shadow: 
            0 0 20px rgba(218, 165, 32, 0.6),
            inset 0 0 10px rgba(255, 255, 255, 0.3);
    }
    100% {
        box-shadow: 
            0 0 30px rgba(218, 165, 32, 0.9),
            inset 0 0 15px rgba(255, 255, 255, 0.5);
    }
}

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

.alphabet-btn:hover::before {
    left: 100%;
}

.alphabet-btn.active::before {
    left: 100%;
    animation: activeScan 2s linear infinite;
}

/* 主内容区 */
.main {
    padding: 2rem 0;
}

.card-section {
    margin-bottom: 3rem;
}

.card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.modern-card {
    width: 100%;
    max-width: 600px;
    background: #FAF0E6; /* 护眼的米黄色 */
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(139, 69, 19, 0.1), 0 5px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 2px solid rgba(218, 165, 32, 0.3);
    margin: 0 auto 20px auto;
    position: relative;
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(139, 69, 19, 0.15);
}

.search-toggle-btn {
    position: absolute;
    right: 15px;
    top: 15px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.search-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.card-content {
    padding: 2.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.word-main {
    text-align: center;
    margin-bottom: 2rem;
}

.word {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    text-shadow: 0 0 10px var(--glow-color);
}

.phonetic {
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-family: 'Segoe UI', 'Arial Unicode MS', 'DejaVu Sans', serif;
    letter-spacing: 0.02em;
    font-weight: 500;
}

.word-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent-color), var(--secondary-color));
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.word-details {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 2rem;
    margin-top: 1rem;
    width: 100%;
}

.etymology-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border-left: 3px solid var(--accent-color);
}

.etymology-title {
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.etymology-content {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.root-highlight {
    color: var(--primary-color);
    font-weight: 600;
    text-shadow: 0 0 5px var(--glow-color);
}

.word-roots {
    margin-top: 2rem;
    width: 100%;
    text-align: left;
}

.root-analysis {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.root-analysis h4 {
    color: #8b4513;
    margin: 20px 0 15px 0;
    font-size: 1.2em;
    font-weight: bold;
    border-bottom: 2px solid rgba(255, 140, 66, 0.3);
    padding-bottom: 5px;
    font-family: 'Segoe UI', Arial, sans-serif;
    text-shadow: none;
    font-style: normal;
}

.root-list,
.related-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.root-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.root-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(5px);
}

.root-info {
    flex: 1;
}

.root-name {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.root-meaning {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.related-word-item {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.related-word-item:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.word-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.word-details {
    width: 100%;
    text-align: left;
}

.definition,
.example {
    text-align: center;
    margin-bottom: 1rem;
}

.definition h4,
.example h4 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-weight: normal;
    font-style: normal;
    color: #333;
    font-size: 1.2em;
}

.translation-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.translation {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.definition {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.example-section {
    border-left: 3px solid var(--accent-color);
    padding-left: 1rem;
}

.example {
    font-size: 1.4rem;
    color: #000000;
    line-height: 1.6;
    font-style: italic;
    font-weight: 500;
}

.example strong {
    color: var(--primary-color);
    font-weight: 700;
    font-style: normal;
}

.navigation-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    background: #000000;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.nav-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.nav-btn:active {
    transform: translateY(0) scale(1);
}



/* 难度选择 */
.difficulty-section {
    margin-bottom: 2rem;
}

.difficulty-section h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.difficulty-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.difficulty-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(22, 33, 62, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.difficulty-btn:hover,
.difficulty-btn.active {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* 单词列表 */
.word-list-section {
    margin-top: 2rem;
}

.word-list-section h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.word-grid-container {
    height: 600px; /* Or any fixed height */
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.5);
}

.word-grid-sizer {
    position: relative;
    width: 100%;
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.word-item {
    background: rgba(22, 33, 62, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    padding: 1rem;
    transition: var(--transition);
    cursor: pointer;
}

.word-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.word-item.learned {
    opacity: 0.6;
    border-color: var(--accent-color);
}

.word-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.word-item-word {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.word-item-phonetic {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

.word-item-translation {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.word-item-difficulty {
    padding: 0.2rem 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* 设置面板 */
.settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.settings-panel.active {
    display: flex;
}

.settings-content {
    background: var(--bg-card);
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow);
}

.settings-content h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
}

.setting-item {
    margin-bottom: 1.5rem;
}

.setting-item label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.theme-options {
    display: flex;
    gap: 0.5rem;
}

.theme-btn {
    padding: 0.5rem 1rem;
    background: rgba(22, 33, 62, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.theme-btn:hover,
.theme-btn.active {
    background: var(--primary-color);
    transform: translateY(-2px);
}

/* 浮动操作按钮 */
.fab-group {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 100;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.fab:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.fab-primary {
    background: var(--secondary-color);
}

/* 加载指示器样式 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 69, 19, 0.3);
    border-top: 3px solid #8b4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

/* 太极加载图标 - 左下角定位 */
.taiji-loading {
    position: fixed;
    left: 10px;
    bottom: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.taiji-loader {
    width: 35px;
    height: 35px;
    background-image: url('tai ji.WCgje0BNYnsHsaTvwkyvswAAAA');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: taiji-spin 2s linear infinite;
    margin-bottom: 4px;
}

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

.taiji-loading .loading-text {
    font-size: 0.75em;
    color: #8b4513;
    margin-bottom: 2px;
    white-space: nowrap;
}

.taiji-loading .loading-progress {
    font-size: 0.65em;
    color: #666;
    white-space: nowrap;
}

.loading-text {
    font-size: 1.2em;
    font-weight: bold;
    color: #8b4513;
    margin-bottom: 10px;
}

.loading-subtext {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
}

.loading-progress {
    font-size: 1em;
    color: #8b4513;
    font-weight: bold;
}

/* 加载状态指示器 */
.loading-more {
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 20px;
    color: #00ffff;
    font-size: 12px;
    text-align: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .stats {
        justify-content: center;
    }
    
    .alphabet-container {
        justify-content: flex-start;
    }
    
    .word {
        font-size: 2.4em;
    }
    
    .phonetic {
        font-size: 1.4em;
    }
    
    .navigation-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .difficulty-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .word-grid {
        grid-template-columns: 1fr;
    }
    
    .fab-group {
        bottom: 1rem;
        right: 1rem;
    }
    
    .similar-word-card {
        flex: 0 0 200px;
        padding: 18px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .anime-card {
        height: 250px;
    }
    
    .word {
        font-size: 2.2em;
    }
    
    .phonetic {
        font-size: 1.3em;
    }
    
    .card-controls {
        flex-direction: column;
        align-items: center;
    }
}

/* 增强的单词标题样式 */
.word {
    font-size: 2.8em !important;
    font-weight: 700;
    background: linear-gradient(45deg, #000000, #333333);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px !important;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.phonetic {
    font-size: 1.5em !important;
    color: #000000 !important;
    font-family: 'Segoe UI', 'Arial Unicode MS', 'DejaVu Sans', 'Times New Roman', serif !important;
    margin-bottom: 0;
    opacity: 0.9;
    font-style: italic;
    letter-spacing: 1px;
    font-weight: 500;
    unicode-range: U+0250-02AF, U+0300-036F, U+1D00-1D7F, U+2070-209F;
}

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

.phonetic-btn {
    background: linear-gradient(135deg, #ff8c42, #ff6b35);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    opacity: 1 !important;
    visibility: visible !important;
}

.phonetic-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.phonetic-btn:active {
    transform: scale(0.95);
}

.phonetic:empty::after {
    content: "暂无英标";
    color: var(--text-secondary);
    font-style: normal;
}

@media (max-width: 768px) {
    .phonetic-section {
        gap: 8px;
    }
    
    .phonetic-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .phonetic {
        font-size: 1.3em !important;
    }
}

/* 优化的相似单词滚动样式 */
.similar-words-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 15px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.5) rgba(255, 255, 255, 0.1);
}

.similar-words-scroll::-webkit-scrollbar {
    height: 8px;
}

.similar-words-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.similar-words-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.similar-word-card {
    flex: 0 0 220px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.similar-word-card:hover {
    transform: translateY(-8px) scale(1.05);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 0, 0, 0.5);
}

.similar-word-text {
    font-size: 1.4em;
    font-weight: 700;
    color: #000;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.similar-word-meaning {
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    line-height: 1.5;
    font-weight: 400;
}

.similarity-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #000000, #333333);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 导航按钮样式 */
.navigation-section {
    margin: 30px 0;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.nav-btn {
        padding: 15px 30px;
        border: none;
        border-radius: 50px;
        background: #000000;
        color: white;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        font-weight: 600;
        font-size: 16px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
        position: relative;
        overflow: hidden;
    }

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

.nav-btn:hover::before {
    left: 100%;
}

.nav-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}



/* 相似单词 - 柔和科技风 */
.similar-words-section h4 {
    margin-bottom: 25px;
    color: #000000; /* 黑色 */
    font-size: 24px; /* 适中大小 */
    font-weight: 600;
    text-align: center;
    font-family: 'Orbitron', 'Microsoft YaHei', sans-serif;
    text-shadow: none; /* 移除辉光 */
    animation: none;
}

.similar-word-text {
    font-size: 1.1em;
    font-weight: 600;
    font-family: 'Segoe UI', Arial, sans-serif; /* 标准字体 */
    color: #000; /* 清晰的深灰色/黑色 */
    background: none; /* 移除渐变背景 */
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
    animation: none; /* 移除动画 */
}

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



.similar-words-section h4::before {
    content: '✨';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    animation: sparkle 2s ease-in-out infinite;
}

.similar-words-section h4::after {
    content: '✨';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    animation: sparkle 2s ease-in-out infinite 1s;
}

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

@keyframes sparkle {
    0%, 100% { opacity: 0.5; transform: translateY(-50%) scale(1); }
    50% { opacity: 1; transform: translateY(-50%) scale(1.2); }
}

@keyframes scan {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes techGlow {
    0% { box-shadow: 0 0 20px rgba(0, 255, 255, 0.6), inset 0 0 20px rgba(0, 255, 255, 0.1); }
    100% { box-shadow: 0 0 30px rgba(0, 255, 255, 0.8), inset 0 0 30px rgba(0, 255, 255, 0.2); }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* 下滑型相似单词列表 */
.similar-words-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 5px 0;
}

.similar-words-list::-webkit-scrollbar {
    width: 6px;
}

.similar-words-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.similar-words-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

.similar-word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(255, 179, 71, 0.15), rgba(255, 153, 51, 0.1));
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 179, 71, 0.3);
    box-shadow: 0 2px 10px rgba(255, 153, 51, 0.15);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.similar-word-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 20px rgba(255, 153, 51, 0.25);
    background: linear-gradient(135deg, rgba(255, 179, 71, 0.25), rgba(255, 153, 51, 0.2));
}

.similar-word-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(135deg, #ff9933, #ffb347);
}

.similar-word-content {
    flex: 1;
    margin-right: 15px;
}

.similar-word-text {
    font-size: 1.3em;
    font-weight: 700;
    color: #000;
    margin-bottom: 4px;
}

.similar-word-meaning {
    font-size: 0.9em;
    color: #000;
    line-height: 1.4;
    font-weight: 400;
}

.similarity-badge {
    background: #f0f0f0;
    color: #000;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(255, 153, 51, 0.4);
    white-space: nowrap;
}

/* 保留旧的横向滚动样式（备用） */
.similar-words-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.similar-words-scroll::-webkit-scrollbar {
    height: 8px;
}

.similar-words-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.similar-words-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}