* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.page-header {
    background: #ffffff;
    border-bottom: 1px solid #e1e8ed;
    padding: 20px 0;
    margin-bottom: 30px;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    flex-shrink: 0;
}

.header-text h1 {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

.header-subtitle {
    font-size: 14px;
    color: #7f8c8d;
    margin: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.intro-section,
.usage-section,
.example-section,
.faq-section,
.tips-section {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

.intro-section h2,
.usage-section h2,
.example-section h2,
.faq-section h2,
.tips-section h2 {
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e8ed;
}

.intro-section p,
.usage-section p,
.example-section p,
.faq-section p,
.tips-section p {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.8;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.feature-list li {
    padding: 10px 0 10px 25px;
    position: relative;
    color: #555;
    line-height: 1.8;
}

.feature-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #4a90e2;
    font-weight: bold;
    font-size: 18px;
}

.usage-steps {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.step {
    padding: 20px;
    background: #f8f9fa;
    border-left: 4px solid #4a90e2;
    border-radius: 4px;
}

.step h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.step p {
    margin: 0;
    color: #555;
}

.example-box {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.example-box:last-child {
    margin-bottom: 0;
}

.example-box h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 15px 0;
}

.example-code {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.example-left,
.example-right {
    flex: 1;
}

.example-left strong,
.example-right strong {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 14px;
}

.example-left pre,
.example-right pre {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    padding: 12px;
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    color: #333;
}

.faq-item {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e1e8ed;
}

.faq-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.faq-item h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.faq-item p {
    margin: 0;
    color: #555;
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list li {
    padding: 12px 0 12px 25px;
    position: relative;
    color: #555;
    line-height: 1.8;
    border-bottom: 1px solid #f0f0f0;
}

.tips-list li:last-child {
    border-bottom: none;
}

.tips-list li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #4a90e2;
    font-weight: bold;
}

.page-footer {
    background: #ffffff;
    border-top: 1px solid #e1e8ed;
    padding: 30px 20px;
    text-align: center;
    margin-top: 40px;
}

.page-footer p {
    margin: 5px 0;
    color: #7f8c8d;
    font-size: 14px;
}

.footer-links {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e8ed;
}

.footer-links p {
    margin-bottom: 10px;
    color: #7f8c8d;
    font-size: 14px;
}

.footer-links a {
    display: inline-block;
    margin: 0 15px;
    color: #2196F3;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #1976D2;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .footer-links a {
        display: block;
        margin: 8px 0;
    }
}

.comparison-container {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    min-height: 500px;
    max-height: 70vh;
    height: 70vh;
}

.text-panel {
    flex: 1;
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    background: #f8f9fa;
    padding: 12px 16px;
    border-bottom: 1px solid #e1e8ed;
    font-weight: 600;
    color: #495057;
}

.panel-title {
    font-size: 14px;
}

.text-area-wrapper {
    display: flex;
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.line-numbers {
    background: #f8f9fa;
    border-right: 1px solid #e1e8ed;
    padding: 16px 8px;
    font-size: 14px;
    line-height: 1.8;
    color: #6c757d;
    text-align: right;
    user-select: none;
    min-width: 50px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    height: 100%;
}

.line-number {
    min-height: 1.8em;
    line-height: 1.8;
    padding-right: 8px;
    box-sizing: border-box;
}

.text-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    overflow-x: auto;
    white-space: normal;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.8;
    min-height: 0;
    outline: none;
    border: none;
    resize: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    /* 禁用拼写检查的下划线 */
    -webkit-text-decoration-skip-ink: none;
    text-decoration-skip-ink: none;
    height: 100%;
}

.toolbar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.tool-btn {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.tool-btn:hover {
    background: #357abd;
}

.file-upload-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    display: inline-block;
    text-align: center;
}

.file-upload-btn:hover {
    background: #5a6268;
}

.diff-added {
    background-color: #ffebee !important;
    border-left: 3px solid #f44336 !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    padding: 0 4px !important;
    margin-left: 0 !important;
    border-radius: 0 !important;
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    line-height: 1.8 !important;
    min-height: 1.8em !important;
    margin: 0 !important;
}

.diff-removed {
    background-color: #ffebee !important;
    border-left: 3px solid #f44336 !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    padding: 0 4px !important;
    margin-left: 0 !important;
    border-radius: 0 !important;
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    line-height: 1.8 !important;
    min-height: 1.8em !important;
    margin: 0 !important;
}

.diff-changed {
    background-color: #ffebee !important;
    border-left: 3px solid #f44336 !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    padding: 0 4px !important;
    margin-left: 0 !important;
    border-radius: 0 !important;
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    line-height: 1.8 !important;
    min-height: 1.8em !important;
    margin: 0 !important;
}

.line-wrapper {
    display: block;
    width: 100%;
    min-height: 1.8em;
    line-height: 1.8;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-size: 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
    /* 禁用拼写检查的下划线 */
    -webkit-text-decoration-skip-ink: none;
    text-decoration-skip-ink: none;
}

/* 隐藏浏览器拼写检查的波浪下划线 */
.line-wrapper[contenteditable="true"] {
    -webkit-text-decoration-skip-ink: none;
    text-decoration-skip-ink: none;
}

.line-wrapper[contenteditable="true"]::spelling-error {
    text-decoration: none !important;
}

.line-wrapper[contenteditable="true"]::grammar-error {
    text-decoration: none !important;
}

.text-content::-webkit-scrollbar,
.line-numbers::-webkit-scrollbar {
    width: 8px;
}

.text-content::-webkit-scrollbar-track,
.line-numbers::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.text-content::-webkit-scrollbar-thumb,
.line-numbers::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.text-content::-webkit-scrollbar-thumb:hover,
.line-numbers::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-text h1 {
        font-size: 24px;
    }
    
    .comparison-container {
        flex-direction: column;
        gap: 15px;
        max-height: none;
        height: auto;
        min-height: 400px;
    }
    
    .text-area-wrapper {
        min-height: 300px;
    }
    
    .intro-section,
    .usage-section,
    .example-section,
    .faq-section,
    .tips-section {
        padding: 20px;
    }
    
    .example-code {
        flex-direction: column;
    }
    
    .toolbar {
        flex-direction: column;
    }
    
    .tool-btn,
    .file-upload-btn {
        width: 100%;
    }
}
