/* Code Diff 工具样式 */
.code-diff-section {
    padding: 60px 0;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-title {
    font-size: 2.2rem;
    margin-bottom: 15px;
    color: #333;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.page-title i {
    color: #667eea;
}

.page-subtitle {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* 工作区 */
.workspace {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
}

/* 语言选择器 */
.language-selector {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-selector label {
    font-weight: 600;
    color: #333;
}

.language-select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.language-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 代码输入区 */
.code-inputs {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    min-height: 300px;
}

.code-panel {
    flex: 1;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.panel-header {
    background: #e9ecef;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.panel-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

.file-input {
    display: none;
}

.code-editor {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: none;
    resize: vertical;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    background: #f8f9fa;
    color: #333;
}

.code-editor:focus {
    outline: none;
}

/* 分隔线 */
.divider {
    width: 2px;
    background: #e0e0e0;
    position: relative;
    cursor: col-resize;
}

.divider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 40px;
    background: #667eea;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.divider:hover .divider-handle {
    opacity: 1;
}

/* 操作按钮面板 */
.action-panel {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.primary-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.secondary-btn {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.secondary-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

/* 差异结果 */
.diff-result {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.result-header {
    background: #e9ecef;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.result-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.diff-stats {
    display: flex;
    gap: 20px;
}

.stat {
    font-size: 0.9rem;
    font-weight: 600;
}

.stat.added {
    color: #28a745;
}

.stat.modified {
    color: #ffc107;
}

.stat.deleted {
    color: #dc3545;
}

.diff-content {
    padding: 20px;
    min-height: 200px;
    background: white;
    max-height: 500px;
    overflow-y: auto;
}

.empty-message {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 40px 0;
}

/* 差异容器 */
.diff-container {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.diff-line {
    display: flex;
    min-height: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.line-number {
    width: 60px;
    padding: 0 10px;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    text-align: right;
    color: #999;
    font-size: 0.8rem;
    user-select: none;
}

.line-content {
    flex: 1;
    padding: 0 10px;
}

.diff-line.added {
    background: rgba(40, 167, 69, 0.1);
}

.diff-line.deleted {
    background: rgba(220, 53, 69, 0.1);
}

.diff-line.modified {
    background: rgba(255, 193, 7, 0.1);
}

.modified-content {
    flex: 1;
    padding: 0 10px;
}

.modified-content .original {
    color: #dc3545;
    text-decoration: line-through;
    margin-bottom: 2px;
}

.modified-content .current {
    color: #28a745;
}

/* 功能说明区 */
.feature-section {
    margin-bottom: 40px;
}

.feature-section h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.feature-item i {
    color: #667eea;
    font-size: 1.2rem;
}

.feature-item span {
    color: #333;
    font-weight: 500;
}

/* FAQ部分 */
.faq-section {
    margin-bottom: 40px;
}

.faq-section h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
}

.faq-list {
    display: grid;
    gap: 15px;
}

.faq-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.faq-question {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.faq-answer {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

/* 案例说明 */
.case-section {
    margin-bottom: 40px;
}

.case-section h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
}

.case-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.case-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.case-title {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.case-description {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

/* 相关工具 */
.related-section {
    margin-bottom: 20px;
}

.related-section h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
}

.related-tools {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.tool-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tool-link:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #667eea;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    font-weight: 500;
}

.notification.show {
    transform: translateX(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .code-diff-section {
        padding: 40px 0;
    }

    .workspace {
        padding: 20px;
    }

    .code-inputs {
        flex-direction: column;
        gap: 15px;
    }

    .divider {
        display: none;
    }

    .action-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .primary-btn,
    .secondary-btn {
        justify-content: center;
    }

    .feature-list {
        grid-template-columns: 1fr;
    }

    .case-list {
        grid-template-columns: 1fr;
    }

    .related-tools {
        flex-direction: column;
    }

    .tool-link {
        justify-content: center;
    }

    .language-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .language-select {
        width: 100%;
    }
}

/* 深色主题适配 */
body.dark-theme .code-diff-section {
    background: #1a1a1a;
}

body.dark-theme .page-title {
    color: #fff;
}

body.dark-theme .page-subtitle {
    color: #aaa;
}

body.dark-theme .workspace {
    background: #2d2d2d;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body.dark-theme .language-selector label {
    color: #fff;
}

body.dark-theme .language-select {
    background: #333;
    border-color: #444;
    color: #fff;
}

body.dark-theme .code-panel {
    background: #333;
    border-color: #444;
}

body.dark-theme .panel-header {
    background: #444;
    border-color: #555;
}

body.dark-theme .panel-header h3 {
    color: #fff;
}

body.dark-theme .action-btn {
    background: #444;
    border-color: #555;
    color: #ccc;
}

body.dark-theme .action-btn:hover {
    background: #555;
    border-color: #667eea;
    color: #667eea;
}

body.dark-theme .code-editor {
    background: #333;
    color: #fff;
}

body.dark-theme .divider {
    background: #444;
}

body.dark-theme .secondary-btn {
    background: #333;
    border-color: #444;
    color: #ccc;
}

body.dark-theme .secondary-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

body.dark-theme .diff-result {
    background: #333;
    border-color: #444;
}

body.dark-theme .result-header {
    background: #444;
    border-color: #555;
}

body.dark-theme .result-header h3 {
    color: #fff;
}

body.dark-theme .diff-content {
    background: #2d2d2d;
}

body.dark-theme .empty-message {
    color: #aaa;
}

body.dark-theme .diff-line {
    border-bottom-color: #444;
}

body.dark-theme .line-number {
    background: #333;
    border-right-color: #444;
    color: #888;
}

body.dark-theme .feature-section h3,
body.dark-theme .faq-section h3,
body.dark-theme .case-section h3,
body.dark-theme .related-section h3 {
    color: #fff;
}

body.dark-theme .feature-item {
    background: #333;
    border-color: #444;
}

body.dark-theme .feature-item span {
    color: #ccc;
}

body.dark-theme .faq-item {
    background: #333;
    border-color: #444;
}

body.dark-theme .faq-question {
    color: #fff;
}

body.dark-theme .faq-answer {
    color: #aaa;
}

body.dark-theme .case-item {
    background: #2d2d2d;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-color: #444;
}

body.dark-theme .case-title {
    color: #fff;
}

body.dark-theme .case-description {
    color: #aaa;
}

body.dark-theme .tool-link {
    background: #333;
    border-color: #444;
    color: #ccc;
}

body.dark-theme .tool-link:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}