/* ============ CSS 重置和基础设置 ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0ea5a4;
    --primary-dark: #0891b2;
    --primary-light: #5eead4;
    --primary-bg: #ecfeff;
    --text-dark: #0f172a;
    --text-medium: #475569;
    --text-light: #94a3b8;
    --bg-body: #f0fdfa;
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
        sans-serif;
    background: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* ============ 背景装饰 ============ */
.bg-decoration {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
}

.circle-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #5eead4 0%, transparent 70%);
    top: -150px;
    left: -150px;
    animation: float 20s ease-in-out infinite;
}

.circle-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #67e8f9 0%, transparent 70%);
    bottom: -100px;
    right: -100px;
    animation: float 25s ease-in-out infinite reverse;
}

.circle-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #a5f3fc 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float 30s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, -40px); }
}

/* ============ 顶部品牌区 ============ */
.brand-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 32px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.brand-logo {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(14, 165, 164, 0.25));
}

.brand-logo svg {
    width: 100%;
    height: 100%;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.3px;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--text-light);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ============ 主内容区 ============ */
.main-content {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 24px;
    gap: 24px;
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
}

/* ============ 卡片容器 ============ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px 32px 32px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

/* 卡片标题区 */
.card-header {
    text-align: center;
    margin-bottom: 32px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--primary-bg);
    border-radius: 100px;
    font-size: 12px;
    color: var(--primary-dark);
    font-weight: 500;
    margin-bottom: 16px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    position: relative;
}

.status-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--primary);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(2);
        opacity: 0;
    }
}

.card-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.card-desc {
    font-size: 14px;
    color: var(--text-medium);
}

/* ============ 二维码展示区 ============ */
.qrcode-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.qrcode-frame {
    position: relative;
    width: 240px;
    height: 240px;
    padding: 16px;
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfeff 100%);
    border-radius: var(--radius-md);
    border: 2px solid var(--primary-light);
    box-shadow: 0 8px 24px rgba(14, 165, 164, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid var(--primary);
}

.corner-tl {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 12px;
}

.corner-tr {
    top: -3px;
    right: -3px;
    border-left: none;
    border-bottom: none;
    border-top-right-radius: 12px;
}

.corner-bl {
    bottom: -3px;
    left: -3px;
    border-right: none;
    border-top: none;
    border-bottom-left-radius: 12px;
}

.corner-br {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 12px;
}

.qrcode-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
}

.qrcode-container canvas,
.qrcode-container img {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.qrcode-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.qrcode-logo svg {
    width: 100%;
    height: 100%;
}

/* ============ 操作按钮区 ============ */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(14, 165, 164, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(14, 165, 164, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--primary-bg);
    color: var(--primary-dark);
    border: 1px solid transparent;
}

.btn-secondary:hover {
    background: #cffafe;
    border-color: var(--primary-light);
}

/* ============ URL 显示区 ============ */
.url-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed var(--border);
}

.url-icon {
    color: var(--text-light);
    flex-shrink: 0;
}

.url-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.url-text {
    flex: 1;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 12px;
    color: var(--text-medium);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============ 提示卡片 ============ */
.tips-card {
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.tips-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 14px;
}

.tips-title svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.tips-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tips-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-medium);
}

.tip-number {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============ 页脚 ============ */
.page-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: var(--text-light);
}

.footer-version {
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.7;
}

/* ============ Toast 提示 ============ */
.toast {
    position: fixed;
    top: 32px;
    left: 50%;
    transform: translate(-50%, -120%);
    background: var(--text-dark);
    color: white;
    padding: 12px 20px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.3s;
}

.toast.show {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
}

.toast svg {
    width: 18px;
    height: 18px;
    color: var(--primary-light);
}

/* ============ 响应式设计 ============ */
@media (max-width: 480px) {
    .brand-header {
        padding: 20px 20px;
    }

    .brand-title {
        font-size: 18px;
    }

    .main-content {
        padding: 12px 16px;
    }

    .card {
        padding: 28px 20px 24px;
        border-radius: 20px;
    }

    .card-title {
        font-size: 20px;
    }

    .qrcode-frame {
        width: 220px;
        height: 220px;
    }

    .action-buttons {
        gap: 8px;
    }

    .btn {
        padding: 10px 8px;
        font-size: 12px;
    }

    .btn span {
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .qrcode-frame {
        width: 200px;
        height: 200px;
        padding: 12px;
    }

    .btn span {
        display: none;
    }

    .btn svg {
        width: 18px;
        height: 18px;
    }
}

/* ============ 入场动画 ============ */
.card,
.tips-card,
.brand-header {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.brand-header { animation-delay: 0.05s; }
.card { animation-delay: 0.15s; }
.tips-card { animation-delay: 0.3s; }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}