* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; color: #333; }
.header { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); color: white; padding: 20px 0; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.header h1 { font-size: 24px; }
.header .nav-link { color: rgba(255,255,255,0.8); text-decoration: none; font-size: 14px; }
.header .nav-link:hover { color: white; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.card { background: white; border-radius: 10px; padding: 20px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.card h2 { font-size: 18px; margin-bottom: 15px; color: #1a1a2e; display: flex; align-items: center; gap: 8px; }
.card h3 { font-size: 15px; margin-bottom: 10px; color: #2c3e50; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat-item { background: white; border-radius: 10px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); text-align: center; }
.stat-item .stat-value { font-size: 32px; font-weight: 700; color: #0f3460; }
.stat-item .stat-label { font-size: 14px; color: #666; margin-top: 5px; }
.stat-item.green .stat-value { color: #27ae60; }
.stat-item.orange .stat-value { color: #e67e22; }
.stat-item.red .stat-value { color: #e74c3c; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tag-item { background: #e8f0fe; color: #0f3460; padding: 6px 14px; border-radius: 20px; font-size: 13px; }
.tag-item .count { color: #666; font-size: 11px; margin-left: 4px; }
.config-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0f2f5; }
.config-row:last-child { border-bottom: none; }
.config-label { font-size: 14px; color: #333; }
.config-value { font-size: 14px; color: #666; font-family: monospace; }
.config-value.ok { color: #27ae60; }
.config-value.err { color: #e74c3c; }
.btn { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; transition: all 0.2s; }
.btn-primary { background: #0f3460; color: white; }
.btn-primary:hover { background: #1a5276; }
.btn-success { background: #27ae60; color: white; }
.btn-success:hover { background: #2ecc71; }
.btn-danger { background: #e74c3c; color: white; }
.btn-danger:hover { background: #c0392b; }
.btn-warning { background: #e67e22; color: white; }
.btn-warning:hover { background: #d35400; }
.btn-outline { background: white; color: #333; border: 1px solid #ddd; }
.btn-outline:hover { background: #f5f5f5; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 2px 8px; font-size: 11px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.log-box { background: #1a1a2e; color: #a8d8ea; padding: 15px; border-radius: 8px; font-family: monospace; font-size: 12px; max-height: 300px; overflow-y: auto; white-space: pre-wrap; line-height: 1.6; }
.log-box .log-info { color: #a8d8ea; }
.log-box .log-success { color: #2ecc71; }
.log-box .log-error { color: #e74c3c; }
.log-box .log-warning { color: #f39c12; }
.loading { text-align: center; padding: 20px; color: #999; }
.error { text-align: center; padding: 20px; color: #e74c3c; }
.empty { text-align: center; padding: 20px; color: #999; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #f0f2f5; }
th { background: #f8f9fa; font-weight: 600; color: #555; }
tr:hover { background: #f8f9fa; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.on { background: #2ecc71; }
.status-dot.off { background: #e74c3c; }
.range-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.range-tab { padding: 6px 14px; background: #f0f2f5; border-radius: 6px; cursor: pointer; font-size: 13px; border: none; }
.range-tab.active { background: #0f3460; color: white; }
.summary-content { font-size: 14px; line-height: 1.8; max-height: 400px; overflow-y: auto; padding: 10px; background: #f8f9fa; border-radius: 8px; }
.summary-content h3 { color: #1a1a2e; margin: 10px 0 5px; }
.summary-content h4 { color: #2c3e50; margin: 8px 0 4px; }
.summary-content li { margin: 3px 0; }
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; vertical-align: middle; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #ccc; border-radius: 24px; transition: 0.3s; }
.toggle .slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.3s; }
.toggle input:checked + .slider { background: #27ae60; }
.toggle input:checked + .slider:before { transform: translateX(20px); }
.input-text { padding: 6px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; width: 100%; max-width: 400px; }
.input-text:focus { outline: none; border-color: #0f3460; }
.ai-context-textarea { min-height: 120px; max-width: 500px; resize: vertical; line-height: 1.6; font-family: inherit; }
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: center; }
.modal-overlay.active { display: flex; }
.modal { background: white; border-radius: 12px; padding: 30px; width: 90%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal h2 { margin-bottom: 20px; font-size: 20px; }
.modal .form-group { margin-bottom: 15px; }
.modal .form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 5px; }
.modal .form-group input { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.modal .form-group input:focus { outline: none; border-color: #0f3460; }
.modal .modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal .modal-actions .btn { flex: 1; }
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 24px; border-radius: 8px; color: white; font-size: 14px; z-index: 2000; animation: slideIn 0.3s; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.toast.success { background: #27ae60; }
.toast.error { background: #e74c3c; }
.toast.info { background: #2980b9; }
.toast.warning { background: #e67e22; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 2px solid #e8e8e8; }
.tabs .tab { padding: 10px 20px; cursor: pointer; font-size: 14px; color: #666; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.tabs .tab:hover { color: #0f3460; }
.tabs .tab.active { color: #0f3460; border-bottom-color: #0f3460; font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ======== 首次启动引导弹窗 ======== */
.first-run-modal .modal {
    max-width: 500px;
}
.first-run-modal .first-run-list {
    max-height: 300px;
    overflow-y: auto;
}
.first-run-modal .channel-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.first-run-modal .channel-input-row input {
    flex: 1;
}
.first-run-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.first-run-step {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px;
    background: #f9f9fb;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
}
.first-run-step .step-icon {
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f5ff;
    border-radius: 10px;
    flex-shrink: 0;
}
.first-run-step .step-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.6;
}
.first-run-step .step-text strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    color: #1a1a2e;
}
.first-run-step .step-text p {
    color: #666;
    margin: 0;
}
.first-run-input {
    background: #f6ffed;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #b7eb8f;
}

/* ======== 频道警告横幅 ======== */
.channel-warning-banner {
    display: none;
    background: #fff7e6;
    border: 1px solid #ffd591;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #d46b08;
    position: relative;
}
.channel-warning-banner .banner-content {
    display: flex;
    align-items: center;
    gap: 8px;
}
.channel-warning-banner .banner-close {
    position: absolute;
    right: 12px;
    top: 12px;
    cursor: pointer;
    font-size: 16px;
    color: #999;
}
.channel-warning-banner .banner-close:hover {
    color: #333;
}
.channel-warning-banner a {
    color: #0f3460;
    text-decoration: underline;
    cursor: pointer;
}

/* ======== 行内滚动容器 ======== */
.inline-scroll {
    max-height: 400px;
    overflow-y: auto;
}

/* ======== 间隔预设按钮 ======== */
.interval-presets {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.interval-presets .preset-btn {
    padding: 4px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.interval-presets .preset-btn:hover {
    background: #0f3460;
    color: white;
    border-color: #0f3460;
}

/* ======== 当前抓取间隔条 ======== */
.scrape-interval-bar {
    background: #f6f8fa;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid #e8e8e8;
}
.scrape-interval-bar .config-row {
    border-bottom: none;
    padding: 4px 0;
}

/* ======== 图表面板 ======== */
.chart-panel {
    margin-top: 16px;
}
.chart-panel .chart-bar {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    padding: 10px 0;
}
.chart-panel .chart-bar-item {
    flex: 1;
    background: #0f3460;
    border-radius: 3px 3px 0 0;
    min-width: 8px;
    transition: height 0.3s;
    position: relative;
}
.chart-panel .chart-bar-item:hover {
    background: #1a5276;
}
.chart-panel .chart-bar-item .chart-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #999;
    white-space: nowrap;
}

/* ======== 选项卡分隔线 ======== */
.tab-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 20px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8e8e8;
}

/* ======== 进度条 ======== */
.progress-bar-wrap {
    width: 100%;
    max-width: 200px;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0f3460, #1a5276);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}
.progress-bar-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.progress-bar-wrap .progress-label {
    display: none;
}

/* ======== 辅助布局 ======== */
.flex-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.flex-row > * {
    flex: 1;
    min-width: 280px;
}
