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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 30px 20px;
    text-align: center;
}

.title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* 搜索区域 */
.search-section {
    padding: 30px 20px;
    background: #f8f9fa;
}

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

.search-input {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
}

.search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 加载动画 */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 结果区域 */
.results-section {
    padding: 20px;
}

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

/* 分类标签页 */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.category-tab {
    padding: 8px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
    font-weight: 500;
    position: relative;
    white-space: nowrap;
}

.category-tab:hover {
    background: #e0e0e0;
    color: #333;
}

.category-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.category-tab .count {
    font-weight: 600;
    margin-left: 2px;
}

.category-tab.active .count {
    color: #fff;
}

.empty-category {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.results-title {
    font-size: 18px;
    color: #333;
}

.results-title span {
    color: #667eea;
    font-weight: 600;
}

.results-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 8px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    color: #333;
}

.action-btn:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

/* 关键词列表 */
.keywords-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.keyword-item {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    animation: slideIn 0.3s ease-out;
}

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

.keyword-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.keyword-text {
    flex: 1;
    font-size: 16px;
    color: #333;
    word-break: break-word;
}

.keyword-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: 8px;
}

.keyword-type {
    font-size: 12px;
    color: #999;
    padding: 2px 8px;
    background: #e0e0e0;
    border-radius: 4px;
}

/* Trends 类型的关键词特殊样式 */
.keyword-item.trends-item {
    border-left-color: #4285f4;
}

.keyword-type.trends-type {
    background: #e8f0fe;
    color: #1a73e8;
    font-weight: 600;
}

/* YouTube 类型的关键词特殊样式 */
.keyword-item.youtube-item {
    border-left-color: #ff0000;
}

.keyword-type.youtube-type {
    background: #ffe0e0;
    color: #cc0000;
    font-weight: 600;
}

/* 百度类型的关键词特殊样式 */
.keyword-item.baidu-item {
    border-left-color: #3385ff;
}

.keyword-type.baidu-type {
    background: #e6f0ff;
    color: #0066cc;
    font-weight: 600;
}

/* Bing 类型的关键词特殊样式 */
.keyword-item.bing-item {
    border-left-color: #008373;
}

.keyword-type.bing-type {
    background: #e0f5f3;
    color: #006b5f;
    font-weight: 600;
}

/* Yandex 类型的关键词特殊样式 */
.keyword-item.yandex-item {
    border-left-color: #fc3f1d;
}

.keyword-type.yandex-type {
    background: #ffe8e5;
    color: #d32f1a;
    font-weight: 600;
}

.keyword-heat {
    font-size: 12px;
    color: #ff6b6b;
    padding: 2px 8px;
    background: #ffe0e0;
    border-radius: 4px;
    font-weight: 600;
}

.keyword-actions {
    display: flex;
    gap: 8px;
    margin-left: 12px;
}

.copy-btn {
    padding: 6px 12px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: #5568d3;
    transform: scale(1.05);
}

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

/* 空状态 */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-text {
    font-size: 16px;
}

/* 错误提示 */
.error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4757;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 16px;
    }

    .header {
        padding: 24px 16px;
    }

    .title {
        font-size: 20px;
    }

    .search-section {
        padding: 20px 16px;
    }

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

    .search-btn {
        width: 100%;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-actions {
        width: 100%;
        justify-content: space-between;
    }

    .action-btn {
        flex: 1;
    }

    .category-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
    }

    .category-tab {
        font-size: 12px;
        padding: 6px 12px;
    }

    .keyword-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .keyword-actions {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
    }

    .copy-btn {
        flex: 1;
    }
}

/* 成功提示动画 */
.copy-success {
    background: #2ed573 !important;
}

