:root {
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --border: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #0ea5e9;
    --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.08);
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.astro-page {
    padding: clamp(1rem, 2vw, 2rem) 0 clamp(2rem, 4vw, 4rem);
}

.astro-hero {
    margin-bottom: clamp(1rem, 3vw, 2rem);
}

.astro-title {
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.astro-stats {
    display: flex;
    justify-content: flex-start;
    gap: 2rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.astro-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.astro-stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
}

.astro-stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.astro-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-muted);
    max-width: 960px;
    margin: 0;
    line-height: 1.6;
}

.astro-converter {
    background: var(--surface);
    border-radius: 1.5rem;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border);
}

.astro-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.astro-input-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 1rem;
    align-items: end;
}

@media (max-width: 768px) {
    .astro-input-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .astro-swap {
        justify-self: center;
    }
}

.astro-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.astro-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.astro-tip {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: none;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: help;
}

.astro-tip-text {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--text-main);
    color: #fff;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    z-index: 10;
}

.astro-tip:hover + .astro-tip-text,
.astro-tip:focus + .astro-tip-text {
    display: block;
}

.astro-input,
.astro-select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    background: var(--surface-muted);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.astro-input:focus,
.astro-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--surface);
}

.astro-select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20'%3E%3Cpath fill='%2364748b' d='M5.23 7.21a1 1 0 0 1 1.4-.18L10 9.58l3.37-2.55a1 1 0 1 1 1.22 1.58l-4 3a1 1 0 0 1-1.22 0l-4-3a1 1 0 0 1-.14-1.4Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.astro-swap {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    align-self: end;
    margin-bottom: 0.5rem;
}

.astro-swap:hover {
    background: rgba(37, 99, 235, 0.1);
    transform: rotate(180deg);
}

.astro-convert-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.astro-convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.astro-result {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2744 100%);
    color: #fff;
    border-radius: 1rem;
    padding: clamp(1.25rem, 2.5vw, 2rem);
    margin-top: 1.5rem;
}

.astro-result-main {
    margin-bottom: 0.75rem;
}

.astro-result-number {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.astro-result-number::after {
    content: attr(data-unit);
    font-size: 1rem;
    font-weight: 600;
    margin-left: 0.5rem;
    opacity: 0.75;
}

.astro-result-equation {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.astro-formula {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary);
}

.astro-formula-text {
    font-size: 0.9rem;
    margin: 0;
}

.astro-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.astro-action-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.astro-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.astro-action-btn[data-state="copied"] {
    background: rgba(34, 197, 94, 0.3);
    border-color: rgba(34, 197, 94, 0.5);
}

.astro-share {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0.75rem;
    padding: 1rem;
}

.astro-share-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.astro-share-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 0.5rem;
}

.astro-share-btn {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    transition: transform 0.2s;
}

.astro-share-btn:hover {
    transform: translateY(-2px);
}

.astro-share-x { background: #000; }
.astro-share-fb { background: #1877f2; }
.astro-share-li { background: #0a66c2; }
.astro-share-rd { background: #ff4500; }
.astro-share-tg { background: #229ed9; }
.astro-share-wa { background: #25d366; color: #000; }

.astro-breakdown {
    margin-top: 1.5rem;
    background: var(--surface-muted);
    border-radius: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.astro-breakdown-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.astro-breakdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(256px, 1fr));
    gap: 0.5rem;
}

.astro-breakdown-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.astro-breakdown-list li span:first-child {
    color: var(--text-muted);
}

.astro-breakdown-list li span:last-child {
    font-weight: 600;
    color: var(--text-main);
}

.astro-section {
    background: var(--surface);
    border-radius: 1.25rem;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    margin-top: clamp(2rem, 4vw, 3rem);
}

.astro-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.astro-section h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.astro-section p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.astro-section p:last-child {
    margin-bottom: 0;
}

.astro-formula-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.astro-formula-card {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(14, 165, 233, 0.08) 100%);
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.astro-formula-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.astro-formula-card code {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.astro-formula-card small {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.astro-callout {
    background: var(--surface-muted);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    border-left: 4px solid var(--primary);
}

.astro-callout-warning {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}

.astro-callout strong {
    color: var(--text-main);
}

.astro-use-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin: 1.25rem 0;
}

.astro-use-case {
    padding: 1.25rem;
    background: var(--surface-muted);
    border-radius: 0.75rem;
}

.astro-use-case h3 {
    margin-bottom: 0.5rem;
}

.astro-use-case p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.astro-tips {
    border-left: 4px solid #f59e0b;
}

.astro-trust {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-muted) 100%);
}

.astro-section h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

@media (max-width: 576px) {
    .astro-converter {
        padding: 1.25rem;
        border-radius: 1rem;
    }
    
    .astro-result {
        border-radius: 0.75rem;
    }
    
    .astro-stats {
        gap: 1rem;
    }
    
    .astro-section {
        padding: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
