/* ============================================================
   CNCEO REWARDS · UI 样式 v2
   ============================================================ */

/* ---------- 皮肤覆盖 ---------- */
html[data-skin="retro"] { --neon-cyan: #00ff41; --neon-purple: #008f11; --neon-pink: #00ff41; --neon-gold: #ffcc00; --neon-green: #00ff41; --neon-gradient: linear-gradient(135deg, #00ff41, #008f11); --neon-gradient-btn: linear-gradient(135deg, #00ff41, #008f11); }
html[data-skin="spring"] { --neon-cyan: #ffd93d; --neon-purple: #dc2626; --neon-pink: #ff5fa0; --neon-gold: #ffd93d; --neon-green: #ffb020; --neon-gradient: linear-gradient(135deg, #ffd93d, #dc2626, #ff5fa0); --neon-gradient-btn: linear-gradient(135deg, #ffd93d, #dc2626); }
html[data-skin="cyber"] { --neon-cyan: #00f0ff; --neon-purple: #bf00ff; --neon-pink: #ff00aa; --neon-gold: #f0ff00; --neon-green: #00ffaa; --neon-gradient: linear-gradient(135deg, #00f0ff, #bf00ff, #ff00aa); --neon-gradient-btn: linear-gradient(135deg, #00f0ff, #bf00ff); }
html[data-skin="aurora"] { --neon-cyan: #7ef5d0; --neon-purple: #a78bfa; --neon-pink: #f0abfc; --neon-gold: #fde68a; --neon-green: #6ee7b7; --neon-gradient: linear-gradient(135deg, #7ef5d0, #a78bfa, #f0abfc); --neon-gradient-btn: linear-gradient(135deg, #7ef5d0, #a78bfa); }

/* ---------- 顶栏 ---------- */
.cr-bar {
    position: fixed;
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 12px;
    background: linear-gradient(135deg, rgba(10,15,35,.92), rgba(5,5,15,.92));
    border: 1px solid rgba(255,217,61,.5);
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .5px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    z-index: 9998;
    user-select: none;
    box-shadow: 0 6px 24px rgba(0,0,0,.5), 0 0 18px rgba(255,217,61,.25);
    transition: transform .15s;
}
.cr-bar:active { transform: scale(.96); }
.cr-bar .ico { font-size: 17px; }
.cr-bar .val { color: #ffd93d; text-shadow: 0 0 8px rgba(255,217,61,.6); }
.cr-bar .badge {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 8px; border-radius: 999px;
    background: linear-gradient(135deg, rgba(0,210,255,.25), rgba(123,47,247,.25));
    border: 1px solid rgba(0,210,255,.5);
    color: #cfefff; font-size: 11px;
}
.cr-bar .badge .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #ff2fd0;
    box-shadow: 0 0 6px #ff2fd0;
    animation: cr-pulse 1.4s ease-in-out infinite;
}
@keyframes cr-pulse { 50% { opacity: .35; } }

/* ---------- 展开面板 ---------- */
.cr-panel {
    position: fixed;
    top: calc(60px + env(safe-area-inset-top, 0px));
    right: 16px;
    width: min(380px, 92vw);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: linear-gradient(160deg, rgba(10,15,35,.98), rgba(5,5,15,.98));
    border: 1px solid rgba(0,210,255,.4);
    border-radius: 18px;
    padding: 14px;
    color: #cfefff;
    z-index: 9999;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 20px 60px rgba(0,0,0,.8), 0 0 40px rgba(0,210,255,.2);
    display: none;
    animation: cr-slide .2s ease-out;
}
.cr-panel.show { display: block; }
@keyframes cr-slide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 顶部 Tab */
.cr-tabs {
    display: flex; gap: 4px;
    padding: 4px;
    background: rgba(0,210,255,.06);
    border: 1px solid rgba(0,210,255,.18);
    border-radius: 12px;
    margin-bottom: 12px;
}
.cr-tab {
    flex: 1;
    padding: 7px 4px;
    border-radius: 9px;
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    color: #7a8fb8;
    cursor: pointer;
    transition: all .18s;
    letter-spacing: .5px;
    border: none;
    background: transparent;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    white-space: nowrap;
}
.cr-tab:active { transform: scale(.96); }
.cr-tab.active {
    background: linear-gradient(135deg, #00d2ff, #7b2ff7);
    color: #fff;
    box-shadow: 0 0 14px rgba(0,210,255,.5);
}
.cr-tab .tab-badge {
    position: absolute;
    top: 2px; right: 4px;
    min-width: 14px; height: 14px;
    padding: 0 3px;
    border-radius: 7px;
    background: #ff2fd0;
    color: #fff;
    font-size: 8px;
    font-weight: 900;
    line-height: 14px;
    box-shadow: 0 0 6px #ff2fd0;
}

/* Tab 面板 */
.cr-tabpanel { display: none; }
.cr-tabpanel.active { display: block; }

/* ---------- 通用 Section ---------- */
.cr-section { margin-bottom: 14px; }
.cr-section:last-child { margin-bottom: 0; }
.cr-section h4 {
    font-size: 12px;
    color: #7fd6ff;
    letter-spacing: 2px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
}
.cr-section h4::after {
    content: '';
    flex: 1; height: 1px;
    background: linear-gradient(90deg, rgba(0,210,255,.5), transparent);
}

/* ---------- 签到 ---------- */
.cr-signin {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,217,61,.1), rgba(255,152,0,.08));
    border: 1px solid rgba(255,217,61,.4);
}
.cr-signin .streak {
    font-size: 22px; font-weight: 900;
    color: #ffd93d; text-shadow: 0 0 12px rgba(255,217,61,.6);
    line-height: 1; text-align: center;
}
.cr-signin .streak small { display: block; font-size: 9px; color: #7a8fb8; letter-spacing: 1px; font-weight: 600; margin-top: 3px; }
.cr-signin .info { flex: 1; font-size: 11px; color: #cfefff; line-height: 1.6; }
.cr-signin .info b { color: #ffd93d; }
.cr-signin-btn {
    padding: 8px 16px; border-radius: 10px;
    border: none; cursor: pointer; font-family: inherit;
    font-size: 12px; font-weight: 800;
    background: linear-gradient(135deg, #ffd93d, #ff9800);
    color: #2a1a00;
    box-shadow: 0 4px 14px rgba(255,152,0,.4);
    transition: transform .15s;
}
.cr-signin-btn:active { transform: scale(.95); }
.cr-signin-btn[disabled] { opacity: .35; pointer-events: none; box-shadow: none; }

/* 签到日历条 */
.cr-signin-days {
    display: flex; gap: 4px; margin-top: 10px;
    justify-content: space-between;
}
.cr-signin-day {
    flex: 1;
    padding: 6px 2px;
    border-radius: 8px;
    text-align: center;
    font-size: 9px;
    font-weight: 700;
    background: rgba(0,0,0,.3);
    border: 1px solid rgba(120,130,170,.25);
    color: #5a6a9a;
}
.cr-signin-day.done {
    background: linear-gradient(135deg, rgba(255,217,61,.3), rgba(255,152,0,.2));
    border-color: rgba(255,217,61,.6);
    color: #ffd93d;
}
.cr-signin-day .num { display: block; font-size: 11px; font-weight: 900; margin-bottom: 2px; }

/* ---------- 任务 ---------- */
.cr-task {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: rgba(0,210,255,.05);
    border: 1px solid rgba(0,210,255,.18);
    border-radius: 10px;
    font-size: 12px;
    transition: all .2s;
}
.cr-task.done { background: rgba(0,255,157,.08); border-color: rgba(0,255,157,.4); }
.cr-task.claimed { opacity: .45; }
.cr-task .chk {
    width: 20px; height: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 900;
    background: rgba(120,130,170,.2);
    border: 1px solid rgba(120,130,170,.4);
    color: #a0a8c0;
    flex-shrink: 0;
}
.cr-task.done .chk { background: linear-gradient(135deg, #00ff9d, #00d2ff); color: #0a1a2a; border-color: #00ff9d; }
.cr-task .info { flex: 1; min-width: 0; }
.cr-task .desc { font-weight: 700; color: #cfefff; margin-bottom: 2px; }
.cr-task .prog { font-size: 10px; color: #7a8fb8; }
.cr-task .reward { color: #ffd93d; font-weight: 800; white-space: nowrap; font-size: 11px; }
.cr-task .claim-btn {
    padding: 4px 10px; font-size: 10.5px; font-weight: 800;
    border-radius: 8px; border: 1px solid #00d2ff;
    background: linear-gradient(135deg, #00d2ff, #7b2ff7);
    color: #fff; cursor: pointer; font-family: inherit;
    transition: transform .15s;
}
.cr-task .claim-btn:active { transform: scale(.94); }
.cr-task .claim-btn[disabled] { opacity: .35; pointer-events: none; }

/* 进度条 */
.cr-prog-bar {
    width: 60px; height: 4px;
    background: rgba(120,130,170,.2);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}
.cr-prog-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d2ff, #7b2ff7);
    transition: width .3s;
}
.cr-task.done .cr-prog-fill { background: linear-gradient(90deg, #00ff9d, #00d2ff); }

/* ---------- 成就 ---------- */
.cr-achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}
.cr-achievement {
    position: relative;
    padding: 10px 8px;
    border-radius: 10px;
    background: rgba(0,210,255,.04);
    border: 1px solid rgba(0,210,255,.15);
    text-align: center;
    transition: all .2s;
}
.cr-achievement.unlocked {
    background: linear-gradient(135deg, rgba(255,217,61,.12), rgba(255,152,0,.08));
    border-color: rgba(255,217,61,.5);
    box-shadow: 0 0 12px rgba(255,217,61,.2);
}
.cr-achievement.locked { opacity: .55; }
.cr-achievement .ac-icon {
    font-size: 24px;
    margin-bottom: 4px;
    display: block;
    filter: grayscale(1);
    opacity: .5;
}
.cr-achievement.unlocked .ac-icon { filter: none; opacity: 1; }
.cr-achievement .ac-name {
    font-size: 10.5px;
    font-weight: 800;
    color: #cfefff;
    margin-bottom: 2px;
    line-height: 1.2;
}
.cr-achievement.unlocked .ac-name { color: #ffd93d; }
.cr-achievement .ac-desc {
    font-size: 8.5px;
    color: #7a8fb8;
    line-height: 1.3;
    margin-bottom: 4px;
    min-height: 20px;
}
.cr-achievement .ac-reward {
    font-size: 9px;
    color: #ffd93d;
    font-weight: 800;
}
.cr-achievement.unlocked .ac-reward { color: #00ff9d; }

/* ---------- 商店 ---------- */
.cr-shop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: rgba(0,210,255,.05);
    border: 1px solid rgba(0,210,255,.18);
    border-radius: 10px;
    font-size: 12px;
}
.cr-shop-item .ico { font-size: 18px; }
.cr-shop-item .info { flex: 1; min-width: 0; }
.cr-shop-item .name { font-weight: 700; color: #cfefff; margin-bottom: 2px; font-size: 11.5px; }
.cr-shop-item .owned { font-size: 10px; color: #7a8fb8; }
.cr-shop-item .owned b { color: #ffd93d; }
.cr-shop-item .price { color: #ffd93d; font-weight: 800; font-size: 11.5px; white-space: nowrap; }
.cr-shop-item .buy-btn {
    padding: 4px 10px; font-size: 10.5px; font-weight: 800;
    border-radius: 8px; border: 1px solid rgba(255,217,61,.6);
    background: rgba(255,217,61,.15);
    color: #ffd93d; cursor: pointer; font-family: inherit;
    transition: all .15s;
}
.cr-shop-item .buy-btn:active { transform: scale(.94); background: rgba(255,217,61,.3); }
.cr-shop-item .buy-btn[disabled] { opacity: .3; pointer-events: none; }

/* ---------- 皮肤 ---------- */
.cr-skins-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.cr-skin {
    position: relative;
    padding: 10px 8px;
    border-radius: 12px;
    background: rgba(0,210,255,.04);
    border: 1px solid rgba(0,210,255,.18);
    text-align: center;
    transition: all .2s;
    cursor: pointer;
}
.cr-skin.equipped {
    background: linear-gradient(135deg, rgba(0,210,255,.2), rgba(123,47,247,.15));
    border-color: #00d2ff;
    box-shadow: 0 0 16px rgba(0,210,255,.4);
}
.cr-skin.locked { opacity: .6; }
.cr-skin:active { transform: scale(.97); }
.cr-skin .sk-preview {
    width: 100%; height: 42px;
    border-radius: 8px;
    margin-bottom: 6px;
    box-shadow: inset 0 0 20px rgba(0,0,0,.3);
}
.cr-skin .sk-name {
    font-size: 11px;
    font-weight: 800;
    color: #cfefff;
    margin-bottom: 2px;
}
.cr-skin.equipped .sk-name { color: #00d2ff; }
.cr-skin .sk-desc {
    font-size: 8.5px;
    color: #7a8fb8;
    line-height: 1.3;
    margin-bottom: 4px;
    min-height: 20px;
}
.cr-skin .sk-status {
    font-size: 10px;
    font-weight: 800;
}
.cr-skin.equipped .sk-status { color: #00ff9d; }
.cr-skin.locked .sk-status { color: #ffd93d; }
.cr-skin.owned:not(.equipped) .sk-status { color: #7fd6ff; }

/* ---------- 空状态 ---------- */
.cr-empty {
    text-align: center;
    padding: 16px;
    font-size: 11px;
    color: #5a6a9a;
}

/* ---------- Toast ---------- */
.cr-toast {
    position: fixed;
    top: 40%; left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    padding: 14px 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(0,210,255,.95), rgba(123,47,247,.95));
    color: #fff;
    font-size: 16px; font-weight: 900; letter-spacing: 2px;
    text-shadow: 0 0 12px rgba(255,255,255,.5);
    box-shadow: 0 0 40px rgba(0,210,255,.8), 0 12px 30px rgba(0,0,0,.7);
    border: 2px solid #fff;
    z-index: 99999;
    opacity: 0; pointer-events: none;
    transition: opacity .25s, transform .35s cubic-bezier(.34,1.56,.64,1);
    white-space: nowrap;
}
.cr-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- 动画 ---------- */
@keyframes cr-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.cr-bounce { animation: cr-bounce .35s ease-out; }

/* ---------- 小屏 ---------- */
@media (max-width: 520px) {
    .cr-bar { top: calc(10px + env(safe-area-inset-top, 0px)); right: 10px; padding: 6px 11px 6px 10px; font-size: 12px; }
    .cr-bar .ico { font-size: 15px; }
    .cr-panel { top: calc(52px + env(safe-area-inset-top, 0px)); right: 8px; left: 8px; width: auto; max-height: calc(100vh - 70px); }
    .cr-task { padding: 7px 8px; font-size: 11px; }
    .cr-signin { padding: 10px 12px; }
    .cr-signin .streak { font-size: 19px; }
    .cr-tab { font-size: 10px; padding: 6px 2px; }
    .cr-achievement { padding: 8px 6px; }
    .cr-achievement .ac-icon { font-size: 20px; }
    .cr-achievement .ac-name { font-size: 9.5px; }
}