.compare-page {
    max-width: var(--medium-width);
    margin: 0 auto;
    padding: 20px;
}

.settings-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.select-group {
    flex: 0 0 auto;
}

.compare-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    background: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' 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 8px center;
    min-width: 140px;
}

.compare-select:focus {
    outline: none;
    border-color: #3b82f6;
}

.checkbox-group {
    display: flex;
    gap: 16px;
    margin-left: auto;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.input-section {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.input-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.panel-stats {
    font-size: 13px;
    color: #9ca3af;
}

.compare-textarea {
    flex: 1;
    min-height: 200px;
    padding: 12px;
    border: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    background: white;
    transition: background-color 0.2s;
}

.compare-textarea:focus {
    outline: none;
    background: #fafafa;
}

.compare-textarea::placeholder {
    color: #9ca3af;
}

.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    justify-content: flex-end;
    width: 100%;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon {
    font-size: 14px;
}

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

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #f1f5f9;
    color: #374151;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.summary-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 16px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.summary-dot.added {
    background: #22c55e;
}

.summary-dot.removed {
    background: #ef4444;
}

.summary-dot.modified {
    background: #f59e0b;
}

.summary-label {
    font-size: 13px;
    color: #6b7280;
}

.summary-value {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.summary-item.similarity {
    margin-left: auto;
}

.summary-item.similarity .summary-value {
    color: #3b82f6;
}

.result-section {
    display: none;
    gap: 16px;
}

.result-panel {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.result-panel-header {
    padding: 10px 14px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.result-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.result-content {
    max-height: 300px;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.result-content > div {
    display: flex;
    min-height: 28px;
}

.line-number {
    width: 45px;
    padding: 6px 10px;
    text-align: right;
    background: #f3f4f6;
    color: #9ca3af;
    font-size: 12px;
    font-family: 'Monaco', 'Menlo', monospace;
    border-right: 1px solid #e5e7eb;
    user-select: none;
    flex-shrink: 0;
}

.line-content {
    flex: 1;
    padding: 6px 10px;
    white-space: pre-wrap;
    word-break: break-all;
}

.line-removed {
    background: #fee2e2;
}

.line-removed .line-content {
    color: #dc2626;
}

.line-added {
    background: #dcfce7;
}

.line-added .line-content {
    color: #16a34a;
}

.line-modified-left {
    background: #fef3c7;
}

.line-modified-left .line-content {
    color: #b45309;
}

.line-modified-right {
    background: #dcfce7;
}

.line-modified-right .line-content {
    color: #16a34a;
}

.line-equal {
    background: white;
}

.line-empty {
    background: #f9fafb;
}

.line-empty .line-content {
    opacity: 0;
}

.char-removed {
    background: #fecaca;
    border-radius: 2px;
    padding: 0 2px;
}

.char-added {
    background: #bbf7d0;
    border-radius: 2px;
    padding: 0 2px;
}

.unified-panel {
    width: 100%;
}

.unified-row {
    padding-left: 10px;
    border-left: 3px solid transparent;
}

.line-removed.unified-row {
    border-left-color: #ef4444;
}

.line-added.unified-row {
    border-left-color: #22c55e;
}

@media (max-width: 768px) {
    .toolbar {
        flex-wrap: wrap;
    }

    .settings-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .checkbox-group {
        margin-left: 0;
        margin-top: 8px;
    }

    .input-section {
        flex-direction: column;
    }

    .result-section {
        flex-direction: column;
    }

    .line-number {
        width: 40px;
        padding: 4px 8px;
    }
}