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

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

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

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.description {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
}

.mobile-tips {
    font-size: 0.9rem;
    opacity: 0.8;
    max-width: 600px;
    margin: 10px auto 0;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.main-container {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.input-section,
.output-section {
    flex: 1;
    min-width: 300px;
}

.input-card,
.output-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.input-card h2,
.output-header h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 20px;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.output-info {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 600;
}

.input-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

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

.file-upload-area {
    border: 3px dashed #e1e5e9;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
}

.file-upload-area:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.file-upload-area.drag-over {
    border-color: #667eea;
    background: #e8edff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 8px;
    font-weight: 600;
}

.upload-hint {
    font-size: 0.9rem;
    color: #6c757d;
}

.file-name {
    display: block;
    margin-top: 15px;
    color: #667eea;
    font-weight: 600;
    font-size: 0.95rem;
}

.paste-input {
    width: 100%;
    min-height: 400px;
    height: 400px;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: border-color 0.3s;
}

.paste-input:focus {
    outline: none;
    border-color: #667eea;
}

.format-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.format-group {
    display: flex;
    gap: 20px;
}

.separator-options {
    display: flex;
    gap: 20px;
    padding-top: 15px;
    border-top: 1px solid #e1e5e9;
}

.format-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #555;
    transition: color 0.3s;
}

.format-option:hover {
    color: #667eea;
}

.format-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.format-option input[type="radio"]:checked + span {
    color: #667eea;
}

.output-text {
    width: 100%;
    min-height: 400px;
    height: 400px;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    resize: vertical;
    background: #f8f9fa;
    color: #333;
}

.output-text:focus {
    outline: none;
    border-color: #667eea;
}

.output-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

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

.btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

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

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

.explanation {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.explanation h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 1.8rem;
}

.explanation-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.explanation-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.explanation-item h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.explanation-item p {
    color: #666;
    line-height: 1.6;
}

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

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

.notification.success {
    background: #4ECDC4;
    color: white;
}

.notification.error {
    background: #FF6B6B;
    color: white;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        max-width: 95%;
        padding: 15px;
    }
    
    .main-container {
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    .container {
        max-width: 98%;
        padding: 12px;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    .description {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .mobile-tips {
        font-size: 0.8rem;
        padding: 6px 12px;
        margin: 8px auto 0;
    }
    
    .main-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .input-section,
    .output-section {
        width: 100%;
    }
    
    .output-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .output-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .explanation-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .explanation {
        padding: 20px;
    }
    
    .explanation h2 {
        font-size: 1.6rem;
    }
    
    .explanation-item {
        padding: 15px;
    }
    
    .explanation-item h3 {
        font-size: 1.1rem;
    }
    
    .explanation-item p {
        font-size: 0.95rem;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        transform: translateY(-100%);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header {
        margin-bottom: 25px;
    }
    
    header h1 {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }
    
    .description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .input-card,
    .output-card {
        padding: 15px;
    }
    
    .input-card h2,
    .output-header h2 {
        font-size: 1.3rem;
    }
    
    .tab-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .paste-input,
    .output-text {
        min-height: 300px;
        height: 300px;
        font-size: 0.9rem;
    }
    
    .format-options {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    
    .format-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .separator-options {
        flex-direction: column;
        gap: 12px;
        padding-top: 12px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    .explanation {
        padding: 15px;
    }
    
    .explanation h2 {
        font-size: 1.4rem;
        margin-bottom: 20px;
    }
    
    .explanation-item {
        padding: 12px;
    }
    
    .explanation-item h3 {
        font-size: 1rem;
    }
    
    .explanation-item p {
        font-size: 0.9rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .tab-btn {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .file-upload-area {
        min-height: 200px;
        touch-action: manipulation;
    }
    
    .paste-input,
    .output-text {
        min-height: 250px;
        height: 250px;
        font-size: 16px;
    }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 600px) {
    header {
        margin-bottom: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }
    
    .description {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .main-container {
        margin-bottom: 20px;
    }
    
    .explanation {
        padding: 15px;
    }
    
    .explanation h2 {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }
}
