/* Purchase page specific styles */
.pricing-card {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--card-shadow);
    background-color: var(--bg-secondary);
    transition: all 0.3s ease;
}

.pricing-card:hover {
    box-shadow: var(--card-hover-shadow);
}

.price-tag {
    font-size: 2.25rem;
    font-weight: bold;
    color: #4D6BFE;
}

.per-unit {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: normal;
}

.promotion-badge {
    display: inline-block;
    background-color: #FF6B6B;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.promotion-details {
    background-color: rgba(255, 107, 107, 0.1);
    border-left: 4px solid #FF6B6B;
    padding: 1rem;
    margin: 1.5rem 0;
}

.purchase-form {
    margin-top: 1rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: var(--bg-secondary);
    color: var(--text-main);
}

.amount-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.amount-option {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    color: var(--text-main);
}

.amount-option:hover {
    border-color: #4D6BFE;
}

.amount-option.selected {
    border-color: #4D6BFE;
    background: rgba(77, 107, 254, 0.05);
}

.amount-value {
    font-weight: bold;
    font-size: 1.1rem;
}

.conversions {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.bonus {
    font-size: 0.85rem;
    color: #FF6B6B;
    font-weight: bold;
    margin-top: 0.25rem;
}

.total-conversions {
    font-size: 0.85rem;
    color: var(--text-main);
    font-weight: bold;
    margin-top: 0.25rem;
}

.discount-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #E74C3C;
    color: white;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 12px 4px 12px 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: rotate(15deg);
}

.purchase-btn {
    background: #4D6BFE;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    transition: all 0.2s ease;
}

.purchase-btn:hover {
    background: #3D5BEE;
}

.api-instructions {
    margin-top: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-secondary);
}

/* Quota Checker styles */
.quota-checker {
    margin-top: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.quota-form {
    margin: 1rem 0 1rem 0;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: #4D6BFE;
    color: white;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 0.5rem;
}

code {
    background: rgba(77, 107, 254, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
}

/* Custom amount styles */
.custom-amount-input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.currency-symbol {
    background-color: var(--bg-color);
    padding: 0.8rem;
    border-right: 1px solid var(--border-color);
    font-weight: bold;
}

.custom-amount-input-group input {
    border: none;
    border-radius: 0;
    flex: 1;
}

.custom-amount-input-group input:focus {
    outline: none;
}

.custom-amount-details {
    margin-top: 1rem;
    background-color: var(--bg-color);
    border-radius: 6px;
}

.bonus-text {
    font-weight: bold;
    color: #FF6B6B;
}

input[type="number"] {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background-color: var(--bg-secondary);
    color: var(--text-main);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

/* Responsive adjustments for amount options */
@media (max-width: 768px) {
    .amount-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Purchase page specific styles */
.feature-description {
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.6;
    margin: 0.5rem 0;
    color: var(--text-main);
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

.free-features-section h2,
.quota-checker h2,
.api-instructions h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Content layout styles */
.content {
    max-width: 1200px;
    margin: 80px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
}

.content>h1 {
    order: 1;
}

.pricing-card {
    order: 2;
}

.left-column-wrapper {
    order: 3;
}

/* Two-column layout for desktop */
@media (min-width: 992px) {
    .content>h1 {
        text-align: center;
        margin-bottom: 0rem;
    }

    /* Create a two-column layout */
    .content {
        display: grid;
        grid-template-columns: 5fr 7fr;
        grid-template-areas:
            "heading heading"
            "left-col right-col";
        gap: 1.2rem;
    }

    .content>h1 {
        grid-area: heading;
        width: 100%;
    }

    /* Left column with free features and API instructions */
    .left-column-wrapper {
        grid-area: left-col;
        display: flex;
        flex-direction: column;
        gap: 1.2rem;
    }

    .free-features-section {
        margin: 0;
    }

    .api-instructions {
        margin: 0;
        width: auto;
    }

    .quota-checker {
        margin: 0;
    }

    /* Right column with pricing card */
    .pricing-card {
        grid-area: right-col;
        margin: 0;
        align-self: start;
        padding-top: 1rem;
    }
}

/* Feature Comparison Section */
.feature-comparison-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-card {
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    /* transition: box-shadow 0.3s ease; */
}

.feature-card.free {
    background: linear-gradient(135deg, #f8faff 0%, #eef2ff 100%);
    border: 1px solid rgba(77, 107, 254, 0.1);
}

.feature-card.pro {
    background: linear-gradient(135deg, #4D6BFE 0%, #3D5BEE 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(77, 107, 254, 0.2);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-card.pro h3 {
    color: white;
}

.feature-status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.feature-card.free .feature-status-badge {
    background: rgba(77, 107, 254, 0.1);
    color: #4D6BFE;
}

.feature-card.pro .feature-status-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.feature-item svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.feature-card.pro .feature-item {
    color: rgba(255, 255, 255, 0.9);
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .feature-card.free {
        background: linear-gradient(135deg, #1e212d 0%, #161922 100%);
        border-color: rgba(255, 255, 255, 0.05);
        color: #eee;
    }

    .feature-card.free h3 {
        color: #fff;
    }

    .feature-card.free .feature-status-badge {
        background: rgba(255, 255, 255, 0.05);
        color: #aaa;
    }
}

@media (max-width: 600px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
}


/* Payment Modal Styles */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.payment-modal-content {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.25rem;
    max-width: 500px;
    width: 90%;
    position: relative;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

.close-modal:hover {
    color: #333;
}

.payment-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
    text-align: left;
    padding-left: 1rem;
}

.payment-step {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.payment-step .step-number {
    min-width: 24px;
    height: 24px;
    background-color: #4D6BFE;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    flex-shrink: 0;
    margin: 0;
}

.payment-step p {
    margin: 0;
    line-height: 1.5;
    text-align: left;
    flex-grow: 1;
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    min-height: 24px;
}

.payment-note {
    margin: 1.5rem 0;
    font-size: 0.9rem;
    color: #666;
}

.copy-again-btn {
    background: #4D6BFE;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    position: relative;
}

.copy-again-btn:hover {
    background: #3D5BEE;
}

.copy-confirmation {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/* Dark mode styles for modal */
@media (prefers-color-scheme: dark) {
    .payment-modal-content {
        background-color: #2d2d2d;
        color: #fff;
    }

    .close-modal {
        color: #aaa;
    }

    .close-modal:hover {
        color: #fff;
    }

    .payment-note {
        color: #aaa;
    }
}

/* Responsive adjustments for modal */
@media (max-width: 480px) {
    .payment-modal-content {
        padding: 1.5rem;
    }
}

.check-quota-btn {
    background: #4D6BFE;
    color: white;
    border: none;
    padding: 0.7rem 1.25rem;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    width: 100%;
}

.check-quota-btn:hover {
    background: #3D5BEE;
}

.quota-result-card {
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
}

/* Quota loading state */
.quota-loading {
    display: flex;
    flex-direction: column;
}

.quota-loading-blocks {
    display: flex;
    gap: 12px;
}

.quota-loading-block {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quota-loading-label {
    height: 14px;
    width: 60px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color, #e5e7eb) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 3px;
}

.quota-loading-value {
    height: 24px;
    width: 80px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color, #e5e7eb) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.quota-loading-progress {
    width: 100%;
    height: 6px;
    background-color: var(--border-color, #e5e7eb);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.quota-loading-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: loading-slide 1.5s infinite;
}

.quota-loading-note {
    height: 15px;
    width: 50px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color, #e5e7eb) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 3px;
    opacity: 0.7;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes loading-slide {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(300%);
    }
}

/* Quota header */
.quota-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.quota-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-color);
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
    cursor: pointer;
}

/* Dual quota blocks layout */
.quota-blocks {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.quota-block {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.quota-block-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.quota-block-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
    margin-right: auto;
}

.quota-block-badge {
    font-size: 0.8rem;
    color: var(--primary-color);
    background: rgba(77, 107, 254, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    flex-shrink: 0;
}

.quota-block-value {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.quota-block-remaining {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.quota-block-sep {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 2px;
}

.quota-block-value span:last-child {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.quota-block-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Progress bar (shared by both blocks) */
.quota-progress-container {
    width: 100%;
    height: 6px;
    background-color: var(--border-color, #e5e7eb);
    border-radius: 3px;
    margin: 4px 0;
    overflow: hidden;
}

.quota-progress {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Quota footer */
.quota-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 8px;
}

.quota-footer-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.quota-footer .purchase-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.quota-footer .purchase-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .quota-blocks {
        flex-direction: column;
        gap: 8px;
    }

    .quota-loading-blocks {
        flex-direction: column;
        gap: 8px;
    }
}

/* Dark mode styles for quota */
@media (prefers-color-scheme: dark) {
    .quota-block {
        border-color: #374151;
    }

    .quota-loading-block {
        border-color: #374151;
    }
}

/* API Key Input Styles */
.api-key-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.api-key-input-wrapper input {
    padding-right: 70px;
    /* Make room for both buttons */
}

/* Hide browser's default password reveal icon */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear,
input[type="password"]::-webkit-contacts-auto-fill-button,
input[type="password"]::-webkit-credentials-auto-fill-button {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
}

.toggle-visibility-btn,
.copy-api-key-btn,
.download-api-key-btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px;
    height: 32px;
    width: 32px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.toggle-visibility-btn:hover,
.copy-api-key-btn:hover,
.download-api-key-btn:hover {
    background: rgba(77, 107, 254, 0.1);
    color: #4D6BFE;
}

.toggle-visibility-btn {
    right: 36px;
}

.copy-api-key-btn {
    right: 4px;
}

/* Tooltip for copy success */
.copy-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    top: -30px;
    right: 0;
    white-space: nowrap;
    opacity: 0;
    animation: fadeInOut 1.5s ease;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {

    .toggle-visibility-btn,
    .copy-api-key-btn {
        color: var(--text-light);
    }

    .toggle-visibility-btn:hover,
    .copy-api-key-btn:hover {
        color: var(--primary-color);
    }
}

/* FAQ Section Styles */
.faq-section {
    background-color: #f5f8ff;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border-left: 4px solid #4D6BFE;
}

.faq-section h2 {
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 1.5rem;
}

.faq-card {
    border-bottom: 1px solid rgba(77, 107, 254, 0.2);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.faq-card:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-question {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    color: var(--text-color);
}

.faq-answer {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Dark mode styles for FAQ section */
@media (prefers-color-scheme: dark) {
    .faq-section {
        background-color: #2a2d3a;
    }

    .faq-card {
        border-bottom-color: rgba(77, 107, 254, 0.3);
    }
}

/* FAQ styles that work with the api-instructions class */
.api-instructions .faq-card {
    border-bottom: 1px solid rgba(77, 107, 254, 0.2);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.api-instructions .faq-card:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.api-instructions .faq-question {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: color 0.2s ease;
}

.api-instructions .faq-question:hover {
    color: #4D6BFE;
}

.api-instructions .faq-question-text {
    flex: 1;
}

.api-instructions .faq-toggle-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    color: #4D6BFE;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.api-instructions .faq-card.collapsed .faq-toggle-icon {
    transform: rotate(-90deg);
}

.api-instructions .faq-answer {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
    opacity: 1;
    margin-top: 0.5rem;
}

.api-instructions .faq-card.collapsed .faq-answer {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .api-instructions .faq-card {
        border-bottom-color: rgba(77, 107, 254, 0.3);
    }

    .api-instructions .faq-question:hover {
        color: #6D8BFE;
    }
}

/* Alipay Payment Modal Styles */
.alipay-qrcode {
    margin: 2rem auto;
    max-width: 200px;
    text-align: center;
}

.alipay-qrcode img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.payment-status {
    font-size: 1rem;
    font-weight: 500;
    margin-top: 1rem;
    color: #666;
}

.payment-status.success {
    color: #4CAF50;
}

.payment-status.error {
    color: #FF5252;
}

.payment-progress-spinner {
    margin: 1rem auto;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(77, 107, 254, 0.3);
    border-top-color: #4D6BFE;
    border-radius: 50%;
    animation: spin 1s ease-in-out infinite;
}

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

.order-summary {
    margin: 1.5rem auto;
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 300px;
    text-align: left;
}

.order-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    width: 100%;
}

.order-detail span:first-child {
    text-align: left;
}

.order-detail span:last-child {
    text-align: right;
}

.order-detail.total {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    font-weight: bold;
}

.order-id {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: #888;
}

.open-alipay-btn {
    display: inline-block;
    background-color: #00a0e9;
    /* Alipay blue color */
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    margin: 1rem 0;
    transition: all 0.2s ease;
}

.open-alipay-btn:hover {
    background-color: #0092d2;
}

/* Success screen after payment */
.success-icon {
    width: 64px;
    height: 64px;
    background-color: #4CAF50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 1rem auto;
}

.api-key-section {
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: 8px;
    background-color: var(--bg-color);
}

.api-key-display-wrapper {
    position: relative;
    display: flex;
    margin: 1rem 0;
}

.api-key-display-wrapper input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: monospace;
    letter-spacing: 1px;
    background-color: var(--bg-secondary);
    color: var(--text-main);
}

.api-key-instruction {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

.quota-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
}

.quota-stat-item {
    text-align: center;
    min-width: 100px;
}

.quota-stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.quota-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
}

.quota-stat-value.highlight {
    color: #FF6B6B;
}

.success-close-btn {
    background: #4D6BFE;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    margin-top: 1.5rem;
}

.success-close-btn:hover {
    background: #3D5BEE;
}

.next-steps {
    text-align: left;
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 8px;
}

.next-steps h3 {
    margin-bottom: 0.8rem;
}

.next-steps ol {
    margin-left: 1.5rem;
    padding: 0;
}

.next-steps li {
    margin-bottom: 0.5rem;
}

/* Dark mode adjustments for Alipay payment modal */
@media (prefers-color-scheme: dark) {
    .order-summary {
        background-color: #333;
        color: #e0e0e0;
        /* Adding text color for dark mode */
    }

    .order-detail.total {
        border-top-color: #555;
    }

    .order-id {
        color: #aaa;
        /* Lighter color for order ID in dark mode */
    }

    .api-key-section {
        background-color: #333;
    }

    .api-key-display-wrapper input {
        background-color: #2d2d2d;
        border-color: #444;
        color: #fff;
    }

    .api-key-instruction,
    .payment-status {
        color: #aaa;
    }

    .next-steps {
        background-color: #2a2d3a;
    }
}

/* Optimized payment modal layout */
.payment-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 100%;
}

.payment-qrcode-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.payment-info-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.payment-steps-compact {
    padding: 0;
    margin: 0 0 0 1.5rem;
}

.payment-steps-compact li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.payment-instructions {
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 0.8rem 1rem;
}

/* Desktop layout - side by side */
@media (min-width: 640px) {
    .payment-container {
        flex-direction: row;
        align-items: flex-start;
    }

    .payment-qrcode-area {
        width: 40%;
        padding-right: 1rem;
        border-right: 1px solid #eee;
    }

    .payment-info-area {
        width: 60%;
        padding-left: 1rem;
    }

    .payment-modal-content {
        max-width: 600px;
    }

    .order-summary {
        margin-top: 0;
    }
}

/* Dark mode adjustments for optimized modal */
@media (prefers-color-scheme: dark) {
    .payment-instructions {
        background-color: #333;
    }

    @media (min-width: 640px) {
        .payment-qrcode-area {
            border-right-color: #444;
        }
    }
}

/* Optimized success modal layout */
.success-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.success-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

.success-header h2 {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.success-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    /* 减小gap从1rem到0.8rem */
    margin-top: 0.5rem;
    /* 减小上边距 */
}

.quota-summary-compact {
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 1rem;
}

.quota-stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    padding: 0.25rem 0;
}

.quota-stat-row:last-child {
    margin-bottom: 0;
}

.quota-label {
    font-weight: 500;
    color: #666;
}

.quota-value {
    font-weight: 600;
}

.quota-value.highlight {
    color: #FF6B6B;
}

.next-steps-compact {
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0;
}

.next-steps-compact h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.next-steps-compact ol {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.next-steps-compact li {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.next-steps-compact li:last-child {
    margin-bottom: 0;
}

.next-steps-compact code {
    font-size: 0.85rem;
    padding: 0.15rem 0.3rem;
}

/* Dark mode adjustments for success modal */
@media (prefers-color-scheme: dark) {
    .quota-summary-compact {
        background-color: #333 !important;
        color: #e0e0e0;
    }

    .quota-label {
        color: #aaa;
    }

    .next-steps-compact {
        background-color: #2a2d3a;
    }
}

/* Modified Payment Modal Styles */
.payment-modal-content {
    max-width: 400px;
    /* Reduced from 500px to 400px for a slimmer modal */
}

.payment-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.alipay-logo {
    width: 36px;
    height: 36px;
}

.payment-header h2 {
    margin: 0;
    font-size: 1.4rem;
}

.payment-container-single {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    /* Reduced gap for more compact layout */
}

.alipay-qrcode-large {
    width: 180px;
    /* Smaller QR code for more compact layout */
    margin: 0 auto;
    text-align: center;
}

.alipay-qrcode-large img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.payment-status-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
    /* Reduced for compact layout */
    gap: 0.5rem;
}

.payment-progress-spinner {
    margin: 0;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(77, 107, 254, 0.3);
    border-top-color: #4D6BFE;
    border-radius: 50%;
    animation: spin 1s ease-in-out infinite;
}

.payment-status {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
}

.order-summary {
    margin: 0.25rem auto;
    /* Reduced margin for compact layout */
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    width: 180px;
    /* Match the QR code width */
    text-align: left;
}

.order-id {
    margin-top: 0.25rem;
    /* Reduced for compact layout */
    font-size: 0.8rem;
    color: #888;
}

/* Dark mode adjustments for modified payment modal */
@media (prefers-color-scheme: dark) {
    .payment-status {
        color: #aaa;
    }

    .order-summary {
        background-color: #333 !important;
        color: #e0e0e0;
    }

    .order-detail {
        color: #e0e0e0;
    }
}

/* API key display and button styles */
.api-key-display-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

.api-key-instruction {
    font-size: 0.9rem;
    color: #666;
    margin: 0.3rem 0 0 0;
}

.api-key-display-wrapper input {
    padding-right: 70px;
    /* Make room for both buttons */
    width: 100%;
    font-family: monospace;
}

.download-api-key-btn {
    right: 38px;
}

/* 使用说明样式 */
.usage-instructions {
    margin-top: 0.5rem;
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 0.8rem 1rem;
}

.usage-instructions h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.usage-steps {
    list-style-type: decimal;
    padding-left: 1.5rem;
    margin: 0.5rem 0 0 0;
}

.usage-steps li {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.usage-steps li:last-child {
    margin-bottom: 0;
}

.inline-icon {
    height: 1em;
    width: auto;
    vertical-align: middle;
    margin: 0 0.25rem;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .usage-instructions {
        background-color: #2a2d3a;
    }

    .api-key-instruction {
        color: #aaa;
    }
}

/* 成功模态框整体布局调整 */
.success-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    /* 减小整体间距 */
}

.success-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0;
    /* 从0.6rem减小到0.4rem - 减少支付成功与下面元素的距离 */
}

.success-header h2 {
    margin-top: 0.3rem;
    /* 从0.4rem减小到0.3rem */
    margin-bottom: 0;
}

.success-content {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    /* 从0.8rem减小到0.6rem */
    margin-top: 0.3rem;
    /* 从0.4rem减小到0.3rem */
}

/* API Key 区域调整 */
.api-key-section {
    margin: 0.4rem 0;
    padding: 0.7rem;
    background-color: var(--bg-color);
}

.api-key-instruction {
    margin: 0.2rem 0 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.api-key-display-wrapper {
    margin-top: 0.4rem;
    margin-bottom: 0;
}

.api-key-display-wrapper input {
    padding-right: 80px;
    width: 100%;
    font-family: monospace;
    font-size: 0.9rem;
    background-color: var(--bg-secondary);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

/* 使用说明与配额统计调整 */
.quota-summary-compact,
.usage-instructions {
    margin-top: 0.4rem;
    background-color: var(--bg-color);
    border-radius: 8px;
    padding: 0.7rem;
    color: var(--text-main);
}

.usage-title {
    margin: 0;
    font-size: 1rem;
    text-align: left;
}

.usage-steps {
    list-style-position: inside;
    padding-left: 0;
    margin: 0.3rem 0 0 0;
    text-align: left;
}

.usage-steps li {
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

/* Dark mode overrides for specific success modal elements if needed */
@media (prefers-color-scheme: dark) {
    .quota-label {
        color: var(--text-muted);
    }
}