/* 主样式文件 */
body {
    background-color: #f8f9fa;
    color: #212529;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden; /* 防止水平滚动 */
    width: 100%;
    max-width: 100%;
}

html {
    overflow-x: hidden; /* 防止水平滚动 */
    width: 100%;
    max-width: 100%;
}

.container-fluid {
    max-width: 1400px;
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden; /* 防止水平滚动 */
    width: 100%;
    max-width: 100%;
}

/* 颜色预览区域 */
.color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(13, 110, 253, 0.5) rgba(0, 0, 0, 0.1);
}

.color-grid::-webkit-scrollbar {
    width: 6px;
}

.color-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.color-grid::-webkit-scrollbar-thumb {
    background-color: rgba(13, 110, 253, 0.5);
    border-radius: 10px;
}

.color-grid .color-item {
    aspect-ratio: 1;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    border: 1px solid rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.color-grid .color-item:hover {
    transform: scale(1.1);
}

.color-name {
    flex: 1;
    margin-right: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.color-block {
    width: 50px;
    height: 50px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

/* 颜色预览 */
.color-preview {
    width: 100%;
    height: 200px;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.1);
}

/* 配方信息 */
.recipe-info {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    border: 1px solid rgba(0,0,0,0.05);
}

/* 计算结果 */
.calculation-result {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    border: 1px solid rgba(0,0,0,0.05);
}

/* 表格样式 */
.table {
    margin-bottom: 0;
}

.table-responsive {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.table th {
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 1;
}

.table td {
    vertical-align: middle;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 8px;
        padding-right: 8px;
        max-width: 100%;
    }
    
    .card-body {
        padding: 0.5rem;
    }
    
    .color-grid {
        grid-template-columns: repeat(5, 1fr);
        max-height: 300px;
        gap: 0.4rem;
    }
    
    .color-block {
        width: 40px;
        height: 40px;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .color-preview {
        height: 150px;
    }
    
    .form-control {
        font-size: 14px;
    }
    
    .btn {
        font-size: 14px;
        padding: 0.375rem 0.75rem;
    }
    
    h5.card-title {
        font-size: 1rem;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 14px;
    }
}

/* 小屏幕手机 */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 4px;
        padding-right: 4px;
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }
    
    .row {
        margin-left: -4px;
        margin-right: -4px;
        max-width: 100%;
    }
    
    .col-md-4, .col-md-12 {
        padding-left: 4px;
        padding-right: 4px;
    }
    
    .color-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 2px;
        max-height: 250px;
        padding: 0.2rem;
    }
    
    .color-block {
        width: 35px;
        height: 35px;
    }
    
    .card-body {
        padding: 0.5rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .mb-4 {
        margin-bottom: 0.75rem !important;
    }
    
    .g-3 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }
    
    .g-4 {
        --bs-gutter-y: 0.5rem;
        --bs-gutter-x: 0.5rem;
    }
    
    /* 减少按钮内边距 */
    .btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.875rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-pane {
    animation: fadeIn 0.3s ease-out;
}

/* 辅助功能样式 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 高对比度模式 */
@media (forced-colors: active) {
    .card {
        border: 1px solid CanvasText;
    }
    
    .color-preview,
    .color-grid .color-item {
        border: 1px solid CanvasText;
    }
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 卡片样式 */
.card {
    border: none;
    transition: transform 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
}

.card-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
}

/* 表单样式 */
.form-control {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 按钮样式 */
.btn {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0a58ca 0%, #084298 100%);
    transform: translateY(-1px);
}

/* 模态框样式 */
.modal-content {
    border: none;
    border-radius: 0.5rem;
}

.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding: 1rem;
} 