/* ========== QY服务 公共样式 ========== */

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

/* 防止全页跳转白屏闪烁 */
html { background: #0a0814; }

body {
    background: #0a0814;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
    color: #e2e8f0;
    min-height: 100vh;
    padding-top: 0;
    animation: fadeIn 0.5s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: -1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========== 容器 ========== */
.container {
    text-align: center;
    padding: 60px 40px;
    background: rgba(255,255,255,0.05);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ========== 按钮 ========== */
.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

.btn-ghost {
    border: 1px solid rgba(255,255,255,0.2);
    color: #cbd5e1;
}

.btn-game {
    background: linear-gradient(135deg, rgba(167,139,250,0.3), rgba(124,58,237,0.5));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(167,139,250,0.4);
    color: #e9d5ff;
    box-shadow: 0 4px 20px rgba(139,92,246,0.2);
}

.btn-game:hover {
    box-shadow: 0 8px 30px rgba(139,92,246,0.4);
}

/* ========== 骨架屏 ========== */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.5s ease-in-out infinite;
    border-radius: 8px;
}
.skeleton-text { height: 14px; margin-bottom: 10px; width: 80%; }
.skeleton-text.short { width: 50%; }
.skeleton-text.long { width: 95%; }
.skeleton-title { height: 22px; margin-bottom: 16px; width: 60%; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; }
.skeleton-card { height: 100px; border-radius: 12px; margin-bottom: 12px; }
.skeleton-img { height: 180px; border-radius: 12px; margin-bottom: 12px; }
.skeleton-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; }
.skeleton-btn { height: 44px; border-radius: 8px; width: 100%; }

@keyframes skeletonPulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========== 连接状态横幅 ========== */
.ws-status-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 300;
    background: linear-gradient(135deg, rgba(234,179,8,0.15), rgba(250,204,21,0.1));
    border-bottom: 1px solid rgba(234,179,8,0.3);
    color: #fde68a;
    text-align: center;
    padding: 10px 16px;
    font-size: 0.85rem;
    backdrop-filter: blur(10px);
    animation: bannerSlideIn 0.3s ease;
}
.ws-status-banner.show { display: block; }
.ws-status-banner.reconnected {
    background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(74,222,128,0.1));
    border-bottom: 1px solid rgba(34,197,94,0.3);
    color: #86efac;
}

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

/* ========== 响应式 ========== */
/* 平板：max 1024px 两列布局辅助 */
@media (max-width: 1024px) {
    .container { max-width: 90%; }
}

/* 手机：max 768px */
@media (max-width: 768px) {
    /* 容器 */
    .container { padding: 24px 16px; max-width: 100%; border-radius: 16px; }
    .container h1 { font-size: 1.6rem; }

    /* 按钮 */
    button, .btn-primary, .btn-ghost, .btn-game {
        min-height: 44px;
        width: 100%;
        font-size: 0.95rem;
    }

    /* 输入框 */
    input[type="text"], input[type="password"], input[type="email"],
    input[type="search"], input[type="number"], textarea, select {
        min-height: 44px;
        font-size: 16px;
    }

    /* 链接间距 */
    a { padding: 10px 4px; }

    /* 字体缩小 */
    /* 防止全页跳转白屏闪烁 */
html { background: #0a0814; }

body { font-size: 14px; }

    /* 底部 Tab Bar */
    .mobile-tab-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;
        background: rgba(15,15,20,0.95);
        backdrop-filter: blur(16px);
        border-top: 1px solid rgba(167,139,250,0.12);
        padding: 8px 4px env(safe-area-inset-bottom, 8px);
        justify-content: space-around;
        align-items: center;
    }
    .mobile-tab-bar a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        color: rgba(255,255,255,0.5);
        text-decoration: none;
        font-size: 0.7rem;
        padding: 6px 10px;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        border-radius: 10px;
        transition: all 0.2s;
    }
    .mobile-tab-bar a .tab-icon { font-size: 1.3rem; }
    .mobile-tab-bar a.active { color: #a78bfa; background: rgba(167,139,250,0.1); }

    body.has-mobile-tab { padding-bottom: 80px; }
}

@media (min-width: 769px) {
    .mobile-tab-bar { display: none; }
    }

/* ========== 订单进度条 ========== */
.order-progress {
    display: flex; align-items: center; gap: 0;
    padding: 8px 0; flex-wrap: wrap;
}
.order-progress .step {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.7rem; color: #475569;
    white-space: nowrap;
}
.order-progress .step .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #334155; flex-shrink: 0;
    transition: all 0.3s;
}
.order-progress .step.done .dot { background: #34d399; }
.order-progress .step.current .dot { background: #a78bfa; box-shadow: 0 0 8px rgba(167,139,250,0.5); }
.order-progress .step.done { color: #34d399; }
.order-progress .step.current { color: #a78bfa; font-weight: 600; }
.order-progress .connector {
    width: 16px; height: 1px; background: #334155; flex-shrink: 0; margin: 0 2px;
}
.order-progress .connector.done { background: #34d399; }

/* ========== 通知中心 ========== */
.notif-bell {
    position: relative; cursor: pointer; padding: 6px;
    font-size: 1.2rem; color: rgba(255,255,255,0.7);
    transition: color 0.2s; min-width: 44px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
}
.notif-bell:hover { color: #a78bfa; }
.notif-badge {
    position: absolute; top: 2px; right: 2px;
    min-width: 16px; height: 16px; border-radius: 8px;
    background: #ef4444; color: #fff; font-size: 0.6rem;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; line-height: 1;
}
.notif-badge:empty { display: none; }
.notif-dropdown {
    position: absolute; top: 100%; right: 0;
    width: 340px; max-height: 420px; overflow-y: auto;
    background: rgba(20,20,30,0.98); border: 1px solid rgba(167,139,250,0.15);
    border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,0.6);
    z-index: 300; display: none; backdrop-filter: blur(20px);
}
.notif-dropdown.show { display: block; }
.notif-dropdown .notif-item {
    padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer; transition: background 0.15s;
}
.notif-dropdown .notif-item:hover { background: rgba(167,139,250,0.08); }
.notif-dropdown .notif-item.unread {
    border-left: 3px solid #a78bfa;
    font-weight: 600; background: rgba(167,139,250,0.04);
}
.notif-dropdown .notif-item .notif-time {
    font-size: 0.68rem; color: #64748b; margin-top: 2px;
}
.notif-dropdown .notif-empty {
    padding: 32px 16px; text-align: center; color: #64748b; font-size: 0.85rem;
}

/* ========== 星级评分 ========== */
.star-rating { display: inline-flex; gap: 2px; align-items: center; }
.star-rating .star { color: #334155; font-size: 0.85rem; }
.star-rating .star.filled { color: #fbbf24; }
.star-rating .star.half { color: #fbbf24; }
.rating-count { font-size: 0.7rem; color: #64748b; margin-left: 4px; }

/* 评分交互 */
.rate-stars { display: inline-flex; gap: 6px; cursor: pointer; }
.rate-stars .rate-star {
    font-size: 1.5rem; color: #334155; transition: color 0.15s;
}
.rate-stars .rate-star.active { color: #fbbf24; }
.rate-stars .rate-star:hover { color: #fbbf24; }
.rate-comment {
    width: 100%; min-height: 60px; padding: 10px; border-radius: 8px;
    border: 1px solid rgba(167,139,250,0.2); background: rgba(255,255,255,0.04);
    color: #e2e8f0; font-size: 0.85rem; resize: vertical; margin-top: 8px;
}

/* ========== 管理仪表盘 ========== */
.dashboard-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(167,139,250,0.1);
    border-radius: 14px; padding: 20px;
}
.stat-card .stat-label { font-size: 0.75rem; color: #64748b; text-transform: uppercase; letter-spacing: 1px; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; color: #e2e8f0; margin-top: 6px; }
.stat-card .stat-sub { font-size: 0.7rem; color: #475569; margin-top: 4px; }
.dashboard-section { margin-bottom: 24px; }
.dashboard-section h3 {
    font-size: 0.95rem; font-weight: 600; color: #c4b5fd;
    margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 1px solid rgba(167,139,250,0.12);
}
.dashboard-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.dashboard-table th {
    text-align: left; padding: 10px 12px; background: rgba(167,139,250,0.06);
    color: #94a3b8; font-weight: 600; border-bottom: 1px solid rgba(167,139,250,0.1);
}
.dashboard-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); color: #cbd5e1; }

/* 进度条移动端适配 */
@media (max-width: 768px) {
    .order-progress { font-size: 0.62rem; }
    .order-progress .step .dot { width: 8px; height: 8px; }
    .order-progress .connector { width: 10px; }
    .notif-dropdown { width: calc(100vw - 24px); right: -80px; }
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
}
