* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 28px;
}

h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 20px;
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.controls label {
    color: #666;
    font-size: 14px;
}

.controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 8px;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-primary.paused {
    background: #48bb78;
}

.btn-secondary {
    background: #f7fafc;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #edf2f7;
}

.remove-keyword-btn {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #e53e3e;
    padding: 4px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.remove-keyword-btn:hover {
    background: #fed7d7;
    border-color: #fc8181;
}

.keyword-input-group {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tabs 样式 */
.tabs-container {
    display: flex;
    gap: 5px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.tabs-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.tab-item {
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #64748b;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-item:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.tab-item.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    font-weight: 600;
}

.data-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.monitor-keywords-config {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.keywords-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.keywords-list-header .label {
    font-weight: bold;
    color: #333;
    font-size: 16px;
}

.keywords-table-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #edf2f7;
    border-radius: 8px;
}

.keywords-table-container table {
    width: 100%;
}

.keywords-table-container th {
    padding: 10px 15px;
    background: #f8fafc;
    font-size: 13px;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}

.keywords-table-container td {
    padding: 8px 15px;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.push-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.push-enabled {
    background: #def7ec;
    color: #03543f;
}

.push-disabled {
    background: #fde8e8;
    color: #9b1c1c;
}

.keywords-actions {
    display: flex;
    gap: 8px;
}

.btn-mini {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.keywords-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.add-keyword-box {
    display: flex;
    gap: 5px;
}

.add-keyword-box input {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 150px;
}

.add-keyword-box button {
    padding: 5px 10px;
}

@media (max-width: 768px) {
    .data-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tabs-container {
        width: 100%;
    }

    .keywords-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .add-keyword-box {
        width: 100%;
    }

    .add-keyword-box input {
        flex: 1;
    }

    #keywordInputsContainer {
        width: 100%;
    }
}

/* 关键词标签样式 */
.keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ebf4ff;
    color: #2b6cb0;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    border: 1px solid #bee3f8;
}

.keyword-tag .remove-btn {
    cursor: pointer;
    color: #63b3ed;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
}

.keyword-tag .remove-btn:hover {
    color: #2c5282;
}

.status-bar {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-item .label {
    color: #666;
    font-size: 14px;
}

.status-item .value {
    color: #333;
    font-weight: 500;
}

.status-running {
    color: #48bb78;
    font-weight: 600;
}

.status-paused {
    color: #ed8936;
    font-weight: 600;
}

.search-info {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    gap: 8px;
}

.info-item .label {
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

.info-item .value {
    color: #333;
    font-weight: 500;
    word-break: break-all;
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #c53030;
}

.data-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.no-data {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f7fafc;
}

th {
    padding: 15px;
    text-align: left;
    color: #666;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid #e2e8f0;
}

td {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    color: #333;
}

tbody tr:hover {
    background: #f7fafc;
}

.status-active {
    color: #48bb78;
    font-weight: 600;
}

.status-inactive {
    color: #cbd5e0;
}

.history-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    padding: 12px;
    border-left: 3px solid #667eea;
    background: #f7fafc;
    margin-bottom: 10px;
    border-radius: 5px;
    font-size: 14px;
}

.history-item .time {
    color: #666;
    font-size: 12px;
    margin-bottom: 5px;
}

.history-item .content {
    color: #333;
}

.history-item.success {
    border-left-color: #48bb78;
}

.history-item.error {
    border-left-color: #f56565;
    background: #fff5f5;
}

/* 滚动条样式 */
.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .status-bar {
        flex-direction: column;
        gap: 15px;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .controls button {
        width: 100%;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 10px 8px;
    }
}
