/* ============================================
   Synolon - 工具组件样式 v2.2.0
   
   样式索引 (按行号)
   ============================================
   
   [基础组件]
   - 表单区域        : ~35
   - 标签样式        : ~70
   - 输入框          : ~90
   - 按钮样式        : ~180
   - 结果区域        : ~290
   - 表格样式        : ~400
   
   [工具专用]
   - S7解析器        : ~500
   - IP计算器        : ~600
   - 哈希计算器      : ~750
   - 密码生成器      : ~900
   - 文本差异对比    : ~1100
   - ASCII码表       : ~1350
   - 文本统计        : ~1480
   - 欢迎页面        : ~1560
   
   ============================================ */

/* ===== 表单区域 ===== */
.form-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group.flex-2 {
    flex: 2;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.label-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

/* ===== 标签 ===== */
.tag {
    display: inline-flex;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.tag-required {
    background: var(--error-bg);
    color: var(--error);
}

.tag-optional {
    background: var(--bg-overlay);
    color: var(--text-tertiary);
}

/* ===== 输入框 ===== */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--border-emphasis);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-disabled);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px var(--error-bg);
}

.form-textarea {
    min-height: 140px;
    resize: vertical;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Number输入框特殊样式 */
.form-input[type="number"] {
    -moz-appearance: textfield;
    padding-right: var(--space-md);
}

.form-input[type="number"]::-webkit-outer-spin-button,
.form-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239ba3b5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-select optgroup {
    font-weight: 600;
    color: var(--text-secondary);
}

.form-select option {
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: var(--space-sm);
}

/* ===== 按钮 ===== */
.form-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    box-shadow: var(--shadow-sm), var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), 0 0 30px rgba(0, 212, 255, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-active);
    color: var(--text-primary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--bg-hover);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
}

.btn-icon:hover {
    background: var(--bg-active);
    color: var(--text-primary);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

.inline-error {
    color: var(--error);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===== 快捷掩码按钮 ===== */
.quick-masks {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.quick-mask-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-right: var(--space-sm);
}

.quick-mask-btn {
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-overlay);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

/* ===== 结果区域 ===== */
.result-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-default);
}

.result-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.result-content {
    padding: var(--space-xl);
}

/* ===== 协议层卡片 ===== */
.protocol-layer {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.protocol-layer:hover {
    border-color: var(--border-emphasis);
}

.protocol-layer:last-child {
    margin-bottom: 0;
}

.layer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-overlay);
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
}

.layer-title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-weight: 600;
    color: var(--text-primary);
}

.layer-title .layer-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.layer-title .layer-icon.tpkt { background: var(--primary-400); }
.layer-title .layer-icon.cotp { background: var(--accent-500); }
.layer-title .layer-icon.s7header { background: var(--success); }
.layer-title .layer-icon.s7param { background: var(--warning); }
.layer-title .layer-icon.s7data { background: #a855f7; }

.layer-bytes {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.layer-content {
    padding: var(--space-lg);
}

.field-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: var(--space-lg);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.field-row:last-child {
    border-bottom: none;
}

.field-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.field-value {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--primary-400);
    word-break: break-all;
}

.field-value.success {
    color: var(--success);
}

.field-value.error {
    color: var(--error);
}

.field-value.warning {
    color: var(--warning);
}

/* ===== 状态徽章 ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 2px var(--space-sm);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.status-badge.success {
    background: var(--success-bg);
    color: var(--success);
}

.status-badge.error {
    background: var(--error-bg);
    color: var(--error);
}

/* ===== 十六进制显示 ===== */
.hex-display {
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
    word-break: break-all;
}

.hex-byte {
    display: inline-block;
    padding: 2px 4px;
    margin: 2px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.hex-byte:hover {
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.hex-byte.tpkt { background: rgba(0, 212, 255, 0.2); color: var(--primary-400); }
.hex-byte.cotp { background: rgba(255, 119, 0, 0.2); color: var(--accent-400); }
.hex-byte.s7header { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.hex-byte.s7param { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.hex-byte.s7data { background: rgba(168, 85, 247, 0.2); color: #a855f7; }

.hex-legend {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-sm);
}

/* ===== 哈希结果 ===== */
.hash-result-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    transition: all var(--transition-fast);
}

.hash-result-item:hover {
    border-color: var(--border-emphasis);
    background: var(--bg-overlay);
}

.hash-result-item:last-child {
    margin-bottom: 0;
}

.hash-label {
    min-width: 80px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.hash-value {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--primary-400);
    word-break: break-all;
    user-select: all;
}

.hash-copy-btn {
    flex-shrink: 0;
}

/* ===== IP计算结果 ===== */
.ip-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.ip-result-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.ip-result-card h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.ip-result-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-primary);
    word-break: break-all;
}

.ip-result-value.highlight {
    color: var(--primary-400);
    font-weight: 600;
}

.ip-result-sub {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

.ip-binary-display {
    margin-top: var(--space-lg);
    padding: var(--space-lg);
    background: var(--bg-base);
    border-radius: var(--radius-lg);
}

.ip-binary-display h4 {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.binary-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.binary-label {
    min-width: 80px;
    color: var(--text-secondary);
}

.binary-value {
    color: var(--text-primary);
}

.binary-value .network {
    color: var(--primary-400);
}

.binary-value .host {
    color: var(--accent-400);
}

/* ===== 文件上传区域 ===== */
.file-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl);
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-xl);
    background: var(--bg-base);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--primary-500);
    background: rgba(0, 212, 255, 0.05);
}

.file-drop-zone svg {
    width: 48px;
    height: 48px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-lg);
}

.file-drop-zone p {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.file-select-btn {
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    background: var(--primary-500);
    color: white;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-select-btn:hover {
    background: var(--primary-600);
}

.file-hint {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: var(--space-md);
}

.file-info {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    margin-top: var(--space-lg);
}

.file-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-overlay);
    border-radius: var(--radius-lg);
}

.file-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary-400);
}

.file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
}

.file-size {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== 进度条 ===== */
.progress-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.progress-track {
    flex: 1;
    height: 8px;
    background: var(--bg-overlay);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
    border-radius: var(--radius-sm);
    transition: width 0.2s ease;
}

.progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

/* ===== 验证结果 ===== */
.verify-result {
    text-align: center;
    padding: var(--space-2xl);
}

.verify-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.verify-icon.success {
    background: var(--success-bg);
    color: var(--success);
}

.verify-icon.error {
    background: var(--error-bg);
    color: var(--error);
}

.verify-icon svg {
    width: 32px;
    height: 32px;
}

.verify-text {
    font-size: 1.1rem;
    font-weight: 600;
}

.verify-text.success {
    color: var(--success);
}

.verify-text.error {
    color: var(--error);
}

.verify-detail {
    margin-top: var(--space-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===== 复制成功反馈 ===== */
.copy-success {
    position: relative;
}

.copy-success::after {
    content: '已复制!';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: var(--success);
    color: white;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    animation: fadeOut 1.5s ease forwards;
}

@keyframes fadeOut {
    0%, 70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* ===== 错误和警告消息 ===== */
.message-box {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.message-box.error {
    background: var(--error-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.message-box.warning {
    background: var(--warning-bg);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.message-box.info {
    background: var(--info-bg);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.message-box svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.message-box.error svg {
    color: var(--error);
}

.message-box.warning svg {
    color: var(--warning);
}

.message-box.info svg {
    color: var(--info);
}

.message-box p {
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ===== 响应式调整 ===== */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .field-row {
        grid-template-columns: 1fr;
        gap: var(--space-xs);
    }
    
    .ip-result-grid {
        grid-template-columns: 1fr;
    }
    
    .hash-result-item {
        flex-wrap: wrap;
    }
    
    .hash-value {
        width: 100%;
        order: 3;
        margin-top: var(--space-sm);
    }
    
    .file-drop-zone {
        padding: var(--space-xl);
    }
}

/* ===== 密码生成器样式 ===== */
.range-input-group {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.form-range {
    flex: 1;
    min-width: 100px;
    -webkit-appearance: none;
    height: 6px;
    background: var(--bg-overlay);
    border-radius: 3px;
    outline: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-500);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.form-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-500);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.range-value {
    width: 90px;
    min-width: 90px;
    flex-shrink: 0;
    text-align: center;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-mono);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.checkbox-group.compact {
    gap: var(--space-lg);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.checkbox-item:hover {
    border-color: var(--primary-500);
    background: var(--bg-elevated);
}

.checkbox-item input[type="checkbox"] {
    display: none;
}

.checkbox-mark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-emphasis);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.checkbox-item input:checked + .checkbox-mark {
    background: var(--primary-500);
    border-color: var(--primary-500);
}

.checkbox-item input:checked + .checkbox-mark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-item span:last-child {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Radio按钮 */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.radio-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.radio-item:hover {
    border-color: var(--primary-500);
}

.radio-item input[type="radio"] {
    display: none;
}

.radio-mark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-emphasis);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.radio-item input:checked + .radio-mark {
    border-color: var(--primary-500);
}

.radio-item input:checked + .radio-mark::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary-500);
    border-radius: 50%;
}

.radio-item span:last-child {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 密码结果项 */
.pwd-result-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    transition: all var(--transition-fast);
}

.pwd-result-item:hover {
    border-color: var(--border-emphasis);
    background: var(--bg-overlay);
}

.pwd-result-item:last-child {
    margin-bottom: 0;
}

.pwd-index {
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-overlay);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
}

.pwd-value {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--primary-400);
    word-break: break-all;
    user-select: all;
    letter-spacing: 0.5px;
}

.pwd-strength {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
}

.pwd-strength.weak { background: var(--error-bg); color: var(--error); }
.pwd-strength.medium { background: var(--warning-bg); color: var(--warning); }
.pwd-strength.strong { background: var(--success-bg); color: var(--success); }

.pwd-copy-btn { flex-shrink: 0; }

/* ===== 文本差异对比样式 ===== */
.diff-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.diff-pane {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.diff-pane label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.diff-textarea {
    min-height: 200px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
}

.diff-result-content {
    max-height: 500px;
    overflow-y: auto;
}

.diff-stats {
    display: flex;
    gap: var(--space-lg);
    font-size: 0.85rem;
}

.diff-stats .stat-item { display: flex; align-items: center; gap: var(--space-xs); }
.diff-stats .added { color: var(--success); }
.diff-stats .removed { color: var(--error); }
.diff-stats .modified { color: var(--warning); }

.diff-line {
    display: flex;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    border-bottom: 1px solid var(--border-subtle);
}

.diff-line:last-child { border-bottom: none; }

.diff-line-num {
    min-width: 40px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-overlay);
    color: var(--text-tertiary);
    text-align: right;
    user-select: none;
    border-right: 1px solid var(--border-subtle);
}

.diff-line-content {
    flex: 1;
    padding: var(--space-xs) var(--space-md);
    white-space: pre-wrap;
    word-break: break-all;
}

.diff-line.added { background: rgba(16, 185, 129, 0.1); }
.diff-line.added .diff-line-content { color: var(--success); }
.diff-line.removed { background: rgba(239, 68, 68, 0.1); }
.diff-line.removed .diff-line-content { color: var(--error); }
.diff-line.modified { background: rgba(245, 158, 11, 0.1); }

.diff-char-add { background: rgba(16, 185, 129, 0.3); padding: 0 2px; border-radius: 2px; }
.diff-char-del { background: rgba(239, 68, 68, 0.3); padding: 0 2px; border-radius: 2px; text-decoration: line-through; }

/* 差异对比增强样式 */
.diff-similarity {
    display: flex;
    align-items: center;
}

.similarity-badge {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.similarity-badge.high {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.similarity-badge.medium {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.similarity-badge.low {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.diff-view-options {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-md);
}

.diff-view-options .checkbox-item {
    font-size: 0.85rem;
}

/* Toggle按钮样式 */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-toggle {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.btn-toggle:hover {
    background: var(--bg-active);
    border-color: var(--primary-400);
}

.btn-toggle .toggle-on {
    display: none;
}

.btn-toggle .toggle-off {
    display: inline;
}

.btn-toggle.active {
    background: var(--primary-500);
    border-color: var(--primary-500);
    color: white;
}

.btn-toggle.active .toggle-on {
    display: inline;
}

.btn-toggle.active .toggle-off {
    display: none;
}

.diff-line-add {
    background: rgba(16, 185, 129, 0.1);
}

.diff-line-add .diff-line-content {
    color: var(--success);
}

.diff-line-del {
    background: rgba(239, 68, 68, 0.1);
}

.diff-line-del .diff-line-content {
    color: var(--error);
}

.diff-line-equal {
    background: transparent;
}

.diff-prefix {
    min-width: 20px;
    padding: var(--space-xs);
    color: var(--text-tertiary);
    user-select: none;
    text-align: center;
    font-weight: 600;
}

.diff-line-add .diff-prefix {
    color: var(--success);
}

.diff-line-del .diff-prefix {
    color: var(--error);
}

.diff-line-num.add {
    color: var(--success);
}

.diff-line-num.del {
    color: var(--error);
}

/* ===== 哈希比对样式 ===== */
.hash-compare-input { font-family: var(--font-mono); font-size: 0.9rem; }

.hash-compare-visual {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding: var(--space-xl);
}

.hash-compare-row { display: flex; align-items: center; gap: var(--space-md); }
.hash-compare-label { min-width: 80px; font-weight: 600; font-size: 0.85rem; color: var(--text-secondary); }
.hash-compare-value {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: var(--space-md);
    background: var(--bg-base);
    border-radius: var(--radius-md);
    word-break: break-all;
}

.hash-compare-value.match { color: var(--success); border: 1px solid var(--success); }
.hash-compare-value.mismatch { color: var(--error); border: 1px solid var(--error); }

.hash-char-match { color: var(--success); }
.hash-char-mismatch { color: var(--error); background: var(--error-bg); padding: 0 2px; border-radius: 2px; }

@media (max-width: 768px) {
    .diff-container { grid-template-columns: 1fr; }
    .checkbox-group, .radio-group { flex-direction: column; }
    .pwd-result-item { flex-wrap: wrap; }
    .pwd-value { width: 100%; order: 2; margin-top: var(--space-sm); }
}

/* ===== ASCII表样式 ===== */
.ascii-table-container {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.ascii-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.ascii-table thead {
    position: sticky;
    top: 0;
    background: var(--bg-elevated);
    z-index: 1;
}

.ascii-table th {
    padding: var(--space-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-default);
    white-space: nowrap;
}

.ascii-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.ascii-table tr {
    cursor: pointer;
    transition: background var(--transition-fast);
}

.ascii-table tr:hover {
    background: var(--bg-hover);
}

.ascii-table tr.control {
    color: var(--warning);
}

.ascii-table tr.control .char-cell {
    background: var(--warning-bg);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.ascii-table .char-cell {
    font-weight: 600;
    color: var(--primary-400);
    font-size: 1rem;
}

.ascii-table .desc-cell {
    color: var(--text-tertiary);
    font-family: var(--font-sans);
}

/* 可复制单元格 */
.ascii-table .copyable {
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

.ascii-table .copyable:hover {
    background: var(--bg-active);
    color: var(--primary-300);
}

.ascii-table .copyable.copied {
    background: var(--success-bg);
    color: var(--success);
}

.ascii-table .copyable::after {
    content: '点击复制';
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-overlay);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    z-index: 10;
}

.ascii-table .copyable:hover::after {
    opacity: 1;
}

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

/* ===== 文本统计增强样式 ===== */
.textstat-section {
    margin-bottom: var(--space-xl);
}

.textstat-section .section-title {
    margin: 0 0 var(--space-md) 0;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.ip-result-card.wide {
    grid-column: span 2;
}

.ip-result-card small {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-left: 4px;
}

.duplicate-lines-section {
    margin-top: var(--space-xl);
    padding: var(--space-lg);
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.duplicate-lines-section h4 {
    margin: 0 0 var(--space-md) 0;
    font-size: 0.95rem;
    color: var(--error);
    font-weight: 600;
}

.duplicate-lines-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.duplicate-line {
    background: var(--bg-elevated);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 高频词汇样式 ===== */
.word-freq-section {
    margin-top: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.word-freq-section h4 {
    margin: 0 0 var(--space-md) 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.word-freq-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.word-freq-item {
    display: inline-flex;
    align-items: center;
    background: var(--bg-overlay);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    white-space: nowrap;
    border: 1px solid var(--border-subtle);
}

.word-freq-item em {
    font-style: normal;
    color: var(--primary-400);
    margin-left: 6px;
    font-weight: 600;
}

/* ===== 欢迎界面样式 ===== */
.welcome-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--topbar-height));
    padding: var(--space-xl);
}

.welcome-panel.hidden {
    display: none;
}

.welcome-content {
    text-align: center;
    max-width: 800px;
    width: 100%;
}

/* 头部 */
.welcome-header {
    margin-bottom: var(--space-2xl);
}

.welcome-logo {
    margin-bottom: var(--space-lg);
}

.welcome-logo img {
    width: 72px;
    height: 72px;
    opacity: 0.95;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.welcome-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0;
    background: linear-gradient(
        90deg,
        #00d4ff,
        #00ff88,
        #ff00ff,
        #ffaa00
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 分类卡片 */
.welcome-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.category-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.category-card:hover {
    border-color: var(--primary-500);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.12);
}

.category-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(0, 212, 255, 0.04));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon svg {
    width: 20px;
    height: 20px;
    color: var(--primary-400);
}

.category-info {
    text-align: center;
}

.category-info h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.category-info span {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    line-height: 1.3;
}

/* 快捷入口 */
.welcome-quick {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
    padding: var(--space-lg);
    background: var(--bg-overlay);
    border-radius: var(--radius-lg);
}

.quick-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.quick-tools {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.quick-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.quick-btn:hover {
    color: var(--primary-400);
    border-color: var(--primary-500);
    background: rgba(0, 212, 255, 0.08);
}

/* 底部 */
.welcome-footer {
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-version {
    font-size: 0.75rem;
    color: var(--text-disabled);
    font-family: var(--font-mono);
}

/* 响应式 */
@media (max-width: 900px) {
    .welcome-categories {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .welcome-content h1 {
        font-size: 2.2rem;
    }
    
    .welcome-categories {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .welcome-quick {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .quick-tools {
        gap: 6px;
    }
}

/* ===== 图表生成器样式 ===== */
.chart-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: var(--space-lg);
    min-height: 500px;
    max-height: calc(100vh - 180px);
}

.chart-settings {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    overflow-y: auto;
    padding-right: var(--space-sm);
}

/* 滚动条美化 */
.chart-settings::-webkit-scrollbar {
    width: 6px;
}

.chart-settings::-webkit-scrollbar-track {
    background: transparent;
}

.chart-settings::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px;
}

.chart-settings::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.chart-settings .form-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}

.chart-settings .section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.chart-settings .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.chart-settings .section-header .section-title {
    margin-bottom: 0;
}

/* 带单位的输入框 */
.input-with-unit {
    display: flex;
    align-items: center;
    gap: 0;
}

.input-with-unit .form-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
    text-align: right;
    padding-right: var(--space-sm);
}

.input-with-unit .input-unit {
    background: var(--bg-overlay);
    border: 1px solid var(--border-default);
    border-left: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 10px 12px;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* 标签提示文字 */
.label-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

/* 数据条数显示 */
.data-count {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-tertiary);
}

/* 排序按钮 */
.sort-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0 4px;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.sort-btn:hover {
    color: var(--primary-400);
}

/* 数据集标签页 */
.chart-dataset-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
    padding: 4px;
    background: var(--bg-overlay);
    border-radius: var(--radius-md);
}

.dataset-tab {
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dataset-tab:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.dataset-tab.active {
    background: var(--primary-500);
    color: white;
}

.dataset-settings {
    padding: var(--space-sm);
    background: var(--bg-overlay);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
}

.dataset-settings .form-row {
    margin-bottom: 0;
}

.dataset-settings .form-group {
    margin-bottom: 0;
}

.dataset-settings .color-input {
    width: 100%;
    height: 38px;
    padding: 4px;
    cursor: pointer;
}

/* 颜色提示 */
.color-tip {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    padding: var(--space-xs) 0 0 0;
    margin-top: var(--space-xs);
    border-top: 1px dashed var(--border-subtle);
}

.label-hint {
    cursor: help;
    opacity: 0.6;
}

.chart-data-table {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.chart-data-header {
    display: grid;
    grid-template-columns: 1fr 100px 50px;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-overlay);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* 散点图/气泡图三列 */
.chart-data-header.scatter-mode {
    grid-template-columns: 1fr 80px 80px 50px;
}

.chart-data-row.scatter-mode {
    grid-template-columns: 1fr 80px 80px 50px;
}

/* 气泡图四列 */
.chart-data-header.bubble-mode {
    grid-template-columns: 80px 80px 80px 60px 50px;
}

.chart-data-row.bubble-mode {
    grid-template-columns: 80px 80px 80px 60px 50px;
}

#chart-data-rows {
    max-height: 240px;
    overflow-y: auto;
}

.chart-data-row {
    display: grid;
    grid-template-columns: 1fr 100px 50px;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    align-items: center;
}

.chart-data-row:last-child {
    border-bottom: none;
}

.chart-data-row .form-input {
    padding: 6px 10px;
    font-size: 0.85rem;
}

.chart-data-row .btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
}

.chart-data-row .btn-icon svg {
    width: 14px;
    height: 14px;
}

.btn-danger {
    color: var(--error);
    border-color: transparent;
    background: transparent;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--error);
}

.chart-data-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    flex-wrap: wrap;
}

.chart-preview {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
}

.chart-preview-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.preview-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.chart-preview-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chart-export-btns {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

/* 显示选项开关组 */
.chart-toggles {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    padding-top: var(--space-xs);
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toggle-item:hover {
    color: var(--text-primary);
}

.toggle-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--primary-400);
}

.toggle-item input[type="checkbox"]:checked + span {
    color: var(--primary-400);
}

/* 参考线设置面板 */
.refline-panel {
    background: var(--bg-overlay);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    margin-top: var(--space-xs);
}

.refline-inputs {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
}

.refline-inputs .form-input {
    padding: 6px 8px;
    font-size: 0.8rem;
}

.refline-inputs input[type="number"] {
    width: 80px;
}

.refline-inputs input[type="text"] {
    flex: 1;
    min-width: 120px;
}

.refline-inputs input[type="color"] {
    width: 36px;
    height: 28px;
    padding: 2px;
    cursor: pointer;
}

.chart-canvas-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: var(--bg-base);
    border-radius: var(--radius-md);
    overflow: auto;
    padding: var(--space-sm);
}

/* 图表画布自适应 */
#chart-canvas {
    max-width: 100%;
    height: auto !important;
}

.chart-placeholder {
    text-align: center;
    color: var(--text-tertiary);
    padding: var(--space-xl) 0;
}

.chart-placeholder svg {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.chart-placeholder p {
    font-size: 0.9rem;
}

#chart-canvas {
    max-width: 100%;
    height: auto;
}

/* 显示选项网格 */
.chart-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xs) var(--space-md);
}

.chart-option {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.chart-option:hover {
    color: var(--text-primary);
}

.chart-option input[type="checkbox"] {
    margin: 0;
}

/* 参考线设置 */
.refline-settings {
    padding: var(--space-sm);
    background: var(--bg-overlay);
    border-radius: var(--radius-sm);
    margin-top: var(--space-xs);
}

.refline-settings .form-row {
    gap: var(--space-xs);
    margin: 0;
}

/* Excel粘贴区域（旧样式保留兼容） */
.chart-paste-area {
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chart-paste-area:hover,
.chart-paste-area.drag-over {
    border-color: var(--primary-400);
    background: rgba(0, 212, 255, 0.05);
}

.chart-paste-area.active {
    border-color: var(--primary-400);
    border-style: solid;
}

.paste-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-tertiary);
}

.paste-hint svg {
    opacity: 0.5;
}

.paste-hint span {
    font-size: 0.8rem;
}

.paste-format {
    font-size: 0.7rem !important;
    opacity: 0.7;
}

/* 紧凑型粘贴区 */
.chart-paste-compact {
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    overflow: hidden;
}

.chart-paste-compact:hover {
    border-color: var(--primary-400);
    background: rgba(0, 212, 255, 0.05);
}

.chart-paste-compact.active {
    border-color: var(--primary-400);
    border-style: solid;
    cursor: default;
}

.chart-paste-compact .paste-hint {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.chart-paste-compact:hover .paste-hint {
    color: var(--primary-400);
}

.chart-paste-compact textarea {
    width: 100%;
    min-height: 50px;
    border: none;
    border-top: 1px solid var(--border-subtle);
    border-radius: 0;
    resize: none;
}

/* 统计信息栏（右侧预览区下方） */
.chart-stats-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-overlay);
    border-radius: var(--radius-md);
    margin-top: var(--space-sm);
    position: relative;
}

.chart-stats-bar .stat-dataset-name {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--primary-400);
    background: var(--bg-secondary);
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.chart-stats-bar .stat-item {
    text-align: center;
    padding: var(--space-xs) var(--space-sm);
}

.chart-stats-bar .stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-bottom: 2px;
}

.chart-stats-bar .stat-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-400);
    font-family: var(--font-mono);
}

/* 统计信息面板 */
.chart-stats-section {
    padding: var(--space-sm) var(--space-md) !important;
}

.chart-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.stat-item {
    text-align: center;
    padding: var(--space-sm);
    background: var(--bg-overlay);
    border-radius: var(--radius-sm);
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-bottom: 2px;
}

.stat-value {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-400);
    font-family: var(--font-mono);
}

/* 数据洞察 */
.chart-insight {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 255, 136, 0.05));
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--radius-md);
}

.insight-header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--primary-400);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.insight-content {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.insight-content strong {
    color: var(--text-primary);
}

.insight-content .insight-highlight {
    color: var(--primary-400);
    font-weight: 600;
}

.insight-content .insight-up {
    color: var(--success);
}

.insight-content .insight-down {
    color: var(--error);
}

@media (max-width: 900px) {
    .chart-layout {
        grid-template-columns: 1fr;
    }
    
    .chart-preview {
        min-height: 400px;
    }
    
    .chart-options-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== 网络布局设计样式 ===== */
.np-layout {
    display: grid;
    grid-template-columns: 260px 1fr 280px;
    gap: var(--space-lg);
    height: calc(100vh - 200px);
    min-height: 500px;
}

.np-sidebar,
.np-cable-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    overflow-y: auto;
    min-width: 0;
}

.np-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.np-section h4 {
    margin: 0 0 var(--space-md) 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.np-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

.np-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    width: 100%;
}

.np-form-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
}

.np-form-item label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.np-form-item input {
    padding: 6px 10px;
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.np-form-item input[type="number"] {
    -moz-appearance: textfield;
}

.np-form-item input[type="number"]::-webkit-outer-spin-button,
.np-form-item input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.np-form-item input:focus {
    outline: none;
    border-color: var(--primary-500);
}

/* 设备库 */
.np-device-library {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.np-device-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.np-device-item:hover {
    background: var(--bg-active);
    border-color: var(--primary-400);
    transform: translateY(-2px);
}

.np-device-item svg {
    width: 24px;
    height: 24px;
    color: var(--primary-400);
}

.np-device-item span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
}

/* 主画布区域 */
.np-main {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.np-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.np-toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-subtle);
    margin: 0 var(--space-sm);
}

.np-toolbar-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-left: auto;
}

/* Toggle开关 */
.np-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.np-toggle input {
    display: none;
}

.np-toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--bg-overlay);
    border-radius: 10px;
    transition: all 0.2s;
}

.np-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--text-tertiary);
    border-radius: 50%;
    transition: all 0.2s;
}

.np-toggle input:checked + .np-toggle-slider {
    background: var(--primary-500);
}

.np-toggle input:checked + .np-toggle-slider::after {
    transform: translateX(16px);
    background: #fff;
}

.np-toggle-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.np-canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--bg-base);
}

.np-canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* 属性面板 */
.np-prop-empty {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    text-align: center;
    padding: var(--space-xl);
    line-height: 1.6;
}

.np-prop-empty p {
    margin-bottom: var(--space-sm);
}

.np-prop-empty small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-disabled);
    margin-top: var(--space-sm);
}

.np-prop-section .np-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin: var(--space-sm) 0;
    line-height: 1.5;
}

.np-prop-section h4 {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.np-prop-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.85rem;
}

.np-prop-row label {
    color: var(--text-secondary);
    min-width: 70px;
}

.np-prop-row span {
    color: var(--text-primary);
    text-align: right;
}

.np-prop-row input,
.np-prop-row select {
    flex: 1;
    max-width: 120px;
    padding: 4px 8px;
    background: var(--bg-base);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8rem;
}

.np-prop-row.highlight {
    background: var(--primary-500);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 212, 255, 0.05));
    margin: var(--space-sm) calc(var(--space-md) * -1);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
}

.np-distance {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-400) !important;
}

/* 距离明细区块 */
.np-distance-detail {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin: var(--space-md) 0;
}

.np-dd-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-subtle);
}

.np-dd-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 4px 0;
    color: var(--text-secondary);
}

.np-dd-row.total {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px dashed var(--border-default);
    font-weight: 600;
    color: var(--text-primary);
}

.np-dd-row.total .np-distance {
    font-size: 1rem;
}

/* 场地参数表单项全宽 */
.np-form-item.full {
    grid-column: 1 / -1;
}

.np-prop-section .btn {
    width: 100%;
    margin-top: var(--space-md);
}

/* 线缆清单 */
.np-list-empty {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    text-align: center;
    padding: var(--space-xl);
}

/* 布线清单卡片式 */
.np-cable-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.np-cable-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.np-cable-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-emphasis);
}

.np-cable-item.sel {
    border-color: var(--primary-400);
    background: rgba(0, 212, 255, 0.1);
}

.np-cable-item.over {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.np-ci-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.np-ci-head span {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.np-ci-head b {
    font-size: 0.95rem;
    font-weight: 700;
}

.np-ci-route {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.np-ci-info {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.np-ci-warn {
    font-size: 0.7rem;
    color: var(--error);
    margin-top: 4px;
}

/* 线缆状态 */
.np-cable-item.warn {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.np-cable-item.alert {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.np-cable-item.over {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* 属性面板警告 */
.np-cable-status {
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    margin: var(--space-sm) 0;
}

.np-status-warn {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.np-status-alert {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.np-status-error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* 转弯点设备样式 */
.np-device-item.np-waypoint {
    border-color: #6366f1;
}

.np-device-item.np-waypoint svg {
    color: #818cf8;
}

.np-total {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
    font-size: 0.9rem;
    text-align: right;
}

.np-total b {
    color: var(--primary-400);
    font-size: 1.2rem;
}

/* 导出按钮 */
.np-export-btns {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.np-export-btns .btn {
    flex: 1;
    min-width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.np-import-area {
    margin-top: var(--space-md);
}

.np-import-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
}

/* v2.0 新增样式 */
.np-form-item select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 12px;
    width: 100%;
}

.np-form-item select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.np-bg-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.np-bg-opacity-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.np-bg-opacity-row input[type="range"] {
    flex: 1;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    -webkit-appearance: none;
}

.np-bg-opacity-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.np-bg-opacity-row span {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 32px;
}

.np-bg-actions {
    display: flex;
    gap: 6px;
}

.np-bg-actions .btn {
    flex: 1;
    font-size: 11px;
    padding: 5px 8px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* 测距按钮激活状态 */
#np-measure.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* 位置信息样式 */
.np-position-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.np-position-info h5 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.np-pos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.np-pos-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 4px 6px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.np-pos-row .np-pos-dir {
    font-weight: 600;
    color: var(--primary);
    min-width: 20px;
}

.np-pos-row .np-pos-val {
    color: var(--text);
}

.np-pos-center {
    grid-column: 1 / -1;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-weight: 500;
}

/* 设备尺寸编辑 */
.np-device-size-edit {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.np-device-size-edit h5 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.np-size-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.np-size-row label {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 45px;
}

.np-size-row input {
    flex: 1;
    padding: 4px 6px;
    font-size: 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    width: 60px;
}

.np-size-row input:focus {
    outline: none;
    border-color: var(--primary);
}

.np-size-row .np-size-unit {
    font-size: 10px;
    color: var(--text-secondary);
}

.np-size-actions {
    display: flex;
    gap: 6px;
}

.np-size-actions .btn {
    flex: 1;
    font-size: 10px;
    padding: 4px 6px;
}

/* 标定模式提示 */
.np-calibration-hint {
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius);
    text-align: center;
}

.np-calibration-hint p {
    font-size: 12px;
    color: var(--text);
    margin-bottom: 8px;
}

.np-calibration-hint .step {
    font-weight: 600;
    color: #f59e0b;
}

.np-calibration-hint input {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    width: 80px;
    margin-right: 8px;
}

/* 测距结果面板 */
.np-measure-result {
    padding: 12px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius);
    text-align: center;
}

.np-measure-result .distance {
    font-size: 24px;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 8px;
}

.np-measure-result .boundaries {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    font-size: 11px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(16, 185, 129, 0.3);
}

.np-measure-result .boundaries span {
    color: var(--text-secondary);
}

/* 响应式 */
@media (max-width: 1200px) {
    .np-layout {
        grid-template-columns: 220px 1fr 220px;
    }
}

@media (max-width: 900px) {
    .np-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 400px auto;
        height: auto;
    }
    
    .np-sidebar {
        order: 1;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .np-sidebar .np-section {
        flex: 1;
        min-width: 200px;
    }
    
    .np-main {
        order: 2;
    }
    
    .np-cable-panel {
        order: 3;
    }
}

/* ==========================================
   进制转换工具样式
   ========================================== */
.radix-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.radix-result-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.radix-result-item label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.radix-value-row {
    display: flex;
    gap: var(--space-xs);
}

.radix-value-row .form-input {
    flex: 1;
    font-family: var(--font-mono);
}

.radix-value-row .btn-copy {
    flex-shrink: 0;
}

.radix-custom-section {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

.radix-custom-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

/* 输入错误状态 */
.form-input.error {
    border-color: var(--error) !important;
    background: rgba(239, 68, 68, 0.1);
}

.input-error {
    font-size: 0.8rem;
    color: var(--error);
    margin-top: var(--space-xs);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.input-error::before {
    content: '⚠';
}

@media (max-width: 600px) {
    .radix-results-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   长度单位换算工具样式
   ========================================== */
.length-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.length-category {
    background: var(--bg-overlay);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}

.length-category h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-400);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.length-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.length-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs) 0;
}

.length-item .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.length-item .value {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: right;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .length-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .length-results-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   SQL工具样式
   ========================================== */
#sql-input,
#sql-output,
#sql-gen-output {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
}

#sql-output,
#sql-gen-output {
    background: var(--bg-overlay);
}

/* SQL标签页 */
.sql-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-sm);
}

.sql-tab {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.sql-tab:hover {
    color: var(--text-primary);
    background: var(--bg-overlay);
}

.sql-tab.active {
    color: var(--primary-400);
    background: var(--bg-overlay);
    border-color: var(--border-subtle);
    border-bottom-color: var(--bg-overlay);
}

/* SQL字段列表 */
.sql-fields-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.sql-fields-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    max-height: 300px;
    overflow-y: auto;
    padding: var(--space-sm);
    background: var(--bg-overlay);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.sql-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: var(--space-sm);
    align-items: center;
    padding: var(--space-xs);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.sql-field-row.simple {
    grid-template-columns: 1fr auto;
}

.sql-field-row.with-value {
    grid-template-columns: 1fr 1fr auto;
}

.sql-field-row.create-mode {
    grid-template-columns: 1fr 120px 80px 80px auto;
}

.sql-field-row input,
.sql-field-row select {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.85rem;
}

.sql-field-row .btn-icon {
    padding: var(--space-xs);
    min-width: auto;
}

.sql-fields-tip {
    margin-top: var(--space-sm);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* WHERE条件列表 */
.sql-where-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-sm);
    background: var(--bg-overlay);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.sql-where-row {
    display: grid;
    grid-template-columns: 80px 1fr 100px 1fr auto;
    gap: var(--space-sm);
    align-items: center;
    padding: var(--space-xs);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.sql-where-row:first-child {
    grid-template-columns: 1fr 100px 1fr auto;
}

.sql-where-row input,
.sql-where-row select {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.85rem;
}

.sql-where-row .btn-icon {
    padding: var(--space-xs);
    min-width: auto;
}

/* SQL结果标签页 */
.sql-result-tabs {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-sm);
}

.sql-result-tab {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.sql-result-tab:hover {
    color: var(--text-primary);
    background: var(--bg-overlay);
}

.sql-result-tab.active {
    color: var(--primary-400);
    background: var(--bg-overlay);
    border-color: var(--primary-400);
}

.sql-result-panel {
    margin-bottom: var(--space-sm);
}

.result-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: normal;
}

#sql-gen-output-formatted,
#sql-gen-output-minified {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.5;
    background: var(--bg-overlay);
}

#sql-gen-output-minified {
    white-space: nowrap;
    overflow-x: auto;
}

/* ==========================================
   JSON转义样式
   ========================================== */
#json-escape-input,
#json-escape-output {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.5;
}

.info-box {
    background: var(--bg-overlay);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.info-box strong {
    color: var(--text-primary);
}

/* ==========================================
   Base64工具补充样式
   ========================================== */
.file-info-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-overlay);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.file-info-box span:first-child {
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}

.file-info-box span:last-child {
    color: var(--text-secondary);
    margin-left: var(--space-md);
    flex-shrink: 0;
}

.result-actions {
    display: flex;
    gap: var(--space-sm);
}

#base64-preview {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-subtle);
}

#base64-preview label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

/* 键盘快捷键提示样式 */
.shortcut-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.shortcut-hint kbd {
    display: inline-block;
    padding: 0.1em 0.4em;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    background: var(--bg-overlay);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    box-shadow: 0 1px 0 var(--border-subtle);
}

/* ==========================================
   Base64编解码工具样式
   ========================================== */
.file-drop-zone {
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-overlay);
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--primary-400);
    background: rgba(59, 130, 246, 0.05);
}

.file-drop-zone svg {
    width: 48px;
    height: 48px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.file-drop-zone p {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.file-drop-zone small {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.file-info-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: var(--bg-overlay);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
}

.file-info-card strong {
    color: var(--text-primary);
    word-break: break-all;
}

.file-info-card span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.base64-stats {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: var(--space-sm);
    padding: var(--space-sm);
    background: var(--bg-overlay);
    border-radius: var(--radius-sm);
}

.base64-image-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-overlay);
    border-radius: var(--radius-md);
    min-height: 100px;
}

.base64-image-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ===== 二维码解码样式 ===== */
.qr-decode-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-xxl);
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-lg);
    background: var(--bg-overlay);
    cursor: pointer;
    transition: all var(--transition-normal);
    min-height: 200px;
}

.qr-decode-dropzone:hover,
.qr-decode-dropzone.dragover {
    border-color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb), 0.05);
}

.qr-decode-dropzone p {
    margin: 0;
    color: var(--text-secondary);
}

.qr-decode-dropzone p.hint {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.qr-decode-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-lg);
    background: var(--bg-overlay);
    border-radius: var(--radius-lg);
    margin-top: var(--space-md);
}

.qr-decode-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.qr-decode-type {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--accent-primary);
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
}

.qr-decode-data {
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    word-break: break-all;
    white-space: pre-wrap;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.qr-decode-extra {
    margin-top: var(--space-md);
}

.qr-decode-extra .wifi-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.qr-decode-extra .wifi-info-item {
    padding: var(--space-md);
    background: var(--bg-overlay);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.qr-decode-extra .wifi-info-item label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xs);
}

.qr-decode-extra .wifi-info-item span {
    font-weight: 500;
    color: var(--text-primary);
}

.qr-decode-error {
    padding: var(--space-lg);
    background: rgba(var(--error-rgb), 0.1);
    border: 1px solid var(--error);
    border-radius: var(--radius-md);
    color: var(--error);
    text-align: center;
}

/* ===== 端口参考表格样式 ===== */
.port-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.port-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.port-table th,
.port-table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.port-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 1;
}

.port-table tbody tr:hover {
    background: var(--bg-overlay);
}

.port-table td:first-child {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--accent-primary);
}

.port-table td:nth-child(2) {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.port-table .port-category {
    display: inline-block;
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    font-size: 0.7rem;
    font-weight: 500;
    margin-left: var(--space-xs);
}

.port-table .port-category.web { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.port-table .port-category.mail { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.port-table .port-category.file { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.port-table .port-category.remote { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.port-table .port-category.database { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.port-table .port-category.other { background: rgba(107, 114, 128, 0.15); color: #6b7280; }

/* ===== IP子网划分结果样式 ===== */
.subnet-results {
    display: grid;
    gap: var(--space-md);
}

.subnet-item {
    padding: var(--space-md);
    background: var(--bg-overlay);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-sm) var(--space-lg);
    align-items: center;
}

.subnet-item .subnet-number {
    grid-row: span 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--accent-primary);
    color: white;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.subnet-item .subnet-network {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
}

.subnet-item .subnet-range {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.subnet-item .subnet-info {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.result-count {
    font-size: 0.85rem;
    font-weight: normal;
    color: var(--text-secondary);
    margin-left: var(--space-sm);
}

/* ===== 网络布局 v2.2 修复和优化 ===== */

/* 修复下拉框颜色问题 - 关键修复 */
.np-form-item select,
.np-prop-row select {
    padding: 6px 10px;
    background-color: var(--bg-base);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.np-form-item select:focus,
.np-prop-row select:focus {
    outline: none;
    border-color: var(--primary-500);
}

/* 下拉选项样式 - 暗色主题 */
.np-form-item select option,
.np-prop-row select option {
    background-color: #1a1f2e;
    color: #e2e8f0;
    padding: 8px;
}

.np-form-item select optgroup,
.np-prop-row select optgroup {
    background-color: #0f1419;
    color: #94a3b8;
    font-weight: 600;
}

/* 优化布局 - 增大画布区域 */
.np-layout {
    grid-template-columns: 240px 1fr 260px;
    gap: var(--space-md);
}

/* 侧边栏紧凑化 */
.np-sidebar .np-section,
.np-cable-panel .np-section {
    padding: var(--space-md);
}

.np-sidebar .np-section h4,
.np-cable-panel .np-section h4 {
    font-size: 0.85rem;
    margin-bottom: var(--space-sm);
}

/* 设备库更紧凑 */
.np-device-library {
    gap: 6px;
}

.np-device-item {
    padding: 8px 4px;
}

.np-device-item svg {
    width: 20px;
    height: 20px;
}

.np-device-item span {
    font-size: 0.65rem;
}

/* 工具栏优化 */
.np-toolbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
}

.np-toolbar .btn {
    font-size: 0.75rem;
    padding: 4px 8px;
}

.np-toolbar .btn svg {
    width: 14px;
    height: 14px;
}

.np-toggle-label {
    font-size: 0.75rem;
    white-space: nowrap;
}

.np-toolbar-hint {
    font-size: 0.7rem;
    white-space: nowrap;
}

/* 测距按钮激活状态 */
#np-measure.active {
    background: var(--primary-500);
    color: white;
    border-color: var(--primary-500);
}

/* 位置信息样式 */
.np-position-info {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    margin-top: var(--space-sm);
}

.np-pos-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-subtle);
}

.np-pos-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    padding: 3px 0;
    color: var(--text-secondary);
}

.np-pos-row span:last-child {
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.np-pos-center {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed var(--border-subtle);
}

/* 设备尺寸编辑 */
.np-device-size-edit {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    margin-top: var(--space-sm);
}

.np-device-size-edit .np-prop-row {
    padding: 4px 0;
}

.np-device-size-edit .np-prop-row label {
    min-width: 50px;
    font-size: 0.75rem;
}

.np-device-size-edit .np-prop-row input {
    max-width: 80px;
    padding: 3px 6px;
    font-size: 0.75rem;
}

/* 背景图控制区域 */
.np-bg-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.np-bg-opacity-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.np-bg-opacity-row label {
    min-width: 50px;
}

.np-bg-opacity-row input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: var(--bg-overlay);
    border-radius: 2px;
}

.np-bg-opacity-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--primary-500);
    border-radius: 50%;
    cursor: pointer;
}

.np-bg-opacity-row span {
    min-width: 35px;
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.np-bg-actions {
    display: flex;
    gap: 6px;
}

.np-bg-actions .btn {
    flex: 1;
    font-size: 0.7rem;
    padding: 4px 6px;
}

/* 按钮全宽样式 */
.btn-block {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

/* 导出按钮布局 */
.np-export-btns {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.np-export-btns .btn {
    flex: 1;
    font-size: 0.7rem;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.np-import-area {
    margin-top: 8px;
}

.np-import-btn {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* 线缆状态颜色 */
.np-cable-status {
    padding: 8px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    margin: var(--space-sm) 0;
}

.np-status-warn {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.np-status-alert {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.np-status-error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* 线缆清单优化 */
.np-cable-items {
    max-height: 250px;
}

.np-cable-item {
    padding: 8px 10px;
}

.np-ci-head {
    font-size: 0.8rem;
}

.np-ci-route {
    font-size: 0.7rem;
}

.np-ci-info {
    font-size: 0.65rem;
}

.np-total {
    padding: 8px;
    text-align: center;
    font-size: 0.85rem;
    border-top: 1px solid var(--border-subtle);
    margin-top: 8px;
}

/* 属性面板按钮 */
.np-prop-section .btn {
    width: auto;
    margin-top: var(--space-sm);
}

.np-prop-section .btn-danger {
    margin-left: 0;
}

/* 响应式优化 */
@media (max-width: 1400px) {
    .np-layout {
        grid-template-columns: 220px 1fr 240px;
    }
}

@media (max-width: 1200px) {
    .np-layout {
        grid-template-columns: 200px 1fr 220px;
    }
    
    .np-toolbar {
        flex-wrap: wrap;
    }
    
    .np-toolbar-hint {
        display: none;
    }
}
