/* ===== 基础样式重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: #333;
}

/* ===== 主容器 ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== 头部样式 ===== */
.header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* ===== 主要内容区域 ===== */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    flex: 1;
    margin-bottom: 30px;
}

/* ===== 通用区域样式 ===== */
.input-section,
.output-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    height: 600px;
    min-width: 0;
    overflow: hidden;
}

/* ===== 区域头部 ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1e293b;
}

.char-count {
    font-size: 0.9rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
}

/* ===== 输入区域样式 ===== */
.input-container {
    flex: 1;
    margin-bottom: 20px;
    min-height: 0;
}

#inputText {
    width: 100%;
    height: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 20px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    resize: none;
    outline: none;
    transition: all 0.3s ease;
    background: #fefefe;
    line-height: 1.6;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
}

#inputText:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#inputText::placeholder {
    color: #94a3b8;
    line-height: 1.6;
}

/* ===== 输出区域样式 ===== */
.output-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.output-text {
    width: 100%;
    height: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 20px;
    background: #fefefe;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: 'Inter', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

/* HR分割线样式美化 */
.output-text hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, #e2e8f0, #94a3b8, #e2e8f0);
    margin: 20px 0;
    border-radius: 1px;
    opacity: 0.8;
}

/* ===== 占位符样式 ===== */
.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #94a3b8;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.7;
}

.placeholder p {
    margin-bottom: 5px;
    font-weight: 500;
}

.placeholder-hint {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ===== 按钮样式 ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    outline: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

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

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== 按钮组样式 ===== */
.input-actions,
.output-actions {
    display: flex;
    gap: 12px;
}

.output-actions {
    margin-left: auto;
}

/* ===== 底部信息 ===== */
.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.footer h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.footer ul {
    list-style: none;
}

.footer li {
    margin-bottom: 8px;
    opacity: 0.9;
    position: relative;
    padding-left: 20px;
}

.footer li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

/* ===== 提示消息 ===== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1f2937;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    font-weight: 500;
    max-width: 350px;
}

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

.toast.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.toast.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .input-section,
    .output-section {
        height: 500px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .input-section,
    .output-section {
        padding: 20px;
        height: 400px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .output-actions {
        margin-left: 0;
    }
    
    .input-actions,
    .output-actions {
        flex-wrap: wrap;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .input-section,
    .output-section {
        height: 350px;
        padding: 15px;
    }
    
    #inputText,
    .output-text {
        padding: 15px;
    }
    
    .footer {
        padding: 20px;
    }
}

/* ===== 滚动条样式 ===== */
.output-text::-webkit-scrollbar,
#inputText::-webkit-scrollbar {
    width: 8px;
}

.output-text::-webkit-scrollbar-track,
#inputText::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.output-text::-webkit-scrollbar-thumb,
#inputText::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.output-text::-webkit-scrollbar-thumb:hover,
#inputText::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

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

.main-content > * {
    animation: fadeIn 0.6s ease-out;
}

.input-section {
    animation-delay: 0.1s;
}

.output-section {
    animation-delay: 0.2s;
} 