/* 响应式样式和特殊组件样式 */

/* 结果卡片样式 */
.result-card {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.result-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.result-title::before {
    content: '💰';
    font-size: 1.2rem;
}

/* 折扣控制区域样式 */
.discount-control-section {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.discount-control-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.discount-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.discount-icon {
    font-size: 1.2rem;
    color: #2563eb;
}

.discount-title {
    font-weight: 700;
    color: #1f2937;
    font-size: 1.1rem;
}

.discount-mode-toggle {
    display: flex;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 4px;
    gap: 2px;
}

.discount-mode-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: #6b7280;
}

.discount-mode-btn.active {
    background: white;
    color: #2563eb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.discount-mode-btn:hover:not(.active) {
    color: #374151;
}

.unified-discount-section {
    display: block;
    margin-top: 16px;
}

.discount-input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
}

.discount-input-container:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.discount-input-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
    min-width: 80px;
}

.discount-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.discount-input-large {
    width: 100px;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    background: #f9fafb;
}

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

.discount-percent {
    font-size: 1rem;
    font-weight: 600;
    color: #6b7280;
}

.discount-slider-container {
    flex: 1;
    margin: 0 16px;
}

.discount-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.discount-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.discount-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.discount-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.apply-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.apply-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.apply-btn:active {
    transform: translateY(0);
}

.discount-presets {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 6px 12px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #374151;
}

.preset-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.preset-btn:active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* 表格样式 */
.breakdown-table {
    margin-top: 20px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: white;
}

.breakdown-header {
    display: grid;
    grid-template-columns: 2fr 1fr 0.8fr 0.8fr 1fr 100px 1fr;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    font-weight: 700;
    font-size: 0.8rem;
    color: #374151;
    border-bottom: 2px solid #d1d5db;
}

.breakdown-body {
    background: white;
}

.breakdown-row {
    display: grid;
    grid-template-columns: 2fr 1fr 0.8fr 0.8fr 1fr 100px 1fr;
    gap: 8px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s ease;
}

.breakdown-row:hover {
    background: #f9fafb;
}

.breakdown-row:last-child {
    border-bottom: none;
}

.breakdown-col-item {
    font-weight: 600;
    color: #374151;
    font-size: 0.85rem;
}

.breakdown-col-usage {
    text-align: center;
    font-weight: 500;
    color: #6b7280;
    font-size: 0.8rem;
}

.usage-input-inline {
    width: 80px;
    padding: 4px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.75rem;
    text-align: center;
    transition: all 0.2s ease;
    background: white;
}

.usage-input-inline:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.usage-select-inline {
    width: 120px;
    padding: 4px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.75rem;
    text-align: center;
    transition: all 0.2s ease;
    background: white;
}

.usage-select-inline:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.breakdown-col-unit-price {
    text-align: center;
    font-weight: 500;
    color: #6b7280;
    font-size: 0.8rem;
}

.breakdown-col-price {
    text-align: right;
    font-weight: 500;
    color: #6b7280;
    font-size: 0.85rem;
}

.breakdown-col-discount {
    text-align: center;
}

.breakdown-col-final {
    text-align: right;
    font-weight: 700;
    color: #059669;
    font-size: 0.9rem;
}

.breakdown-totals {
    border-top: 2px solid #e5e7eb;
    background: linear-gradient(135deg, #f9fafb, #ffffff);
}

.breakdown-total-row {
    display: grid;
    grid-template-columns: 2fr 1fr 0.8fr 0.8fr 1fr 100px 1fr;
    gap: 8px;
    align-items: center;
    padding: 16px;
    font-size: 0.95rem;
}

.breakdown-total-row strong {
    color: #1f2937;
}

.breakdown-total-row #totalFinalPrice {
    color: #2563eb;
    font-size: 1.05rem;
}

.individual-discount-input {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.8rem;
    text-align: center;
    transition: all 0.2s ease;
}

.individual-discount-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* 导出区域样式 */
.export-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

.export-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
    text-align: center;
}

.export-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.export-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.export-btn.primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
}

.export-btn.secondary {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .content {
        grid-template-columns: 1fr;
    }
    
    .form-section, .result-section {
        max-height: none;
    }
    
    .input-group {
        grid-template-columns: 1fr;
    }
    
    .breakdown-header,
    .breakdown-row,
    .breakdown-total-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .breakdown-header > div,
    .breakdown-row > div,
    .breakdown-total-row > div {
        text-align: left;
        padding: 4px 0;
    }
    
    .price-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .discount-input-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .discount-input-wrapper {
        flex-direction: column;
        width: 100%;
    }
    
    .discount-slider-container {
        margin: 8px 0;
    }
}