:root {
    --font-family-primary: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-primary);
    background: #ffffff;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    color: #1d1d1f;
    line-height: var(--line-height-normal);
    font-weight: var(--font-weight-normal);
    letter-spacing: -0.022em;
    font-size: var(--font-size-base);
}

.container {
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
    background: transparent;
    border-radius: 0;
    padding: 2rem;
    box-shadow: none;
    border: none;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 1.5rem;
    position: relative;
    padding: 1rem 0 0.5rem 0;
}

header h1 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-semibold);
    color: #1d1d1f;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
    line-height: var(--line-height-tight);
}

header p {
    color: #86868b;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-normal);
    letter-spacing: 0.007em;
}

.calculator {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto auto;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

.input-section, .result-section, .profit-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
}

.input-section h2, .result-section h3, .profit-section h2, .profit-analysis-section h3 {
    color: #1d1d1f;
    margin-bottom: 1.25rem;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.022em;
    line-height: var(--line-height-tight);
    margin-top: 0;
}

.input-section {
    grid-column: 1;
    grid-row: 1;
}

.profit-section {
    grid-column: 3;
    grid-row: 1;
}

.result-section {
    grid-column: 2;
    grid-row: 1;
}

.calculation-process-section {
    grid-column: 1 / 5;
    grid-row: 2;
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}



#material-database {
    grid-column: 1 / 5;
    grid-row: 3;
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
}






.input-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #1d1d1f;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-base);
    letter-spacing: -0.022em;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-size: var(--font-size-base);
    background: #ffffff;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    color: #1d1d1f;
    font-family: var(--font-family-primary);
}

.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.input-group input[type="range"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    outline: none;
}

.input-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

.input-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.input-hint {
    display: block;
    margin-top: 0.5rem;
    color: #86868b;
    font-size: var(--font-size-sm);
    line-height: 1.4;
    font-weight: var(--font-weight-normal);
}

#infill-value, #failure-rate-value {
    display: inline-block;
    margin-left: 10px;
    font-weight: var(--font-weight-bold);
    color: #667eea;
}

#calculate-btn, #calculate-profit-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: #007aff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-family: var(--font-family-primary);
    letter-spacing: -0.022em;
}

#calculate-btn:hover, #calculate-profit-btn:hover {
    background: #0056cc;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.3);
}

#calculate-btn:active, #calculate-profit-btn:active {
    transform: translateY(0);
    background: #004499;
}

#calculate-btn.success, #calculate-profit-btn.success {
    background: #30d158;
    animation: pulse 0.4s ease-in-out;
}

#calculate-btn.error, #calculate-profit-btn.error {
    background: #ff3b30;
    animation: shake 0.5s ease-in-out;
}

#calculate-profit-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: #34c759;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: var(--font-size-lg);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-family: inherit;
    letter-spacing: -0.022em;
}

#calculate-profit-btn:hover {
    background: #28a745;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(52, 199, 89, 0.3);
}

#calculate-profit-btn:active {
    transform: translateY(0);
    background: #1e7e34;
}

#calculate-profit-btn.success {
    background: #30d158;
    animation: pulse 0.4s ease-in-out;
}

#calculate-profit-btn.error {
    background: #ff3b30;
    animation: shake 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.cost-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    order: 2;
}

#result-display {
    padding: 0;
    background: transparent;
    border-radius: 0;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-height: 60px;
    position: relative;
    overflow: hidden;
}

.cost-label {
    color: #495057;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-base);
    display: flex;
    align-items: center;
    gap: 8px;
}



.cost-value {
    color: #2196F3;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-lg);
    font-family: var(--font-family-mono);
    letter-spacing: 0.5px;
}

.cost-item.total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transform: scale(1.02);
}

.cost-item.total .cost-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: var(--font-weight-semibold);
}

.cost-item.total .cost-value {
    color: #ffffff;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.cost-item, .profit-item {
    animation: slideInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.cost-item:nth-child(1) {
    animation-delay: 0.1s;
}

.cost-item:nth-child(2) {
    animation-delay: 0.2s;
}

.cost-item:nth-child(3) {
    animation-delay: 0.3s;
}

.profit-item:nth-child(1) {
    animation-delay: 0.1s;
}

.profit-item:nth-child(2) {
    animation-delay: 0.2s;
}

.profit-item:nth-child(3) {
    animation-delay: 0.3s;
}

.profit-item:nth-child(4) {
    animation-delay: 0.4s;
}

.profit-item:nth-child(5) {
    animation-delay: 0.5s;
}

.profit-item:nth-child(6) {
    animation-delay: 0.6s;
}

.profit-item:nth-child(7) {
    animation-delay: 0.7s;
}

.profit-item:nth-child(8) {
    animation-delay: 0.8s;
}

.profit-item:nth-child(9) {
    animation-delay: 0.9s;
}

/* 利润分析样式 */
.profit-analysis-section {
    grid-column: 4;
    grid-row: 1;
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
}



#profit-display {
    padding: 0;
    background: transparent;
    border-radius: 0;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profit-breakdown {
    background: white;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.profit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    min-height: 60px;
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
}

.profit-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: rgba(52, 199, 89, 0.3);
}

.profit-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(135deg, #34c759, #28a745);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profit-item:hover::before {
    opacity: 1;
}

.profit-item.total {
    background: linear-gradient(135deg, #ff9500 0%, #ff6b35 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 149, 0, 0.3);
    transform: scale(1.02);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
    margin-bottom: 0;
}

.profit-item.total .profit-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: var(--font-weight-semibold);
}

.profit-item.total .profit-value {
    color: #ffffff;
    font-weight: var(--font-weight-bold);
}

.profit-item.total:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 149, 0, 0.4);
}

.profit-item.total::before {
    display: none;
}

.profit-item.profit {
    background: linear-gradient(135deg, #34c759 0%, #28a745 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(52, 199, 89, 0.3);
    transform: scale(1.02);
    font-weight: var(--font-weight-bold);
    font-size: 1.1em;
    margin-bottom: 0;
}

.profit-item.profit .profit-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: var(--font-weight-semibold);
}

.profit-item.profit .profit-value {
    color: #ffffff;
    font-weight: var(--font-weight-bold);
    font-size: 1.1em;
}

.profit-item.profit:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(52, 199, 89, 0.4);
}

.profit-item.profit::before {
    display: none;
}

.profit-label {
    color: #495057;
    font-weight: var(--font-weight-medium);
    display: flex;
    align-items: center;
    gap: 8px;
}



.profit-value {
    color: #28a745;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-lg);
    font-family: var(--font-family-mono);
    letter-spacing: 0.5px;
}





/* 建议和错误提示样式 */
.recommendations-section {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #17a2b8;
}

.recommendations-section h3 {
    margin-top: 0;
    color: #17a2b8;
    font-size: 1.1em;
    margin-bottom: 10px;
}

#recommendations-list {
    margin: 0;
    padding-left: 20px;
    list-style-type: none;
}

#recommendations-list li {
    padding: 5px 0;
    color: #495057;
    position: relative;
}

#recommendations-list li:before {
    content: "•";
    color: #17a2b8;
    font-weight: bold;
    position: absolute;
    left: -15px;
}

/* 错误状态样式 */
.error {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 成功状态样式 */
.success {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 计算过程样式 */
.calculation-process {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin: 15px 0;
    box-shadow: none;
    border: none;
}

.calculation-process h4 {
    margin-top: 0;
    color: #007bff;
    font-size: var(--font-size-base);
    margin-bottom: 20px;
}

.process-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.process-step {
    background: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    flex: 1;
    min-width: 200px;
    max-width: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

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

.process-step strong {
    color: #495057;
    display: block;
    margin-bottom: 6px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

.process-step ul {
    margin: 4px 0;
    padding-left: 12px;
}

.process-step li {
    margin: 2px 0;
    color: #6c757d;
    font-size: var(--font-size-xs);
    line-height: var(--line-height-tight);
}

.process-step p {
    margin: 2px 0;
    color: #6c757d;
    font-family: var(--font-family-mono);
    font-size: var(--font-size-xs);
    line-height: var(--line-height-tight);
}

.total-step {
    background: #e3f2fd;
    border-left-color: #2196F3;
    font-weight: bold;
}

.total-step strong {
    color: #1976D2;
}

.total-step p {
    color: #1976D2;
    font-weight: 600;
}

.cost-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border-color: rgba(102, 126, 234, 0.3);
}

.cost-item.total:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.cost-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cost-item:hover::before {
    opacity: 1;
}

.cost-item.total::before {
    display: none;
}

.cost-item.total {
    background: #007aff;
    color: white;
    border-color: #007aff;
    font-weight: 600;
}

.cost-item.total:hover {
    background: #0056cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.2);
}

.cost-label {
    color: #86868b;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.cost-item.total .cost-label {
    color: rgba(255, 255, 255, 0.9);
}

.cost-value {
    color: #1d1d1f;
    font-size: var(--font-size-xl);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.cost-item.total .cost-value {
    color: white;
    font-weight: 700;
}

/* 利润分析样式 */
.profit-section:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}



.profit-breakdown {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    order: 3;
}

.profit-breakdown h3 {
    color: #1d1d1f;
    margin-bottom: 1rem;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.022em;
    text-align: center;
}

.cost-item.profit {
    background: #34c759;
    color: white;
    border-color: #34c759;
    font-weight: 600;
}

.cost-item.profit:hover {
    background: #28a745;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.2);
}

.cost-item.profit .cost-label {
    color: rgba(255, 255, 255, 0.9);
}

.cost-item.profit .cost-value {
    color: white;
    font-weight: 700;
}





/* 计算过程样式 */
.calculation-process-section h2 {
    color: #1d1d1f;
    margin-bottom: 1.25rem;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    letter-spacing: -0.022em;
    line-height: var(--line-height-tight);
}

.calculation-steps {
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
    min-height: auto;
    box-shadow: none;
}

.calculation-steps p {
    color: #86868b;
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
    text-align: center;
}

.calculation-step {
    background: transparent;
    border-radius: 0;
    padding: 1rem 0;
    margin-bottom: 0.75rem;
    border: none;
    transition: all 0.2s ease;
}

.calculation-step:hover {
    background: transparent;
    transform: none;
}

.calculation-step:last-child {
    margin-bottom: 0;
}

.step-title {
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 0.5rem;
    font-size: var(--font-size-base);
}

.step-formula {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    background: #f0f0f0;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.step-result {
    color: #007aff;
    font-weight: 600;
    font-size: 0.9375rem;
}

/* 响应式布局 */
@media (max-width: 1200px) {
    .calculator {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto auto auto auto;
    }
    
    .input-section {
        grid-column: 1;
        grid-row: 1;
    }
    
    .result-section {
        grid-column: 2;
        grid-row: 1;
    }
    
    .profit-section {
        grid-column: 1;
        grid-row: 2;
    }
    
    .cost-analysis-section {
        grid-column: 2;
        grid-row: 2;
    }
    
    .calculation-process-section {
        grid-column: 1 / 3;
        grid-row: 3;
    }
    
    #material-database {
        grid-column: 1 / 3;
        grid-row: 4;
    }
    
    .cost-item, .profit-item {
        padding: 14px 16px;
        min-height: 50px;
    }
    
    .cost-label, .profit-label {
        font-size: var(--font-size-sm);
    }
    
    .cost-value, .profit-value {
        font-size: var(--font-size-base);
    }
}

@media (max-width: 1024px) {
    .calculator {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .input-section {
        grid-column: 1;
        grid-row: 1;
    }
    
    .profit-section {
        grid-column: 2;
        grid-row: 1;
    }
    
    .result-section {
        grid-column: 1 / 3;
        grid-row: 2;
    }
    
    .calculation-process-section {
        grid-column: 1 / 3;
        grid-row: 3;
    }
}

@media (max-width: 768px) {
    .calculator {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        padding: 10px;
        gap: 15px;
    }
    
    .input-section {
        grid-column: 1;
        grid-row: 1;
    }
    
    .profit-section {
        grid-column: 1;
        grid-row: 2;
    }
    
    .result-section {
        grid-column: 1;
        grid-row: 3;
    }
    
    .calculation-process-section {
        grid-column: 1;
        grid-row: 4;
    }
}

/* 推荐建议样式 */
.recommendations {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    display: none;
    order: 4;
}

.recommendations h3 {
    color: #1d1d1f;
    margin-bottom: 2rem;
    font-size: var(--font-size-2xl);
    font-weight: 600;
    text-align: center;
    letter-spacing: -0.022em;
}

.recommendations h4 {
    color: #1d1d1f;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: -0.022em;
}

.recommendations ul {
    list-style: none;
    padding: 0;
}

.recommendations li {
    background: #f6f6f6;
    margin-bottom: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    color: #1d1d1f;
    line-height: 1.47059;
    font-size: 0.9375rem;
    letter-spacing: -0.022em;
}

.recommendations li:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.recommendations li::before {
    content: '•';
    color: #007aff;
    margin-right: 0.75rem;
    font-weight: bold;
}

.material-database {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 25px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.material-database:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 80px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.3);
}

.material-database h2 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-semibold);
    position: relative;
    padding-bottom: 15px;
}

.material-database h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.material-grid {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-behavior: smooth;
}

.material-grid::-webkit-scrollbar {
    height: 8px;
}

.material-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.material-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

.material-grid::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.material-card {
    background: transparent;
    backdrop-filter: none;
    padding: 20px 0;
    border-radius: 0;
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    min-width: 250px;
    flex-shrink: 0;
}

.material-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.material-card:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.material-card:hover::before {
    transform: scaleX(1);
}

.material-card h3 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.01em;
}

.material-card p {
    color: #718096;
    margin-bottom: 15px;
    font-style: italic;
}

.material-card ul {
    list-style: none;
}

.material-card li {
    padding: 5px 0;
    color: #4a5568;
    position: relative;
    padding-left: 20px;
}

.material-card li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

/* 计算过程样式 */
.calculation-process-container {
    margin: 0.5rem 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 10;
}

.calculation-process h4 {
    color: #2c3e50;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid #3498db;
}



.process-step strong {
    color: #2c3e50;
    font-size: 1.05rem;
    display: block;
    margin-bottom: 0.4rem;
}

.process-step ul {
    margin: 0.3rem 0;
    padding-left: 1rem;
}

.process-step li {
    margin-bottom: 0.2rem;
    color: #34495e;
    font-size: 0.95rem;
    line-height: 1.3;
}

.process-step p {
    margin: 0.3rem 0;
    color: #34495e;
    font-size: 0.95rem;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.7);
    padding: 0.3rem;
    border-radius: 4px;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.total-step {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(39, 174, 96, 0.1));
    border-left-color: #27ae60;
    font-weight: 600;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.total-step strong {
    color: #27ae60;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.total-step p {
    background: rgba(46, 204, 113, 0.1);
    border-color: #27ae60;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.25rem;
    margin: 0.2rem 0;
}

/* 响应式布局 */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    
    .container {
        width: 98%;
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .calculator {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .input-section, .result-section {
        padding: 1.25rem;
    }
    
    .result-section {
        height: auto;
    }
    
    .material-database {
        padding: 15px;
    }
    
    .material-grid {
        grid-template-columns: 1fr;
    }
    
    .cost-breakdown {
        grid-template-columns: 1fr 1fr;
        order: 2;
    }
    

    
    .profit-breakdown {
        order: 3;
    }
    
    .recommendations {
        order: 4;
        padding: 1.25rem;
    }
    
    .calculation-process-container {
        margin: 0.5rem 0;
        padding: 0.75rem;
    }

    .process-grid {
        flex-direction: column;
        gap: 0.5rem;
    }

    .process-step {
        min-width: auto;
        max-width: none;
        min-height: auto;
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .cost-breakdown {
        grid-template-columns: 1fr;
    }
    
    .container {
        width: 100%;
        border-radius: 0;
    }
    
    body {
        padding: 0;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f6f6f6;
    border-radius: 50%;
    border-top-color: #007aff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 淡入效果 */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 错误和成功状态 */
.error {
    color: #ff3b30;
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.2);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 0.9375rem;
    letter-spacing: -0.022em;
}

.success {
    color: #30d158;
    background: rgba(48, 209, 88, 0.1);
    border: 1px solid rgba(48, 209, 88, 0.2);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 0.9375rem;
    letter-spacing: -0.022em;
}