body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

.calculator-container {
    max-width: 600px;
    margin: 20px auto 70px;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.header-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0px;
    position: relative;
}

.settings-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    position: absolute;
    top: -22px;
    right: -14px;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #45a049, #3d8b40);
    color: white;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(69, 160, 73, 0.4);
    font-size: 14px;
    font-weight: 500;
}

.notification-content i {
    font-size: 20px;
}

.settings-btn {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.settings-btn:hover {
    color: #4CAF50;
    background-color: #f0f8f0;
    transform: rotate(90deg);
    opacity: 1;
}

.settings-btn i {
    transition: transform 0.3s ease;
}

.settings-btn:hover i {
    transform: rotate(180deg);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 28px;
    font-weight: 700;
}

.input-group input[type="number"] {
    padding: 12px;
    margin-top: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    -moz-appearance: textfield;
}

.input-group input[type="number"]::-webkit-outer-spin-button,
.input-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-group input[type="number"]:focus {
    border-color: #4CAF50;
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.payment-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.calculate-btn {
    width: auto;
    padding: 10px 20px;
    margin: 0;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 40px;
}

.calculate-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.calculate-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
}

@media (max-width: 768px) {
    .payment-options {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .payment-options > label {
        flex: 0 0 auto;
        margin-bottom: 0;
    }

    .payment-options div {
        flex: 1 1 auto;
        margin-top: 0;
        margin-left: 10px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0px;
    }

    .calculate-btn {
        width: auto;
        margin-top: 0;
        margin-left: 10px;
        flex: 0 0 auto;
        padding: 10px 15px;
        min-width: 70px;
        position: relative;
        overflow: hidden;
    }
}

.payment-options > label {
    display: inline-flex;
    align-items: center;
    margin-right: 15px;
    cursor: pointer;
    position: relative;
    top: -1px;
    font-weight: bold;
}

.payment-options div label {
    display: inline-flex;
    align-items: center;
    margin-right: 15px;
    cursor: pointer;
    position: relative;
    font-weight: normal;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1;
    gap: 6px;
}

@media (max-width: 768px) {
    .payment-options div label {
        margin-right: 10px;
        font-size: 13px;
        gap: 4px;
    }
}

.payment-options div input[type="radio"] {
    margin-right: 5px;
    transform: scale(1.1);
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #4CAF50;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    vertical-align: middle;
}

@media (min-width: 769px) {
    .payment-options div input[type="radio"] {
        margin-right: 2px;
    }

    .payment-options div label {
        margin-left: -2px;
    }
}

.payment-options div input[type="radio"]:checked {
    background-color: #4CAF50;
    border-color: #4CAF50;
}

.payment-options div input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.payment-options div input[type="radio"]:hover {
    border-color: #45a049;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

@media (max-width: 768px) {
    .payment-options div label {
        margin-right: 12px;
        font-size: 14px;
        display: flex;
        align-items: center;
        vertical-align: middle;
    }

    .payment-options div input[type="radio"] {
        width: 14px;
        height: 14px;
        border-width: 1.5px;
        transform: scale(1.0);
    }

    .payment-options div input[type="radio"]:checked::after {
        width: 5px;
        height: 5px;
    }
}

.results-container {
    margin-top: 25px;
    padding: 12px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.results-container h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

.results-container h3 i {
    font-size: 16px;
}

.results-container > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    min-height: 28px;
}

.results-container #copyResultsBtn {
    margin: 0;
    vertical-align: middle;
}

.results-container ul {
    padding-left: 0;
    list-style: none;
}

.results-container li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 8px 0 8px 14px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.results-container li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    background-color: #4CAF50;
    border-radius: 50%;
}

.results-container li span:first-child {
    font-weight: 600;
    color: #2c3e50;
}

.results-container li span:first-child::after {
    content: "%";
    color: inherit;
}

.results-container li span:first-child {
    color: #2c3e50;
}

.results-container li span:first-child b {
    color: #1e90ff;
    font-weight: 600;
}
.results-container li span:last-child {
    color: red;
}

.results-container li span:last-child::after {
    content: "元";
    color: #666;
    margin-left: 2px;
    text-align: right;
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #333;
}

.icon {
    width: 20px;
    height: 20px;
    fill: #4CAF50;
}

button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #4CAF50;
    color: white;
    padding: 12px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

input[type="number"], button {
    width: 100%;
    box-sizing: border-box;
}

input[type="number"] {
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.payment-options div {
    margin-top: 10px;
}

button {
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

button:hover {
    background-color: #45a049;
}

.results-container {
    margin-top: 0px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    body {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    ::-webkit-scrollbar {
        display: none;
    }

    .calculator-container {
        margin: 10px 10px 70px;
        padding: 15px;
    }
}

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 0;
    background-color: #2c3e50;
    color: white;
    text-align: center;
    font-size: 14px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content p {
    margin: 5px 0;
    line-height: 1.4;
}

body {
    padding-bottom: 80px;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    position: relative;
}

.site-footer a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: #4CAF50;
}

.input-group label i {
    color: #4CAF50;
    width: 20px;
    text-align: center;
    margin-right: 5px;
}

.calculate-btn i {
    margin-right: 5px;
}

.usage-instructions {
    margin-top: 10px;
    padding: 24px;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.usage-instructions h4 {
    margin: 0 0 18px 0;
    color: #2c3e50;
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.usage-instructions ol {
    margin: 0;
    padding-left: 0;
    list-style: none;
    color: #495057;
    font-size: 14px;
    line-height: 1.6;
}

.usage-instructions li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.usage-instructions li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
    font-size: 15px;
}
.total-amount {
    margin: 0 -14px;
    padding: 10px 10px;
    background: transparent;
    text-align: center;
    line-height: 26px;
    display: flex;
    flex-direction: column;
}

.total-amount > div:first-child {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    letter-spacing: 1px;
}

.chinese-amount {
    margin-top: 6px;
    font-size: 1.1em;
    color: #4CAF50;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-family: SimSun, STSong, KaiTi, "Microsoft YaHei", serif;
}

.calc-toggle-btn {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 24px;
    opacity: 0.5;
    padding: 0;
    margin: 0;
    text-align: center;
}

.calc-toggle-btn i {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

@media (max-width: 768px) {
    .calc-toggle-btn {
        width: 45px;
        height: 45px;
        right: 15px;
        bottom: 70px;
        font-size: 18px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.25);
    }
}

.calc-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

.blur-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999;
}

.blur-overlay.show {
    display: block;
}

.calc-modal {
    display: none;
    position: fixed;
    right: 20px;
    bottom: 150px;
    background: #ffffff;
    padding: 15px;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    z-index: 1001;
    width: 300px;
}

.calc-modal.show {
    display: block;
}

@media (max-width: 768px) {
    .calc-modal {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        max-width: 90%;
    }
}

.simple-calculator {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.calc-display {
    width: 100%;
    height: 70px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: right;
    padding: 15px;
    font-size: 28px;
    font-weight: 500;
    box-sizing: border-box;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.calc-btn {
    padding: 0;
    border: none;
    background: linear-gradient(to bottom, #ffffff, #f5f5f5);
    border-radius: 10px;
    font-size: 22px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.08);
    color: #333;
    border: 1px solid #e0e0e0;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calc-btn:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.calc-btn:hover:after {
    opacity: 1;
}

.calc-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.calc-btn.operator {
    background: linear-gradient(to bottom, #f0f7ff, #e6f0ff);
    color: #0066cc;
    font-weight: 600;
    border-color: #d0e0ff;
}

.calc-btn.equals {
    background: linear-gradient(to bottom, #4CAF50, #43a047);
    color: white;
    font-weight: 600;
    border-color: #388e3c;
}

.calc-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 5px;
    margin: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 1001;
    outline: none;
    box-shadow: none;
}

.calc-close:hover {
    color: #dc3545;
    transform: scale(1.1);
}

.calc-close:active {
    transform: scale(0.95);
}
#usageCountDisplay {
    color: #666;
    font-size: 14px;
    padding: 5px 12px;
    background-color: #f5f5f5;
    border-radius: 14px;
    position: absolute;
    right: 2px;
    margin-top: -5px;
}

.input-group {
    position: relative;
}

::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}



    @media (max-width: 480px) {
        .payment-options {
            flex-direction: column;
            align-items: stretch;
            gap: 10px;
        }

        .payment-options > label {
            align-self: flex-start;
        }

        .payment-options div {
            margin-left: 0;
            justify-content: center;
        }

        .calculate-btn {
            width: 100%;
            margin-left: 0;
            margin-top: 5px;
        }
    }
}

.total-percentage-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: right;
}

.total-percentage {
    font-size: 14px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 4px;
    display: inline-block;
    min-width: 120px;
    text-align: center;
}

#copyResultsBtn {
    min-width: auto;
    width: auto;
    padding: 5px 12px;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
}

.total-percentage.valid {
    color: #4CAF50;
    background-color: #f0fff0;
    border: 1px solid #c3e6cb;
}

.total-percentage.invalid {
    color: #f44336;
    background-color: #fff0f0;
    border: 1px solid #fccbcb;
}

.custom-payment-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding: 50px 5px;
}

.custom-payment-overlay.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.custom-payment-modal {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.custom-payment-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.custom-payment-header .header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.custom-payment-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.custom-payment-header .total-percentage {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    min-width: 100px;
    text-align: center;
}

.custom-payment-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    margin: -5px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-payment-close:hover {
    color: #666;
    background: #f5f5f5;
}

.custom-payment-content {
    padding: 20px 24px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(85vh - 160px);
}

.custom-payment-content .input-group {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
    height: 44px;
}

.custom-payment-content .input-group label {
    font-weight: 500;
    color: #495057;
    padding: 12px 12px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    min-width: 110px;
    flex-shrink: 0;
    margin: 0;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.payment-count-container {
    flex: 1;
    display: flex;
    align-items: center;
    background: #ffffff;
    height: 100%;
}

.payment-count-container input[type="number"] {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 0;
    font-size: 16px;
    background: transparent;
    text-align: left;
    -moz-appearance: textfield;
}

.payment-count-container input[type="number"]::-webkit-outer-spin-button,
.payment-count-container input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.count-buttons {
    display: flex;
    flex-direction: row;
    border-left: 1px solid #e9ecef;
    align-items: center;
    height: 100%;
}

.count-btn {
    width: 38px;
    height: 100%;
    border: none;
    background: #ffffff;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    border-radius: 0;
    line-height: 1;
}

.count-btn:first-child {
    border-right: 1px solid #e9ecef;
}

.count-btn:hover {
    background: #4CAF50;
    color: white;
}

.custom-payment-content input[type="number"]::-webkit-outer-spin-button,
.custom-payment-content input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.custom-payment-content input[type="number"] {
    -moz-appearance: textfield;
}

.custom-payment-content input[type="number"] {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 0;
    font-size: 16px;
    box-sizing: border-box;
    background: transparent;
    text-align: left;
    transform: translateY(-3px);
}

.custom-payment-content input[type="number"]:focus {
    outline: none;
    border-color: inherit;
    box-shadow: none;
}

.percentage-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.percentage-input-wrapper input[type="number"] {
    width: 100%;
    padding-right: 30px;
    transform: translateY(0);
}

.percentage-input-wrapper input.custom-percentage {
    margin-top: 7px;
    margin-bottom: 7px;
}

.percentage-symbol {
    position: absolute;
    right: 15px;
    color: #6c757d;
    font-size: 16px;
    font-weight: 500;
    pointer-events: none;
}

.custom-payment-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    position: sticky;
    bottom: 0;
    background: white;
}

.custom-payment-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-payment-btn.cancel {
    background: #f5f5f5;
    color: #666;
}

.custom-payment-btn.cancel:hover {
    background: #eee;
}

.custom-payment-btn.confirm {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.custom-payment-btn.confirm:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
}

.custom-payment-content .number-input-container {
    margin-top: 8px;
}

.custom-payment-content .number-input-container input[type="number"] {
    padding: 0 88px 0 15px;
    height: 44px;
}

#customPaymentDetails {
    margin-top: 15px;
}

#customPaymentDetails .input-group {
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .custom-payment-modal {
        width: 95%;
        max-width: none;
        margin: 10px;
        border-radius: 12px;
    }

    .custom-payment-header,
    .custom-payment-content,
    .custom-payment-footer {
        padding: 15px;
    }

    .custom-payment-content .number-input-container input[type="number"] {
        padding-right: 80px;
        height: 42px;
    }
}

.settings-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding: 50px 5px;
}

.settings-overlay.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.settings-modal {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.settings-modal .custom-payment-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
}

.settings-modal .custom-payment-header .header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.settings-modal .custom-payment-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.settings-modal .custom-payment-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 5px;
    margin: -5px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-modal .custom-payment-close:hover {
    color: #666;
    background: #f5f5f5;
}

.settings-modal .custom-payment-content {
    padding: 20px 24px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(85vh - 160px);
}

.settings-modal .custom-payment-content .input-group {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
    height: 44px;
}

.settings-modal .custom-payment-content .input-group label {
    font-weight: 500;
    color: #495057;
    padding: 12px 12px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    min-width: 110px;
    flex-shrink: 0;
    margin: 0;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.settings-modal .custom-payment-content input[type="number"] {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 0;
    font-size: 16px;
    box-sizing: border-box;
    background: transparent;
    text-align: left;
}

.settings-modal .custom-payment-content input[type="number"]:focus {
    outline: none;
    border-color: inherit;
    box-shadow: none;
}

.settings-modal .payment-period-selector {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.settings-modal .payment-period-selector .period-label {
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
}

.settings-modal .payment-radio-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.settings-modal .payment-radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.settings-modal .payment-radio-item input[type="radio"] {
    transform: scale(1.2);
    margin: 0;
    accent-color: #4CAF50;
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #4CAF50;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-modal .payment-radio-item input[type="radio"]:checked {
    background-color: #4CAF50;
    border-color: #4CAF50;
}

.settings-modal .payment-radio-item input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.settings-modal .payment-radio-item label {
    margin: 0;
    font-size: 15px;
    color: #333;
}

.settings-modal .custom-payment-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    position: sticky;
    bottom: 0;
    background: white;
}

.settings-modal .custom-payment-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-modal .custom-payment-btn.cancel {
    background: #f5f5f5;
    color: #666;
}

.settings-modal .custom-payment-btn.cancel:hover {
    background: #eee;
}

.settings-modal .custom-payment-btn.confirm {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.settings-modal .custom-payment-btn.confirm:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
}

.password-modal {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    overflow: hidden;
}

.password-modal .custom-payment-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.password-modal .custom-payment-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.password-modal .custom-payment-content {
    padding: 24px;
}

.password-modal .custom-payment-content .input-group {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
    height: 44px;
}

.password-modal .custom-payment-content .input-group label {
    font-weight: 500;
    color: #495057;
    padding: 0 12px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    min-width: 60px;
    flex-shrink: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    height: 100%;
}

.password-modal .custom-payment-content input[type="password"] {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 0;
    font-size: 16px;
    box-sizing: border-box;
    background: transparent;
    text-align: left;
    font-family: monospace;
    letter-spacing: 2px;
}

.password-modal .custom-payment-content input[type="password"]:focus {
    outline: none;
    border-color: inherit;
    box-shadow: none;
}

.password-modal .custom-payment-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    background: white;
}

.password-modal .custom-payment-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.password-modal .custom-payment-btn.cancel {
    background: #f5f5f5;
    color: #666;
}

.password-modal .custom-payment-btn.cancel:hover {
    background: #eee;
}

.password-modal .custom-payment-btn.confirm {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.password-modal .custom-payment-btn.confirm:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
}
