/* ================================================================
   style.css - 六合彩直播 Mini App 样式
   ================================================================ */

/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0f;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12px;
}

/* ===== 主容器 ===== */
#app {
    width: 100%;
    max-width: 480px;
    background: linear-gradient(145deg, #12121a, #1a1a2e);
    border-radius: 20px;
    padding: 20px 16px 16px 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ===== 头部 ===== */
#header {
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#logo-container {
    margin-bottom: 6px;
}

#emoji-icon {
    font-size: 32px;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

#title {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

#subtitle {
    font-size: 13px;
    color: #8888aa;
    margin-top: 2px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* ===== 视频容器 ===== */
#video-container {
    position: relative;
    background: #000000;
    border-radius: 14px;
    overflow: hidden;
    margin-top: 16px;
    aspect-ratio: 16 / 9;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

#video {
    width: 100%;
    height: 100%;
    background: #000000;
    display: block;
    object-fit: contain;
}

/* 视频加载时的覆盖层 */
#video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    pointer-events: none;
    z-index: 2;
}

#video-overlay span {
    font-size: 48px;
    opacity: 0.6;
    animation: pulse 2s ease-in-out infinite;
}

#video-overlay p {
    font-size: 14px;
    color: #aaaacc;
    margin-top: 8px;
}

/* ===== 状态栏 ===== */
#status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 0 8px 0;
    font-size: 14px;
    color: #8888aa;
    min-height: 40px;
}

#status-icon {
    font-size: 16px;
}

#status-text {
    transition: color 0.3s ease;
}

/* 状态颜色 */
.status-loading #status-icon { color: #f1c40f; }
.status-loading #status-text { color: #f1c40f; }

.status-success #status-icon { color: #2ecc71; }
.status-success #status-text { color: #2ecc71; }

.status-error #status-icon { color: #e74c3c; }
.status-error #status-text { color: #e74c3c; }

.status-idle #status-icon { color: #8888aa; }
.status-idle #status-text { color: #8888aa; }

/* ===== 信息面板 ===== */
#info-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 0;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 10px 14px;
    margin-top: 6px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.info-item {
    display: flex;
    align-items: center;
    width: 33.33%;
    font-size: 13px;
}

.info-label {
    color: #666688;
    margin-right: 6px;
    font-size: 12px;
}

.info-value {
    color: #ddddee;
    font-weight: 500;
    font-size: 13px;
}

/* ===== 底部按钮 ===== */
#footer {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 6px;
}

#footer button {
    flex: 1;
    max-width: 140px;
    padding: 11px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
}

#footer button:active {
    transform: scale(0.95);
}

#btn-refresh {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

#btn-refresh:hover {
    box-shadow: 0 6px 25px rgba(52, 152, 219, 0.5);
    transform: translateY(-1px);
}

#btn-refresh:active {
    transform: scale(0.95);
}

#btn-close {
    background: rgba(255, 255, 255, 0.08);
    color: #9999bb;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#btn-close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ccccdd;
}

/* ================================================================
   响应式适配
   ================================================================ */

/* 小屏手机 */
@media screen and (max-width: 380px) {
    #app {
        padding: 12px 10px 12px 10px;
    }
    #title {
        font-size: 18px;
    }
    .info-item {
        width: 50%;
        font-size: 12px;
    }
    #footer button {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* 大屏手机/平板 */
@media screen and (min-width: 600px) {
    #app {
        padding: 28px 24px 20px 24px;
        border-radius: 28px;
    }
    #title {
        font-size: 28px;
    }
    #video-container {
        border-radius: 18px;
    }
    #footer button {
        padding: 13px 28px;
        font-size: 16px;
    }
}

/* 暗色模式适配（Telegram 暗色主题） */
@media (prefers-color-scheme: dark) {
    body {
        background: #0a0a0f;
    }
    #app {
        background: linear-gradient(145deg, #12121a, #1a1a2e);
        border-color: rgba(255, 255, 255, 0.06);
    }
}

/* Telegram 浅色主题覆盖 */
body[data-theme="light"] #app {
    background: linear-gradient(145deg, #f0f0f5, #e8e8f0);
    border-color: rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] #title {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body[data-theme="light"] #subtitle {
    color: #666688;
}

body[data-theme="light"] .info-label {
    color: #9999aa;
}

body[data-theme="light"] .info-value {
    color: #333344;
}

body[data-theme="light"] #status-text {
    color: #666688;
}

body[data-theme="light"] #info-panel {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] #btn-close {
    background: rgba(0, 0, 0, 0.06);
    color: #666688;
    border-color: rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] #btn-close:hover {
    background: rgba(0, 0, 0, 0.12);
}