/* User Redeem Page Design System */
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-soft: #eef2ff;

    --bg-main: #f9fafb;
    --bg-surface: #ffffff;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    --border-base: #e2e8f0;

    --success: #10b981;
    --success-soft: #ecfdf5;
    --danger: #ef4444;
    --danger-soft: #fef2f2;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, inherit;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3.5rem 1.5rem 1.5rem;
    line-height: 1.5;
}

.container {
    max-width: 1260px;
    width: 100%;
}

.switch-confirm-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1000;
}

.switch-confirm-modal.show {
    display: flex;
}

.switch-confirm-dialog {
    width: min(100%, 520px);
    background: var(--bg-surface);
    border: 1px solid var(--border-base);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.switch-confirm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-base);
}

.switch-confirm-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
}

.switch-confirm-close {
    border: none;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
}

.switch-confirm-body {
    padding: 1.25rem 1.5rem;
}

.switch-confirm-message {
    color: var(--text-main);
    margin-bottom: 1rem;
}

.switch-confirm-summary {
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-base);
    border-radius: 12px;
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.switch-confirm-summary + .switch-confirm-summary {
    margin-top: 0.75rem;
}

.switch-confirm-warning {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    font-size: 0.92rem;
}

.switch-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0 1.5rem 1.25rem;
}

.email-confirm-dialog {
    width: min(100%, 560px);
}

.email-confirm-form-group {
    margin-top: 1rem;
    margin-bottom: 0;
}

.email-confirm-error {
    min-height: 1.25rem;
    margin-top: 0.45rem;
    font-size: 0.8rem;
    color: var(--danger);
}

.announcement-dialog {
    width: min(100%, 620px);
}

.announcement-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.announcement-image-wrap {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-base);
    background: #f8fafc;
}

.announcement-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
}

.announcement-text {
    display: flex;
    flex-direction: column;
    gap: 0.72rem;
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.65;
}

.announcement-text p {
    margin: 0;
}

.redeem-layout {
    display: grid;
    gap: 1.25rem;
    align-items: start;
    justify-content: center;
}

.redeem-layout-with-announcement {
    grid-template-columns: minmax(280px, 320px) minmax(0, 560px) minmax(280px, 320px);
}

.redeem-layout-no-announcement {
    grid-template-columns: minmax(0, 560px) minmax(280px, 320px);
}

.redeem-main-card {
    width: 100%;
    min-width: 0;
    align-self: start;
    display: flex;
    flex-direction: column;
}

.redeem-side-wrapper {
    display: flex;
    align-self: start;
    min-height: 0;
    overflow: hidden;
}

.redeem-announcement-panel,
.redeem-guide-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    flex: 1 1 auto;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.redeem-announcement-panel {
    padding: 1.05rem;
    border: 1px solid rgba(14, 116, 144, 0.16);
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.1), transparent 36%),
        linear-gradient(180deg, #f8fffb 0%, #ffffff 100%);
}

.redeem-announcement-head {
    margin-bottom: 0.7rem;
}

.redeem-announcement-head h3 {
    font-size: 1.14rem;
    line-height: 1.25;
    color: var(--text-main);
}

.redeem-announcement-image-wrap {
    margin-bottom: 0.72rem;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    flex-shrink: 0;
}

.redeem-announcement-image {
    display: block;
    width: 100%;
    max-height: 150px;
    object-fit: contain;
    background: #ffffff;
}

.redeem-announcement-body {
    min-height: 0;
    flex: 1;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    padding: 0.95rem 0.9rem;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.redeem-announcement-text {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-main);
    font-size: 0.88rem;
    line-height: 1.72;
    padding-right: 0.25rem;
}

.redeem-announcement-empty {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.68;
}

/* ===== 右侧固定展示二维码 ===== */
.announcement-float-card {
    position: fixed;
    right: 1.25rem;
    bottom: 5rem;
    width: min(220px, calc(100vw - 2rem));
    border-radius: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-base);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 200;
}

.announcement-float-card-head {
    padding: 0.95rem 1rem 0.7rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), transparent);
    border-bottom: 1px solid var(--border-base);
}

.announcement-float-card-head h3 {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.2rem;
}

.announcement-float-card-head p {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.announcement-float-card-body {
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.announcement-float-card-link {
    display: inline-flex;
    border-radius: 16px;
    overflow: hidden;
}

.announcement-float-card-image {
    display: block;
    width: 168px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid var(--border-base);
    background: #ffffff;
}

.announcement-float-card-tip {
    margin-top: 0.7rem;
    text-align: center;
    font-size: 0.76rem;
    line-height: 1.55;
    color: var(--text-muted);
}

.redeem-guide-panel {
    border: 1px solid rgba(99, 102, 241, 0.12);
    padding: 1.05rem;
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.12), transparent 38%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.redeem-guide-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.redeem-guide-head {
    margin-bottom: 0.68rem;
}

.redeem-guide-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 9999px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.redeem-guide-head h2 {
    margin-top: 0.95rem;
    margin-bottom: 0.55rem;
    font-size: 1.45rem;
    line-height: 1.2;
    color: var(--text-main);
}

.redeem-guide-head p {
    font-size: 0.92rem;
    color: var(--text-muted);
}

.redeem-guide-list {
    display: grid;
    gap: 0.52rem;
}

.redeem-guide-footer {
    margin-top: auto;
    padding-top: 0.58rem;
    flex-shrink: 0;
}

.redeem-guide-action {
    width: 100%;
}

.redeem-guide-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.58rem;
    padding: 0.8rem 0.75rem;
    border-radius: 15px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.82);
}

.redeem-guide-item-neutral {
    border-color: rgba(148, 163, 184, 0.25);
}

.redeem-guide-item-warning {
    border-color: rgba(245, 158, 11, 0.22);
    background: linear-gradient(180deg, rgba(255, 251, 235, 0.95), rgba(255, 255, 255, 0.9));
}

.redeem-guide-item-accent {
    border-color: rgba(99, 102, 241, 0.22);
    background: linear-gradient(180deg, rgba(238, 242, 255, 0.95), rgba(255, 255, 255, 0.92));
}

.redeem-guide-item-premium {
    border-color: rgba(16, 185, 129, 0.24);
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(255, 255, 255, 0.92));
}

.redeem-guide-badge {
    width: 1.62rem;
    height: 1.62rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: var(--text-main);
    color: #ffffff;
    font-size: 0.64rem;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

.redeem-guide-item-warning .redeem-guide-badge {
    background: #d97706;
}

.redeem-guide-item-accent .redeem-guide-badge {
    background: var(--primary);
}

.redeem-guide-item-premium .redeem-guide-badge {
    background: #059669;
}

.redeem-guide-copy h3 {
    font-size: 0.84rem;
    font-weight: 800;
    margin-bottom: 0.08rem;
    color: var(--text-main);
    line-height: 1.22;
}

.redeem-guide-copy p {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.34;
}

.header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
}

.service-switcher {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin: 1.4rem auto 0;
    max-width: 1040px;
    text-align: left;
}

.service-switch-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--border-base);
    background:
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    position: relative;
}

.service-switch-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.service-switch-card-active {
    border-color: rgba(99, 102, 241, 0.28);
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.10), transparent 42%),
        linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
    box-shadow: 0 12px 24px -18px rgba(99, 102, 241, 0.55);
}

.service-switch-card-external {
    border-color: rgba(245, 158, 11, 0.25);
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent 42%),
        linear-gradient(180deg, #ffffff 0%, #fffbeb 100%);
}

.service-switch-card-external:hover {
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 12px 24px -18px rgba(245, 158, 11, 0.45);
}

.service-switch-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.service-switch-card strong {
    font-size: 0.95rem;
    color: var(--text-main);
}

.service-switch-copy {
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.warranty-section {
    margin-top: 2.5rem;
    padding-top: 1.9rem;
    border-top: 1px solid var(--border-base);
}

.warranty-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.08rem;
    margin-bottom: 0.95rem;
    color: var(--text-main);
}

.warranty-section-icon {
    width: 18px;
    height: 18px;
}

.warranty-section-help {
    margin-bottom: 0.95rem;
}

.warranty-section-input {
    margin-bottom: 0.95rem;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-base);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition-base);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

.btn {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

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

/* Toast */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-base);
    display: none;
    z-index: 100;
}

.toast.show {
    display: block;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

/* Steps */
.step {
    display: none;
}

.step.active {
    display: block;
}

/* Result */
.result-success {
    text-align: center;
}

.result-error {
    text-align: center;
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.result-message {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.result-policy-inline {
    margin-top: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-full);
    background-color: var(--primary-soft);
    color: var(--primary);
    font-size: 0.88rem;
    font-weight: 600;
    flex-wrap: wrap;
    justify-content: center;
}

.result-policy-inline-label {
    color: var(--text-muted);
    font-weight: 600;
}

.result-policy-inline-value {
    color: var(--primary);
    font-weight: 800;
}

.policy-inline-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.policy-inline-tooltip-trigger {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background-color: rgba(99, 102, 241, 0.12);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    cursor: help;
    border: 1px solid rgba(99, 102, 241, 0.18);
}

.policy-inline-tooltip-content {
    position: absolute;
    left: 50%;
    top: calc(100% + 0.65rem);
    transform: translateX(-50%) translateY(-4px);
    width: min(320px, calc(100vw - 3rem));
    padding: 0.85rem 0.95rem;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.97);
    color: #f8fafc;
    text-align: left;
    font-size: 0.8rem;
    line-height: 1.6;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition-base), transform var(--transition-base), visibility var(--transition-base);
    z-index: 30;
}

.policy-inline-tooltip-content::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -6px;
    width: 12px;
    height: 12px;
    background: rgba(15, 23, 42, 0.97);
    transform: translateX(-50%) rotate(45deg);
}

.policy-inline-tooltip-item + .policy-inline-tooltip-item {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.policy-inline-tooltip-item strong {
    display: block;
    margin-bottom: 0.15rem;
    color: #ffffff;
}

.policy-inline-tooltip:hover .policy-inline-tooltip-content,
.policy-inline-tooltip:focus-within .policy-inline-tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.result-details {
    background-color: var(--bg-main);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: left;
    margin-bottom: 2rem;
}

.result-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-base);
}

.result-detail-item:last-child {
    border-bottom: none;
}

.result-detail-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.result-detail-value {
    font-size: 0.875rem;
    font-weight: 600;
}

.policy-summary-card {
    text-align: left;
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-soft), #f8faff);
    border: 1px solid rgba(99, 102, 241, 0.18);
}

.policy-summary-label {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.35rem;
}

.policy-summary-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
    color: var(--text-main);
}

.policy-summary-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.activation-success-note {
    margin-bottom: 1.5rem;
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(245, 158, 11, 0.28);
    background: linear-gradient(180deg, #fff7ed 0%, #fffbeb 100%);
    color: #9a3412;
    font-size: 0.92rem;
    line-height: 1.7;
    text-align: left;
}

.community-qr-card {
    margin: 0 auto 1.5rem;
    padding: 1rem 1rem 1.1rem;
    max-width: 260px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #fbfcff 0%, #f5f8ff 100%);
    border: 1px solid rgba(59, 130, 246, 0.14);
    box-shadow: var(--shadow-sm);
}

.community-qr-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}

.community-qr-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.85rem;
}

.community-qr-box {
    display: flex;
    justify-content: center;
}

.community-qr-link {
    display: inline-flex;
    border-radius: 14px;
    overflow: hidden;
}

.community-qr-image {
    display: block;
    width: 168px;
    height: 168px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
}

.community-qr-tip {
    margin-top: 0.65rem;
    font-size: 0.76rem;
    color: var(--text-muted);
}

#warrantyResult .card,
#step2 .card,
#step3 .card {
    max-width: 560px;
    margin: 0 auto;
}

@media (max-width: 1220px) {
    .container {
        max-width: 560px;
    }

    .service-switcher {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 560px;
    }

    .redeem-layout {
        grid-template-columns: 1fr;
    }

    .redeem-side-wrapper {
        height: auto;
    }

    .redeem-announcement-panel,
    .redeem-guide-panel {
        width: 100%;
        margin-top: 1.25rem;
        padding: 1.25rem;
        height: auto;
    }

    .redeem-side-wrapper {
        min-height: auto;
        height: auto;
    }

    .redeem-announcement-text {
        max-height: 280px;
    }

    .announcement-float-card {
        display: none;
    }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    body {
        padding: 1rem;
    }

    .header {
        margin-bottom: 1.5rem;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    .redeem-announcement-panel,
    .redeem-guide-panel {
        padding: 1rem;
        border-radius: 20px;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        top: 1rem;
    }

    .result-title {
        font-size: 1.25rem;
    }

    .result-policy-inline {
        border-radius: var(--radius-md);
        padding: 0.65rem 0.8rem;
    }

    .switch-confirm-actions {
        flex-direction: column;
    }
}
