* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: #f0f2f5;
    min-height: 100vh;
    padding: 90px 20px 20px 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 20px 20px;
}


.main-header {
    background: white;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 15px 0;

    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.header-title {
    flex: 1;
}


.main-header h1 {
    margin-bottom: 5px;
    font-size: 1.8rem;
    color: #1a1a1a;
}

.main-header .subtitle {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
}


.header-image {
    margin-left: 30px;
    display: flex;
    align-items: center;
}

#headerLogo {
    height: 50px;
    width: auto;
    border-radius: 4px;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

#headerLogo:hover {
    opacity: 1;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); 
}

.card-title {
    font-size: 1.6rem;
    color: #1a1a1a;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eaeaea;
}

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 25px;
    transition: all 0.2s ease;
    cursor: pointer;
    background-color: #fafafa;
}

.upload-area:hover, .upload-area.dragover {
    border-color: #4a6fa5;
    background-color: #f0f4f8;
}

.upload-icon {
    font-size: 3rem;
    color: #666;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 10px;
    font-weight: 500;
}

.upload-note {
    color: #888;
    font-size: 0.85rem;
}

.preview-container {
    margin: 20px 0;
    text-align: center;
}

.preview-title {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 12px;
    text-align: left;
    font-weight: 600;
}

.image-preview {
    max-width: 100%;
    max-height: 250px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin: 0 auto;
    display: block;
    border: 1px solid #eee;
}

.text-area {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 1px solid #d1d1d1;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 20px;
    background-color: #fcfcfc;
    color: #333;
}

.text-area:focus {
    outline: none;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.btn {
    padding: 11px 22px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 160px;
}

.btn-primary {
    background-color: #4a6fa5;
    color: white;
}

.btn-primary:hover {
    background-color: #4a6fa5;
}

.btn-success {
    background-color: #2a7a5f;
    color: white;
}

.btn-success:hover {
    background-color: #2a7a5f;
}

.btn-secondary {
    background-color: #c53241;
    color: white;
}

.btn-secondary:hover {
    background-color: #c1303f; 
}

.btn-icon {
    font-size: 1rem;
}

.status-message {
    padding: 12px 20px;
    border-radius: 6px;
    margin-top: 20px;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 10px;
    border-left-width: 3px;
}

.status-success {
    background-color: #edf7f0;
    color: #0d5c3d;
    border-left-color: #2a7a5f;
}

.status-error {
    background-color: #fdf0f0;
    color: #8a1a1a;
    border-left-color: #c33;
}

.status-info {
    background-color: #f0f7fb;
    color: #2c5a7a;
    border-left-color: #4a6fa5;
}

.instructions {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
    margin-top: 40px;
}

.instructions h3 {
    color: #1a1a1a;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions ul {
    padding-left: 20px;
    line-height: 1.8;
}

.instructions li {
    margin-bottom: 8px;
    color: #555;
}

.file-input {
    display: none;
}

.encoding-info {
    font-size: 0.85rem;
    color: #666;
    margin-top: 10px;
    text-align: center;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    .header-image {
        margin: 15px 0 0 0;
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.modal-content {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}

.modal-caption {
    margin-top: 15px;
    color: #f1f1f1;
    text-align: center;
    font-size: 0.9rem;
    padding: 0 20px;
    max-width: 80%;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.modal-close:hover {
    color: #bbb;
}

.legal-terms h3 {
    color: #1a1a1a;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    align-items: center;
    gap: 10px;
}

.legal-terms h4 {
    color: #2c3e50;
    margin: 25px 0 10px 0;
    font-size: 1.1rem;
}

.terms-content {
    line-height: 1.7;
    font-size: 0.95rem;
}

.terms-content p {
    margin-bottom: 15px;
}

.terms-content ul {
    padding-left: 25px;
    margin-top: 8px;
    margin-bottom: 15px;
}

.terms-content li {
    margin-bottom: 8px;
    color: #555;
}