/* ==================== 教程页面样式 ==================== */
/*
 * 功能：家庭组接受邀请图文教程页面样式
 * 流程：全局重置 → 背景 → 顶部导航 → 步骤卡片 → 图片预览 → 响应式
 * 参数：亮色科技感主题 — 与 landing.css 保持一致的设计语言
 */

:root {
    --bg-primary: #f0f2f7;
    --bg-secondary: #e4e9f2;
    --bg-card: rgba(255, 255, 255, 0.88);
    --border-card: rgba(79, 110, 247, 0.1);
    --text-primary: #1a1a2e;
    --text-secondary: #5a6478;
    --text-hint: #8b95a8;
    --accent: #4f6ef7;
    --accent-glow: rgba(79, 110, 247, 0.25);
    --success: #00c48c;
    --error: #f25f5c;
    --warning: #f2a71b;
    --radius: 16px;
    --radius-lg: 20px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding: 0;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(79, 110, 247, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(124, 92, 245, 0.06) 0%, transparent 50%),
        linear-gradient(rgba(79, 110, 247, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 110, 247, 0.03) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    background-attachment: fixed;
}

/* ==================== 背景画布 ==================== */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ==================== 顶部导航 ==================== */
.tut-header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2.5rem 1.5rem 2rem;
    animation: fadeSlideDown 0.8s ease-out;
}

.tut-back-link {
    position: absolute;
    top: 2rem;
    left: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--accent);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    backdrop-filter: blur(12px);
    transition: var(--transition);
}

.tut-back-link:hover {
    transform: translateX(-3px);
    border-color: var(--accent);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.back-arrow {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.tut-back-link:hover .back-arrow {
    transform: translateX(-3px);
}

.tut-page-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #1a1a2e 0%, #4f6ef7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 0.5rem;
}

.tut-page-subtitle {
    margin-top: 0.6rem;
    font-size: 0.92rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ==================== 主内容区域 ==================== */
.tut-main {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* ==================== 警告提示卡片 ==================== */
.tut-alert-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(79, 110, 247, 0.06) 0%, rgba(124, 92, 245, 0.04) 100%);
    border: 1px solid rgba(79, 110, 247, 0.15);
    border-radius: var(--radius);
    margin-bottom: 2rem;
    animation: fadeSlideUp 0.7s ease-out 0.15s both;
}

.tut-alert-card.warning-alert {
    background: linear-gradient(135deg, rgba(242, 167, 27, 0.06) 0%, rgba(242, 167, 27, 0.03) 100%);
    border-color: rgba(242, 167, 27, 0.2);
}

.alert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.alert-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.alert-text strong {
    color: var(--accent);
    font-weight: 600;
}

.warning-alert .alert-text strong {
    color: var(--warning);
}

/* ==================== 章节区域 ==================== */
.tut-section {
    margin-bottom: 2.5rem;
    animation: fadeSlideUp 0.7s ease-out 0.2s both;
}

.tut-section-warning {
    animation-delay: 0.35s;
}

.section-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(79, 110, 247, 0.08);
}

.section-number {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f6ef7, #7c5cf5);
    color: white;
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(79, 110, 247, 0.3);
}

.section-number.warning {
    background: linear-gradient(135deg, #f2a71b, #f5c842);
    box-shadow: 0 4px 16px rgba(242, 167, 27, 0.3);
    font-size: 1.3rem;
}

.section-title-wrap {
    flex: 1;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.section-desc {
    font-size: 0.82rem;
    color: var(--text-hint);
    margin-top: 0.3rem;
}

/* ==================== 步骤卡片 ==================== */
.tut-step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 4px 24px rgba(79, 110, 247, 0.04),
        0 1px 3px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.tut-step-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 32px rgba(79, 110, 247, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.tut-step-card.highlight-card {
    border-color: rgba(0, 196, 140, 0.2);
    background: linear-gradient(135deg, rgba(0, 196, 140, 0.03), rgba(255, 255, 255, 0.88));
}

.step-badge {
    display: inline-block;
    padding: 0.25rem 0.8rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: white;
    background: linear-gradient(135deg, #4f6ef7, #7c5cf5);
    box-shadow: 0 2px 10px rgba(79, 110, 247, 0.25);
    margin-bottom: 0.8rem;
}

.step-badge.warning-badge {
    background: linear-gradient(135deg, #f2a71b, #f5c842);
    color: #1a1a2e;
    box-shadow: 0 2px 10px rgba(242, 167, 27, 0.25);
}

.step-badge.success-badge {
    background: linear-gradient(135deg, #00c48c, #00e5a0);
    box-shadow: 0 2px 10px rgba(0, 196, 140, 0.25);
}

.step-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.step-text a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.step-text a:hover {
    border-bottom-color: var(--accent);
}

.step-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ==================== 步骤图片 ==================== */
.step-image-wrap {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(79, 110, 247, 0.08);
    background: #f8f9fc;
}

.step-image {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.4s ease;
}

.step-image:hover {
    transform: scale(1.02);
}

/* ==================== 链接卡片 ==================== */
.tut-link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid rgba(79, 110, 247, 0.12);
    border-radius: 12px;
    margin-bottom: 1rem;
    backdrop-filter: blur(16px);
    transition: var(--transition);
}

.tut-link-card:hover {
    border-color: rgba(79, 110, 247, 0.25);
    box-shadow: 0 4px 16px rgba(79, 110, 247, 0.08);
}

.link-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.link-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.link-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-hint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.link-url {
    font-size: 0.82rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
    transition: var(--transition);
}

.link-url:hover {
    color: #3a57e8;
}

.link-open-btn {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f6ef7, #7c5cf5);
    color: white;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 3px 12px rgba(79, 110, 247, 0.25);
}

.link-open-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 20px rgba(79, 110, 247, 0.35);
}

/* ==================== 底部提示 ==================== */
.tut-footer-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    margin-top: 1rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(16px);
    animation: fadeSlideUp 0.7s ease-out 0.5s both;
}

.footer-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.footer-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ==================== 底部按钮 ==================== */
.tut-bottom-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeSlideUp 0.7s ease-out 0.6s both;
}

.tut-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.tut-action-btn.primary {
    background: linear-gradient(135deg, #4f6ef7, #7c5cf5);
    color: white;
    box-shadow: 0 4px 20px rgba(79, 110, 247, 0.3);
}

.tut-action-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(79, 110, 247, 0.4);
}

.tut-action-btn.primary .btn-arrow {
    transition: transform 0.3s ease;
}

.tut-action-btn.primary:hover .btn-arrow {
    transform: translateX(4px);
}

.tut-action-btn.secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-card);
    backdrop-filter: blur(16px);
}

.tut-action-btn.secondary:hover {
    transform: translateY(-2px);
    border-color: rgba(79, 110, 247, 0.2);
    color: var(--accent);
    box-shadow: 0 4px 16px rgba(79, 110, 247, 0.08);
}

/* ==================== 图片放大预览 ==================== */
.img-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.img-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.img-overlay-content {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.img-overlay.active .img-overlay-content {
    transform: scale(1);
}

.img-overlay-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.img-overlay-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* ==================== 动画 ==================== */
@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

/* ==================== 响应式 ==================== */
@media (max-width: 720px) {
    .tut-header {
        padding: 1.5rem 1rem 1.5rem;
    }

    .tut-back-link {
        position: relative;
        top: 0;
        left: 0;
        margin-bottom: 1rem;
    }

    .tut-page-title {
        font-size: 1.5rem;
    }

    .tut-main {
        padding: 0 1rem 2rem;
    }

    .tut-step-card {
        padding: 1.2rem;
    }

    .section-header {
        gap: 0.75rem;
    }

    .section-number {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        border-radius: 10px;
    }

    .section-title {
        font-size: 1.05rem;
    }

    .tut-link-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .link-open-btn {
        width: 100%;
        text-align: center;
    }

    .tut-bottom-actions {
        flex-direction: column;
    }

    .tut-action-btn {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 380px) {
    .tut-page-title {
        font-size: 1.3rem;
    }

    .step-text {
        font-size: 0.82rem;
    }

    .alert-text {
        font-size: 0.8rem;
    }
}
