/* 单位转换器工具样式 */
.unit-converter-tool {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* 统计信息样式 */
.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.stat-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #495057;
    display: block;
}

.stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* 转换器界面样式 */
.converter-interface {
    background: #ffffff;
}

/* 转换结果详情 */
.conversion-details {
    margin-top: 1rem;
}

.conversion-details .alert {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 常用转换样式 */
.quick-conversions {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.quick-conversions h6 {
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
}

.quick-conversion-btn {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
    text-align: center;
}

.quick-conversion-btn:hover {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.quick-conversion-btn.active {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

/* 批量转换样式 */
.batch-results {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.batch-results h6 {
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
}

.batch-results .table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.batch-results .table th {
    background: #495057;
    color: white;
    border: none;
    font-weight: 600;
}

.batch-results .table td {
    vertical-align: middle;
    border-color: #e9ecef;
}

/* 历史记录样式 */
.history-container {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.history-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-conversion {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.history-from {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
}

.history-to {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0d6efd;
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
}

.history-type {
    font-size: 0.75rem;
    color: #6c757d;
    background: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    text-align: center;
    margin-left: 0.5rem;
}

.history-time {
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.history-item:hover .history-actions {
    opacity: 1;
}

.history-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.history-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.history-btn.delete:hover {
    background: #dc3545;
    color: white;
}

/* 收藏样式 */
.favorites-container {
    max-height: 300px;
    overflow-y: auto;
}

.favorite-item {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.favorite-item:hover {
    background: #ffeaa7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 234, 167, 0.5);
}

.favorite-item:last-child {
    margin-bottom: 0;
}

.favorite-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.favorite-conversion {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.favorite-from {
    font-size: 0.875rem;
    color: #856404;
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
}

.favorite-to {
    font-size: 1rem;
    font-weight: 700;
    color: #856404;
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
}

.favorite-type {
    font-size: 0.75rem;
    color: #856404;
    background: #ffeaa7;
    padding: 0.125rem 0.375rem;
    border-radius: 12px;
    text-align: center;
    margin-left: 0.5rem;
}

.favorite-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.favorite-item:hover .favorite-actions {
    opacity: 1;
}

.favorite-btn {
    background: none;
    border: none;
    color: #856404;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.favorite-btn:hover {
    background: #ffeaa7;
    color: #856404;
}

.favorite-btn.delete:hover {
    background: #dc3545;
    color: white;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.empty-state h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
}

.empty-state p {
    font-size: 0.875rem;
    margin: 0;
}

/* 输入框样式增强 */
.form-control-lg {
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 1.125rem;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control-lg:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* 按钮样式增强 */
.btn {
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-outline-primary:hover {
    background: #0d6efd;
    border-color: #0d6efd;
}

.btn-lg {
    font-size: 1.125rem;
    padding: 0.75rem 1.5rem;
}

/* 卡片样式增强 */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-header {
    border-radius: 16px 16px 0 0 !important;
    border: none;
    font-weight: 700;
    padding: 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .converter-interface .row {
        gap: 1rem;
    }

    .converter-interface .col-md-2 {
        text-align: center;
    }

    .converter-interface .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .quick-conversions .row {
        gap: 0.5rem;
    }

    .history-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .history-actions {
        opacity: 1;
        margin-top: 0.5rem;
    }

    .favorite-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .favorite-actions {
        opacity: 1;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .stat-value {
        font-size: 1.25rem;
    }

    .form-control-lg {
        font-size: 1rem;
    }

    .btn-lg {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .quick-conversion-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }

    .history-from,
    .history-to {
        font-size: 0.875rem;
    }

    .favorite-from,
    .favorite-to {
        font-size: 0.75rem;
    }
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
    .unit-converter-tool {
        background: #1a1a1a;
        color: #e9ecef;
    }

    .stat-item {
        background: #2d3748;
        border-color: #4a5568;
    }

    .stat-item:hover {
        background: #4a5568;
    }

    .stat-value {
        color: #e9ecef;
    }

    .stat-label {
        color: #a0aec0;
    }

    .card {
        background: #2d3748;
        color: #e9ecef;
    }

    .card-header {
        background: #4a5568 !important;
        color: #e9ecef;
    }

    .quick-conversions {
        background: #4a5568;
        border-color: #718096;
    }

    .quick-conversions h6 {
        color: #e9ecef;
    }

    .quick-conversion-btn {
        background: #718096;
        color: #e9ecef;
        border-color: #718096;
    }

    .quick-conversion-btn:hover {
        background: #0d6efd;
        color: white;
        border-color: #0d6efd;
    }

    .batch-results {
        background: #4a5568;
        border-color: #718096;
    }

    .batch-results h6 {
        color: #e9ecef;
    }

    .batch-results .table {
        background: #718096;
        color: #e9ecef;
    }

    .batch-results .table th {
        background: #2d3748;
    }

    .batch-results .table td {
        border-color: #4a5568;
    }

    .history-item {
        background: #4a5568;
        border-color: #718096;
    }

    .history-item:hover {
        background: #718096;
    }

    .history-from {
        color: #e9ecef;
    }

    .history-to {
        color: #90cdf4;
    }

    .history-type {
        background: #718096;
        color: #a0aec0;
    }

    .history-time {
        color: #a0aec0;
    }

    .history-btn:hover {
        background: #718096;
        color: #e9ecef;
    }

    .favorite-item {
        background: #744210;
        border-color: #975a16;
    }

    .favorite-item:hover {
        background: #975a16;
    }

    .favorite-from,
    .favorite-to {
        color: #f7d59c;
    }

    .favorite-type {
        background: #975a16;
        color: #f7d59c;
    }

    .favorite-btn:hover {
        background: #975a16;
        color: #f7d59c;
    }

    .empty-state h6 {
        color: #e9ecef;
    }

    .form-control-lg,
    .form-select {
        background: #4a5568;
        color: #e9ecef;
        border-color: #718096;
    }

    .form-control-lg:focus,
    .form-select:focus {
        background: #2d3748;
        border-color: #0d6efd;
        color: #e9ecef;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }

    .btn {
        border: 2px solid #000;
        font-weight: 700;
    }

    .form-control-lg,
    .form-select {
        border: 2px solid #000;
    }

    .stat-item,
    .history-item,
    .favorite-item {
        border: 2px solid #000;
    }
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 打印样式 */
@media print {
    .card-header,
    .history-actions,
    .favorite-actions {
        display: none !important;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }

    .batch-results .table {
        break-inside: auto;
    }

    .history-item,
    .favorite-item {
        break-inside: avoid;
    }
}