/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: #333;
    margin: 0;
    padding: 0;
    background-color: #f9fafb;
}

.nav {
    margin-bottom: 0;
}

.nav-links {
    gap: 0;
}

.title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.icon {
    vertical-align: middle;
}

/* 转换器卡片 */
.converter-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.converter-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 1rem 0;
}

.converter-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.converter-input-wrapper {
    flex: 1;
    min-width: 0;
}

.converter-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #111827;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
}

.converter-input:focus {
    border-color: #4f46e5;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.converter-output-wrapper {
    flex: 1;
    min-width: 0;
}

.converter-output {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #111827;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-weight: 500;
    word-break: break-all;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
}

.converter-copy-btn {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.converter-copy-btn:hover {
    background-color: #e5e7eb;
    border-color: #d1d5db;
}

.converter-copy-btn:active {
    background-color: #d1d5db;
}

.converter-copy-btn svg {
    width: 16px;
    height: 16px;
}

/* 结果卡片 */
.result-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.result-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .result-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

.result-item {
    padding: 1rem;
    border-radius: 0.375rem;
}

.result-item.blue {
    background-color: rgba(59, 130, 246, 0.1);
}

.result-item.purple {
    background-color: rgba(124, 58, 237, 0.1);
}

.result-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    word-break: break-all;
}

/* 复制按钮样式 */
.copy-button {
    background-color: #f3f4f6;
    color: #4f46e5;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
}

.copy-button:hover {
    background-color: #e5e7eb;
}

.copy-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
}

/* 解释文字样式 */
.explanation-card {
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid #e5e7eb;
}

.explanation-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.explanation-content {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.6;
}

.explanation-section {
    margin-bottom: 1.5rem;
}

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

.explanation-section h3 {
    font-size: 1rem;
    font-weight: 500;
    color: #111827;
    margin-bottom: 0.5rem;
}

.explanation-section p {
    margin-bottom: 0.5rem;
}

.example-list {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.example-list li {
    margin-bottom: 0.25rem;
}

.example-list code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    color: #1f2937;
    font-size: 0.875rem;
}

.example-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.example-table th,
.example-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.example-table th {
    font-weight: 500;
    color: #374151;
    background-color: #f9fafb;
}

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

.example-table code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    color: #1f2937;
    font-size: 0.875rem;
}

/* 转换过程展示 */
.conversion-steps {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.conversion-steps:empty {
    display: none;
}

.steps-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
}

.steps-content {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.8;
}

.step-item {
    display: flex;
    align-items: center;
    padding: 3px 0;
    border-bottom: 1px solid #f3f4f6;
}

.step-item:last-child {
    border-bottom: none;
}

.step-symbol {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #4f46e5;
    min-width: 60px;
    text-align: center;
    padding: 3px 6px;
    background-color: #f3f4f6;
    border-radius: 0.25rem;
    margin-right: 0.75rem;
    font-size: 12px;
}

.step-arrow {
    color: #9ca3af;
    margin: 0 0.5rem;
    font-weight: 500;
}

.step-value {
    font-weight: 600;
    color: #111827;
    margin-left: 0.5rem;
    font-size: 12px;
}

.step-operation {
    color: #6b7280;
    font-size: 0.8125rem;
    margin-left: 0.5rem;
}

.step-total {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 2px solid #e5e7eb;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
}

.step-total-label {
    color: #6b7280;
    font-weight: 500;
}

.step-total-value {
    font-size: 1.125rem;
    color: #4f46e5;
}

.step-decomposition {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex: 1;
}

.step-decomposition-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background-color: #f3f4f6;
    border-radius: 0.25rem;
}

.step-decomposition-number {
    font-weight: 600;
    color: #111827;
    font-size: 12px;
}

.step-decomposition-arrow {
    color: #9ca3af;
    margin: 0 0.25rem;
}

.step-decomposition-roman {
    font-family: 'Courier New', monospace;
    color: #4f46e5;
    font-weight: 600;
    font-size: 12px;
    padding: 2px 6px;
    background-color: #eef2ff;
    border-radius: 0.25rem;
}

/* 工具类 */
.hidden {
    display: none;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .converter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .converter-input-wrapper,
    .converter-output-wrapper {
        width: 100%;
    }
    
    .converter-copy-btn {
        width: 100%;
        justify-content: center;
    }
    
    .step-item {
        flex-wrap: wrap;
    }
    
    .step-symbol {
        min-width: auto;
        margin-bottom: 0.25rem;
    }
}

