/* JavaScript验证器工具样式 */
.js-validator-tool {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* 代码编辑器样式 */
.code-textarea {
    border: none;
    border-radius: 0;
    resize: none;
    font-size: 14px;
    line-height: 1.6;
    background: #fafafa;
}

.code-textarea:focus {
    box-shadow: none;
    background: #ffffff;
}

.code-input-container {
    position: relative;
}

.code-status-bar {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* JavaScript语法高亮样式 */
.js-syntax-highlight {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.js-syntax-keyword {
    color: #d73a49;
    font-weight: bold;
}

.js-syntax-string {
    color: #22863a;
}

.js-syntax-number {
    color: #005cc5;
}

.js-syntax-comment {
    color: #6a737d;
    font-style: italic;
}

.js-syntax-function {
    color: #6f42c1;
}

.js-syntax-variable {
    color: #e36209;
}

.js-syntax-operator {
    color: #d73a49;
}

.js-syntax-bracket {
    color: #586069;
}

.js-syntax-regex {
    color: #032f62;
}

.js-syntax-error {
    background-color: #ffeef0;
    color: #d73a49;
    text-decoration: underline wavy;
}

.js-syntax-warning {
    background-color: #fff5b4;
    color: #b08800;
}

/* ES6+特性高亮 */
.js-syntax-es6 {
    color: #6f42c1;
    font-weight: bold;
}

.js-syntax-es7 {
    color: #e36209;
    font-weight: bold;
}

.js-syntax-es8 {
    color: #005cc5;
    font-weight: bold;
}

.js-syntax-es2020 {
    color: #28a745;
    font-weight: bold;
}

.js-syntax-es2021 {
    color: #17a2b8;
    font-weight: bold;
}

/* 验证结果样式 */
.js-validation-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.1);
}

.js-validation-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.1);
}

.js-validation-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.1);
}

.js-validation-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.1);
}

/* 错误列表样式 */
.js-errors-list {
    max-height: 400px;
    overflow-y: auto;
}

.js-error-item {
    background: #ffffff;
    border-left: 4px solid #dc3545;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.js-error-warning {
    border-left-color: #ffc107;
}

.js-error-info {
    border-left-color: #17a2b8;
}

.js-error-line {
    font-weight: bold;
    color: #dc3545;
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
}

.js-error-column {
    color: #6c757d;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.js-error-message {
    color: #495057;
    margin-top: 0.25rem;
}

.js-error-rule {
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* 建议列表样式 */
.js-suggestions-list {
    max-height: 400px;
    overflow-y: auto;
}

.js-suggestion-item {
    background: #ffffff;
    border-left: 4px solid #28a745;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.js-suggestion-title {
    font-weight: 600;
    color: #28a745;
    margin-bottom: 0.25rem;
}

.js-suggestion-description {
    color: #495057;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.js-suggestion-example {
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
    border-left: 3px solid #28a745;
}

/* 代码统计样式 */
.js-code-stats {
    background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%);
    color: #383d41;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.js-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.js-stat-item {
    text-align: center;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
}

.js-stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #005cc5;
}

.js-stat-label {
    font-size: 0.8rem;
    color: #666666;
    margin-top: 0.25rem;
}

/* 性能分析样式 */
.js-performance-analysis {
    background: #e8f5e8;
    border: 1px solid #28a745;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.js-performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.js-performance-item {
    text-align: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
}

.js-performance-label {
    font-size: 0.8rem;
    color: #155724;
    margin-bottom: 0.25rem;
}

.js-performance-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #28a745;
}

.js-performance-unit {
    font-size: 0.7rem;
    color: #6c757d;
}

/* 安全检查样式 */
.js-security-check {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.js-security-item {
    background: rgba(255, 255, 255, 0.7);
    border-left: 4px solid #ffc107;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0 4px 4px 0;
}

.js-security-high {
    border-left-color: #dc3545;
}

.js-security-medium {
    border-left-color: #ffc107;
}

.js-security-low {
    border-left-color: #28a745;
}

.js-security-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.js-security-high .js-security-title {
    color: #dc3545;
}

.js-security-medium .js-security-title {
    color: #856404;
}

.js-security-low .js-security-title {
    color: #155724;
}

.js-security-description {
    color: #495057;
    font-size: 0.9rem;
}

/* JavaScript版本选择器样式 */
.js-version-selector .btn-group .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.js-version-selector .btn-group .btn.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* 验证选项样式 */
.validation-options .form-check {
    padding: 0.25rem 0;
}

.validation-options .form-check-label {
    font-size: 0.9rem;
    cursor: pointer;
}

.validation-options .form-check-input {
    cursor: pointer;
}

/* 工具栏样式 */
.js-toolbar {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.js-toolbar .btn {
    min-width: 80px;
}

.js-toolbar-divider {
    width: 1px;
    height: 24px;
    background: #dee2e6;
    margin: 0 0.5rem;
}

/* 按钮组样式 */
.js-button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.js-button-group .btn {
    min-width: 100px;
}

/* 状态指示器 */
.js-status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.js-status-valid {
    background: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3);
}

.js-status-invalid {
    background: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3);
}

.js-status-warning {
    background: #ffc107;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3);
}

.js-status-processing {
    background: #17a2b8;
    box-shadow: 0 0 0 2px rgba(23, 162, 184, 0.3);
    animation: pulse 1s infinite;
}

/* 动画效果 */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(23, 162, 184, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(23, 162, 184, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(23, 162, 184, 0);
    }
}

.js-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 文本区域增强样式 */
.form-control.font-monospace {
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .js-button-group {
        flex-direction: column;
    }

    .js-button-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .js-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .js-toolbar-divider {
        width: auto;
        height: 1px;
        margin: 0.5rem 0;
    }

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

    .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .js-stats-grid {
        grid-template-columns: 1fr;
    }

    .code-textarea {
        font-size: 12px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .js-version-selector .btn-group .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
    .js-validator-tool {
        background: #1a1a1a;
        color: #e9ecef;
    }

    .code-textarea {
        background: #2d3748;
        color: #e9ecef;
    }

    .code-status-bar {
        background: #2d3748;
        color: #a0aec0;
    }

    .js-syntax-highlight {
        background: #2d3748;
        border-color: #4a5568;
        color: #e9ecef;
    }

    .js-validation-success {
        background: linear-gradient(135deg, #2d5a3d 0%, #22543d 100%);
        color: #9ae6b4;
        border-color: #22543d;
    }

    .js-validation-error {
        background: linear-gradient(135deg, #5a2d2d 0%, #542d2d 100%);
        color: #feb2b2;
        border-color: #542d2d;
    }

    .js-validation-warning {
        background: linear-gradient(135deg, #5a5a2d 0%, #54542d 100%);
        color: #faf089;
        border-color: #54542d;
    }

    .js-code-stats {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        color: #e2e8f0;
    }

    .js-toolbar {
        background: #2d3748;
        border-color: #4a5568;
    }

    .js-error-item {
        background: #2d3748;
    }

    .js-suggestion-item {
        background: #2d3748;
    }
}