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

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

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    padding: 40px;
}

.input-section h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

#businessContext {
    margin-bottom: 30px;
}

.upload-options {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: start;
    margin-top: 20px;
}

.upload-method {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
}

.upload-method h3 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.divider {
    display: flex;
    align-items: center;
    color: #999;
    font-weight: bold;
    padding-top: 60px;
}

.file-upload {
    margin-bottom: 15px;
}

.file-upload input[type="file"] {
    display: none;
}

.file-label {
    display: block;
    padding: 15px;
    background: white;
    border: 2px dashed #667eea;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-label:hover {
    background: #f0f4ff;
    border-color: #764ba2;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.loading {
    text-align: center;
    padding: 40px;
    margin: 30px 0;
}

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

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

.hidden {
    display: none !important;
}

.error {
    background: #fee;
    color: #c33;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #c33;
}

.results-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e0e0e0;
}

.results-section > h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.8em;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    display: block;
    color: #666;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
}

.stat-value.valid {
    color: #28a745;
}

.stat-value.uncertain {
    color: #ffc107;
}

.stat-value.competitor {
    color: #17a2b8;
}

.stat-value.exclude {
    color: #dc3545;
}

.result-category {
    margin-bottom: 30px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.category-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-header.valid { background: #d4edda; border-bottom: 2px solid #28a745; }
.category-header.uncertain { background: #fff3cd; border-bottom: 2px solid #ffc107; }
.category-header.competitor { background: #d1ecf1; border-bottom: 2px solid #17a2b8; }
.category-header.exclude { background: #f8d7da; border-bottom: 2px solid #dc3545; }

.category-header h3 {
    color: #333;
    font-size: 1.3em;
}

.category-actions {
    display: flex;
    gap: 10px;
}

.keywords-list {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
    background: white;
}

.keyword-workbench-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #fff;
    margin-bottom: 10px;
    border-radius: 10px;
    border: 1px solid #eee;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.keyword-main {
    display: flex;
    align-items: center;
    gap: 30px;
    flex: 1;
}

.keyword-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.keyword-text {
    font-size: 1em;
    color: #212529;
    word-break: break-all;
}

.workbench-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-links {
    display: flex;
    gap: 10px;
    margin-right: 15px;
    padding-right: 15px;
    border-right: 1px solid #eee;
}

.search-icon {
    text-decoration: none;
    font-size: 1.3em;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s;
}

.search-icon:hover {
    background: #f0f0f0;
}

.move-btn {
    padding: 8px 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.move-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

.move-btn.to-valid:hover { border-color: #28a745; color: #28a745; background: #f0fff4; }
.move-btn.to-competitor:hover { border-color: #17a2b8; color: #17a2b8; background: #f0faff; }
.move-btn.to-exclude:hover { border-color: #dc3545; color: #dc3545; background: #fff5f5; }

.bulk-actions-bar {
    padding: 12px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 30px;
}

.bulk-actions-bar label {
    font-size: 0.95em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #495057;
    font-weight: 600;
}

.bulk-btns {
    display: flex;
    gap: 12px;
}

.btn-tiny {
    padding: 6px 15px;
    font-size: 0.85em;
    background: white;
    color: #667eea;
    border: 1px solid #667eea;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-tiny:hover {
    background: #667eea;
    color: white;
}

.preview-section {
    margin-top: 30px;
    padding: 30px;
    background: #f0f4ff;
    border-radius: 12px;
    border: 2px solid #667eea;
}

.preview-card { text-align: center; }
.preview-stats { display: flex; justify-content: center; gap: 40px; margin-bottom: 25px; }
.preview-stat { display: flex; flex-direction: column; align-items: center; }
.preview-stat .label { color: #666; font-size: 1.1em; margin-bottom: 5px; }
.preview-stat .value { font-size: 2.2em; font-weight: bold; color: #764ba2; }
.preview-actions { display: flex; justify-content: center; gap: 15px; }

.btn-success { background: linear-gradient(135deg, #28a745 0%, #218838 100%); color: white; }
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4); }
.btn-large { padding: 15px 40px; font-size: 1.2em; }
.btn-outline { background: white; color: #666; border: 2px solid #e0e0e0; }

.progress-container {
    width: 80%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    margin: 20px auto;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.progress-text { font-weight: bold; color: #667eea; margin-top: 10px; }

footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
}

@media (max-width: 768px) {
    .upload-options { grid-template-columns: 1fr; }
    .divider { padding-top: 0; justify-content: center; }
    header h1 { font-size: 1.8em; }
    main { padding: 20px; }
}
