* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif; background: #f0f2f5; color: #1a1a2e; min-height: 100vh; }

/* Header */
.header { background: linear-gradient(135deg, #0984e3 0%, #6c5ce7 100%); color: #fff; padding: 0 24px; height: 56px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.header-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 100%; }
.header h1 { font-size: 20px; font-weight: 700; }
.btn-config { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3); color: #fff; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; transition: background .2s; }
.btn-config:hover { background: rgba(255,255,255,.3); }

/* Buttons */
.btn { padding: 8px 18px; border: 1px solid #ddd; background: #fff; border-radius: 6px; cursor: pointer; font-size: 14px; transition: all .2s; }
.btn:hover { background: #f5f5f5; }
.btn-primary { background: #0984e3; color: #fff; border-color: #0984e3; }
.btn-primary:hover { background: #0770c2; }
.btn-primary:disabled { background: #a0c4e8; border-color: #a0c4e8; cursor: not-allowed; }
.btn-danger { background: #d63031; color: #fff; border-color: #d63031; }
.btn-danger:hover { background: #b71c1c; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 32px; font-size: 16px; font-weight: 700; }
.required { color: #d63031; }

/* Main */
.main { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* Filter Bar */
.filter-bar { background: #fff; border-radius: 10px; padding: 16px 20px; display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; box-shadow: 0 1px 4px rgba(0,0,0,.06); margin-bottom: 16px; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 12px; color: #666; font-weight: 600; }
.filter-group input, .date-range input { padding: 7px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; outline: none; transition: border-color .2s; }
.filter-group input:focus, .date-range input:focus { border-color: #0984e3; }
.date-range { display: flex; align-items: center; gap: 8px; }
.date-range span { color: #999; font-size: 13px; }

/* Tier Tabs */
.tier-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.tier-tab { padding: 6px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; background: #fff; border: 1px solid #e0e0e0; transition: all .2s; display: flex; align-items: center; gap: 6px; }
.tier-tab:hover { border-color: #0984e3; }
.tier-tab.active { background: #0984e3; color: #fff; border-color: #0984e3; }
.tier-tab .tier-desc { font-size: 11px; opacity: .7; }
.tier-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.tier-dot-t1 { background: #00b894; }
.tier-dot-t2 { background: #fdcb6e; }
.tier-dot-t3 { background: #b2bec3; }
.tier-tab.active .tier-dot { background: #fff; }

/* API Badge */
.api-badge { font-size: 10px; padding: 1px 6px; border-radius: 3px; font-weight: 700; margin-left: 6px; }
.api-badge-yes { background: #00b89420; color: #00b894; }
.api-badge-no { background: #b2bec315; color: #b2bec3; }

/* Match List */
.match-list { display: flex; flex-direction: column; gap: 8px; }
.match-card { background: #fff; border: 1px solid #e8e8e8; border-radius: 10px; padding: 14px 20px; display: flex; align-items: center; gap: 16px; cursor: pointer; transition: all .2s; }
.match-card:hover { border-color: #0984e3; box-shadow: 0 2px 12px rgba(9,132,227,.12); transform: translateY(-1px); }
.match-time { color: #666; font-size: 13px; min-width: 130px; }
.match-league { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 4px; white-space: nowrap; }
.match-teams { flex: 1; text-align: center; font-weight: 600; font-size: 16px; }
.match-teams .vs { color: #ccc; margin: 0 10px; font-weight: 400; font-size: 14px; }
.match-btn { background: #0984e3; color: #fff; border: none; padding: 8px 18px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; white-space: nowrap; transition: background .2s; }
.match-btn:hover { background: #0770c2; }
.match-btn-cached { background: #00b894; }
.match-btn-cached:hover { background: #00a381; }

/* Quality Check */
.btn-qc { background: #6c5ce7; color: #fff; border-color: #6c5ce7; }
.btn-qc:hover { background: #5a4bd1; color: #fff; }
.qc-badge { position: absolute; top: 8px; right: 60px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.qc-pass { background: #00b89420; color: #00b894; }
.qc-fail { background: #d6303120; color: #d63031; }
.card-header { position: relative; }
.qc-score { font-size: 11px; margin-left: 8px; padding: 1px 6px; border-radius: 3px; }
.qc-score-high { background: rgba(255,255,255,.25); }
.qc-score-low { background: rgba(214,48,49,.5); }
.copy-card.qc-failed { opacity: .45; }
.copy-card.qc-failed .card-header { background: linear-gradient(135deg, #636e72, #b2bec3); }

/* Loading */
.loading { text-align: center; padding: 40px; color: #999; }

/* Provider Grid */
.provider-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.provider-chip { padding: 6px 14px; border: 2px solid #e0e0e0; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; transition: all .2s; user-select: none; }
.provider-chip:hover { border-color: #0984e3; background: #0984e308; }
.provider-chip.active { border-color: #0984e3; background: #0984e312; color: #0984e3; font-weight: 700; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 16px; padding: 12px; }
.page-btn { padding: 6px 14px; border: 1px solid #ddd; background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; }
.page-btn:hover { background: #f0f0f0; }
.page-btn.active { background: #0984e3; color: #fff; border-color: #0984e3; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 480px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-lg { width: 640px; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid #eee; display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 18px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #999; padding: 0 4px; }
.modal-close:hover { color: #333; }
.modal-body { padding: 20px; }
.modal-body label { display: block; font-size: 13px; font-weight: 600; color: #555; margin: 12px 0 4px; }
.modal-body label:first-child { margin-top: 0; }
.modal-body input[type="text"], .modal-body input[type="password"] { width: 100%; padding: 9px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; outline: none; }
.modal-body input:focus { border-color: #0984e3; }
.modal-footer { padding: 14px 20px; border-top: 1px solid #eee; display: flex; gap: 10px; justify-content: flex-end; }

/* Match Info in modal */
.match-info { background: #f8f9fa; border-radius: 8px; padding: 14px; text-align: center; margin-bottom: 16px; font-weight: 600; font-size: 16px; }
.match-info .meta { font-size: 13px; color: #666; font-weight: 400; margin-top: 4px; }

/* Direction Grid */
.direction-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.dir-chip { padding: 10px 20px; border: 2px solid #e0e0e0; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; transition: all .2s; user-select: none; }
.dir-chip:hover { border-color: #0984e3; background: #0984e308; }
.dir-chip.selected { border-color: #0984e3; background: #0984e312; color: #0984e3; font-weight: 700; }
.dir-summary { background: #e8f4fd; border-radius: 8px; padding: 12px 16px; font-size: 14px; margin-top: 8px; display: none; }
.dir-summary.show { display: block; }

/* Result Panel */
.result-overlay { position: fixed; inset: 0; background: #f0f2f5; z-index: 300; overflow-y: auto; }
.result-container { max-width: 900px; margin: 0 auto; padding: 20px; }
.result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.result-header h3 { font-size: 20px; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Direction Tabs */
.dir-tabs { display: flex; gap: 0; border-bottom: 2px solid #e0e0e0; margin-bottom: 16px; overflow-x: auto; }
.dir-tab { padding: 10px 24px; cursor: pointer; font-size: 14px; font-weight: 500; color: #666; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .2s; }
.dir-tab:hover { color: #0984e3; }
.dir-tab.active { color: #0984e3; font-weight: 700; border-bottom-color: #0984e3; }

/* Progress */
.progress-bar { background: #fff; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.progress-info { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; color: #666; }
.progress-track { background: #e0e0e0; border-radius: 4px; height: 6px; overflow: hidden; }
.progress-fill { background: linear-gradient(90deg, #0984e3, #6c5ce7); height: 100%; border-radius: 4px; transition: width .3s; width: 0%; }

/* Result Cards */
.result-cards { display: flex; flex-direction: column; gap: 16px; }
.copy-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); border: 1px solid #e8e8e8; }
.card-header { padding: 12px 18px; background: linear-gradient(135deg, #0984e3, #6c5ce7); color: #fff; display: flex; align-items: center; justify-content: space-between; }
.card-header .card-num { font-weight: 700; }
.card-header .style-badge { background: rgba(255,255,255,.2); padding: 3px 10px; border-radius: 4px; font-size: 12px; }
.card-header .card-copy-btn { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3); color: #fff; padding: 3px 10px; border-radius: 4px; font-size: 12px; cursor: pointer; }
.card-header .card-copy-btn:hover { background: rgba(255,255,255,.35); }
.card-body { padding: 18px; }
.card-body .block { margin-bottom: 14px; }
.card-body .block:last-child { margin-bottom: 0; }
.card-body .block-title { font-weight: 700; font-size: 14px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.card-body .block-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.card-body .block-content { font-size: 14px; color: #444; line-height: 1.85; background: #f8f9fa; padding: 10px 14px; border-radius: 6px; border-left: 3px solid; white-space: pre-wrap; }
.block-fund .block-dot { background: #e17006; }
.block-fund .block-content { border-color: #e17006; }
.block-data .block-dot { background: #0984e3; }
.block-data .block-content { border-color: #0984e3; }
.block-score .block-dot { background: #00b894; }
.block-score .block-content { border-color: #00b894; }

/* Streaming text cursor */
.streaming::after { content: "▊"; animation: blink .6s infinite; color: #0984e3; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* Toast */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #333; color: #fff; padding: 10px 24px; border-radius: 8px; font-size: 14px; z-index: 999; opacity: 0; transition: opacity .3s; pointer-events: none; }
.toast.show { opacity: 1; }

/* Empty state */
.empty { text-align: center; padding: 60px 20px; color: #999; }
.empty .emoji { font-size: 48px; margin-bottom: 12px; }

/* Responsive */
@media (max-width: 768px) {
  .header h1 { font-size: 16px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .match-card { flex-wrap: wrap; }
  .match-time { min-width: auto; }
  .match-teams { text-align: left; font-size: 14px; }
  .result-header { flex-direction: column; align-items: flex-start; }
}
