/**
 * 兑换码网站 - 样式（主色 #007AFF，响应式，卡片+渐变按钮）
 */

* {
    box-sizing: border-box;
}

:root {
    --primary: #007AFF;
    --primary-dark: #0066dd;
    --primary-light: #4da3ff;
    --card-shadow: 0 4px 20px rgba(0, 122, 255, 0.12);
    --card-radius: 16px;
    --btn-radius: 12px;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background: linear-gradient(160deg, #f0f5ff 0%, #e8f0fe 50%, #f5f8fc 100%);
    min-height: 100vh;
}

.page-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 16px;
}

.container {
    flex: 1;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
}

/* ---------- 进度条 ---------- */
.header {
    margin-bottom: 24px;
}

.progress-bar {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 16px 20px;
}

.progress-text {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
}
.progress-pct {
    font-weight: 500;
    color: #666;
    font-size: 13px;
}

.progress-track {
    height: 8px;
    background: #e8ecf4;
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 999px;
    transition: width 0.35s ease;
}

/* ---------- 步骤卡片 ---------- */
.main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step-card {
    display: none;
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 24px;
}

.step-card.active {
    display: block;
    animation: cardIn 0.3s ease;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-title {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

.tutorial {
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
}

.tutorial-img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 160px;
    object-fit: cover;
}

.tutorial-tip {
    margin: 0 0 20px;
    font-size: 14px;
    color: #666;
}

.form-group {
    margin-bottom: 16px;
}

.input-key {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e0e4ea;
    border-radius: var(--btn-radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-key:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
}

.form-group .error {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #c0392b;
}

/* ---------- 按钮：圆角 + 渐变 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--btn-radius);
    cursor: pointer;
    transition: transform 0.15s, opacity 0.2s;
    position: relative;
}

.btn:active {
    transform: scale(0.98);
}

.btn-next,
.btn-unlock {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 122, 255, 0.4);
}

.btn-next:hover,
.btn-unlock:hover {
    opacity: 0.95;
}

.btn.loading .btn-text {
    visibility: hidden;
}

.btn-loading {
    display: none;
    position: absolute;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn.loading .btn-loading {
    display: block;
}

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

/* ---------- 领取成功：兑换码展示 ---------- */
.redeem-code-label {
    margin: 0 0 8px;
    font-size: 14px;
    color: #666;
}

.redeem-code-display {
    margin: 0 0 16px;
    padding: 16px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--primary);
    background: #f0f6ff;
    border-radius: var(--btn-radius);
    border: 2px dashed rgba(0, 122, 255, 0.3);
    word-break: break-all;
    user-select: all;
    -webkit-user-select: all;
}

.btn-copy {
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
}

.btn-copy:hover {
    opacity: 0.95;
}

.btn-software {
    background: linear-gradient(135deg, #34c759 0%, #28a745 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(52, 199, 89, 0.35);
}

.btn-software:hover {
    opacity: 0.95;
}

/* ---------- 付费区域 ---------- */
.pay-area {
    margin-top: 24px;
    flex-shrink: 0;
}

.pay-card {
    background: linear-gradient(145deg, #fff 0%, #f8fafc 100%);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(0, 122, 255, 0.15);
}

.pay-title {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
    color: #444;
}

.btn-pay {
    display: inline-block;
    background: linear-gradient(135deg, #34c759 0%, #28a745 100%);
    color: #fff;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--btn-radius);
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(52, 199, 89, 0.35);
    transition: opacity 0.2s, transform 0.1s;
}

.btn-pay:hover {
    opacity: 0.95;
}

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

/* ---------- 弹窗 ---------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal.active {
    display: flex;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}
.modal-box {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    padding: 24px;
}
.modal-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}
.modal-desc {
    margin: 0 0 16px;
    font-size: 14px;
    color: #666;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 24px;
    line-height: 1;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 8px;
}
.modal-close:hover {
    color: #333;
    background: #f0f0f0;
}
.checkbox-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
}
.checkbox-remember input {
    width: auto;
}
.download-link-wrap {
    margin-bottom: 16px;
}
.download-link-text {
    margin: 0 0 12px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    background: #f5f8fc;
    border: 1px solid #e0e4ea;
    border-radius: var(--btn-radius);
    color: #1a1a2e;
}
.btn-copy-download {
    width: 100%;
}

/* ---------- Toast 提示 ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(80px);
    padding: 12px 20px;
    border-radius: var(--btn-radius);
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
    max-width: 90%;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.success { background: #34c759; }
.toast.error { background: #ff3b30; }
.toast.info { background: var(--primary); }

/* ---------- 响应式：PC 时主内容与付费区并排 ---------- */
@media (min-width: 768px) {
    .page-wrap {
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        padding: 24px;
        gap: 24px;
    }

    .container {
        margin: 0;
        max-width: 480px;
    }

    .pay-area {
        margin-top: 0;
        width: 280px;
        flex-shrink: 0;
        position: sticky;
        top: 24px;
    }
}

/* ---------- 移动端优化 ---------- */
@media (max-width: 767px) {
    .page-wrap {
        padding: 12px;
    }

    .step-card {
        padding: 20px;
    }

    .progress-bar {
        padding: 14px 16px;
    }
}
.verify-tip {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9em;
}

.verify-tip a {
    color: #007AFF;
    text-decoration: none;
}

.verify-tip a:hover {
    text-decoration: underline;
}

/* 付费区域验证 */
.pay-verify {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

.pay-verify-title {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 10px;
}

.pay-verify-form {
    display: flex;
    gap: 10px;
}

.pay-input {
    flex: 1;
    padding: 10px;
    font-size: 0.9em;
}

.btn-verify {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.btn-verify:hover {
    background: #218838;
}

/* 付费区域验证 - 优化版 */
.pay-verify {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.pay-verify-title {
    font-size: 1em;
    color: #555;
    margin-bottom: 15px;
    font-weight: 500;
}

.pay-verify-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pay-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: all 0.3s;
    box-sizing: border-box;
    height: 50px;
}

.pay-input:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0,122,255,0.1);
}

.btn-verify {
    width: 100%;
    background: #28a745;
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 500;
    transition: all 0.3s;
    height: 50px;
}

.btn-verify:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-verify:active {
    transform: translateY(0);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .pay-input {
        padding: 12px 14px;
        font-size: 1em;
        height: 46px;
    }
    
    .btn-verify {
        padding: 12px 16px;
        font-size: 1em;
        height: 46px;
    }
}