/* ============================================
   二级页面通用样式 sub_page.css
   ============================================ */

/* 页面通用背景 */
body { background: var(--bg, #F5F5F5); }

/* ---- 二级页顶部导航 ---- */
.sub-header {
    position: sticky;
    top: 0; z-index: 100;
    background: #fff;
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 14px;
    border-bottom: 1px solid #eee;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.sub-header-back {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    margin-right: 6px;
    border-radius: 50%;
    cursor: pointer;
    color: #222;
    font-size: 20px;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s;
}
.sub-header-back:active { background: #f0f0f0; }

.sub-header-title {
    flex: 1;
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    /* 让标题视觉上居中（左边36px back，补右侧）*/
    margin-right: 36px;
}

.sub-header-action {
    font-size: 14px;
    color: var(--primary, #FF6B35);
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
    /* 覆盖 margin-right 保证右侧有内容时正常 */
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
}

/* ---- 卡片通用 ---- */
.sub-card {
    background: #fff;
    border-radius: 12px;
    margin: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.sub-card-title {
    font-size: 15px;
    font-weight: 700;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #eee;
    color: #1a1a1a;
}

/* ---- 表单样式 ---- */
.form-section { padding: 0 12px; }

.form-card {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-row {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}
.form-row:last-child { border-bottom: none; }

.form-label {
    font-size: 14px;
    color: #666;
    width: 64px;
    flex-shrink: 0;
}

.form-input-wrap { flex: 1; }

.form-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    color: #1a1a1a;
    background: transparent;
    padding: 0;
    font-family: inherit;
}
.form-input::placeholder { color: #bbb; }

.form-select {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    color: #1a1a1a;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    padding: 0;
}

.form-textarea {
    width: 100%;
    border: none;
    outline: none;
    font-size: 14px;
    color: #1a1a1a;
    background: transparent;
    resize: none;
    font-family: inherit;
    line-height: 1.5;
    min-height: 56px;
}

/* ---- 底部固定按钮 ---- */
.sub-footer-btn {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    padding: 10px 16px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.btn-sub-primary {
    flex: 1;
    height: 46px;
    background: var(--primary, #FF6B35);
    color: #fff;
    border: none;
    border-radius: 23px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-sub-primary:active { opacity: 0.8; }

.btn-sub-secondary {
    height: 46px;
    padding: 0 24px;
    background: #fff;
    color: #666;
    border: 1.5px solid #ddd;
    border-radius: 23px;
    font-size: 15px;
    cursor: pointer;
}
.btn-sub-secondary:active { background: #f5f5f5; }

/* ---- 空态 ---- */
.empty-state {
    text-align: center;
    padding: 60px 0 40px;
    color: #bbb;
}
.empty-state-icon { font-size: 52px; margin-bottom: 12px; }
.empty-state-text { font-size: 14px; color: #bbb; }
.empty-state-btn {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 28px;
    background: var(--primary, #FF6B35);
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    text-decoration: none;
    font-weight: 600;
}

/* ---- Toast ---- */
.toast {
    position: fixed;
    bottom: 100px; left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 9px 20px;
    border-radius: 20px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 9999;
    white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- 地址页 ---- */
.address-card {
    background: #fff;
    border-radius: 12px;
    margin: 0 12px 10px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
    cursor: pointer;
}
.address-card.default { border: 1.5px solid var(--primary, #FF6B35); }

.address-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.address-name { font-size: 15px; font-weight: 700; }
.address-phone { font-size: 13px; color: #666; }
.address-default-tag {
    background: var(--primary, #FF6B35);
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
}
.address-detail { font-size: 13px; color: #666; line-height: 1.5; }
.address-card-actions {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}
.address-action-btn {
    font-size: 13px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 0;
}
.address-action-btn.danger { color: #FF4444; }

.btn-add-address {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 12px;
    padding: 13px;
    background: #fff;
    border: 1.5px dashed #ddd;
    border-radius: 12px;
    font-size: 15px;
    color: var(--primary, #FF6B35);
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.btn-add-address:active { background: #FFF4F0; border-color: var(--primary, #FF6B35); }

/* ---- 底部弹窗 ---- */
.bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 500;
    display: none;
}
.bottom-sheet-overlay.show { display: block; }

.bottom-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    z-index: 501;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}
.bottom-sheet.show { transform: translateY(0); }

.bottom-sheet-handle {
    width: 36px; height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin: 10px auto 14px;
}

.bottom-sheet-title {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    padding: 0 16px 14px;
    border-bottom: 1px solid #f0f0f0;
}

/* ---- 邀请页 ---- */
.invite-hero {
    background: linear-gradient(135deg, var(--primary, #FF6B35), #FF8C42);
    padding: 30px 20px;
    text-align: center;
    color: #fff;
}
.invite-hero-icon { font-size: 52px; margin-bottom: 10px; }
.invite-hero-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.invite-hero-sub { font-size: 13px; opacity: 0.9; }

.invite-qr-wrap {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    display: inline-block;
    margin-top: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.invite-link-card {
    background: #fff;
    border-radius: 12px;
    margin: 12px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.invite-link-label { font-size: 12px; color: #999; margin-bottom: 8px; }
.invite-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.invite-link-input {
    flex: 1;
    padding: 10px 12px;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    color: #666;
    outline: none;
}
.btn-copy-invite {
    padding: 10px 16px;
    background: var(--primary, #FF6B35);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.invite-benefit-card {
    background: #fff;
    border-radius: 12px;
    margin: 0 12px 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.invite-benefit-title {
    font-size: 15px;
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}
.invite-benefit-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}
.invite-benefit-row:last-child { border-bottom: none; }
.invite-benefit-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--primary-bg, #FFF4F0);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.invite-benefit-text { flex: 1; font-size: 14px; color: #333; }
.invite-benefit-reward {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary, #FF6B35);
}

.invite-record-card {
    background: #fff;
    border-radius: 12px;
    margin: 0 12px 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.invite-record-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}
.invite-record-row:last-child { border-bottom: none; }
.invite-record-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--primary-bg, #FFF4F0);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.invite-record-info { flex: 1; }
.invite-record-name { font-size: 14px; font-weight: 600; }
.invite-record-time { font-size: 12px; color: #999; margin-top: 2px; }
.invite-record-reward { font-size: 14px; font-weight: 700; color: var(--primary, #FF6B35); }

/* ---- 注册页 ---- */
.register-wrap {
    min-height: 100vh;
    background: linear-gradient(160deg, #FF6B35 0%, #FF8C42 40%, #F5F5F5 40%);
    display: flex;
    flex-direction: column;
}
.register-logo-area {
    padding: 40px 24px 24px;
    color: #fff;
    text-align: center;
}
.register-logo { font-size: 44px; margin-bottom: 8px; }
.register-app-name { font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.register-slogan { font-size: 13px; opacity: 0.85; margin-top: 4px; }

.register-form-card {
    margin: 0 16px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.register-tabs {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
}
.register-tab-btn {
    flex: 1;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    color: #999;
    background: none;
    border: none;
    border-bottom: 2.5px solid transparent;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.register-tab-btn.active {
    color: var(--primary, #FF6B35);
    border-bottom-color: var(--primary, #FF6B35);
}

.register-form-body { padding: 16px; }

.reg-form-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    gap: 10px;
}
.reg-form-row:last-of-type { border-bottom: none; }

.reg-form-icon { font-size: 18px; width: 28px; text-align: center; flex-shrink: 0; }
.reg-form-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: #1a1a1a;
    background: transparent;
    padding: 0;
    font-family: inherit;
}
.reg-form-input::placeholder { color: #bbb; }

.btn-register-submit {
    width: 100%;
    height: 48px;
    background: var(--primary, #FF6B35);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 16px;
    transition: opacity 0.2s;
}
.btn-register-submit:active { opacity: 0.85; }

.register-agree {
    font-size: 12px;
    color: #aaa;
    text-align: center;
    margin-top: 12px;
    padding-bottom: 4px;
}
.register-agree a { color: var(--primary, #FF6B35); text-decoration: none; }

.register-login-link {
    text-align: center;
    padding: 16px;
    font-size: 13px;
    color: #999;
}
.register-login-link a { color: var(--primary, #FF6B35); font-weight: 600; text-decoration: none; }

/* ---- 定位条 ---- */
.location-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #FFF4F0;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--primary, #FF6B35);
    cursor: pointer;
    border-bottom: 1px solid #FFE0D0;
}
.location-bar-icon { font-size: 16px; }
.location-bar-text { flex: 1; font-weight: 500; }
.location-bar-change { font-size: 12px; opacity: 0.7; }

/* ---- 情侣页修复 ---- */
.couple-page { background: var(--bg, #F5F5F5); }
