/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

/* 任务栏 */
.taskbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #1a73e8, #1557b0);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    flex-wrap: wrap;
    gap: 12px;
}

.taskbar .logo {
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    white-space: nowrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 500px;
    min-width: 250px;
}

.search-box input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    background: rgba(255,255,255,0.95);
    color: #333;
    transition: box-shadow 0.2s;
}

.search-box input:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.4);
}

.search-box input::placeholder {
    color: #999;
}

.search-box button {
    padding: 10px 24px;
    border: none;
    border-radius: 24px;
    background: #fff;
    color: #1a73e8;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.search-box button:hover {
    background: #e8f0fe;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* 字母目录 */
.alphabet-nav {
    position: sticky;
    top: 74px;
    z-index: 99;
    background: #fff;
    padding: 12px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-bottom: 1px solid #e8eaed;
}

.alpha-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #1a73e8;
    background: #e8f0fe;
    user-select: none;
}

.alpha-item:hover {
    background: #1a73e8;
    color: #fff;
    transform: scale(1.1);
}

.alpha-item.selected {
    background: #1a73e8;
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,115,232,0.4);
}

.alpha-item.disabled {
    color: #ccc;
    background: #f5f5f5;
    cursor: default;
}

/* 主内容区 */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 24px 60px;
}

/* 字母分组 */
.letter-section {
    margin-bottom: 32px;
}

.letter-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a73e8;
    padding: 8px 0 12px;
    border-bottom: 2px solid #e8f0fe;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

/* 单词盒子 */
.word-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* 表头 */
.word-box::before {
    content: '';
    display: none;
}

.word-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.15s;
}

.word-item:last-child {
    border-bottom: none;
}

.word-item:hover {
    background: #f8f9ff;
}

.word-item.highlight {
    background: #fff3cd;
    animation: highlightPulse 1.5s ease-in-out;
}

@keyframes highlightPulse {
    0%, 100% { background: #fff3cd; }
    50% { background: #ffe8a1; }
}

.word-index {
    flex: 0 0 44px;
    font-size: 13px;
    color: #aaa;
    font-weight: 500;
    text-align: center;
}

.word-text {
    flex: 0 0 160px;
    font-weight: 700;
    font-size: 16px;
    color: #1a73e8;
}

.word-meaning {
    flex: 1;
    font-size: 15px;
    color: #555;
    padding: 0 16px;
}

.word-phonetic {
    flex: 0 0 160px;
    font-size: 13px;
    color: #999;
    font-style: italic;
    text-align: right;
}

/* 搜索结果浮动盒子 */
.search-result-box {
    position: fixed;
    top: 120px;
    right: 24px;
    z-index: 95;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    max-width: 300px;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.3s ease;
}

.search-result-box.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.result-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.result-number {
    font-size: 16px;
    font-weight: 600;
    color: #1a73e8;
    line-height: 1.8;
    word-break: break-all;
}

.result-num-link {
    color: #1a73e8;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.15s;
}

.result-num-link:hover {
    background: #1a73e8;
    color: #fff;
}

/* 响应式 */
@media (max-width: 640px) {
    .taskbar {
        padding: 12px 16px;
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .alphabet-nav {
        top: 110px;
        padding: 10px 12px;
        gap: 4px;
    }

    .alpha-item {
        width: 30px;
        height: 30px;
        font-size: 12px;
        border-radius: 6px;
    }

    .container {
        padding: 16px 12px 40px;
    }

    .word-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .word-index {
        flex: none;
    }

    .word-text {
        flex: none;
    }

    .word-meaning {
        padding: 0;
    }

    .word-phonetic {
        flex: none;
        text-align: left;
    }
}
