/* ============================================
   Zibll 抖音外壳 v6 — 深色/浅色双主题（手机端）
   ============================================ */

/* 全局消除蓝色/任何颜色点击高亮（覆盖主题CSS） */
.zdg-shell,
.zdg-shell *,
.zdg-shell *::before,
.zdg-shell *::after {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
}
.zdg-shell a,
.zdg-shell button,
.zdg-shell input,
.zdg-shell [role="button"] {
    outline: none !important;
}
.zdg-shell a:focus,
.zdg-shell a:active,
.zdg-shell button:focus,
.zdg-shell button:active {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* ===== 外壳容器 ===== */
.zdg-shell {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #000;
    z-index: 2147483647;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
    color: #fff;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding-top: env(safe-area-inset-top, 0px);
}

.zdg-shell.zdg-no-cover {
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 35%, #0f3460 70%, #1a1a2e 100%);
}
.zdg-shell.zdg-no-cover .zdg-cover-area {
    min-height: 55vh;
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}
.zdg-shell.zdg-no-cover .zdg-gradient {
    background: linear-gradient(to bottom, transparent 0%, transparent 30%, rgba(0,0,0,0.3) 55%, rgba(0,0,0,0.6) 75%, rgba(0,0,0,0.8) 100%);
}

/* ===== 封面区域 ===== */
.zdg-cover-area {
    position: relative;
    width: 100%;
    min-height: 60vh;
    flex-shrink: 0;
    background: #000;
    overflow: hidden;
}

/* 封面图：宽度撑满屏幕，高度按原始比例自适应 */
.zdg-cover-img {
    display: block;
    width: 100%;
    height: auto;
    z-index: 0;
    pointer-events: none;
}

.zdg-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, transparent 45%, rgba(0,0,0,0.12) 60%, rgba(0,0,0,0.35) 75%, rgba(0,0,0,0.6) 88%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
    z-index: 1;
}

/* ===== 播放按钮 ===== */
.zdg-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: transform .2s, background .2s;
    padding: 0;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.zdg-play:active {
    transform: translate(-50%, -50%) scale(0.92);
    background: rgba(255,255,255,0.25);
}
.zdg-play-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    opacity: 0.85;
    pointer-events: none;
}

/* ===== 右侧操作栏 ===== */
.zdg-sidebar {
    position: absolute;
    right: 10px;
    bottom: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 5;
}
.zdg-avatar-wrap {
    position: relative;
    width: 54px;
    height: 54px;
    margin-bottom: 8px;
}
.zdg-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
    background: #222;
    display: block;
}
.zdg-follow {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -10px;
    width: 22px;
    height: 22px;
    margin: 0 auto;
    border-radius: 50%;
    background: #fe2c55;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #000;
    box-sizing: border-box;
    padding: 0 0 1px 0;
}
.zdg-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}
.zdg-action-icon {
    width: 42px;
    height: 42px;
    object-fit: contain;
    opacity: 0.85;
    pointer-events: none;
}

/* ===== CTA 大按钮 ===== */
.zdg-cta {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 20px 14px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    flex-shrink: 0;
}
.zdg-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 400px;
    background: #fe2c55;
    color: #fff;
    padding: 15px 0;
    border-radius: 26px;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(254,44,85,0.35);
    transition: transform .15s;
    letter-spacing: 0.5px;
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
    border: none;
}
.zdg-cta-btn:active {
    transform: scale(0.97);
    color: #fff;
    -webkit-tap-highlight-color: transparent !important;
}
.zdg-cta-btn:hover,
.zdg-cta-btn:visited,
.zdg-cta-btn:focus,
.zdg-cta-btn:focus-visible {
    color: #fff;
    outline: none !important;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent !important;
}
.zdg-cta-btn svg { flex-shrink: 0; }
.zdg-cta-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ===== 底部信息区 ===== */
.zdg-bottom {
    position: absolute;
    left: 0;
    bottom: 0;
    right: 80px;
    z-index: 3;
    padding: 16px 12px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* 地点标签 */
.zdg-location {
    display: none;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    background: rgba(0,0,0,0.35);
    padding: 5px 10px;
    border-radius: 14px;
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.zdg-location.zdg-location-active { display: inline-flex; }
.zdg-location svg { flex-shrink: 0; }
.zdg-location-icon { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.zdg-location-name { color: #fff; font-weight: 600; }
.zdg-location-hint { color: rgba(255,255,255,0.5); font-weight: 400; font-size: 12px; }

/* 作者名（无发光效果） */
.zdg-author {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.3px;
}

/* "共XX人推荐" 标签（药丸形状，与地点标签风格一致） */
.zdg-recommend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    background: rgba(0,0,0,0.35);
    padding: 5px 10px;
    border-radius: 14px;
    width: fit-content;
    max-width: 100%;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.zdg-recommend svg,
.zdg-recommend img { width: 14px; height: 14px; object-fit: contain; flex-shrink: 0; }
.zdg-recommend-arrow {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-left: 1px;
}

/* 简介文案（JS 控制截断，无 CSS clamp） */
.zdg-caption {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255,255,255,0.88);
    font-weight: 500;
    word-break: break-word;
}
.zdg-caption-more {
    display: none;
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-left: 2px;
    -webkit-tap-highlight-color: transparent;
}
.zdg-caption-more:active { color: rgba(255,255,255,0.85); }
.zdg-caption-more.zdg-visible { display: inline; }

/* 音乐条 */
.zdg-music-bar {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
}
.zdg-music-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}
.zdg-spin {
    animation: zdgSpin 3s linear infinite;
}
@keyframes zdgSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.zdg-music-text {
    display: inline-block;
    padding-left: 8px;
    animation: zdgMarquee 14s linear infinite;
    padding-right: 30px;
}
@keyframes zdgMarquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(var(--marquee-offset, -50%)); }
}

/* ===== 社交证明浮层 ===== */
.zdg-proof {
    position: fixed;
    left: 14px;
    top: calc(env(safe-area-inset-top, 0) + 24px);
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}
.zdg-proof-item {
    background: rgba(0,0,0,0.5);
    padding: 8px 14px;
    border-radius: 16px;
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: zdgSlideIn .4s ease-out;
    max-width: 260px;
}
.zdg-proof-item img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}
@keyframes zdgSlideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ===== 登录弹窗 ===== */
.zdg-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20;
    opacity: 0;
    transition: opacity .3s;
}
.zdg-modal.zdg-show {
    display: flex;
    opacity: 1;
}
.zdg-modal-card {
    width: 86%;
    max-width: 340px;
    background: #1a1a1a;
    border-radius: 20px;
    padding: 32px 24px 22px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.06);
    transform: translateY(30px);
    animation: zdgPopIn .4s cubic-bezier(.2,.9,.3,1.2) forwards;
}
@keyframes zdgPopIn { to { transform: translateY(0); } }
.zdg-modal-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}
.zdg-modal-title {
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
}
.zdg-modal-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    margin: 0 0 22px;
}
.zdg-wx-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: #07c160;
    color: #fff;
    padding: 13px 0;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: transform .15s;
    -webkit-tap-highlight-color: transparent;
}
.zdg-wx-btn:active { transform: scale(0.97); }
.zdg-modal-close {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.45);
    padding: 12px 0 4px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
}
.zdg-modal-close:active { color: rgba(255,255,255,0.8); }
.zdg-modal-tip {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    margin: 12px 0 0;
}
.zdg-modal-tip a { color: rgba(255,255,255,0.5); text-decoration: underline; }

/* ===== 外壳淡出 ===== */
.zdg-shell.zdg-fade-out {
    animation: zdgShellFadeOut .8s ease-out forwards;
}
@keyframes zdgShellFadeOut {
    0%   { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.05); }
}

/* ============================================================
   浅色模式 — 仅背景变白，文字/图标保持半透明白色（与深色一致）
   ============================================================ */
@media (prefers-color-scheme: light) {
    .zdg-shell {
        background: #fff;
    }
    .zdg-cover-area {
        background: #fff;
    }
    .zdg-shell.zdg-no-cover {
        background: #fff;
    }
    .zdg-shell.zdg-no-cover .zdg-cover-area {
        background: #fff;
    }
    /* CTA 区域白底 */
    .zdg-cta {
        background: #fff;
    }
    /* 登录弹窗保持白色卡片 */
    .zdg-modal { background: rgba(0,0,0,0.25); }
    .zdg-modal-card {
        background: #fff;
        border-color: rgba(0,0,0,0.05);
        box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    }
    .zdg-modal-title { color: #1c1c1e; }
    .zdg-modal-desc { color: rgba(0,0,0,0.4); }
    .zdg-modal-close { color: rgba(0,0,0,0.3); }
    .zdg-modal-close:active { color: rgba(0,0,0,0.6); }
    .zdg-modal-tip { color: rgba(0,0,0,0.2); }
    .zdg-modal-tip a { color: rgba(0,0,0,0.4); }
    /* 社交证明白底 */
    .zdg-proof-item {
        background: rgba(255,255,255,0.85);
        color: #1c1c1e;
    }
    .zdg-proof-item img { border: 1px solid #e5e5ea; }
}

/* ===== 小屏幕适配 ===== */
@media (max-width: 374px) {
    .zdg-bottom { right: 60px; padding-left: 10px; }
    .zdg-sidebar { right: 4px; gap: 14px; }
    .zdg-action-icon { width: 36px; height: 36px; }
    .zdg-action { font-size: 12px; }
    .zdg-avatar-wrap { width: 46px; height: 46px; }
    .zdg-avatar { width: 46px; height: 46px; }
}

/* ===== 桌面端隐藏 ===== */
@media (min-width: 768px) {
    .zdg-shell { display: none !important; }
}
