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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Tabs */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

.tab-button {
    background: transparent;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 0.5rem 0.5rem 0 0;
    transition: all 0.2s;
    position: relative;
}

.tab-button:hover {
    background: var(--border);
    color: var(--text-primary);
}

.tab-button.active {
    color: var(--primary-color);
    background: var(--surface);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -0.6rem;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tool Section */
.tool-section {
    background: var(--surface);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.tool-section h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.info {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Input Group */
.input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.input-group input,
.input-group select {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-group button {
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.input-group button:hover {
    background: var(--primary-hover);
}

.input-group button:active {
    transform: scale(0.98);
}

.input-group button:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
}

/* Result Box */
.result-box {
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    min-height: 100px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
}

.result-box:empty {
    display: none;
}

.result-box .loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

.result-box .error {
    color: var(--error-color);
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 0.5rem;
    border-left: 4px solid var(--error-color);
}

.result-box .success {
    color: var(--success-color);
}

/* Result Cards */
.result-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.result-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.result-card .field {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.result-card .field:last-child {
    border-bottom: none;
}

.result-card .field-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 150px;
}

.result-card .field-value {
    color: var(--text-primary);
    word-break: break-all;
}

/* Table */
.result-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.result-table th,
.result-table td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.result-table th {
    background: var(--background);
    font-weight: 600;
    color: var(--text-primary);
}

.result-table tr:hover {
    background: var(--background);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.badge-info {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tab-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .tool-section {
        padding: 1.5rem;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group input,
    .input-group select,
    .input-group button {
        width: 100%;
    }

    .result-table {
        font-size: 0.85rem;
    }

    .result-card .field {
        flex-direction: column;
    }

    .result-card .field-label {
        margin-bottom: 0.25rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
