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

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fafafa;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    overflow: hidden;
}

/* 手机容器 */
.phone-container {
    width: 100%;
    max-width: 420px;
    height: calc(100vh - 20px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    margin: 10px;
}

.page-title {
    padding: 16px 16px 0 16px;
    font-size: 20px;
    font-weight: 600;
    color: #1976d2;
    text-align: left;
    background: white;
}

.page-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 0 16px;
    gap: 12px;
}

.page-title-wrapper .page-title {
    padding: 0;
    margin: 0;
}

.more-link {
    font-size: 12px;
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.more-link:hover {
    opacity: 0.7;
}

.more-link:active {
    opacity: 0.5;
}

.calculator {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px 16px 0 16px;
    gap: 12px;
    background: white;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 卡片样式 */
.card {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 16px;
    background: white;
}

.card-input {
    /* 卡片1 */
}

.card-products {
    /* 卡片2 - 浅色边框 */
    border: 1px solid #ccc;
}

.card-discounts {
    /* 卡片3 - 浅灰色背景 */
    background: #f5f5f5;
}

/* 企业人数输入区 */
.input-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
}

.input-label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
    width: 60px;
}

.input-field {
    flex: 1;
    padding: 12px;
    font-size: 18px;
    font-weight: 600;
    border: 1px solid #ccc;
    border-radius: 8px;
    outline: none;
    color: #212121;
    background: white;
    transition: border-color 0.3s;
}

.input-field:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

/* 滑块区 */
.slider-section {
    padding: 16px 0;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1976d2;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.slider-label {
    font-size: 12px;
    color: #999;
    text-align: center;
    margin-top: 8px;
}

.slider {
    width: 80%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    border: none;
}

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

.slider::-webkit-slider-thumb:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

.slider::-moz-range-thumb:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 产品列表区 */
.products-section {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 小计头部（在卡片2的顶部） */
.subtotal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    margin-bottom: 12px;
}

.subtotal-header .product-name {
    font-size: 14px;
    font-weight: 600;
    color: #666 !important;
}

.subtotal-header .product-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.subtotal-header .price-amount {
    font-size: 20px;
    font-weight: 700;
    color: #666 !important;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 0;
    flex-wrap: wrap;
}

.product-item .product-detail {
    width: 100%;
    order: 3;
}

/* 卡片2中的产品明细项 */
.card-products .product-item {
    color: #999;
    padding-left: 1em;
}

.card-products .product-name {
    color: #999;
}

.card-products .product-detail {
    color: #999;
}

.card-products .price-amount {
    color: #999;
}

.card-products .price-unit {
    color: #999;
}

.product-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.product-detail {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.product-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.price-amount {
    font-size: 16px;
    font-weight: 600;
    color: #212121;
}

.price-unit {
    font-size: 12px;
    color: #999;
}

/* 分割线 */
.divider {
    height: 1px;
    background: #e0e0e0;
    margin: 0;
}

/* 小计头部下的分割线 */
.subtotal-header + .divider {
    margin: 0 -16px;
    width: calc(100% + 32px);
}

/* 赠券样式 */
.coupon-item {
    padding: 16px 16px;
    background: #fce4ec;
    margin: 0 -16px;
    color: #ff6f3c;
}

.coupon-item .product-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #ff6f3c;
}

.coupon-item .product-detail {
    color: #ff6f3c;
}

.coupon-item .product-price {
    align-items: center;
    gap: 3px;
    flex-direction: row;
}

.coupon-minus {
    color: #ff6f3c;
    font-size: 16px;
    font-weight: 600;
    margin-left: 2px;
}

.coupon-item .price-amount {
    margin: 0;
    color: #ff6f3c;
    font-weight: 600;
}



/* 最终折扣价样式 */
.final-price-item {
    padding: 16px 0;
    background: #f0f7ff;
    margin: 0;
    border-radius: 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.final-price-item .product-name {
    font-size: 16px;
    font-weight: 600;
    color: #1976d2;
}

.final-price .price-amount {
    font-size: 24px;
    color: #1976d2;
    font-weight: 700;
}

/* 底部信息组 */
.bottom-group {
    flex-shrink: 0;
    background: white;
    padding: 24px 16px 16px 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.info-link {
    text-align: center;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    transition: all 0.3s ease;
}

.info-link:active {
    opacity: 0.7;
}

.apply-subsidy-link {
    text-align: right;
    color: #ff6f3c;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 0;
    transition: all 0.3s ease;
    display: block;
    margin-right: 15px;
}

.apply-subsidy-link:active {
    opacity: 0.7;
}

/* 申请小额补助行 */
.apply-subsidy-row {
    padding: 12px 0 12px 0;
    text-align: right;
    background: transparent;
    min-height: 20px;
}

/* 底部信息组 */
.bottom-group {
    flex-shrink: 0;
    background: white;
    padding: 24px 16px 16px 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: row;
    gap: 8px;
    z-index: 100;
}

.service-button {
    flex: 0 0 30%;
    padding: 12px 16px;
    background: transparent;
    border: 2px solid #d0d0d0;
    color: #666;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.service-button:hover {
    background: rgba(0, 0, 0, 0.04);
}

.service-button:active {
    background: rgba(0, 0, 0, 0.08);
}

.purchase-button {
    flex: 0 0 70%;
    padding: 12px 16px;
    background: #1976d2;
    border: none;
    color: white;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.purchase-button:hover {
    background: #1565c0;
}

.purchase-button:active {
    background: #0d47a1;
}

/* 二维码弹窗 */
.qr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.qr-modal.active {
    display: flex;
}

.qr-modal-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.qr-close-btn {
    position: absolute;
    top: -35px;
    right: 0;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all 0.3s;
}

.qr-close-btn:hover {
    opacity: 0.7;
}

.qr-image {
    max-width: 80%;
    max-height: 80vh;
    border-radius: 12px;
    display: block;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* 小额补助样式 */
.subsidy-item {
    padding: 16px 16px;
    background: #fce4ec;
    margin: 0 -16px;
    color: #ff6f3c;
}

.subsidy-item .product-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #ff6f3c;
}

.subsidy-item .product-price {
    align-items: center;
    gap: 3px;
    flex-direction: row;
}

.subsidy-minus {
    color: #ff6f3c;
    font-size: 16px;
    font-weight: 600;
    margin-left: 2px;
}

.subsidy-item .price-amount {
    margin: 0;
    color: #ff6f3c;
    font-weight: 600;
}



/* 小额补助加载窗 */
.subsidy-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.subsidy-modal.active {
    display: flex;
}

.subsidy-modal-content {
    background: white;
    border-radius: 12px;
    padding: 40px 30px;
    max-width: 300px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.subsidy-modal-header {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.loading-icon {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #1976d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.subsidy-modal-text {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

/* 小额补助接果窗 */
.subsidy-result-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.subsidy-result-modal.active {
    display: flex;
}

.subsidy-result-content {
    background: white;
    border-radius: 12px;
    padding: 30px 24px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.result-icon {
    width: 60px;
    height: 60px;
    background: #4caf50;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.result-icon::after {
    content: '';
    width: 16px;
    height: 28px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.result-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.result-message {
    font-size: 12px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 16px;
}

.result-amount {
    font-size: 24px;
    font-weight: 700;
    color: #d32f2f;
    margin-bottom: 8px;
}

.result-validity {
    font-size: 12px;
    color: #d32f2f;
    margin-bottom: 20px;
}

.receive-subsidy-btn {
    width: 100%;
    padding: 12px 16px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.receive-subsidy-btn:hover {
    background: #1565c0;
}

.receive-subsidy-btn:active {
    background: #0d47a1;
}

@media (max-width: 480px) {
    .phone-container {
        border-radius: 8px;
    }

    .calculator {
        padding: 20px 12px 130px 12px;
    }

    .input-section {
        gap: 8px;
        padding-bottom: 12px;
    }

    .input-field {
        font-size: 16px;
    }

    .product-item {
        padding: 12px;
    }

    .subtotal-item,
    .final-price-item {
        margin: 0 -12px;
        padding: 12px;
    }

    .bottom-group {
        padding: 16px 12px 12px 12px;
    }
}
