/* ── 单位换算通用样式 ── */

/* 输入区域 */
.unit-input-area {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.unit-input-group {
    flex: 1;
}

.unit-input-group label {
    display: block;
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.unit-input-group input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1.1rem;
    font-family: 'Fira Code', monospace;
    background: #fafafa;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.unit-input-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    background: white;
}

.unit-input-group select {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: #fafafa;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s;
    box-sizing: border-box;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23666' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.2rem;
}

.unit-input-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* 结果列表 */
.unit-results {
    margin-top: 1.5rem;
}

.unit-results-title {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.unit-result-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.unit-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    background: #f8f9fb;
    border: 1px solid #e8eaf0;
    border-radius: 6px;
    transition: border-color 0.2s;
}

.unit-result-item:hover {
    border-color: #2563eb;
}

.unit-result-item.active {
    border-color: #2563eb;
    background: #eef2ff;
}

.unit-result-name {
    font-size: 0.88rem;
    color: #666;
}

.unit-result-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    font-family: 'Fira Code', monospace;
    text-align: right;
    word-break: break-all;
}

.unit-result-symbol {
    font-size: 0.78rem;
    color: #999;
    margin-left: 0.3rem;
}

/* 换算表 */
.conv-table-wrap {
    max-width: 800px;
    margin: 0 auto;
}

.conv-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    font-size: 0.88rem;
}

.conv-table th {
    background: #f5f7fa;
    padding: 0.7rem 0.8rem;
    font-weight: 600;
    color: #333;
    text-align: left;
    border-bottom: 2px solid #e0e0e0;
}

.conv-table td {
    padding: 0.6rem 0.8rem;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
}

.conv-table tr:last-child td {
    border-bottom: none;
}

.conv-table td:first-child {
    font-weight: 500;
    color: #333;
}

/* 公式卡片 */
.formula-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto;
}

.formula-card {
    background: white;
    border: 1px solid #e8eaf0;
    border-radius: 8px;
    padding: 1.2rem;
    text-align: center;
}

.formula-card-title {
    font-size: 0.88rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.formula-card-expr {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2563eb;
    font-family: 'Fira Code', monospace;
}

/* Mobile */
@media (max-width: 640px) {
    .unit-input-area {
        flex-direction: column;
        align-items: stretch;
    }

    .unit-result-list {
        grid-template-columns: 1fr;
    }

    .formula-cards {
        grid-template-columns: 1fr;
    }

    .conv-table {
        font-size: 0.82rem;
    }
}
