:root {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #fbbf24;
    --success-color: #10b981;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 10px 40px rgba(99, 102, 241, 0.15);
    --card-shadow-hover: 0 20px 60px rgba(99, 102, 241, 0.25);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

.page {
    min-height: 100vh;
    width: 100%;
}

/* ========== 微信引导页 ========== */
.wechat-page {
    position: relative;
    background: linear-gradient(180deg, #f0f4ff 0%, #e8edff 50%, #ddd6fe 100%);
}

.wechat-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 180px;
    background: linear-gradient(180deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
    z-index: 100;
    pointer-events: none;
}

.arrow-container {
    position: absolute;
    top: 12px;
    right: 20px;
    animation: floatArrow 1.5s ease-in-out infinite;
}

.arrow-icon {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 4px 12px rgba(251, 191, 36, 0.5));
}

.pulse-dot {
    animation: pulse 1.5s ease-in-out infinite;
    transform-origin: center;
}

@keyframes floatArrow {
    0%, 100% { transform: translateY(0) rotate(-10deg); }
    50% { transform: translateY(8px) rotate(-10deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; r: 8; }
    50% { opacity: 0.6; r: 12; }
}

.tap-hint {
    position: absolute;
    top: 70px;
    right: 90px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 15px;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.tap-dots {
    display: flex;
    gap: 4px;
}

.tap-dots .dot {
    width: 6px;
    height: 6px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: bounceDot 1.4s ease-in-out infinite;
}

.tap-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.tap-dots .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounceDot {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1.2); opacity: 1; }
}

.wechat-content {
    padding: 200px 24px 48px;
    max-width: 480px;
    margin: 0 auto;
}

.brand-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
}

.brand-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
}

.brand-logo svg {
    width: 100%;
    height: 100%;
}

.brand-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

.guide-steps {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
}

.steps-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.step-content {
    flex: 1;
    padding-top: 4px;
}

.step-text {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
}

.highlight {
    color: var(--primary-color);
    font-weight: 600;
}

.bottom-tip {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.swipe-icon {
    width: 24px;
    height: 24px;
    animation: swipeDown 2s ease-in-out infinite;
}

@keyframes swipeDown {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(6px); opacity: 1; }
}

/* ========== 浏览器引导页 ========== */
.browser-page {
    background: linear-gradient(180deg, #eef2ff 0%, #f5f3ff 50%, #faf5ff 100%);
    min-height: 100vh;
}

.browser-content {
    padding: 48px 24px 60px;
    max-width: 480px;
    margin: 0 auto;
}

.hero-section {
    text-align: center;
    margin-bottom: 32px;
}

.hero-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    animation: float 3s ease-in-out infinite;
}

.hero-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 30px rgba(99, 102, 241, 0.3));
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.guide-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.card-icon {
    width: 28px;
    height: 28px;
    color: var(--primary-color);
}

.card-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-steps {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ios-step,
.android-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-badge {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.step-info {
    flex: 1;
    padding-top: 4px;
}

.step-label {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
}

.step-highlight {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 2px;
}

.step-icon-preview {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f3f4f6;
    border-radius: 8px;
    color: var(--primary-color);
}

.safari-share svg {
    width: 20px;
    height: 20px;
}

.menu-dots {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: center;
    justify-content: center;
}

.menu-dots span {
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
}

/* 预览卡片 */
.preview-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
    text-align: center;
}

.preview-title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.app-icon-preview {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.app-icon {
    width: 60px;
    height: 60px;
    animation: iconBounce 2s ease-in-out infinite;
}

.app-icon svg {
    width: 100%;
    height: 100%;
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.app-name {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 行动按钮 */
.action-section {
    margin-top: 8px;
}

.primary-btn {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    transition: all var(--transition-normal);
    min-height: 52px;
}

.primary-btn:active {
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.primary-btn svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
}

.primary-btn:active svg {
    transform: translateX(4px);
}

/* ========== 动画类 ========== */
.animate-slide-up {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 0.6s ease forwards;
}

.animate-fade-in {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.25s; }
.delay-3 { animation-delay: 0.4s; }

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

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

/* ========== 调试按钮 ========== */
.debug-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 8px 16px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    z-index: 999;
    cursor: pointer;
}

/* ========== 响应式 ========== */
@media (min-width: 768px) {
    .wechat-content,
    .browser-content {
        padding-top: 60px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .brand-name {
        font-size: 28px;
    }
}

@media (max-width: 360px) {
    .wechat-content {
        padding: 180px 16px 40px;
    }
    
    .browser-content {
        padding: 32px 16px 48px;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .hero-icon {
        width: 100px;
        height: 100px;
    }
    
    .guide-card,
    .guide-steps,
    .brand-card,
    .preview-card {
        padding: 20px;
    }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .wechat-mask {
        height: 120px;
    }
    
    .wechat-content {
        padding-top: 140px;
    }
    
    .browser-content {
        padding-top: 24px;
    }
    
    .hero-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 12px;
    }
    
    .hero-title {
        font-size: 20px;
        margin-bottom: 8px;
    }
}

/* ========== 生成器页面 ========== */
.generator-page {
    background: linear-gradient(180deg, #eef2ff 0%, #f5f3ff 50%, #fdf4ff 100%);
    min-height: 100vh;
}

.generator-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 48px 24px 60px;
}

.gen-header {
    text-align: center;
    margin-bottom: 32px;
}

.gen-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.gen-logo svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 8px 24px rgba(99, 102, 241, 0.3));
}

.gen-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gen-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 表单卡片 */
.gen-form-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
}

.gen-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.label-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.label-icon svg {
    width: 18px;
    height: 18px;
}

.label-required {
    color: #ef4444;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="url"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--text-primary);
    background: #f9fafb;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.form-group input[type="text"]:focus,
.form-group input[type="url"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
    color: var(--text-light);
}

.form-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

/* 颜色选择器 */
.color-picker-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-picker-wrapper input[type="color"] {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    cursor: pointer;
    background: none;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 3px;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
    border-radius: 6px;
    border: none;
}

.color-picker-wrapper input[type="text"] {
    flex: 1;
    padding: 12px 12px !important;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    text-transform: uppercase;
}

/* 提交按钮 */
.gen-submit-btn {
    margin-top: 8px;
    min-height: 52px;
    font-size: 16px;
    gap: 8px;
}

.gen-submit-btn svg {
    width: 20px;
    height: 20px;
}

/* 结果卡片 */
.gen-result-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
    border: 2px solid #86efac;
    position: relative;
    overflow: hidden;
}

.gen-result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #34d399, #6ee7b7);
}

.result-header {
    text-align: center;
    margin-bottom: 24px;
}

.result-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, #10b981, #34d399);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: resultPop 0.5s ease;
}

.result-icon svg {
    width: 28px;
    height: 28px;
}

@keyframes resultPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.result-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.result-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.result-link-box,
.result-qr-box {
    margin-bottom: 20px;
}

.link-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.link-content {
    display: flex;
    gap: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    padding: 4px;
}

.link-content input {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-primary);
    font-family: 'SF Mono', Monaco, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-content input:focus {
    outline: none;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.copy-btn:active {
    transform: scale(0.96);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
}

/* 二维码 */
.qr-wrapper {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
}

.qrcode-container {
    padding: 10px;
    background: white;
    border-radius: var(--radius-sm);
}

.qrcode-container img,
.qrcode-container canvas {
    display: block;
    border-radius: 4px;
}

/* 操作按钮 */
.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.secondary-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 20px;
    background: #f3f4f6;
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.secondary-btn:active {
    transform: scale(0.98);
    background: #e5e7eb;
}

.secondary-btn svg {
    width: 18px;
    height: 18px;
}

/* 特性介绍 */
.gen-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.feature-item {
    text-align: center;
    padding: 20px 12px;
    background: rgba(255,255,255,0.7);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

.feature-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.feature-icon svg {
    width: 22px;
    height: 22px;
}

.feature-item h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.feature-item p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 页脚 */
.gen-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
}

/* 生成器响应式 */
@media (max-width: 520px) {
    .generator-container {
        padding: 32px 16px 48px;
    }
    
    .gen-title {
        font-size: 24px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .gen-features {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .feature-item {
        display: flex;
        align-items: center;
        text-align: left;
        gap: 12px;
        padding: 16px;
    }
    
    .feature-icon {
        margin: 0;
        flex-shrink: 0;
    }
    
    .result-actions {
        flex-direction: column;
    }
}

@media (min-width: 768px) {
    .gen-title {
        font-size: 32px;
    }
    
    .gen-form-card,
    .gen-result-card {
        padding: 36px 32px;
    }
}
