/**
 * Strategy Module Styles
 * 策略管理模块样式
 * 使用设计Token v1.0
 */

/* Container */
.strategy-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* Header */
.strategy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.strategy-header h1 {
    font-size: var(--font-size-h1);
    margin: 0;
}

.btn-create {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    display: inline-block;
    transition: all var(--duration-normal) var(--ease-in-out);
}

.btn-create:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    padding: var(--spacing-lg);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    text-align: center;
}

.stat-value {
    font-size: var(--font-size-h1);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
}

.stat-card.total .stat-value { color: var(--color-primary); }
.stat-card.active .stat-value { color: var(--color-success); }
.stat-card.inactive .stat-value { color: var(--color-text-muted); }
.stat-card.rule .stat-value { color: var(--color-info); }
.statCard.backtest .stat-value { color: var(--color-warning); }

/* Strategy Grid */
.strategy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

.strategy-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--duration-normal) var(--ease-in-out);
}

.strategy-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.strategy-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.strategy-name {
    font-size: var(--font-size-h4);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-xs);
}

.strategy-code {
    font-size: var(--font-size-small);
    color: var(--color-text-muted);
    font-family: var(--font-family-mono);
}

.strategy-status {
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
}

.strategy-status.active {
    background: var(--color-success-light);
    color: var(--color-success-dark);
}

.strategy-status.inactive {
    background: var(--color-surface);
    color: var(--color-text-muted);
}

/* Strategy Info */
.strategy-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: var(--font-size-small);
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-xs);
}

.info-value {
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-medium);
}

/* Strategy Description */
.strategy-description {
    font-size: var(--font-size-small);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

/* Strategy Actions */
.strategy-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.action-btn {
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-small);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-in-out);
}

.action-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.action-btn.primary {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.action-btn.primary:hover {
    background: var(--color-primary-dark);
}

.action-btn.danger:hover {
    background: var(--color-error);
    border-color: var(--color-error);
    color: white;
}

/* Filter Bar */
.filter-bar {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.filter-group label {
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.filter-group select,
.filter-group input {
    padding: var(--spacing-xs) var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-body);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-xxl) var(--spacing-lg);
    color: var(--color-text-muted);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: var(--spacing-md);
}

.empty-text {
    font-size: var(--font-size-body);
    margin-bottom: var(--spacing-md);
}

/* Card Layout (used by list.html) */
.strategy-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.strategy-card .card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-text-primary, #1e293b);
}

.strategy-card .card-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.strategy-card .card-body {
    margin-bottom: var(--spacing-md);
}

.strategy-card .card-desc {
    font-size: 13px;
    color: var(--color-text-secondary, #64748b);
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

.strategy-card .card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--color-surface, #f8fafc);
    border-radius: var(--radius-md, 8px);
}

.strategy-card .card-stat {
    text-align: center;
}

.strategy-card .card-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary, #3b82f6);
}

.strategy-card .card-stat-label {
    font-size: 12px;
    color: var(--color-text-muted, #94a3b8);
    margin-top: 2px;
}

.strategy-card .card-rules {
    font-size: 13px;
    color: var(--color-text-secondary, #64748b);
}

.strategy-card .card-rules strong {
    margin-right: 4px;
}

.strategy-card .rule-item {
    display: inline-block;
    padding: 2px 8px;
    background: var(--color-surface, #f1f5f9);
    border-radius: var(--radius-sm, 4px);
    font-size: 12px;
    margin: 2px 4px 2px 0;
}

.strategy-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border, #e2e8f0);
}

.strategy-card .card-date {
    font-size: 12px;
    color: var(--color-text-muted, #94a3b8);
}

.strategy-card .card-actions {
    display: flex;
    gap: 6px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-type {
    background: #dbeafe;
    color: #1e40af;
}

.badge-type.script_based {
    background: #fef3c7;
    color: #92400e;
}

.badge-type.hybrid {
    background: #ede9fe;
    color: #5b21b6;
}

.badge-type.ai_driven {
    background: #fce7f3;
    color: #9d174d;
}

.badge-version {
    background: #f1f5f9;
    color: #64748b;
}

.badge-status {
    background: #d1fae5;
    color: #065f46;
}

.badge-status.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

/* Action Buttons */
.btn-action {
    padding: 5px 12px;
    background: var(--color-surface, #f8fafc);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--radius-md, 6px);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--color-text-secondary, #64748b);
}

.btn-action:hover {
    background: var(--color-primary, #3b82f6);
    border-color: var(--color-primary, #3b82f6);
    color: white;
}

.btn-action.danger:hover {
    background: var(--color-error, #ef4444);
    border-color: var(--color-error, #ef4444);
    color: white;
}

/* Filter Select */
.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: var(--radius-md, 6px);
    font-size: 14px;
    background: white;
    color: var(--color-text-primary, #1e293b);
    outline: none;
}

.filter-select:focus {
    border-color: var(--color-primary, #3b82f6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* Empty hint */
.empty-hint {
    font-size: 13px;
    color: var(--color-text-muted, #94a3b8);
}

/* Script stat card color */
.stat-card.script .stat-value { color: var(--color-warning, #f59e0b); }

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .strategy-container {
        padding: var(--spacing-md);
    }

    .strategy-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .strategy-grid {
        grid-template-columns: 1fr;
    }

    .strategy-info {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
}
