/* 关键词生成器 - 独立样式 (无Tailwind依赖) */
/* 使用kws-前缀避免与WordPress/Elementor冲突 */

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

/* 容器 */
.kws-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* 卡片样式 */
.kws-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* 文字样式 */
.kws-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
    text-align: center;
}

.kws-subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    text-align: center;
}

.kws-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1.5rem;
}

.kws-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* 表单元素 */
.kws-textarea,
.kws-select,
.kws-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}

.kws-textarea:focus,
.kws-select:focus,
.kws-input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}

.kws-textarea {
    resize: none;
    font-family: inherit;
}

/* 按钮 */
.kws-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    transition: all 0.2s;
    min-height: 40px;
}

.kws-btn-primary {
    background: #f97316;
    color: #fff;
}

.kws-btn-primary:hover {
    background: #ea580c;
}

.kws-btn-danger {
    background: #ef4444;
    color: #fff;
}

.kws-btn-danger:hover {
    background: #dc2626;
}

.kws-btn-secondary {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.kws-btn-secondary:hover {
    background: #f9fafb;
}

.kws-btn-success {
    background: #10b981;
    color: #fff;
}

.kws-btn-success:hover {
    background: #059669;
}

.kws-btn-blue {
    background: #3b82f6;
    color: #fff;
}

.kws-btn-blue:hover {
    background: #2563eb;
}

/* 网格布局 */
.kws-grid {
    display: grid;
    gap: 1rem;
}

.kws-grid-4 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .kws-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .kws-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .kws-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Flex布局 */
.kws-flex {
    display: flex;
}

.kws-flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.kws-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kws-flex-end {
    display: flex;
    align-items: flex-end;
}

.kws-flex-wrap {
    flex-wrap: wrap;
}

.kws-flex-gap {
    gap: 1rem;
}

.kws-flex-gap-sm {
    gap: 0.5rem;
}

/* 统计数字 */
.kws-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

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

.kws-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.kws-stat-label {
    font-size: 0.875rem;
    color: #6b7280;
}

/* 高级选项 */
.kws-advanced-toggle {
    width: 100%;
    padding: 1rem;
    background: #f9fafb;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    font-size: 1.125rem;
    font-weight: 500;
    color: #111827;
}

.kws-advanced-toggle:hover {
    background: #f3f4f6;
}

.kws-advanced-content {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.kws-advanced-content.hidden {
    display: none;
}

/* 复选框 */
.kws-checkbox {
    width: 1rem;
    height: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
}

.kws-checkbox:checked {
    background: #f97316;
    border-color: #f97316;
}

/* 标签页 */
.kws-tabs {
    display: flex;
    gap: 0.25rem;
}

.kws-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.kws-tab:hover {
    color: #111827;
}

.kws-tab.active {
    background: #f97316;
    color: #fff;
}

/* 可视化内容 */
.kws-viz-content {
    display: block;
}

.kws-viz-content.hidden {
    display: none;
}

/* 关键词列表 */
.kws-keyword-list {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .kws-keyword-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .kws-keyword-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

.kws-keyword-item {
    background: #f9fafb;
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
}

.kws-keyword-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: #f97316;
    border-radius: 50%;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.kws-keyword-text {
    font-size: 0.875rem;
    color: #374151;
}

/* 搜索意图分析 */
.kws-intent-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .kws-intent-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .kws-intent-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.kws-intent-card {
    border-radius: 8px;
    padding: 1rem;
    border: 2px solid;
}

.kws-intent-card.informational {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.kws-intent-card.navigational {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.kws-intent-card.commercial {
    background: #fefce8;
    border-color: #fde68a;
}

.kws-intent-card.transactional {
    background: #fef2f2;
    border-color: #fecaca;
}

.kws-intent-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.kws-intent-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    margin-right: 0.75rem;
}

.kws-intent-dot.informational {
    background: #3b82f6;
}

.kws-intent-dot.navigational {
    background: #10b981;
}

.kws-intent-dot.commercial {
    background: #eab308;
}

.kws-intent-dot.transactional {
    background: #ef4444;
}

.kws-intent-title {
    font-weight: 500;
    color: #111827;
}

.kws-intent-count {
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: 0.5rem;
}

.kws-intent-desc {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.kws-intent-list {
    max-height: 15rem;
    overflow-y: auto;
}

.kws-intent-item {
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.25rem;
    padding: 0.5rem;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

/* 表格控制 */
.kws-table-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .kws-table-controls {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.kws-search-wrapper {
    position: relative;
}

.kws-search-input {
    padding-left: 2.5rem;
}

.kws-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: #9ca3af;
    pointer-events: none;
}

/* 表格 */
.kws-table-wrapper {
    overflow-x: auto;
}

.kws-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.kws-table thead th {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.2s;
}

.kws-table thead th:hover {
    background: #f3f4f6;
}

.kws-table tbody td {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

.kws-table tbody tr:hover {
    background: #f9fafb;
}

/* 分页 */
.kws-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.kws-pagination-info {
    font-size: 0.875rem;
    color: #374151;
}

.kws-pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kws-page-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.kws-page-btn:hover:not(:disabled) {
    background: #f9fafb;
}

.kws-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.kws-page-btn.active {
    background: #f97316;
    color: #fff;
    border-color: #f97316;
}

.kws-page-numbers {
    display: flex;
    gap: 0.25rem;
}

/* 工具类 */
.kws-mb-1 { margin-bottom: 0.25rem; }
.kws-mb-2 { margin-bottom: 0.5rem; }
.kws-mb-3 { margin-bottom: 0.75rem; }
.kws-mb-4 { margin-bottom: 1rem; }
.kws-mb-6 { margin-bottom: 1.5rem; }
.kws-mb-8 { margin-bottom: 2rem; }

.kws-mt-2 { margin-top: 0.5rem; }
.kws-mt-4 { margin-top: 1rem; }
.kws-mt-6 { margin-top: 1.5rem; }

.kws-text-sm { font-size: 0.875rem; }
.kws-text-xs { font-size: 0.75rem; }

.kws-text-gray-500 { color: #6b7280; }
.kws-text-gray-600 { color: #4b5563; }
.kws-text-gray-700 { color: #374151; }
.kws-text-gray-900 { color: #111827; }

.kws-text-center { text-align: center; }

.kws-italic { font-style: italic; }

.kws-hidden { display: none !important; }

.kws-w-full { width: 100%; }

.kws-flex-1 { flex: 1; }

.kws-whitespace-nowrap { white-space: nowrap; }

.kws-min-w-80 { min-width: 80px; }

/* SVG图标 */
.kws-icon {
    width: 1.25rem;
    height: 1.25rem;
    display: inline-block;
    vertical-align: middle;
}

.kws-icon-sm {
    width: 1rem;
    height: 1rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .kws-container {
        padding: 1rem 0.5rem;
    }
    
    .kws-card {
        padding: 1rem;
    }
    
    .kws-title {
        font-size: 1.5rem;
    }
    
    .kws-subtitle {
        font-size: 1rem;
    }
}

/* Progress bar styling */
.progressjs-progress {
    background-color: #f97316 !important;
}

/* Custom table styling for backwards compatibility */
#outtable {
    border-collapse: separate;
    border-spacing: 0;
}

#outtable thead th {
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem;
    font-weight: 600;
    color: #374151;
    transition: background-color 0.2s;
}

#outtable thead th:hover {
    background-color: #f3f4f6;
}

#outtable tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

#outtable tbody tr:hover {
    background-color: #f9fafb;
}

/* Sort indicators */
.sort-indicator {
    transition: transform 0.2s;
}

.sort-indicator.asc {
    transform: rotate(180deg);
}

.sort-indicator.desc {
    transform: rotate(0deg);
}
