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

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.encoding-selector {
    margin-bottom: 20px;
    text-align: center;
}

.encoding-selector label {
    font-weight: bold;
    margin-right: 10px;
}

.encoding-selector select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

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

.header-buttons {
    display: flex;
    gap: 5px;
}

.sample-btn {
    padding: 5px 10px;
    background-color: #ff9800;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.sample-btn:hover {
    background-color: #f57c00;
}

.input-output-container {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 40px;
}

.middle-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 40px;
}

.middle-controls button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
}

#encode-btn {
    background-color: #4CAF50;
    color: white;
}

#encode-btn:hover {
    background-color: #45a049;
}

#decode-btn {
    background-color: #2196F3;
    color: white;
}

#decode-btn:hover {
    background-color: #0b7dda;
}

.input-section,
.output-section {
    flex: 1;
}

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

.section-header h2 {
    font-size: 16px;
    color: #666;
}

.clear-btn {
    padding: 5px 10px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.clear-btn:hover {
    background-color: #da190b;
}

.textarea-wrapper {
    position: relative;
    margin-bottom: 10px;
}

textarea {
    width: 100%;
    height: 300px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: break-word;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    background-color: #999;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.textarea-wrapper:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    background-color: #666;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #666;
}

.base64-info {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.base64-info h2 {
    color: #333;
    margin-bottom: 15px;
}

.base64-info h3 {
    color: #555;
    margin: 20px 0 10px;
}

.base64-info p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.base64-table {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    display: table;
    width: 100%;
    table-layout: fixed;
}

.table-row {
    display: table-row;
    border-bottom: 1px solid #ddd;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row span {
    display: table-cell;
    padding: 8px;
    text-align: center;
    border-right: 1px solid #ddd;
}

.table-row span:last-child {
    border-right: none;
}

.table-row.header {
    background-color: #f2f2f2;
    font-weight: bold;
}

.table-row:nth-child(even):not(.header) {
    background-color: #f9f9f9;
}

.table-row span:nth-child(1) {
    width: 20%;
}

.table-row span:nth-child(2) {
    width: 30%;
}

.table-row span:nth-child(3) {
    width: 50%;
}

@media (max-width: 768px) {
    .input-output-container {
        flex-direction: column;
    }
    
    .input-section,
    .output-section {
        width: 100%;
    }
    
    textarea {
        height: 200px;
    }
}

/* 复制成功提示 */
.copy-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.copy-success.show {
    opacity: 1;
    transform: translateY(0);
}