/* ===== Daily Task (每日任务) — standalone module ===== */

.dtask-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 10001;
    display: flex; align-items: center; justify-content: center;
    padding: 8px;
    box-sizing: border-box;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.dtask-modal {
    position: relative;
    width: 100%;
    max-width: 1160px;
    max-height: 97vh;
    display: flex;
    background: radial-gradient(120% 120% at 50% 0%, #17162e 0%, #0d0c1c 55%, #08070f 100%);
    border: 1px solid rgba(255, 214, 130, 0.18);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    box-sizing: border-box;
}

.dtask-close {
    position: absolute; top: 14px; right: 16px;
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: none; color: #cfcfe0; font-size: 22px; line-height: 1;
    cursor: pointer; z-index: 5;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.dtask-close:hover { background: rgba(255, 255, 255, 0.14); }

/* ===== Left sidebar ===== */
.dtask-sidebar {
    width: 200px; flex-shrink: 0;
    padding: 14px 12px;
    background: linear-gradient(180deg, rgba(30, 28, 56, 0.55), rgba(16, 15, 32, 0.55));
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex; flex-direction: column;
    overflow-y: auto;
}
.dtask-sidebar-title {
    font-size: 15px; font-weight: 700; color: #fff;
    margin: 2px 0 12px 2px;
}
.dtask-reward-card {
    position: relative;
    box-sizing: border-box;
    background: linear-gradient(160deg, #23213f, #16152a);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 8px 8px 6px;
    margin-bottom: 6px;
    text-align: center;
}
.dtask-reward-badge {
    position: absolute; top: 0; left: 0;
    background: linear-gradient(135deg, #8a5cff, #6a3df0);
    color: #fff; font-size: 12px; font-weight: 700;
    padding: 3px 12px;
    border-radius: 12px 0 12px 0;
}
.dtask-reward-img {
    height: 48px; margin: 3px 0 3px;
    display: flex; align-items: center; justify-content: center;
}
.dtask-reward-img img {
    max-height: 48px; max-width: 96%;
    filter: drop-shadow(0 3px 7px rgba(0, 0, 0, 0.45));
}
.dtask-reward-points {
    font-size: 20px; font-weight: 800;
    background: linear-gradient(180deg, #ffe7a8, #f5b53c);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.dtask-reward-unit { font-size: 12px; color: #9a99b5; margin-top: 2px; }

.dtask-days-card {
    box-sizing: border-box;
    background: linear-gradient(160deg, #201e3a, #14132700);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px; padding: 8px 8px;
    text-align: center; margin-bottom: 6px;
}
.dtask-days-label { font-size: 13px; color: #c7c6dd; margin-bottom: 4px; }
.dtask-days-num {
    font-size: 24px; font-weight: 800;
    background: linear-gradient(180deg, #ffe7a8, #f5b53c);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.dtask-days-num span { font-size: 14px; color: #c7c6dd; -webkit-text-fill-color: #c7c6dd; margin-left: 3px; }
.dtask-days-streak { font-size: 12px; color: #ff8a3d; margin-top: 6px; }

.dtask-calendar-btn {
    margin-top: auto;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px; padding: 9px 12px;
    color: #e4e3f2; font-size: 14px; font-weight: 600;
    cursor: pointer;
}
.dtask-calendar-btn:hover { background: rgba(255, 255, 255, 0.09); }

/* ===== Main area ===== */
.dtask-main {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.dtask-header {
    text-align: center; padding: 8px 16px 4px;
    flex-shrink: 0;
}
.dtask-header-title {
    font-size: 19px; font-weight: 800; letter-spacing: 2px;
    background: linear-gradient(180deg, #fff2cf, #f3b73f);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.dtask-header-title .dtask-deco { color: #f3b73f; -webkit-text-fill-color: #f3b73f; margin: 0 10px; font-size: 16px; }
.dtask-header-sub {
    font-size: 13px; color: #9a99b5; margin-top: 3px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}

.dtask-scroll {
    flex: 1; overflow-y: auto;
    padding: 2px 18px 10px;
}

.dtask-section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin: 6px 0 5px;
}
.dtask-section-title { font-size: 16px; font-weight: 700; color: #fff; }
.dtask-section-title .dtask-arrow { color: #f3b73f; margin-left: 4px; }
.dtask-reset { font-size: 13px; color: #ff8a3d; display: flex; align-items: center; gap: 5px; }

.dtask-panel {
    background: linear-gradient(180deg, rgba(30, 28, 56, 0.5), rgba(18, 17, 36, 0.5));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px; padding: 8px;
}

/* ===== Sign-in row ===== */
.dtask-signin-row {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
    align-items: stretch;
}
.dtask-signin-cell {
    position: relative;
    background: #191830;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 6px 3px 6px;
    text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.dtask-signin-cell.available {
    background: linear-gradient(180deg, #2c2717, #1c1a10);
    border-color: #f3b73f;
    box-shadow: 0 0 0 1px #f3b73f, 0 6px 18px rgba(243, 183, 63, 0.25);
}
.dtask-signin-day { font-size: 13px; color: #c7c6dd; }
.dtask-signin-icon {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
.dtask-signin-icon img { max-width: 30px; max-height: 30px; }
.dtask-signin-status { font-size: 12px; }
.dtask-signin-cell.signed .dtask-signin-status { color: #f3b73f; }
.dtask-signin-cell.available .dtask-signin-status { color: #ffd76a; font-weight: 700; }
.dtask-signin-cell.pending .dtask-signin-status { color: #7c7b94; }
.dtask-signin-cell.reward .dtask-signin-status { color: #f3b73f; font-weight: 700; }

/* ===== Task list ===== */
.dtask-task-item {
    display: flex; align-items: center;
    background: #191830;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 6px 12px;
    margin-bottom: 4px;
}
.dtask-task-item:last-child { margin-bottom: 0; }
.dtask-task-icon {
    width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.dtask-task-icon img { width: 32px; height: 32px; object-fit: cover; }
.dtask-task-info { flex: 1; min-width: 0; margin-left: 12px; }
.dtask-task-title { font-size: 14px; font-weight: 600; color: #fff; }
.dtask-task-desc { font-size: 12px; color: #8b8aa5; margin-top: 3px; }
.dtask-task-progress {
    font-size: 15px; color: #e4e3f2; font-weight: 600;
    flex-shrink: 0; margin: 0 14px; min-width: 44px; text-align: center;
}
.dtask-task-state {
    flex-shrink: 0; min-width: 74px; text-align: right;
    font-size: 13px; font-weight: 600;
}
.dtask-task-state.done { color: #b6a4ff; }
.dtask-task-state.todo { color: #7c7b94; }

/* ===== Bet task ===== */
.dtask-new-badge {
    display: inline-block; vertical-align: 2px;
    background: linear-gradient(135deg, #ff5f7a, #e63757);
    color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.5px;
    padding: 1px 7px; border-radius: 8px; margin-right: 7px;
}
.dtask-bet { margin-top: 0; }
.dtask-bet-desc { font-size: 12px; color: #9a99b5; line-height: 1.6; }
.dtask-bet-desc-sub { color: #6f6e8a; }

.dtask-bet-tiers {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    margin: 8px 0;
}
.dtask-bet-tier {
    background: #191830;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px; padding: 7px 8px;
    text-align: center;
}
.dtask-bet-tier.reached {
    background: linear-gradient(180deg, #2c2717, #1c1a10);
    border-color: rgba(243, 183, 63, 0.7);
}
.dtask-bet-tier-label { font-size: 12px; color: #c7c6dd; }
.dtask-bet-tier-reward {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 3px;
}
.dtask-bet-tier-reward img { width: 26px; height: 26px; object-fit: contain; }
.dtask-bet-tier-num {
    font-size: 20px; font-weight: 800; line-height: 1;
    background: linear-gradient(180deg, #ffe7a8, #f5b53c);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.dtask-bet-tier-unit { font-size: 12px; color: #9a99b5; }

.dtask-bet-foot { display: flex; align-items: center; gap: 18px; }
.dtask-bet-progress { flex: 1; min-width: 0; }
.dtask-bet-progress-head {
    display: flex; align-items: center; gap: 5px;
    font-size: 12px; color: #9a99b5;
}
.dtask-bet-amount { margin-left: 4px; color: #c7c6dd; }
.dtask-bet-amount b {
    font-size: 16px; font-weight: 800; margin-right: 2px;
    background: linear-gradient(180deg, #ffe7a8, #f5b53c);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.dtask-bet-bar {
    position: relative; height: 8px; margin-top: 6px;
    background: rgba(255, 255, 255, 0.08); border-radius: 5px;
}
.dtask-bet-bar-fill {
    height: 100%; width: 0; border-radius: 5px;
    background: linear-gradient(90deg, #f5b53c, #ffe08a);
    box-shadow: 0 0 10px rgba(243, 183, 63, 0.45);
    transition: width 0.4s ease;
}
.dtask-bet-marks { position: absolute; inset: 0; }
.dtask-bet-mark {
    position: absolute; top: 50%; width: 8px; height: 8px;
    transform: translate(-50%, -50%); border-radius: 50%;
    background: #322f4d; border: 1px solid rgba(255, 255, 255, 0.18);
}
.dtask-bet-labels { position: relative; height: 15px; margin-top: 3px; }
.dtask-bet-label {
    position: absolute; transform: translateX(-50%);
    font-size: 11px; color: #8b8aa5; white-space: nowrap;
}
.dtask-bet-action { flex-shrink: 0; text-align: center; }
.dtask-bet-btn {
    min-width: 150px;
    padding: 9px 26px; border-radius: 22px; border: none; cursor: pointer;
    font-size: 15px; font-weight: 800; color: #4a2c00;
    background: linear-gradient(135deg, #ffe08a, #f0a92c);
    box-shadow: 0 6px 16px rgba(240, 169, 44, 0.3);
}
.dtask-bet-btn:disabled {
    background: rgba(255, 255, 255, 0.08); color: #7c7b94;
    box-shadow: none; cursor: not-allowed;
}
.dtask-bet-claimed { font-size: 12px; color: #9a99b5; margin-top: 6px; }

/* ===== Responsive (mobile / narrow) ===== */
@media (max-width: 820px) {
    .dtask-overlay { padding: 0; }
    /* Whole modal becomes one vertical scroll container (no nested inner scroll). */
    .dtask-modal {
        display: block;
        max-width: 100%; width: 100%; height: 100%; max-height: 100%;
        border-radius: 0; border: none;
        overflow-y: auto; -webkit-overflow-scrolling: touch;
    }
    /* Sidebar stacks vertically; the 3 reward cards go in a 3-column grid. */
    .dtask-sidebar {
        width: auto; display: block;
        border-right: none; border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        overflow: visible; padding: 14px;
    }
    #dtaskRewardList {
        display: grid; grid-template-columns: repeat(3, 1fr);
        gap: 8px; margin-bottom: 12px;
    }
    .dtask-reward-card { margin-bottom: 0; }
    .dtask-reward-img { height: 60px; }
    .dtask-reward-img img { max-height: 60px; }
    .dtask-reward-points { font-size: 20px; }
    .dtask-days-card { margin-bottom: 12px; }
    .dtask-calendar-btn { width: 100%; margin-top: 0; }
    .dtask-main { display: block; overflow: visible; }
    .dtask-header { padding-top: 14px; }
    .dtask-scroll { flex: none; overflow: visible; padding: 4px 14px 28px; }
    .dtask-bet-foot { flex-direction: column; align-items: stretch; gap: 12px; }
    .dtask-bet-action { width: 100%; }
    .dtask-bet-btn { width: 100%; }
}

@media (max-width: 520px) {
    .dtask-signin-row { grid-template-columns: repeat(4, 1fr); }
    .dtask-bet-tiers { gap: 6px; }
    .dtask-bet-tier { padding: 6px 4px; }
    .dtask-bet-tier-label { font-size: 11px; }
    .dtask-bet-tier-reward { gap: 3px; }
    .dtask-bet-tier-reward img { width: 20px; height: 20px; }
    .dtask-bet-tier-num { font-size: 17px; }
    .dtask-task-progress { margin: 0 8px; min-width: 36px; font-size: 14px; }
    .dtask-task-state { min-width: 56px; }
    .dtask-header-title { font-size: 18px; }
}
