/* ========================================
   SparkShort — Shared Styles
   ======================================== */

/* Hide all scrollbars globally across devices */
::-webkit-scrollbar {
    display: none !important;
    width: 0px !important;
    height: 0px !important;
    background: transparent !important;
}
html, body {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    background-color: #0B0B0C;
    color: #FFFFFF;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
}

/* ========================================
   Button System — PC/H5 Responsive
   ========================================
   PC  (≥768px): 所有按钮默认灰色背景+边框
       hover → 红色背景 + 红色边框 + 流光
   H5  (<768px): 首要按钮默认红色背景 (无hover交互)
       次要按钮保持灰色

   用法:
     class="spark-btn glow-red btn-glow"               → 标准按钮 (PC灰/H5灰)
     class="spark-btn spark-btn-primary glow-red btn-glow" → 首要按钮 (PC灰/H5红)

   展示型元素 (不可点击):
     直接写 inline: border border-white/10 bg-white/5 glow-red btn-glow
     hover → 红色边框 + 流光 (无背景变化)
   ======================================== */

/* 基础按钮 — mobile-first: 灰色背景 + 灰色边框 */
.spark-btn {
    background-color: rgba(39, 39, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a1a1aa;
    transition: background-color 0.8s ease, color 0.8s ease,
                border-color 0.35s ease, box-shadow 0.35s ease;
}
.spark-btn:hover {
    background-color: rgba(229, 9, 20, 0.8);
    color: #ffffff;
}

/* PC (≥768px): 按钮背景设为灰色 (覆盖 H5 的红色) */
@media (min-width: 768px) {
    .spark-btn {
        background-color: rgba(39, 39, 42, 0.8);
    }
}

/* 首要按钮 — H5 默认红色; PC 由上面的 media query 覆盖为灰色 */
.spark-btn-primary {
    background-color: #E50914;
    color: #ffffff;
}
@media (min-width: 768px) {
    .spark-btn-primary {
        background-color: rgba(39, 39, 42, 0.8);
        color: #a1a1aa;
    }
    .spark-btn-primary:hover {
        background-color: rgba(229, 9, 20, 0.8);
        color: #ffffff;
    }
}

/* Diagonal dynamic glow effect for buttons */
.btn-glow {
    position: relative;
    overflow: hidden;
    transition: all 0.8s ease-in-out;
}
.btn-glow::after {
    content: '';
    position: absolute;
    top: -60%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.5);
    transform: rotate(30deg);
    opacity: 0;
    transition: none;
}
.btn-glow:hover::after {
    left: 200%;
    opacity: 1;
    transition: all 1.2s ease-in-out;
}

/* Unified red glow hover — for ALL interactive elements */
.glow-red {
    transition: filter 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, color 0.35s ease, stroke 0.35s ease;
}
.glow-red:hover {
    box-shadow: 0 0 18px rgba(229, 9, 20, 0.55), 0 0 36px rgba(229, 9, 20, 0.18);
    border-color: rgba(229, 9, 20, 0.6) !important;
}

/* Elegant italic text styling for SparkShort Logo word */
.logo-font {
    font-style: italic;
    font-weight: 900;
    background: linear-gradient(135deg, #FFF 30%, #E50914 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
    text-shadow: 0 2px 10px rgba(229, 9, 20, 0.2);
}

/* Blur-down overlay for immersive backgrounds */
.immersive-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60vh;
    background-size: cover;
    background-position: center;
    filter: blur(80px) brightness(0.3);
    opacity: 0.65;
    z-index: 0;
    pointer-events: none;
}

/* ===== Cinematic Card — shared hover effects for drama cards ===== */
.cinematic-card {
    position: relative;
    z-index: 1;
}
.group.is-hovered .cinematic-card,
.group:hover .cinematic-card {
    z-index: 50;
}
.cinematic-card-inner {
    width: 100%;
    height: 100%;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(24, 24, 27, 0.4);
    overflow: hidden;
    transform-origin: center center;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.33, 1),
                border-color 0.4s ease,
                box-shadow 0.4s ease;
    will-change: transform;
    position: relative;
    z-index: 1;
}
.group.is-hovered .cinematic-card-inner,
.group:hover .cinematic-card-inner {
    transform: scale(1.08);
    border-color: rgba(229, 9, 20, 0.85);
    box-shadow: 0 0 0 1px rgba(229, 9, 20, 0.7),
                0 0 22px rgba(229, 9, 20, 0.5),
                0 0 48px rgba(229, 9, 20, 0.22),
                0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Card bottom gradient overlay */
.card-meta-inner {
    background: linear-gradient(to top, rgba(11, 11, 12, 1) 0%, rgba(11, 11, 12, 0.85) 45%, rgba(11, 11, 12, 0) 100%);
}

/* Hover title sizing */
.card-meta-inner h3 {
    font-size: 13px !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: normal !important;
    line-height: 1.35 !important;
    font-weight: 600 !important;
}
@media (min-width: 1280px) {
    .card-meta-inner h3 {
        font-size: 15px !important;
    }
}
@media (min-width: 1536px) {
    .card-meta-inner h3 {
        font-size: 16px !important;
    }
}

/* iOS Bottom Safe Zone support */
.pb-safe {
    padding-bottom: calc(env(safe-area-inset-bottom) + 0.5rem);
}

/* ========================================
   Sidebar Active State
   ========================================
   活跃页面: 保持灰色背景 + 红色左边框指示器 (PC)
   H5 横向模式: 红色底边框 + 红色文字
   ======================================== */
.user-sidebar a.active,
.user-sidebar button.active {
    color: #e4e4e7 !important;
    background-color: rgba(39, 39, 42, 0.9) !important;
}
/* PC: 红色左边框 (垂直排列) */
@media (min-width: 768px) {
    .user-sidebar a.active,
    .user-sidebar button.active {
        border-left: 2px solid rgba(229, 9, 20, 0.8) !important;
    }
}
/* H5: 红色底边框 (横向排列) */
@media (max-width: 767px) {
    .user-sidebar a.active,
    .user-sidebar button.active {
        border-bottom: 2px solid rgba(229, 9, 20, 0.8) !important;
        color: #E50914 !important;
    }
}

/* ========================================
   Toast Notification — 淡入淡出消息提示
   ========================================
   用法:  SparkToast.show('操作成功', 'success')
          SparkToast.show('出错了', 'error')
          SparkToast.show('提示信息', 'info')
   ======================================== */
.spark-toast-container {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    width: max-content;
    max-width: 90vw;
}
.spark-toast {
    pointer-events: auto;
    padding: 10px 22px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
    opacity: 0;
    transform: translateY(-12px) scale(0.96);
    animation: sparkToastIn 0.35s ease forwards;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90vw;
}
.spark-toast.toast-out {
    animation: sparkToastOut 0.3s ease forwards;
}
/* Types */
.spark-toast-success {
    background: rgba(229, 9, 20, 0.9);
    color: #fff;
    border-color: rgba(229,9,20,0.4);
}
.spark-toast-error {
    background: rgba(60, 20, 20, 0.92);
    color: #fca5a5;
    border-color: rgba(239,68,68,0.3);
}
.spark-toast-info {
    background: rgba(39, 39, 42, 0.92);
    color: #e4e4e7;
    border-color: rgba(255,255,255,0.1);
}
@keyframes sparkToastIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes sparkToastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(-12px) scale(0.96); }
}

/* ========================================
   PC 按钮主次区分 — spark-btn-accent
   ========================================
   PC 默认静默态: 主按钮有淡红色边框 + 微弱光晕
   H5 无此效果 (无 hover 交互环境)
   hover 后: 恢复红色背景 + 流光 (与 spark-btn-primary 一致)
   ======================================== */
@media (min-width: 768px) {
    .spark-btn-accent {
        border-color: rgba(229, 9, 20, 0.35) !important;
        box-shadow: 0 0 12px rgba(229, 9, 20, 0.08);
        color: #d4d4d8 !important;
    }
    .spark-btn-accent:hover {
        border-color: rgba(229, 9, 20, 0.6) !important;
        box-shadow: 0 0 18px rgba(229, 9, 20, 0.55), 0 0 36px rgba(229, 9, 20, 0.18);
        color: #ffffff !important;
    }
}
/* H5: 显式重置 accent 样式，避免断点切换时残留 */
@media (max-width: 767px) {
    .spark-btn-accent {
        border-color: rgba(255, 255, 255, 0.1) !important;
        box-shadow: none;
    }
}

/* ========================================
   H5 关键元素突出
   ========================================
   H5 无鼠标交互，关键提示/按钮需主动吸引注意力
   方式: 红色背景 (spark-btn-primary) / 红色文字 / 加粗
   ======================================== */

/* H5 红色数值 — 用于统计数字等需要突出的文字 */
.h5-red-value {
    color: #E50914;
    font-weight: 900;
}
@media (min-width: 768px) {
    .h5-red-value {
        color: #ffffff;
        font-weight: 900;
    }
}

/* ========================================
   AdSense Auto Ads — H5 Bottom Ad Constraint
   ========================================
   限制 H5 底部自动广告的最大高度，避免过多空白
   ======================================== */
@media (max-width: 767px) {
    ins.adsbygoogle[data-ad-status="active"] {
        max-height: 60px !important;
        overflow: hidden !important;
    }
    /* 约束 Google 底部广告覆盖层 */
    #google-image-rich-text-medium-rectangle,
    [id*="aswift_"][id*="_host"] {
        max-height: 80px !important;
    }
}
