/**
 * 前端样式文件
 * 
 * @package DailyTaobaoKeywords
 */

/* 基础样式重置 */
.dtk-container * {
    box-sizing: border-box;
}

/* 主容器 */
.dtk-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

/* 头部样式 */
.dtk-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.dtk-title-section {
    margin-bottom: 30px;
}

.dtk-main-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.dtk-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.dtk-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 300;
}

.dtk-features {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.dtk-feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.dtk-feature-icon {
    font-size: 1.2rem;
}

/* 统计信息栏 */
.dtk-stats-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

.dtk-stat-item {
    background: white;
    padding: 20px 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-width: 120px;
    transition: transform 0.3s ease;
}

.dtk-stat-item:hover {
    transform: translateY(-2px);
}

.dtk-stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.dtk-stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
}

/* 分类筛选 */
.dtk-category-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.dtk-category-btn {
    background: white;
    border: 2px solid #e9ecef;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dtk-category-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.dtk-category-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.dtk-count {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* 主内容区域 */
.dtk-main-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.dtk-sidebar {
    flex: 0 0 250px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.dtk-keywords-wrapper {
    flex: 1;
}

/* 当前日期显示 */
.dtk-current-date {
    margin-bottom: 25px;
}

.dtk-current-date h3 {
    background: white;
    padding: 20px;
    margin: 0;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    color: #333;
}

.dtk-date-icon {
    font-size: 1.5rem;
}

.dtk-count-badge {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-left: auto;
}

/* 历史记录导航 */
.dtk-history-nav h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1rem;
}

.dtk-date-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dtk-date-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dtk-date-btn:hover {
    background: #e9ecef;
}

.dtk-date-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 词根卡片网格 */
.dtk-keywords-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 25px;
}

/* 词根卡片 */
.dtk-keyword-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.dtk-keyword-card:hover,
.dtk-keyword-card.dtk-card-hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.dtk-card-header {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8effe 100%);
    padding: 20px;
    cursor: pointer;
    border-bottom: 1px solid #e9ecef;
}

.dtk-keyword-title {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    color: #333;
    font-weight: 600;
}

.dtk-keyword-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.dtk-category {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.dtk-risk-level {
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
}

.dtk-risk-low {
    background: #d4edda;
    color: #155724;
}

.dtk-risk-medium {
    background: #fff3cd;
    color: #856404;
}

.dtk-risk-high {
    background: #f8d7da;
    color: #721c24;
}

/* 卡片主体 */
.dtk-card-body {
    padding: 20px;
}

.dtk-competition-score {
    margin-bottom: 20px;
}

.dtk-competition-score label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.dtk-score-bar {
    background: #e9ecef;
    height: 25px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.dtk-score-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease;
    position: relative;
}

.dtk-competition-low {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.dtk-competition-medium {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.dtk-competition-high {
    background: linear-gradient(90deg, #dc3545, #e83e8c);
}

.dtk-score-text {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* 信息区块 */
.dtk-info-section {
    margin-bottom: 20px;
}

.dtk-info-section:last-child {
    margin-bottom: 0;
}

.dtk-info-section h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

.dtk-info-section p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

.dtk-risk-warning {
    background: #fff8e1;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ff9800;
}

.dtk-risk-warning h4 {
    color: #e65100;
}

/* 相关关键词 */
.dtk-related-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dtk-tag {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #495057;
}

/* 卡片底部 */
.dtk-card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.dtk-generated-time {
    color: #6c757d;
    font-size: 0.8rem;
}

/* 无数据状态 */
.dtk-no-data {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dtk-no-data-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.dtk-no-data h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.dtk-no-data p {
    margin: 0 0 20px 0;
    color: #666;
}

/* 加载状态 */
.dtk-loading {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dtk-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: dtk-spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* 按钮样式 */
.dtk-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.dtk-btn-primary {
    background: #667eea;
    color: white;
}

.dtk-btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.dtk-btn-secondary {
    background: #6c757d;
    color: white;
}

.dtk-btn-secondary:hover {
    background: #5a6268;
}

/* 底部声明 */
.dtk-footer {
    background: #2d3748;
    color: white;
    padding: 40px 30px;
    border-radius: 15px;
    margin-top: 40px;
    text-align: center;
}

.dtk-disclaimer {
    margin-bottom: 30px;
}

.dtk-disclaimer h4 {
    margin: 0 0 15px 0;
    color: #ffd700;
    font-size: 1.2rem;
}

.dtk-disclaimer p {
    margin: 0 0 10px 0;
    line-height: 1.6;
    opacity: 0.9;
}

.dtk-powered-by {
    border-top: 1px solid #4a5568;
    padding-top: 20px;
    font-size: 0.9rem;
    opacity: 0.7;
}

.dtk-brand {
    color: #667eea;
    font-weight: 600;
}

/* 返回顶部按钮 */
.dtk-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.dtk-back-to-top:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.dtk-back-to-top span {
    font-size: 1.2rem;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .dtk-container {
        padding: 15px;
    }
    
    .dtk-main-title {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .dtk-features {
        gap: 15px;
    }
    
    .dtk-feature-item {
        font-size: 0.8rem;
        padding: 8px 15px;
    }
    
    .dtk-main-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .dtk-sidebar {
        flex: none;
        position: static;
    }
    
    .dtk-keywords-grid {
        grid-template-columns: 1fr;
    }
    
    .dtk-stats-bar {
        flex-direction: column;
        align-items: center;
    }
    
    .dtk-category-filter {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .dtk-date-list {
        max-height: 200px;
        overflow-y: auto;
    }
    
    .dtk-back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .dtk-header {
        padding: 30px 20px;
    }
    
    .dtk-main-title {
        font-size: 1.5rem;
    }
    
    .dtk-keyword-card {
        margin: 0 -5px;
    }
    
    .dtk-card-header,
    .dtk-card-body {
        padding: 15px;
    }
    
    .dtk-footer {
        padding: 30px 20px;
    }
} 