* {
    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%);
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

header h1 {
    color: #667eea;
    font-size: 28px;
    margin-bottom: 15px;
}

.main-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}

.chart-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.chart-header h2 {
    color: #2c3e50;
}

#timeframe {
    padding: 8px 15px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

#chart-container {
    width: 100%;
    height: 500px;
    margin-bottom: 20px;
}

.key-levels {
    margin-top: 20px;
}

.key-levels h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.level-box {
    padding: 15px;
    border-radius: 10px;
    border: 2px solid;
}

.level-box.resistance {
    border-color: #e74c3c;
    background: #ffe5e5;
}

.level-box.support {
    border-color: #2ecc71;
    background: #e5ffe5;
}

.level-box.pivot {
    border-color: #3498db;
    background: #e5f3ff;
}

.level-box h4 {
    margin-bottom: 10px;
    font-size: 14px;
}

.level-item {
    padding: 5px 0;
    font-size: 14px;
    font-weight: 600;
}

.analysis-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.panel h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.state-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

.state-item:last-child {
    border-bottom: none;
}

.state-item .label {
    color: #7f8c8d;
    font-weight: 500;
}

.state-item .value {
    font-weight: bold;
    color: #2c3e50;
}

.signal-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid;
}

.signal-item.bullish {
    border-left-color: #2ecc71;
}

.signal-item.bearish {
    border-left-color: #e74c3c;
}

.signal-item.neutral {
    border-left-color: #95a5a6;
}

.signal-type {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.signal-detail {
    font-size: 13px;
    color: #7f8c8d;
}

.entry-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.entry-card.long {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.entry-card.short {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.entry-direction {
    font-size: 20px;
    font-weight: bold;
}

.entry-confidence {
    background: rgba(255,255,255,0.3);
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 12px;
}

.entry-type {
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.entry-prices {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.price-item {
    background: rgba(255,255,255,0.2);
    padding: 8px;
    border-radius: 5px;
    font-size: 12px;
}

.price-label {
    opacity: 0.8;
    display: block;
    margin-bottom: 3px;
}

.price-value {
    font-weight: bold;
    font-size: 14px;
}

.entry-reason {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.3);
    font-size: 13px;
    opacity: 0.9;
}

.prediction-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.prediction-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.prediction-scenario {
    font-weight: bold;
    color: #2c3e50;
}

.prediction-probability {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 12px;
}

.prediction-target {
    color: #7f8c8d;
    font-size: 13px;
    margin-bottom: 5px;
}

.prediction-description {
    color: #34495e;
    font-size: 13px;
}

.risk-item {
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

.risk-item:last-child {
    border-bottom: none;
}

.risk-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.risk-value {
    color: #7f8c8d;
    font-size: 14px;
}

.risk-notes {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px;
    border-radius: 5px;
    margin-top: 10px;
}

.risk-notes ul {
    margin-left: 20px;
    margin-top: 8px;
}

.risk-notes li {
    margin-bottom: 5px;
    color: #856404;
    font-size: 13px;
}

.trend-up {
    color: #2ecc71 !important;
}

.trend-down {
    color: #e74c3c !important;
}

.trend-sideways {
    color: #95a5a6 !important;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .levels-grid {
        grid-template-columns: 1fr;
    }
}

/* 移动端适配 - 顶部 */
@media (max-width: 768px) {
    header {
        padding: 15px 20px;
    }
    
    header h1 {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .status-bar {
        flex-wrap: wrap;
        gap: 0.8rem;
        font-size: 0.85rem;
    }
    
    .status-item {
        flex: 1 1 45%;
        min-width: 140px;
    }
    
    .status-value.price-value {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 12px 15px;
    }
    
    header h1 {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .status-bar {
        gap: 0.6rem;
        font-size: 0.8rem;
    }
    
    .status-item {
        flex: 1 1 100%;
        min-width: auto;
    }
    
    .status-label {
        font-size: 0.75rem;
    }
    
    .status-value {
        padding: 0.15rem 0.5rem;
        font-size: 0.85rem;
    }
    
    .status-value.price-value {
        font-size: 1rem;
        padding: 0.2rem 0.6rem;
    }
}

/* 状态栏样式 */
.status-bar {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-label {
    color: #6b7280;
}

.status-value {
    font-weight: bold;
    padding: 0.2rem 0.6rem;
    background: #f3f4f6;
    border-radius: 4px;
    color: #374151;
}

.status-value.price-value {
    font-size: 1.3rem;
    color: #10b981;
    background: transparent;
    padding: 0.3rem 0.8rem;
    transition: color 0.3s ease;
}

#collect-status.active {
    color: #4ade80;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

#export-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

#export-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}


/* 高级分析样式 */
.pivot-item {
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pivot-main {
    background: #2196F3;
    color: white;
    font-weight: bold;
}

.pivot-item.resistance {
    background: #ffebee;
    color: #c62828;
}

.pivot-item.support {
    background: #e8f5e9;
    color: #2e7d32;
}

.signal-main {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
}

.signal-main.buy {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: white;
}

.signal-main.sell {
    background: linear-gradient(135deg, #f44336, #ef5350);
    color: white;
}

.signal-main.hold {
    background: linear-gradient(135deg, #9E9E9E, #BDBDBD);
    color: white;
}

.signal-action {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.signal-confidence {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 14px;
}

.strength.strong {
    color: #FFD700;
    font-weight: bold;
}

.strength.medium {
    color: #FFF;
}

.strength.weak {
    color: #DDD;
}

.signal-list {
    margin-top: 15px;
}

.signal-item {
    padding: 8px;
    background: #f5f5f5;
    margin: 5px 0;
    border-radius: 4px;
    border-left: 3px solid #2196F3;
}

.entry-section, .risk-section {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.entry-section h4, .risk-section h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.entry-item, .risk-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.entry-item.better {
    background: #fff3e0;
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid #FF9800;
}

.entry-item.best {
    background: #e8f5e9;
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid #4CAF50;
}

.recommendation {
    margin-top: 10px;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 4px;
    color: #1976D2;
    font-weight: bold;
    text-align: center;
}

.risk-item.stop-loss .value {
    color: #f44336;
    font-weight: bold;
}

.risk-item.take-profit .value {
    color: #4CAF50;
    font-weight: bold;
}

.risk-info {
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    font-size: 12px;
}

.risk-note {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.prediction-item {
    margin: 10px 0;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #ccc;
}

.prediction-item.primary {
    background: #e8f5e9;
    border-left-color: #4CAF50;
}

.prediction-item.secondary {
    background: #fff3e0;
    border-left-color: #FF9800;
}

.prediction-item.tertiary {
    background: #ffebee;
    border-left-color: #f44336;
}

.prediction-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: bold;
}

.prediction-header .scenario {
    color: #666;
    font-size: 12px;
}

.prediction-header .direction {
    font-size: 14px;
}

.prediction-header .direction.bullish {
    color: #4CAF50;
}

.prediction-header .direction.bearish {
    color: #f44336;
}

.prediction-header .direction.neutral {
    color: #9E9E9E;
}

.prediction-target {
    font-size: 16px;
    font-weight: bold;
    margin: 5px 0;
}

.prediction-condition {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.state-item.reversal {
    background: #fff3e0;
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid #FF9800;
}

.no-signal, .no-data {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}

.level-value {
    padding: 5px 10px;
    margin: 3px 0;
    background: #f5f5f5;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}

/* 导入弹框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-content h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.import-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: bold;
    color: #374151;
}

.form-group select {
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

/* 移动端适配 - 弹框 */
@media (max-width: 480px) {
    .modal-content {
        margin: 20% auto;
        padding: 20px;
        width: 95%;
    }
    
    .modal-content h2 {
        font-size: 20px;
    }
    
    .form-group select {
        font-size: 13px;
    }
    
    .btn-primary {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* 导入按钮样式 */
.status-item.status-action {
    margin-left: auto;
}

#import-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

#import-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

#import-btn:active {
    transform: translateY(0);
}

/* 缩放倍数显示 */
#zoom-level {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}
