:root {
    --primary-color: #ffd700;
    --background-color: #f4f7fa;
    --sub-app-color: #fff1b3;
    --sub1-app-color: #dff7f5;
    --sub2-app-color: #e8f5e9;
    --sub3-app-color: #ffe9e9;
    --sub4-app-color: #ff8e8e;
    --sub5-app-color: #6eddd6;
    --text-primary: #333333;
    --text-secondary: #8e8e8e;
    --card-shadow: 0 4px 10px rgba(0,0,0,0.05);
    --tab-height: 60px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    overflow-x: hidden;
    overscroll-behavior-y: none;
}

/* ===== PAGE BASE ===== */
.page {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    background: var(--background-color);
    transition: transform 0.3s ease-in-out;
}

.page.active {
    transform: translateX(0);
    z-index: 2;
}

.page.hidden {
    transform: translateX(100%);
    z-index: 1;
    display: flex;
}

/* Tab页用hidden-tab隐藏（不滑入，直接hide） */
.page.hidden-tab {
    display: none;
    z-index: 1;
}

.page.tab-active {
    display: flex;
    transform: translateX(0);
    z-index: 2;
}

/* ===== SCROLL CONTENT ===== */
.scroll-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: calc(var(--tab-height) + env(safe-area-inset-bottom, 0px) + 20px);
    -webkit-overflow-scrolling: touch;
}

/* Analysis page no tab bar padding needed */
.analysis-content {
    padding-bottom: 80px;
}

/* Me page scroll */
.me-scroll {
    padding-bottom: calc(var(--tab-height) + env(safe-area-inset-bottom, 0px) + 20px);
}

/* ===== TOP BAR ===== */
.top-bar {
    background-color: var(--primary-color);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    padding: 44px 15px 20px 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.top-bar-content {
    display: flex;
    align-items: center;
    width: 100%;
}

.app-logo img {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    margin-right: 10px;
}

.title-container {
    background-color: #2C2C2C;
    border-radius: 15px;
    padding: 10px 15px;
    flex: 1;
}

.main-title {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: bold;
    display: block;
}

.sub-title {
    color: white;
    font-size: 12px;
    margin-top: 2px;
    display: block;
}

/* ===== BANNER ===== */
.banner-container {
    margin: 15px 10px;
    height: 160px;
    border-radius: 15px;
    overflow: hidden;
}

.banner-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== SCENE GRID ===== */
.scene-section {
    padding: 0 10px;
    margin-top: 10px;
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.section-icon {
    color: var(--primary-color);
    font-size: 24px;
    margin-right: 10px;
}

.section-title {
    font-size: 19px;
    font-weight: bold;
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.scene-card {
    background: white;
    border-radius: 15px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform 0.1s;
    min-height: 80px;
}

.scene-card:active { transform: scale(0.97); }

.card-text { flex: 1; margin-right: 8px; }
.card-title { font-size: 17px; font-weight: bold; display: block; margin-bottom: 4px; }
.card-subtitle {
    font-size: 13px; color: var(--text-secondary);
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2;
}

.card-badge {
    width: 45px; height: 45px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: bold; color: #333; text-align: center; flex-shrink: 0;
}

/* ===== ANALYSIS PAGE ===== */
.app-bar {
    background-color: var(--background-color);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    margin-top: 44px;
    flex-shrink: 0;
}

.app-bar-title { font-size: 18px; font-weight: bold; }
.back-btn { font-size: 24px; color: #333; cursor: pointer; }

.share-btn {
    background-color: var(--primary-color);
    padding: 5px 15px;
    border-radius: 100px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
}

.video-cover-container {
    margin: 10px 20px;
    aspect-ratio: 16/9;
    background-color: #eee;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

#video-player, #video-thumbnail { width: 100%; height: 100%; object-fit: cover; display: block; }

.cover-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.1); z-index: 1;
}

.play-btn-circle {
    width: 50px; height: 50px;
    background-color: rgba(0,0,0,0.54);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
}

.center-state {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    margin-top: 60px;
}

.loading-text { font-size: 16px; margin-bottom: 10px; color: #666; }

.progress-track {
    width: 50%; height: 6px;
    background-color: #e0e0e0;
    border-radius: 10px; overflow: hidden;
}

.progress-fill {
    height: 100%; background-color: #2196F3;
    width: 0%; transition: width 0.3s;
}

.markdown-body { padding: 20px; line-height: 1.6; color: #333; }
.markdown-body h1,.markdown-body h2,.markdown-body h3 { margin-top: 24px; margin-bottom: 16px; font-weight: 600; }
.markdown-body p { margin-bottom: 16px; }

.fab-container {
    position: absolute; bottom: 30px; right: 20px;
    width: 56px; height: 56px;
    background-color: #e0e0e0;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    cursor: pointer; z-index: 10;
}

#audio-icon { color: #757575; font-size: 24px; }

/* ===== BOTTOM TAB BAR ===== */
.bottom-tab-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(var(--tab-height) + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    justify-content: space-around;
    padding-top: 8px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 0 4px;
    position: relative;
    user-select: none;
}

.tab-icon {
    font-size: 24px;
    color: #bbb;
    transition: color 0.2s;
}

.tab-label {
    font-size: 11px;
    color: #bbb;
    margin-top: 3px;
    transition: color 0.2s;
}

.tab-item.active .tab-icon,
.tab-item.active .tab-label {
    color: var(--primary-color);
}

/* 中间拍摄按钮 */
.tab-center-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    margin-top: -20px;
}

.shoot-btn {
    width: 56px; height: 56px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 12px rgba(255,215,0,0.5);
    transition: transform 0.15s;
}

.shoot-btn:active { transform: scale(0.92); }

.shoot-btn-inner {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: var(--primary-color);
}

/* ===== ME PAGE ===== */
.me-profile-header {
    background: var(--primary-color);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    padding: 0 20px 20px;
    flex-shrink: 0;
}

.safe-area-top {
    height: 44px; /* simulate status bar */
}

.me-profile-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.me-avatar {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.me-profile-info { flex: 1; }
.me-nickname { font-size: 20px; font-weight: bold; color: #333; }
.me-uid { font-size: 13px; color: #555; margin-top: 2px; }

.me-settings-icon {
    font-size: 24px;
    color: #444;
    cursor: pointer;
}

/* 功能组 */
.me-func-group {
    margin: 0 10px;
    background: #fff;
    border-radius: 15px;
    padding: 0 20px;
    box-shadow: var(--card-shadow);
}

.me-func-item {
    display: flex;
    align-items: center;
    padding: 14px 0;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
}

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

.me-func-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.me-func-title {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.me-func-arrow {
    color: #ccc;
    font-size: 20px;
}

.me-func-tail {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 底部公司信息 */
.me-footer {
    margin-top: 32px;
    padding-bottom: 24px;
    text-align: center;
}
.me-footer-company {
    font-size: 12px;
    color: #bbb;
    margin-bottom: 6px;
}
.me-footer-icp {
    font-size: 11px;
    color: #ccc;
    text-decoration: none;
    display: inline-block;
}
.me-footer-icp:active { opacity: 0.7; }

.me-vip-badge {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--sub-app-color);
    border-radius: 100px;
    padding: 4px 10px;
}

.me-vip-label {
    font-size: 13px;
    font-weight: bold;
    color: orange;
}

/* 历史记录 */
.me-record-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
    padding: 0 15px;
    margin-bottom: 12px;
}

.me-history-item {
    margin: 0 10px 12px;
    background: #fff;
    border-radius: 15px;
    padding: 15px;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform 0.1s;
}

.me-history-item:active { transform: scale(0.98); }

.me-history-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.me-history-tag {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    color: #333;
}

.me-history-date {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.me-history-desc {
    font-size: 15px;
    font-weight: bold;
    color: var(--text-primary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.me-history-thumb {
    background: #f5f5f5;
    border-radius: 10px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    z-index: 999;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.hidden { display: none !important; }

/* ===== 运动视频换脸 首页入口 ===== */
.face-section {
    padding: 0 10px;
    margin-top: 24px;
}

.face-template-list {
    display: flex;
    gap: 10px;
}

.face-template-card {
    flex: 1;
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform 0.1s;
}
.face-template-card:active { transform: scale(0.97); }

.face-tpl-video-wrap {
    position: relative;
    aspect-ratio: 9/16;
    background: #111;
    overflow: hidden;
}

.face-tpl-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.face-tpl-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.15);
}

.face-tpl-play .material-icons {
    font-size: 44px;
    color: rgba(255,255,255,0.9);
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.face-tpl-info {
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.face-tpl-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.face-tpl-btn {
    background: var(--primary-color);
    color: #333;
    font-size: 11px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 100px;
    white-space: nowrap;
}

/* ===== 换脸流程页 ===== */
.fs-template-preview {
    margin: 10px 20px;
    aspect-ratio: 9/16;
    max-height: 260px;
    background: #111;
    border-radius: 15px;
    overflow: hidden;
}

.fs-template-label {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.fs-section-title {
    font-size: 15px;
    font-weight: bold;
    color: var(--text-primary);
    padding: 0 20px;
    margin-bottom: 6px;
}

.fs-photo-tips {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 0 20px;
    margin-bottom: 12px;
}

.fs-photo-upload-area {
    margin: 0 20px;
    height: 160px;
    background: #fff;
    border: 2px dashed #e0e0e0;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s;
}
.fs-photo-upload-area:active { border-color: var(--primary-color); }

#fs-photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fs-submit-btn {
    width: 100%;
    background: var(--primary-color);
    color: #333;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    padding: 14px 0;
    border-radius: 100px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 4px 12px rgba(255,215,0,0.4);
}
.fs-submit-btn:active { transform: scale(0.98); opacity: 0.85; }
.fs-submit-btn.disabled {
    background: #e0e0e0;
    color: #aaa;
    box-shadow: none;
    pointer-events: none;
}

/* 加载动画 */
.fs-loading-ring {
    width: 48px; height: 48px;
    border: 4px solid #f0f0f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: fs-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes fs-spin { to { transform: rotate(360deg); } }

.fs-loading-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 结果操作按钮 */
.fs-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--primary-color);
    color: #333;
    font-size: 14px;
    font-weight: bold;
    padding: 12px 0;
    border-radius: 100px;
    cursor: pointer;
}
.fs-action-secondary {
    background: #f0f0f0;
    color: #555;
}

/* ===== FACE SWAP 换脸 ===== */
.faceswap-section {
    padding: 0 10px;
    margin-top: 24px;
}

.faceswap-badge {
    background: linear-gradient(135deg, #ff6b6b, #ff4444);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 100px;
    margin-left: 6px;
    vertical-align: middle;
}

.faceswap-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.faceswap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.faceswap-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform 0.12s;
}

.faceswap-card:active { transform: scale(0.97); }

.faceswap-video-wrap {
    position: relative;
    height: 120px;
    background: #111;
    overflow: hidden;
}

.faceswap-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.faceswap-play-mask {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.18);
    transition: opacity 0.2s;
}

.faceswap-card:hover .faceswap-play-mask { opacity: 0; }

.faceswap-play-icon {
    font-size: 40px;
    color: rgba(255,255,255,0.85);
}

.faceswap-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
}

.faceswap-card-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-primary);
}

.faceswap-use-btn {
    background: var(--primary-color);
    color: #333;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 100px;
}

/* 换脸页面 */
/* faceswap-tpl-preview & faceswap-upload-box 已迁移至 fs-dual-row 布局 */
.faceswap-tpl-preview { display: none; }
.faceswap-upload-box { /* 由 fs-upload-box 接管 */ }

.faceswap-tips {
    display: flex;
    align-items: flex-start;
    margin: 10px 16px 0;
    font-size: 12px;
    color: #aaa;
    line-height: 1.5;
}

.faceswap-submit-btn {
    background: var(--primary-color);
    color: #333;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.faceswap-submit-btn:active { opacity: 0.8; }
.faceswap-submit-btn.disabled {
    background: #e0e0e0;
    color: #aaa;
    pointer-events: none;
}

.faceswap-action-btn {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.faceswap-action-outline {
    border: 2px solid var(--primary-color);
    color: #333;
    background: #fff;
}

.faceswap-action-primary {
    background: var(--primary-color);
    color: #333;
}

/* ===== ANALYSIS PAGE - ENHANCED LAYOUT ===== */
.analysis-app-bar {
    background: #fff;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    padding-top: env(safe-area-inset-top, 44px);
    padding-top: max(env(safe-area-inset-top, 0px), 44px);
    flex-shrink: 0;
    border-bottom: 1px solid #f0f0f0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* 视频区域增强 */
#page-analysis .video-cover-container {
    margin: 14px 16px 0;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

/* 加载状态卡片 */
.analysis-loading-card {
    margin: 20px 16px;
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.analysis-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #f0f0f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin-anim 0.8s linear infinite;
    margin-bottom: 4px;
}
@keyframes spin-anim { to { transform: rotate(360deg); } }

.analysis-loading-label {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analysis-loading-percent {
    color: var(--primary-color);
    font-size: 15px;
    font-weight: 700;
    min-width: 36px;
}

.analysis-progress-track {
    width: 70% !important;
    height: 6px;
    background: #f0f0f0;
    border-radius: 100px;
    overflow: hidden;
}

.analysis-loading-hint {
    font-size: 12px;
    color: #bbb;
    margin-top: 2px;
}

/* 结果卡片 */
.analysis-result-card {
    margin: 14px 16px 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    padding: 20px 18px 24px;
    line-height: 1.7;
}

.analysis-result-card h1,
.analysis-result-card h2 {
    font-size: 16px;
    font-weight: 700;
    color: #222;
    margin-top: 20px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.analysis-result-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: #444;
    margin-top: 16px;
    margin-bottom: 8px;
}

.analysis-result-card p {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
}

.analysis-result-card ul, .analysis-result-card ol {
    padding-left: 18px;
    color: #555;
    font-size: 14px;
    line-height: 1.8;
}

/* FAB 按钮增强 */
#page-analysis .fab-container {
    background: var(--primary-color);
    box-shadow: 0 4px 14px rgba(255,215,0,0.5);
}

#page-analysis #audio-icon {
    color: #333;
}

/* ===== FACESWAP PAGE - DUAL COLUMN LAYOUT ===== */
.fs-dual-row {
    display: flex;
    gap: 12px;
    margin: 14px 16px 0;
    align-items: flex-start;
}

.fs-dual-col {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.fs-col-label {
    font-size: 12px;
    color: #999;
    font-weight: 500;
    margin-bottom: 8px;
}

/* 模板视频：竖屏比例 */
.fs-tpl-box {
    position: relative;
    aspect-ratio: 9 / 14;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.fs-tpl-tag {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 100px;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

/* 上传照片：同等高度，方形 */
.fs-upload-box {
    aspect-ratio: 9 / 14;
    background: #fafafa;
    border: 2px dashed #ddd;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.fs-upload-box:active { border-color: var(--primary-color); }

#faceswap-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    gap: 4px;
}

.fs-upload-hint {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

.fs-upload-sub {
    font-size: 10px;
    color: #ccc;
}

/* ME 页去掉 profile header 后的顶部安全区 */
.me-top-safe {
    height: max(env(safe-area-inset-top, 0px), 44px);
    flex-shrink: 0;
}

/* ===== MORE SPORTS SECTION ===== */
.more-sports-section {
    padding: 0 10px;
    margin-top: 24px;
}

.more-sports-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.more-sports-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.more-sports-item:active .more-sports-icon {
    transform: scale(0.92);
}

.more-sports-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.15s;
}

.more-sports-label {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    text-align: center;
}

/* ===== ME 个人资料卡 ===== */
.me-profile-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 16px 10px 14px;
    background: linear-gradient(135deg, #fff6c5 0%, #ffd700 100%);
    border-radius: 18px;
    padding: 16px 16px;
    box-shadow: 0 6px 18px rgba(255,215,0,0.25);
    cursor: pointer;
    transition: transform 0.15s;
}
.me-profile-card:active { transform: scale(0.98); }

.me-profile-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(0,0,0,0.25);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.me-profile-text { flex: 1; min-width: 0; }
.me-profile-name {
    font-size: 17px;
    font-weight: bold;
    color: #2c2c2c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.me-profile-sub {
    font-size: 12px;
    color: #5a5a5a;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.me-profile-arrow {
    color: #5a5a5a;
    font-size: 20px;
    flex-shrink: 0;
}

/* ===== ME VIP 入口卡 ===== */
.me-vip-card {
    margin: 0 10px 14px;
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    transition: transform 0.15s;
}
.me-vip-card:active { transform: scale(0.98); }

.me-vip-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.me-vip-crown {
    color: var(--primary-color);
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(255,215,0,0.4));
}

.me-vip-title {
    color: var(--primary-color);
    font-size: 15px;
    font-weight: bold;
}
.me-vip-sub {
    color: #bbb;
    font-size: 12px;
    margin-top: 2px;
}

.me-vip-btn {
    background: var(--primary-color);
    color: #2c2c2c;
    font-size: 13px;
    font-weight: bold;
    padding: 6px 14px;
    border-radius: 100px;
}

/* ===== 登录弹窗 ===== */
.login-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(6px);
    animation: login-fade-in 0.2s ease-out;
}
@keyframes login-fade-in { from { opacity: 0; } to { opacity: 1; } }

.login-card {
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: 20px;
    padding: 28px 22px 22px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    animation: login-slide-up 0.25s ease-out;
}
@keyframes login-slide-up {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-close {
    position: absolute;
    top: 12px; right: 12px;
    font-size: 24px;
    color: #bbb;
    cursor: pointer;
    padding: 4px;
}
.login-close:active { color: #777; }

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}
.login-logo img {
    width: 52px; height: 52px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(255,215,0,0.4);
}

.login-title {
    text-align: center;
    font-size: 19px;
    font-weight: bold;
    color: #222;
    margin-bottom: 4px;
}
.login-sub {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-bottom: 20px;
}

.login-input-wrap {
    display: flex;
    align-items: center;
    background: #f6f6f8;
    border-radius: 12px;
    padding: 0 12px;
    margin-bottom: 12px;
    height: 46px;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}
.login-input-wrap:focus-within {
    border-color: var(--primary-color);
    background: #fff;
}

.login-input-icon {
    color: #aaa;
    font-size: 20px;
    margin-right: 8px;
}

.login-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 15px;
    color: #333;
    height: 44px;
}
.login-input::placeholder { color: #bbb; }

.login-send-code {
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    padding: 4px 2px;
    user-select: none;
}
.login-send-code.disabled {
    color: #bbb;
    pointer-events: none;
}

.login-error {
    color: #f44336;
    font-size: 12px;
    margin-bottom: 10px;
    padding: 0 4px;
}

.login-submit {
    background: var(--primary-color);
    color: #2c2c2c;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    padding: 13px 0;
    border-radius: 100px;
    cursor: pointer;
    margin-top: 6px;
    box-shadow: 0 4px 12px rgba(255,215,0,0.4);
    transition: opacity 0.2s, transform 0.1s;
}
.login-submit:active { transform: scale(0.98); opacity: 0.85; }
.login-submit.disabled {
    background: #e0e0e0;
    color: #aaa;
    box-shadow: none;
    pointer-events: none;
}

.login-agree {
    margin-top: 14px;
    font-size: 11px;
    color: #aaa;
    text-align: center;
    line-height: 1.5;
}
.login-agree a {
    color: #ff9800;
    cursor: pointer;
    text-decoration: none;
}

/* 登出确认弹窗 */
.logout-card {
    max-width: 300px;
    padding: 24px 20px 16px;
    text-align: center;
}
.logout-title {
    font-size: 16px;
    font-weight: bold;
    color: #222;
    margin-bottom: 6px;
}
.logout-sub {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
}
.logout-actions {
    display: flex;
    gap: 10px;
}
.logout-btn {
    flex: 1;
    padding: 11px 0;
    border-radius: 100px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
}
.logout-btn:active { opacity: 0.8; }
.logout-btn-cancel {
    background: #f0f0f0;
    color: #555;
}
.logout-btn-ok {
    background: #f44336;
    color: #fff;
}

/* ===== VIP 页 ===== */
.vip-app-bar {
    background: #fff;
    margin-top: 0;
    padding-top: env(safe-area-inset-top, 44px);
    padding-top: max(env(safe-area-inset-top, 0px), 44px);
    border-bottom: 1px solid #f0f0f0;
}

#page-vip { background: #f7f8fa; }

.vip-hero {
    margin: 14px 16px 0;
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border-radius: 18px;
    padding: 28px 20px 24px;
    text-align: center;
    color: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}
.vip-hero::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 160px; height: 160px;
    background: radial-gradient(circle, rgba(255,215,0,0.3), transparent 70%);
    pointer-events: none;
}

.vip-hero-crown {
    font-size: 48px;
    color: var(--primary-color);
    filter: drop-shadow(0 3px 10px rgba(255,215,0,0.6));
    margin-bottom: 8px;
}

.vip-hero-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.vip-hero-sub {
    font-size: 12px;
    color: #d0d0d0;
    letter-spacing: 0.5px;
}

/* 特权列表 */
.vip-benefits {
    margin: 16px 16px 0;
    background: #fff;
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: var(--card-shadow);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
}

.vip-benefit-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vip-benefit-icon { font-size: 22px; flex-shrink: 0; }
.vip-benefit-text {
    font-size: 13px;
    color: #444;
    font-weight: 500;
    line-height: 1.3;
}

/* 套餐 */
.vip-plan-title {
    font-size: 15px;
    font-weight: bold;
    color: #2c2c2c;
    margin: 22px 16px 12px;
}

.vip-plans {
    display: flex;
    gap: 10px;
    margin: 0 16px;
}

.vip-plan-card {
    flex: 1;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 16px 10px 14px;
    text-align: center;
    cursor: pointer;
    position: relative;
    box-shadow: var(--card-shadow);
    transition: transform 0.15s, border-color 0.15s;
}
.vip-plan-card:active { transform: scale(0.97); }

.vip-plan-highlight {
    border-color: var(--primary-color);
    background: linear-gradient(180deg, #fffbe5 0%, #fff 50%);
    box-shadow: 0 6px 18px rgba(255,215,0,0.25);
}

.vip-plan-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff6b6b, #ff4444);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 10px;
    border-radius: 100px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.vip-plan-badge-save {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
}

.vip-plan-name {
    font-size: 13px;
    color: #555;
    font-weight: 500;
    margin-bottom: 8px;
}

.vip-plan-price {
    color: #2c2c2c;
    margin-bottom: 6px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 1px;
}

.vip-plan-currency {
    font-size: 14px;
    font-weight: bold;
}
.vip-plan-amount {
    font-size: 26px;
    font-weight: bold;
    line-height: 1;
}
.vip-plan-unit {
    font-size: 12px;
    color: #888;
}

.vip-plan-desc {
    font-size: 11px;
    color: #999;
    line-height: 1.4;
    min-height: 30px;
}

/* 支付按钮 */
/* 单套餐布局 */
.vip-plans-single {
    display: block;
}

.vip-plan-single {
    padding: 16px 16px 16px;
    text-align: left;
}

.vip-plan-single-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.vip-plan-single-left {
    flex: 1;
    min-width: 0;
}

.vip-plan-single .vip-plan-name {
    font-size: 16px;
    color: #2c2c2c;
    font-weight: bold;
    margin-bottom: 4px;
    text-align: left;
}

.vip-plan-single .vip-plan-desc {
    text-align: left;
    min-height: 0;
    font-size: 12px;
    color: #888;
}

.vip-plan-single .vip-plan-price {
    margin-bottom: 0;
    flex-shrink: 0;
}

.vip-pay-wrap {
    margin: 24px 16px 0;
}

.vip-pay-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #09bb07, #07a105);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    padding: 14px 0;
    border-radius: 100px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(9,187,7,0.35);
    transition: transform 0.12s, opacity 0.2s;
}
.vip-pay-btn:active { transform: scale(0.98); opacity: 0.9; }
.vip-pay-btn.vip-pay-loading {
    pointer-events: none;
    opacity: 0.85;
    gap: 10px;
}
.vip-pay-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin-anim 0.7s linear infinite;
    flex-shrink: 0;
}

.vip-pay-wx-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vip-pay-text { letter-spacing: 0.5px; }

.vip-pay-agree {
    margin-top: 12px;
    font-size: 11px;
    color: #aaa;
    text-align: center;
    line-height: 1.5;
    padding: 0 10px;
}

/* 购买须知 */
.vip-notice {
    margin: 20px 16px 0;
    background: #f7f8fa;
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid #eee;
}
.vip-notice-title {
    font-size: 13px;
    font-weight: bold;
    color: #555;
    margin-bottom: 10px;
}
.vip-notice-item {
    font-size: 12px;
    color: #888;
    line-height: 1.7;
    margin-bottom: 4px;
}
.vip-notice-link {
    color: #fb8c00;
    text-decoration: none;
}
.vip-notice-sub {
    margin-top: 4px;
    padding-left: 10px;
    font-size: 11px;
    color: #aaa;
    line-height: 1.6;
    border-left: 2px solid #e0e0e0;
}

/* VIP 套餐 — 行内布局（两个方案都用） */
.vip-plans { flex-direction: column; }
.vip-plan-card { text-align: left; padding: 16px; }
.vip-plan-single-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vip-plan-single-left { flex: 1; min-width: 0; }
.vip-plan-card .vip-plan-name { font-size: 16px; color: #2c2c2c; font-weight: bold; margin-bottom: 4px; }
.vip-plan-card .vip-plan-desc { text-align: left; min-height: 0; font-size: 12px; color: #888; }
.vip-plan-card .vip-plan-price { margin-bottom: 0; flex-shrink: 0; }

/* ===== 功能入口卡片 ===== */
.func-section { margin: 0 0 0; }
.func-cards {
    display: flex;
    gap: 10px;
    padding: 0 16px;
}
.func-card {
    flex: 1;
    background: #fff;
    border-radius: 14px;
    padding: 14px 10px 12px;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--card-shadow);
    transition: transform 0.12s;
}
.func-card:active { transform: scale(0.96); }
.func-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
}
.func-card-label {
    font-size: 13px;
    font-weight: bold;
    color: #222;
    margin-bottom: 2px;
}
.func-card-sub {
    font-size: 11px;
    color: #999;
    line-height: 1.3;
}

/* ===== 运动教程页 ===== */
.tutorial-list {
    padding: 12px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.tutorial-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: stretch;
    cursor: pointer;
    transition: transform 0.12s;
}
.tutorial-card:active { transform: scale(0.98); }
.tutorial-card-cover {
    width: 100px;
    flex-shrink: 0;
    background: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}
.tutorial-card-body {
    flex: 1;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}
.tutorial-card-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 100px;
    margin-bottom: 6px;
    width: fit-content;
}
.tutorial-badge-free { background: #e8f5e9; color: #388e3c; }
.tutorial-badge-vip  { background: #fff8e1; color: #f57f17; }
.tutorial-card-title {
    font-size: 14px;
    font-weight: bold;
    color: #222;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tutorial-card-desc {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tutorial-detail {
    position: absolute;
    inset: 0;
    background: #fff;
    z-index: 10;
    display: flex;
    flex-direction: column;
}
#page-tutorial { position: relative; }
.tutorial-detail-content {
    padding: 16px;
}
.tutorial-cover-wrap {
    margin: 0 0 4px;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
    background: #eee;
}
.tutorial-cover-img {
    width: 100%;
    display: block;
    max-height: 220px;
    object-fit: cover;
}
.tutorial-section-title {
    font-size: 16px;
    font-weight: bold;
    color: #222;
    margin: 18px 0 8px;
}
.tutorial-section-img {
    width: 100%;
    border-radius: 12px;
    display: block;
    margin-bottom: 10px;
    object-fit: cover;
    max-height: 200px;
    background: #eee;
}
.tutorial-section-content {
    font-size: 14px;
    color: #555;
    line-height: 1.7;
    white-space: pre-wrap;
}
.tutorial-vip-lock {
    margin: 30px 16px;
    background: linear-gradient(135deg, #fffbe5, #fff8e1);
    border: 1.5px solid var(--primary-color);
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center;
}
.tutorial-vip-lock-icon { font-size: 40px; color: var(--primary-color); margin-bottom: 10px; }
.tutorial-vip-lock-text { font-size: 15px; font-weight: bold; color: #333; margin-bottom: 6px; }
.tutorial-vip-lock-sub  { font-size: 12px; color: #888; margin-bottom: 18px; }
.tutorial-vip-btn {
    display: inline-block;
    background: var(--primary-color);
    color: #2c2c2c;
    font-size: 14px;
    font-weight: bold;
    padding: 10px 28px;
    border-radius: 100px;
    cursor: pointer;
}

/* ===== 喝水打卡页 ===== */
.water-date {
    text-align: center;
    font-size: 14px;
    color: #888;
    margin: 14px 0 6px;
}
.water-circle-wrap {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 10px auto 0;
}
.water-svg { width: 180px; height: 180px; transform: rotate(-90deg); }
.water-track {
    fill: none;
    stroke: #e3f2fd;
    stroke-width: 12;
}
.water-fill {
    fill: none;
    stroke: #1e88e5;
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 414.69;
    stroke-dashoffset: 414.69;
    transition: stroke-dashoffset 0.5s ease;
}
.water-circle-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.water-cups-text { font-size: 22px; font-weight: bold; color: #1e88e5; }
.water-ml-text   { font-size: 13px; color: #888; margin-top: 2px; }
.water-mot       { font-size: 12px; color: #aaa; margin-top: 4px; }
.water-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 20px 16px 0;
}
.water-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 100px;
    font-weight: bold;
    transition: transform 0.1s, opacity 0.2s;
}
.water-btn:active { transform: scale(0.95); opacity: 0.8; }
.water-btn-minus {
    width: 44px;
    height: 44px;
    background: #f0f0f0;
    color: #666;
    font-size: 24px;
    border-radius: 50%;
}
.water-btn-plus {
    flex: 1;
    max-width: 200px;
    height: 48px;
    background: #1e88e5;
    color: #fff;
    font-size: 15px;
    border-radius: 100px;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(30,136,229,0.35);
}
.water-record-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin: 20px 16px 8px;
}
.water-records {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.water-record-item {
    background: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--card-shadow);
}
.water-record-time { font-size: 13px; color: #555; }
.water-record-amt  { font-size: 13px; color: #1e88e5; font-weight: bold; }
.water-empty { text-align: center; color: #ccc; font-size: 13px; padding: 20px 0; }
.water-tips-box {
    margin: 20px 16px 0;
    background: #e3f2fd;
    border-radius: 14px;
    padding: 14px 16px;
}
.water-tips-title {
    font-size: 13px;
    font-weight: bold;
    color: #1e88e5;
    margin-bottom: 10px;
}
.water-tip-item {
    font-size: 12px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 4px;
}

/* ===== 训练计划页 ===== */
.plan-summary {
    display: flex;
    align-items: center;
    background: #fff;
    margin: 12px 16px 0;
    border-radius: 14px;
    padding: 16px 0;
    box-shadow: var(--card-shadow);
}
.plan-summary-item {
    flex: 1;
    text-align: center;
}
.plan-summary-sep {
    width: 1px;
    height: 30px;
    background: #f0f0f0;
}
.plan-summary-num {
    font-size: 22px;
    font-weight: bold;
    color: #222;
}
.plan-summary-label {
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
}
.plan-add-btn {
    font-size: 14px;
    color: #fb8c00;
    font-weight: bold;
    padding: 4px 8px;
    cursor: pointer;
}
.plan-tabs {
    display: flex;
    margin: 14px 16px 0;
    background: #f6f6f8;
    border-radius: 10px;
    padding: 3px;
}
.plan-tab {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #888;
    padding: 7px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.plan-tab.active {
    background: #fff;
    color: #222;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.plan-list {
    padding: 12px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.plan-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: var(--card-shadow);
}
.plan-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.plan-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.plan-card-info { flex: 1; min-width: 0; }
.plan-card-name {
    font-size: 15px;
    font-weight: bold;
    color: #222;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.plan-card-desc { font-size: 12px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.plan-meta-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 100px;
    background: #f0f0f0;
    color: #666;
}
.plan-diff-easy   { background: #e8f5e9; color: #388e3c; }
.plan-diff-medium { background: #fff3e0; color: #f57c00; }
.plan-diff-hard   { background: #fce4ec; color: #c62828; }
.plan-card-actions {
    display: flex;
    gap: 8px;
}
.plan-btn {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    border-radius: 100px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}
.plan-btn:active { opacity: 0.8; transform: scale(0.97); }
.plan-btn-complete { background: #fb8c00; color: #fff; }
.plan-btn-undo     { background: #f0f0f0; color: #555; }
.plan-btn-delete   { background: #fce4ec; color: #e53935; flex: 0 0 80px; }
.plan-empty { text-align: center; color: #ccc; font-size: 13px; padding: 40px 0; }
/* 新建弹窗 */
.plan-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: flex-end;
    z-index: 200;
}
.plan-modal.hidden { display: none; }
.plan-modal-card {
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 20px 16px 34px;
    width: 100%;
}
.plan-modal-title {
    font-size: 16px;
    font-weight: bold;
    color: #222;
    text-align: center;
    margin-bottom: 16px;
}
.plan-modal-input {
    width: 100%;
    box-sizing: border-box;
    background: #f6f6f8;
    border: none;
    outline: none;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
}
.plan-modal-textarea {
    width: 100%;
    box-sizing: border-box;
    background: #f6f6f8;
    border: none;
    outline: none;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 14px;
    color: #333;
    min-height: 72px;
    resize: none;
    margin-bottom: 10px;
}
.plan-modal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 4px;
}
.plan-modal-label { font-size: 13px; color: #555; }
.plan-modal-input-sm {
    width: 80px;
    text-align: center;
    background: #f6f6f8;
    border: none;
    outline: none;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 14px;
    color: #333;
}
.plan-modal-select {
    background: #f6f6f8;
    border: none;
    outline: none;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 14px;
    color: #333;
}
.plan-modal-btns {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}
.plan-modal-btn {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    border-radius: 100px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
}
.plan-modal-cancel { background: #f0f0f0; color: #555; }
.plan-modal-ok { background: #fb8c00; color: #fff; box-shadow: 0 4px 12px rgba(251,140,0,0.35); }

/* ===== VIP 状态条 ===== */
.vip-status-bar {
    margin-top: 14px;
    background: rgba(255,215,0,0.18);
    border: 1px solid rgba(255,215,0,0.5);
    border-radius: 100px;
    padding: 6px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    display: inline-block;
}

/* ===== VIP 退订按钮 ===== */
.vip-cancel-btn {
    margin-top: 14px;
    text-align: center;
    font-size: 12px;
    color: #bbb;
    text-decoration: underline;
    cursor: pointer;
    padding: 4px 0;
}
.vip-cancel-btn:active { color: #f44336; }

/* ===== VIP 开通成功弹窗 ===== */
.vip-success-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(6px);
    animation: login-fade-in 0.2s ease-out;
}
.vip-success-modal.hidden { display: none; }

.vip-success-card {
    width: 100%;
    max-width: 300px;
    background: #fff;
    border-radius: 24px;
    padding: 32px 24px 24px;
    text-align: center;
    box-shadow: 0 14px 50px rgba(0,0,0,0.25);
    animation: login-slide-up 0.25s ease-out;
}

.vip-success-icon {
    font-size: 52px;
    margin-bottom: 12px;
    line-height: 1;
}

.vip-success-title {
    font-size: 20px;
    font-weight: bold;
    color: #222;
    margin-bottom: 8px;
}

.vip-success-sub {
    font-size: 13px;
    color: #888;
    line-height: 1.6;
    margin-bottom: 22px;
}

.vip-success-btn {
    background: var(--primary-color);
    color: #2c2c2c;
    font-size: 15px;
    font-weight: bold;
    padding: 12px 0;
    border-radius: 100px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255,215,0,0.4);
    transition: opacity 0.2s, transform 0.1s;
}
.vip-success-btn:active { transform: scale(0.97); opacity: 0.85; }
