:root {
    --primary-green: #2DB84B;
    --primary-dark: #1a8c35;
    --primary-light: #e8f5e9;
    --bg-gradient-start: #f0faf2;
    --bg-gradient-end: #ffffff;
    --card-shadow: 0 4px 20px rgba(45, 184, 75, 0.1);
    --card-shadow-hover: 0 8px 30px rgba(45, 184, 75, 0.18);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 顶部导航 */
.header-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(160deg, #1a8c35 0%, #2DB84B 40%, #3dd65c 100%);
    color: #fff;
    padding: 0;
    overflow: hidden;
}

.header-atmosphere {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.header-orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.12;
    background: #fff;
}

.header-orb--1 {
    width: 140px;
    height: 140px;
    top: -40px;
    right: -20px;
    animation: floatOrb 6s ease-in-out infinite;
}

.header-orb--2 {
    width: 80px;
    height: 80px;
    top: 20px;
    left: -15px;
    animation: floatOrb 8s ease-in-out infinite reverse;
}

.header-orb--3 {
    width: 50px;
    height: 50px;
    bottom: 30px;
    right: 25%;
    opacity: 0.08;
    animation: floatOrb 7s ease-in-out infinite 1s;
}

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

.header-content {
    position: relative;
    z-index: 1;
    padding: 28px 0 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-badge {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.header-bar h1 {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 3px;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-bar .subtitle {
    font-size: 0.78rem;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 6px;
    letter-spacing: 1px;
}

.header-wave {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 28px;
    margin-top: -2px;
}

/* 主内容 */
.main-content {
    padding: 16px 0 40px;
}

/* 教程卡片 */
.tutorial-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    border: 1px solid rgba(45, 184, 75, 0.08);
}

.tutorial-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

/* 序号标签 */
.tutorial-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-dark));
    color: #fff;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.tutorial-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px 10px;
}

.tutorial-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.4;
}

/* 视频容器 */
.video-wrapper {
    position: relative;
    width: 100%;
    padding: 0 12px 14px;
}

.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 */
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}

.video-container > div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 视频占位 & 播放按钮 */
.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.video-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.12);
    transition: background 0.3s ease;
}

.video-placeholder:hover::before {
    background: rgba(0, 0, 0, 0.05);
}

.video-placeholder:hover {
    transform: scale(1.02);
}

.video-placeholder .play-btn,
.video-placeholder .play-text {
    position: relative;
    z-index: 1;
}

.video-placeholder .play-btn {
    width: 56px;
    height: 56px;
    background: rgba(45, 184, 75, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease;
    box-shadow: 0 4px 20px rgba(45, 184, 75, 0.4);
}

.video-placeholder:hover .play-btn {
    transform: scale(1.1);
    background: var(--primary-green);
}

.video-placeholder .play-btn i {
    font-size: 1.6rem;
    color: #fff;
    margin-left: 3px;
}

.video-placeholder .play-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    margin-top: 10px;
}

/* 底部 */
.footer-bar {
    text-align: center;
    padding: 24px 16px 32px;
    color: #999;
    font-size: 0.75rem;
}

.footer-bar .brand {
    color: var(--primary-green);
    font-weight: 600;
}

/* 回到顶部 */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: var(--primary-green);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(45, 184, 75, 0.4);
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-dark);
}

/* 微信X5内核视频兼容 */
.video-container video {
    object-fit: contain !important;
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tutorial-card {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.tutorial-card:nth-child(1) { animation-delay: 0.05s; }
.tutorial-card:nth-child(2) { animation-delay: 0.1s; }
.tutorial-card:nth-child(3) { animation-delay: 0.15s; }
.tutorial-card:nth-child(4) { animation-delay: 0.2s; }
.tutorial-card:nth-child(5) { animation-delay: 0.25s; }
.tutorial-card:nth-child(6) { animation-delay: 0.3s; }
.tutorial-card:nth-child(7) { animation-delay: 0.35s; }
.tutorial-card:nth-child(8) { animation-delay: 0.4s; }
.tutorial-card:nth-child(9) { animation-delay: 0.45s; }
.tutorial-card:nth-child(10) { animation-delay: 0.5s; }
.tutorial-card:nth-child(11) { animation-delay: 0.55s; }
.tutorial-card:nth-child(12) { animation-delay: 0.6s; }
.tutorial-card:nth-child(13) { animation-delay: 0.65s; }
.tutorial-card:nth-child(14) { animation-delay: 0.7s; }
.tutorial-card:nth-child(15) { animation-delay: 0.75s; }
.tutorial-card:nth-child(16) { animation-delay: 0.8s; }
.tutorial-card:nth-child(17) { animation-delay: 0.85s; }
.tutorial-card:nth-child(18) { animation-delay: 0.9s; }
.tutorial-card:nth-child(19) { animation-delay: 0.95s; }

/* ================= 沉浸式全屏播放器 ================= */
.fullscreen-player {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #000;
    display: none;
    flex-direction: column;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
}

.fullscreen-player.active {
    display: flex;
}

/* 顶部栏 — 毛玻璃质感 */
.fs-player-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    padding: 0 12px;
    height: 56px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.3) 70%, transparent 100%);
    color: #fff;
    pointer-events: auto;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.fs-player-header.fs-hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

/* 关闭按钮 — 下箭头语义 + 圆角胶囊 */
.fs-close-btn {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.25s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.fs-close-btn:active {
    background: rgba(255,255,255,0.25);
    transform: scale(0.92);
}

/* 中部标题区 */
.fs-header-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 8px;
}

.fs-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

.fs-counter {
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.6;
    margin-top: 2px;
    letter-spacing: 1px;
}

.fs-header-right {
    width: 40px;
    flex-shrink: 0;
}

/* 视频容器 */
.fs-player-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fs-video-wrap {
    width: 100%;
    height: 100%;
    position: relative;
}

.fs-video-wrap video,
.fs-video-wrap .zwp-container {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

/* 手势拦截层 */
.fs-gesture-layer {
    position: absolute;
    inset: 0;
    z-index: 5;
    touch-action: none;
    -webkit-touch-callout: none;
}

/* 播放/暂停指示器 */
.fs-play-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 6;
    width: 64px;
    height: 64px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.8rem;
    opacity: 0;
    pointer-events: none;
    transition: none;
}

.fs-play-indicator.fs-flash {
    animation: playIndicatorFlash 0.6s ease forwards;
}

@keyframes playIndicatorFlash {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
    30% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); }
}

/* 侧边进度指示器 */
.fs-progress-rail {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.fs-progress-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fs-progress-dot.active {
    background: #fff;
    box-shadow: 0 0 8px rgba(255,255,255,0.5);
    transform: scale(1.5);
}

/* 底部滑动提示 */
.fs-bottom-hint {
    position: absolute;
    bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    pointer-events: none;
    animation: hintFade 3s ease-in-out infinite;
    transition: opacity 0.4s ease;
}

.fs-bottom-hint i {
    font-size: 1rem;
    animation: hintBounce 1.5s ease-in-out infinite;
}

.fs-bottom-hint.fs-hidden {
    opacity: 0;
}

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

@keyframes hintFade {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* 滑动动画 */
.fs-slide-up {
    animation: slideUpOut 0.3s ease forwards;
}

.fs-slide-down {
    animation: slideDownOut 0.3s ease forwards;
}

.fs-slide-in-up {
    animation: slideUpIn 0.3s ease forwards;
}

.fs-slide-in-down {
    animation: slideDownIn 0.3s ease forwards;
}

@keyframes slideUpOut {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-100%); opacity: 0; }
}

@keyframes slideDownOut {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(100%); opacity: 0; }
}

@keyframes slideUpIn {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDownIn {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 微信浏览器兼容 */
@supports (bottom: env(safe-area-inset-bottom)) {
    .footer-bar {
        padding-bottom: calc(32px + env(safe-area-inset-bottom));
    }
}
