* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --success: #48bb78;
    --danger: #f56565;
    --bg: #f7fafc;
    --card-bg: #ffffff;
    --text: #2d3748;
    --text-light: #718096;
    --border: #e2e8f0;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a202c;
        --card-bg: #2d3748;
        --text: #f7fafc;
        --text-light: #a0aec0;
        --border: #4a5568;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', sans-serif;
    background: var(--bg);
    color: var(--text);
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.input-section {
    margin-bottom: 30px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    background: var(--card-bg);
    color: var(--text);
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

button {
    margin-top: 12px;
    width: 100%;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: var(--primary-dark);
}

button:active {
    transform: translateY(1px);
}

.result {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--primary);
}

.info-group {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.info-group h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text-light);
    font-weight: 600;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row.binary {
    flex-direction: column;
}

.info-row.binary .value {
    margin-top: 8px;
    font-size: 0.85rem;
    word-break: break-all;
}

.label {
    font-weight: 500;
    color: var(--text-light);
}

.value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--text);
}

.error {
    padding: 16px;
    background: #fff5f5;
    border: 2px solid var(--danger);
    border-radius: 8px;
    color: var(--danger);
    font-weight: 500;
}

.hidden {
    display: none;
}

@media (max-width: 640px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .info-row {
        flex-direction: column;
        gap: 4px;
    }

    .value {
        font-size: 0.9rem;
    }
}
