/* ============================================
   股票辅助系统 - 专业暗色主题
   文件位置：/www/wwwroot/stock.bwskyer.com/assets/css/style.css
   ============================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0d1117;
    color: #c9d1d9;
    line-height: 1.5;
    padding: 24px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ========== 头部 ========== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid #21262d;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    background: linear-gradient(135deg, #79c0ff, #58a6ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: #8b949e;
}

.update-time {
    background: #161b22;
    padding: 6px 12px;
    border-radius: 20px;
}

/* ========== 按钮 ========== */
.btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: #21262d;
    color: #c9d1d9;
}

.btn-primary {
    background: #238636;
    color: white;
}

.btn-primary:hover {
    background: #2ea043;
}

.btn-outline {
    background: transparent;
    border: 1px solid #30363d;
}

.btn-outline:hover {
    border-color: #58a6ff;
    color: #58a6ff;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.75rem;
}

/* ========== 控制栏 ========== */
.control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.search-box {
    display: flex;
    gap: 8px;
}

.search-box input {
    padding: 8px 14px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    width: 200px;
}

.search-box input:focus {
    outline: none;
    border-color: #58a6ff;
}

/* ========== 统计卡片 ========== */
.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-card {
    background: #161b22;
    border-radius: 12px;
    padding: 14px 20px;
    flex: 1;
    min-width: 100px;
    border: 1px solid #21262d;
}

.stat-card .label {
    font-size: 0.75rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 4px;
}

/* ========== 股票网格 ========== */
.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stock-card {
    background: #161b22;
    border-radius: 16px;
    border: 1px solid #21262d;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.stock-card:hover {
    transform: translateY(-2px);
    border-color: #30363d;
}

.stock-card.high-score {
    border-left: 4px solid #3fb950;
}

.stock-card.low-score {
    border-left: 4px solid #f85149;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #0d1117;
    border-bottom: 1px solid #21262d;
}

.stock-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.stock-code {
    font-size: 0.7rem;
    color: #8b949e;
    margin-left: 8px;
    font-weight: normal;
}

.stock-name {
    color: #58a6ff;
}

/* 评分圆环 */
.score-container {
    text-align: center;
    padding: 20px;
}

.score-ring {
    width: 110px;
    height: 110px;
    margin: 0 auto;
    position: relative;
}

canvas.score-canvas {
    width: 100%;
    height: 100%;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    font-size: 28px;
    font-weight: 700;
}

.score-number.score-high { color: #3fb950; }
.score-number.score-mid { color: #e3b341; }
.score-number.score-low { color: #f85149; }

.score-percent {
    font-size: 12px;
    color: #8b949e;
}

.score-label {
    font-size: 11px;
    color: #8b949e;
    margin-top: 8px;
}

/* 指标详情 */
.indicators {
    padding: 0 16px 16px;
}

.indicator-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.8rem;
}

.indicator-name {
    width: 65px;
    color: #8b949e;
}

.indicator-value {
    width: 70px;
    text-align: right;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
}

.indicator-bar {
    flex: 1;
    height: 4px;
    background: #21262d;
    border-radius: 4px;
    margin: 0 12px;
    overflow: hidden;
}

.indicator-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.fill-good { background: #3fb950; }
.fill-mid { background: #e3b341; }
.fill-bad { background: #f85149; }

.card-footer {
    padding: 12px 16px;
    background: #0d1117;
    border-top: 1px solid #21262d;
    font-size: 0.7rem;
    color: #8b949e;
    display: flex;
    justify-content: space-between;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #161b22;
    border-radius: 16px;
    color: #8b949e;
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #21262d;
    border-top-color: #58a6ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 提示框 */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #21262d;
    border-left: 3px solid #58a6ff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 工具类 */
.text-success { color: #3fb950; }
.text-danger { color: #f85149; }
.text-warning { color: #e3b341; }
.text-info { color: #58a6ff; }
.text-muted { color: #8b949e; }

/* 响应式 */
@media (max-width: 768px) {
    body { padding: 16px; }
    .stock-grid { grid-template-columns: 1fr; }
    .stats-row { flex-wrap: wrap; }
    .stat-card { min-width: calc(50% - 8px); }
    .control-bar { flex-direction: column; align-items: stretch; }
    .search-box { width: 100%; }
    .search-box input { flex: 1; }
}