:root {
    --orange: #f27900;
}

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

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    background: white;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

.container {
    width: 100%;
    max-width: 7.5rem;
    margin: 0 auto;
}

/* ========== 三段式信纸布局 ========== */

.letter-top,
.letter-bottom {
    width: 100%;
    display: block;
}

/* 底部信封下方留出 iPhone 安全区高度，防止被 Home 条遮挡 */
.letter-bottom {
    margin-bottom: env(safe-area-inset-bottom, 0px);
}

/* 中间信纸区：纸色背景 + 左右花边竖条重复 */
.letter-body {
    width: 100%;
    box-sizing: border-box;
    background-color: #FBF3E8;
    background-image:
        url('/trophy/CodeBubbyAssets/5_58/left-border.png'),
        url('/trophy/CodeBubbyAssets/5_58/right-border.png');
    background-repeat: repeat-y, repeat-y;
    background-position: left top, right top;
    background-size: 5.56% auto, 5.56% auto;
    /* 内容缩进，避免压住花边（5.56% + 留白） */
    padding: 0.3rem 0.7rem 0.5rem;
}

.intro-text-1 {
    color: #000;
    font-size: 0.24rem;
    line-height: 2.3;
    text-align: justify;
    padding-bottom: 0.4rem;
}

.intro-text-1 .greeting {
    font-size: 0.3rem;
    font-weight: 600;
    display: inline;
}

.highlight {
    color: var(--orange);
    font-weight: 700;
    font-size: 1.12em;
}

.intro-text-2 {
    color: #000;
    font-size: 0.24rem;
    line-height: 1.75;
    text-align: justify;
    z-index: 2;
}



.claim-button {

    font-size: 0.34rem;
    letter-spacing: 0.03rem;
    padding: 0.1rem 0.4rem;
    color: #fff;
    background: linear-gradient(to right, #f3ac66, #f27900);
    border: 0.03rem solid #000;
    box-shadow: 0.05rem 0.05rem 0 rgba(0, 0, 0, 1);
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    white-space: nowrap;
}



/* ========== 表单弹窗 ========== */
.form-modal {
    max-width: 6.5rem;
}

.modal-content.form-modal {
    background: url('/trophy/CodeBubbyAssets/5_622/1.png') center center / 100% 100% no-repeat;
}

.form-modal .form-desc {
    text-align: center;
    font-size: 0.24rem;
    letter-spacing: 0.03rem;
    line-height: 1.8;
    margin-bottom: 0.3rem;
    color: #000;
}

.form-section {
    max-width: 100%;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.form-label {
    font-size: 0.28rem;
    letter-spacing: 0.04rem;
    color: #000;
    white-space: nowrap;
    flex-shrink: 0;
    width: 1.2rem;
}

.form-input {
    flex: 1;
    height: 0.72rem;
    padding: 0 0.2rem;
    border: 1px solid #000;
    background: white;
    font-size: 0.28rem;
    outline: none;
}

.form-input:focus {
    border-color: #666;
}

.form-input::placeholder {
    color: #999;
}

.payment-box {
    margin: 0.2rem 0 0.1rem;
    text-align: center;
}

.payment-amount {
    font-size: 0.3rem;
    letter-spacing: 0.04rem;
    margin-bottom: 0.06rem;
    color: #000;
    font-weight: normal;
}

.payment-amount .price {
    color: #DC0606;
}

.payment-note {
    font-size: 0.22rem;
    color: #000;
    letter-spacing: 0.03rem;
}

.pay-button {
    text-align: center;
    margin: 0.2rem 0;
}

.pay-button-wrapper {
    display: inline-block;
    position: relative;
    width: 70%;
    cursor: pointer;
}

.pay-button-wrapper:active {
    transform: scale(0.98);
}

.pay-button img {
    width: 100%;
    height: auto;
    display: block;
}

.pay-button-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 0.36rem;
    letter-spacing: 0.06rem;
    white-space: nowrap;
    pointer-events: none;
}

.tips-box {
    font-size: 0.2rem;
    letter-spacing: 0.02rem;
    line-height: 1.8;
    color: #000;
    text-align: left;
    margin-top: 0.1rem;
}

.submit-button {
    display: none;
}

/* ========== 移动端适配 ========== */

    .gift-img {
        width: 99%;
        display: block;
        margin: 0 auto;
    }

    .claim-button {
        font-size: .42rem;
        letter-spacing: 0.03rem;
        padding: 1.2vw 5vw;
        margin: .4rem auto 0;
        display: block;
    }

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 0.15rem 0.3rem;
    border-radius: 0.08rem;
    font-size: 0.28rem;
    z-index: 9999;
    display: none;
    white-space: nowrap;
}

.toast.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========== 弹窗通用 ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 0.2rem;
}

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

.modal-content {
    background: white;
    border-radius: 0.2rem;
    padding: 0.4rem 0.5rem;
    max-width: 6.5rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(0.5rem); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 0.15rem; right: 0.15rem;
    width: 0.48rem; height: 0.48rem;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 0.36rem;
    line-height: 1;
    color: #666;
    cursor: pointer;
}

.modal-title {
    font-size: 0.32rem;
    color: #333;
    margin-bottom: 0.15rem;
    text-align: center;
}

/* ========== 支付方式弹窗 ========== */
.payment-modal {
    max-width: 6rem;
}

.payment-amount-display {
    text-align: center;
    font-size: 0.28rem;
    color: #333;
    margin-bottom: 0.4rem;
    padding: 0.2rem;
    background: #f8f9fa;
    border-radius: 0.1rem;
}

.payment-amount-value {
    font-size: 0.36rem;
    font-weight: bold;
    color: #ff3b30;
    margin: 0 0.05rem;
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.35rem;
}

.payment-method {
    display: flex;
    align-items: center;
    padding: 0.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 0.12rem;
    cursor: pointer;
}

.payment-method.active {
    border-color: #00C800;
    background: #f0fff0;
}

.payment-method[data-method="alipay"].active {
    border-color: #009FE8;
    background: #f0f9ff;
}

.payment-icon {
    width: 0.64rem; height: 0.64rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.2rem;
    flex-shrink: 0;
}

.payment-icon svg {
    width: 0.48rem; height: 0.48rem;
}

.payment-name {
    flex: 1;
    font-size: 0.28rem;
    font-weight: 500;
    color: #333;
}

.payment-radio {
    width: 0.3rem; height: 0.3rem;
    border: 2px solid #ccc;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.payment-method.active .payment-radio { border-color: #00C800; }
.payment-method[data-method="alipay"].active .payment-radio { border-color: #009FE8; }

.payment-method.active .payment-radio::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 0.14rem; height: 0.14rem;
    background: #00C800;
    border-radius: 50%;
}

.payment-method[data-method="alipay"].active .payment-radio::after {
    background: #009FE8;
}

.confirm-payment-btn {
    width: 100%;
    padding: 0.2rem;
    font-size: 0.3rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    box-shadow: 0 0.04rem 0.15rem rgba(102, 126, 234, 0.4);
}

.confirm-payment-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* ========== 结果弹窗 ========== */
.result-modal {
    max-width: 6.2rem;
    text-align: center;
}

.result-content {
    padding: 0.2rem 0;
}

.result-icon {
    margin-bottom: 0.25rem;
}

.result-icon svg {
    width: 1rem; height: 1rem;
}

.success-icon svg { filter: drop-shadow(0 0.04rem 0.12rem rgba(82, 196, 26, 0.3)); }
.failure-icon svg { filter: drop-shadow(0 0.04rem 0.12rem rgba(255, 77, 79, 0.3)); }

.processing-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 1rem;
}

.spinner {
    width: 0.7rem; height: 0.7rem;
    border: 0.04rem solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.result-title {
    font-size: 0.34rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.15rem;
}

.result-message {
    font-size: 0.26rem;
    color: #666;
    margin-bottom: 0.25rem;
    line-height: 1.6;
}

.result-detail {
    background: #f8f9fa;
    border-radius: 0.1rem;
    padding: 0.2rem;
    margin-bottom: 0.25rem;
    text-align: left;
}

.result-detail p {
    font-size: 0.24rem;
    color: #555;
    margin: 0.1rem 0;
    display: flex;
    justify-content: space-between;
}

.result-amount {
    font-size: 0.32rem;
    font-weight: bold;
    color: #ff3b30;
}

.result-order-no {
    font-family: monospace;
    color: #333;
    font-weight: 500;
}

.result-btn {
    width: 100%;
    padding: 0.18rem;
    font-size: 0.28rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    box-shadow: 0 0.04rem 0.15rem rgba(102, 126, 234, 0.4);
}

.result-actions {
    display: flex;
    gap: 0.15rem;
}

.result-actions .result-btn {
    flex: 1;
}

.secondary-btn {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    box-shadow: none;
}

/* ========== 省市区三级联动 ========== */
.region-selects {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1;
}

.form-select {
    width: 100%;
    height: 0.72rem;
    padding: 0 0.5rem 0 0.2rem;
    border: 1px solid #ccc;
    border-radius: 0.08rem;
    background: #fff;
    font-size: 0.26rem;
    color: #333;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.15rem center;
    background-size: 0.18rem;
    transition: border-color 0.2s;
    cursor: pointer;
}

.form-select:focus {
    border-color: #f27900;
    box-shadow: 0 0 0 0.04rem rgba(242, 121, 0, 0.15);
}

.form-select:disabled {
    background-color: #f7f7f7;
    color: #bbb;
    border-color: #e0e0e0;
    cursor: not-allowed;
}

.form-select option {
    font-size: 0.28rem;
    color: #333;
}


/* ==================================================================== */
/* ====== 收货地址表单美化（弹窗 #formModal + 支付结果页 #addressSection） ====== */
/* ==================================================================== */

/* 卡片：弹窗保留信纸背景，留出更舒展的内边距 */
#formModal .modal-content.form-modal {
    padding: 0.7rem 0.6rem 0.55rem;
}

/* 标题 */
#formModal .modal-title,
#addressSection .result-title {
    font-size: 0.4rem;
    font-weight: 800;
    color: #e86a00;
    letter-spacing: 0.02rem;
    line-height: 1.45;
    margin-bottom: 0.14rem;
}

/* 副标题说明 */
#formModal .form-desc,
#addressSection .form-tip {
    color: #9a7b53;
    font-size: 0.24rem;
    line-height: 1.7;
    margin-bottom: 0.45rem;
}

/* 表单项：改为上下结构，更舒展 */
#formModal .form-group,
#addressSection .form-group {
    flex-direction: column;
    align-items: stretch;
    gap: 0.16rem;
    margin-bottom: 0.32rem;
}

/* 标签：左侧橙色竖条点缀 + 加粗 */
#formModal .form-label,
#addressSection .form-label {
    width: auto;
    font-size: 0.27rem;
    font-weight: 700;
    color: #5a4632;
    letter-spacing: 0.03rem;
    display: flex;
    align-items: center;
}
#formModal .form-label::before,
#addressSection .form-label::before {
    content: '';
    display: inline-block;
    width: 0.07rem;
    height: 0.28rem;
    background: linear-gradient(180deg, #ffb347, #f27900);
    border-radius: 0.05rem;
    margin-right: 0.14rem;
}

/* 输入框 & 下拉框：统一圆角软边白底 */
#formModal .form-input,
#formModal .form-select,
#addressSection .form-input,
#addressSection .form-select {
    width: 100%;
    height: 0.86rem;
    border: 0.02rem solid #ecdcc2;
    border-radius: 0.18rem;
    background: #fffdfa;
    font-size: 0.28rem;
    color: #3a3a3a;
    padding: 0 0.28rem;
    box-shadow: inset 0 0.02rem 0.06rem rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
#formModal .form-select,
#addressSection .form-select {
    padding-right: 0.7rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23e0a35a'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.24rem center;
    background-size: 0.2rem;
}

/* 聚焦态：暖橙高亮 + 柔光圈 */
#formModal .form-input:focus,
#formModal .form-select:focus,
#addressSection .form-input:focus,
#addressSection .form-select:focus {
    border-color: #f27900;
    background: #fff;
    box-shadow: 0 0 0 0.05rem rgba(242, 121, 0, 0.14);
}

#formModal .form-input::placeholder,
#addressSection .form-input::placeholder { color: #c2b29a; }

#formModal .form-select:disabled,
#addressSection .form-select:disabled {
    background-color: #f5f1ea;
    color: #c2b29a;
    border-color: #ece4d7;
}

/* 省市区三级：拉开间距 */
#formModal .region-selects,
#addressSection .region-selects { gap: 0.18rem; }

/* 提交按钮：留出呼吸空间，文字加重 */
#formModal .pay-button,
#addressSection .pay-button { margin: 0.45rem 0 0.1rem; }
#formModal .pay-button-wrapper,
#addressSection .pay-button-wrapper { width: 78%; }
#formModal .pay-button-text,
#addressSection .pay-button-text {
    color: #6a3b00;
    font-weight: 800;
    font-size: 0.36rem;
    letter-spacing: 0.1rem;
}

/* 温馨提示：做成淡橙信息条 */
#formModal .tips-box {
    margin-top: 0.3rem;
    text-align: center;
    color: #b07a3c;
    background: rgba(255, 244, 228, 0.75);
    border: 0.02rem dashed #f3c98a;
    border-radius: 0.14rem;
    padding: 0.16rem 0.2rem;
    line-height: 1.7;
}

/* 关闭按钮：与暖色调统一 */
#formModal .modal-close {
    background: rgba(242, 121, 0, 0.12);
    color: #d4691e;
}
