/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

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

/* 头部样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.language-switch {
    margin-top: 1rem;
    text-align: center;
}

.language-switch a {
    color: white;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.language-switch a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.language-switch a.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: bold;
    opacity: 1;
}

/* 主要内容样式 */
main {
    padding: 3rem 0;
}

.tool-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
    overflow: hidden;
}

/* 标签页样式 */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.tab-btn.active {
    color: #667eea;
    background: white;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #667eea;
}

/* 标签内容样式 */
.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* 输入输出区域样式 */
.input-section, .output-section {
    margin-bottom: 2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4a5568;
}

textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

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

textarea[readonly] {
    background-color: #f7fafc;
    color: #4a5568;
}

/* 按钮样式 */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

/* 状态显示样式 */
.status {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    display: none;
}

.status.success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
    display: block;
}

.status.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
    display: block;
}

.status.info {
    background: #bee3f8;
    color: #2a4365;
    border: 1px solid #90cdf4;
    display: block;
}

/* 验证结果样式 */
.validation-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
    display: none;
}

.validation-result.valid {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
    display: block;
}

.validation-result.invalid {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
    display: block;
}

/* 特性展示样式 */
.features {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 3rem 2rem;
    margin-bottom: 3rem;
}

.features h2 {
    text-align: center;
    color: #2d3748;
    margin-bottom: 2rem;
    font-size: 2rem;
}

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

.feature-item {
    text-align: center;
    padding: 1.5rem;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-item h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.feature-item p {
    color: #718096;
    line-height: 1.6;
}

/* 使用指南样式 */
.usage-guide {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 3rem 2rem;
    margin-bottom: 3rem;
}

.usage-guide h2 {
    color: #2d3748;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.guide-section {
    margin-bottom: 2rem;
}

.guide-section h3 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.guide-section ol {
    margin-left: 2rem;
    color: #718096;
}

.guide-section li {
    margin-bottom: 0.5rem;
}

.faq h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.faq p {
    color: #718096;
    margin-bottom: 1rem;
}

/* 页脚样式 */
footer {
    background: #2d3748;
    color: white;
    padding: 2rem 0;
    text-align: center;
}

footer p {
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header .subtitle {
        font-size: 1rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
        text-align: left;
    }
    
    .tab-content {
        padding: 1.5rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .features, .usage-guide {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 2rem 0;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    main {
        padding: 2rem 0;
    }
    
    textarea {
        font-size: 13px;
    }
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content.active {
    animation: fadeIn 0.3s ease-in-out;
}

/* 复制成功动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.btn.copied {
    animation: pulse 0.3s ease-in-out;
}

/* 聚焦样式优化 */
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* 滚动条样式 */
textarea::-webkit-scrollbar {
    width: 8px;
}

textarea::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 关于页面样式 */
.breadcrumb {
    margin: 2rem 0;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.content-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    margin-bottom: 3rem;
    line-height: 1.8;
}

.content-section h2 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    margin-top: 2rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.content-section h3 {
    color: #4a5568;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
    font-size: 1.2rem;
}

.content-section h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.content-section p {
    color: #718096;
    margin-bottom: 1rem;
}

.content-section ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.content-section li {
    color: #718096;
    margin-bottom: 0.5rem;
}

.content-section a {
    color: #667eea;
    text-decoration: none;
}

.content-section a:hover {
    text-decoration: underline;
}

.use-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.use-case {
    background: #f7fafc;
    border-radius: 10px;
    padding: 1.5rem;
    border-left: 4px solid #667eea;
}

.use-case h4 {
    color: #2d3748;
    margin-bottom: 1rem;
}

.use-case p {
    color: #718096;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .content-section {
        padding: 2rem 1rem;
    }
    
    .use-cases {
        grid-template-columns: 1fr;
    }
}

/* 教程页面样式 */
.code-example {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    border-left: 4px solid #667eea;
}

.code-example h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.code-example pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.4;
}

.code-example code {
    font-family: inherit;
    font-size: inherit;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.comparison-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.comparison-table tbody tr:hover {
    background: #f8f9fa;
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.practice-section {
    background: #e6f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    border-left: 4px solid #667eea;
}

.practice-section h2 {
    color: #2d3748;
    margin-bottom: 1rem;
}

.practice-section p {
    color: #4a5568;
    margin-bottom: 1rem;
}

.practice-section ol {
    color: #4a5568;
    margin-left: 2rem;
}

.practice-section li {
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .code-example pre {
        font-size: 12px;
        padding: 0.75rem;
    }
    
    .comparison-table {
        font-size: 14px;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .practice-section {
        padding: 1.5rem;
    }
} 