/**
 * 琳琅钱包界面 V2.0
 * 参考优秀设计，打造精致的钱包体验
 */

/* ========== 钱包视图容器 ========== */
#treasure-view-wallet {
    padding: 0 !important;
    overflow-y: auto !important;
}

/* ========== 余额卡片 - 渐变金色卡片 ========== */
.treasure-wallet-card {
    background: linear-gradient(135deg, #c4a882 0%, #a68968 30%, #8d7355 70%, #7a6348 100%) !important;
    border-radius: 24px !important;
    padding: 28px 24px !important;
    color: white !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(140, 110, 75, 0.3) !important;
    margin: 16px 16px 20px !important;
    flex-shrink: 0 !important;
}

/* 装饰光点 - 右上角 */
.treasure-wallet-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -20px;
    width: 130px;
    height: 130px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* 装饰光点 - 左下角 */
.treasure-wallet-card::after {
    content: '';
    position: absolute;
    bottom: -25px;
    left: 25%;
    width: 110px;
    height: 110px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.07) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* 装饰小圆点 */
.treasure-decorative-dots {
    position: absolute;
    top: 16px;
    right: 20px;
    display: flex;
    gap: 4px;
    opacity: 0.35;
    z-index: 1;
}

.treasure-decorative-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: white;
}

/* 余额标签 */
.treasure-w-label {
    font-size: 13px !important;
    opacity: 0.8 !important;
    letter-spacing: 1px !important;
    margin-bottom: 8px !important;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

/* 余额数字 */
.treasure-w-money {
    font-size: 38px !important;
    font-weight: 700 !important;
    letter-spacing: -1px !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    position: relative;
    z-index: 1;
    margin-bottom: 0 !important;
}

/* 卡片底部信息 */
.treasure-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

.treasure-card-id {
    font-size: 11px;
    opacity: 0.45;
    letter-spacing: 2px;
}

.treasure-card-type {
    font-size: 11px;
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.13);
    padding: 3px 10px;
    border-radius: 10px;
}

/* ========== 操作按钮 - 大卡片式布局 ========== */
.treasure-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 0 16px 24px;
    padding: 0;
    flex-shrink: 0 !important;
}

.treasure-action-btn {
    border: none;
    border-radius: 20px;
    padding: 18px 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.treasure-action-btn:active {
    transform: scale(0.96);
}

.treasure-action-btn .btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(4px);
}

.treasure-action-btn .btn-label {
    font-size: 14px;
    font-weight: 600;
    color: #5a4838;
    letter-spacing: 1px;
}

.treasure-action-btn .btn-desc {
    font-size: 11px;
    color: rgba(90, 72, 56, 0.55);
    min-height: 15px;
}

/* 搬砖按钮 */
.treasure-btn-work-card {
    background: linear-gradient(135deg, #f8e4d4, #f0c9b0, #e8b89e);
    box-shadow: 0 4px 18px rgba(232, 184, 158, 0.35);
}

/* 背包按钮 */
.treasure-btn-warehouse-card {
    background: linear-gradient(135deg, #f5ead6, #e8d5b8, #dfc8a6);
    box-shadow: 0 4px 18px rgba(223, 200, 166, 0.35);
}

/* 背包角标 */
.treasure-warehouse-badge {
    position: absolute;
    top: 10px;
    right: 14px;
    background: #c4785a;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(196, 120, 90, 0.4);
}

/* ========== 搬砖冷却状态 ========== */
.treasure-btn-work-card.on-cooldown {
    background: linear-gradient(135deg, #eee8e0, #e2dbd2);
    box-shadow: 0 4px 14px rgba(200, 190, 178, 0.25);
}

.treasure-btn-work-card.on-cooldown .btn-icon {
    background: rgba(255, 255, 255, 0.4);
    filter: grayscale(0.3) opacity(0.7);
}

.treasure-btn-work-card.on-cooldown .btn-label {
    color: #a09588;
}

/* 冷却计时器 - 显示在按钮内 */
.treasure-cooldown-timer {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 2px;
}

.treasure-btn-work-card.on-cooldown .treasure-cooldown-timer {
    display: flex;
}

.treasure-cooldown-timer .cd-block {
    background: rgba(255, 255, 255, 0.65);
    border-radius: 6px;
    padding: 2px 5px;
    font-size: 13px;
    font-weight: 700;
    color: #a08570;
    min-width: 26px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.treasure-cooldown-timer .cd-colon {
    font-size: 12px;
    font-weight: 700;
    color: #baa898;
    animation: treasureCdBlink 1s infinite;
}

@keyframes treasureCdBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* 小型环形进度 - 右上角 */
.treasure-cd-ring-wrap {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
}

.treasure-btn-work-card.on-cooldown .treasure-cd-ring-wrap {
    display: block;
}

.treasure-cd-ring-bg {
    fill: none;
    stroke: rgba(180, 165, 148, 0.3);
    stroke-width: 3;
}

.treasure-cd-ring-progress {
    fill: none;
    stroke: #c4a882;
    stroke-width: 3;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 1s linear;
}

/* 搬砖进度条 */
.treasure-work-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #d4956a, #c4a882);
    border-radius: 0 2px 2px 0;
    width: 0;
    transition: width 3s linear;
}

.treasure-btn-work-card.working {
    pointer-events: none;
}

.treasure-btn-work-card.working .btn-icon {
    animation: treasureHammer 0.5s ease-in-out infinite;
}

@keyframes treasureHammer {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

/* ========== 搬砖完成 Toast ========== */
.treasure-work-done-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: #fffcf8;
    border-radius: 24px;
    padding: 32px 42px;
    text-align: center;
    z-index: 99999;
    box-shadow: 0 16px 48px rgba(100, 80, 55, 0.15);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.treasure-work-done-toast.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.treasure-work-done-toast .toast-emoji {
    font-size: 48px;
    margin-bottom: 12px;
}

.treasure-work-done-toast .toast-amount {
    font-size: 32px;
    font-weight: 700;
    color: #b8784a;
    margin-bottom: 4px;
}

.treasure-work-done-toast .toast-text {
    font-size: 14px;
    color: #a09588;
}

/* ========== CD冷却弹窗 ========== */
.treasure-cd-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 300px;
    background: #fffaf4;
    border-radius: 28px;
    z-index: 99999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(100, 80, 55, 0.18);
    overflow: hidden;
    pointer-events: none;
}

.treasure-cd-modal.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* 弹窗顶部 */
.treasure-cd-modal-top {
    background: linear-gradient(135deg, #f5e6d6, #ecdac4, #e2ccb0);
    padding: 28px 24px 22px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.treasure-cd-modal-top::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -15px;
    width: 75px;
    height: 75px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.treasure-cd-modal-top::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 20px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
}

.treasure-cd-modal-emoji {
    font-size: 52px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    animation: treasureSleepBounce 2s ease-in-out infinite;
}

@keyframes treasureSleepBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.treasure-cd-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #6b5440;
    position: relative;
    z-index: 1;
}

/* 弹窗主体 */
.treasure-cd-modal-body {
    padding: 22px 24px 24px;
    text-align: center;
}

.treasure-cd-modal-msg {
    font-size: 14px;
    color: #a09588;
    margin-bottom: 18px;
    line-height: 1.7;
}

/* 环形进度 */
.treasure-cd-modal-ring {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    position: relative;
}

.treasure-cd-modal-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.treasure-cd-modal-ring .ring-bg {
    fill: none;
    stroke: #efe6da;
    stroke-width: 5;
}

.treasure-cd-modal-ring .ring-fill {
    fill: none;
    stroke: url(#treasureCdGradient);
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.treasure-cd-modal-ring .ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: #b8784a;
}

/* 大型倒计时 */
.treasure-cd-modal-countdown {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 22px;
}

.treasure-cd-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.treasure-cd-unit-value {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, #faf3ea, #f0e4d4);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: #b8784a;
    box-shadow: 0 3px 10px rgba(180, 150, 110, 0.12);
    font-variant-numeric: tabular-nums;
    border: 1.5px solid rgba(200, 175, 140, 0.15);
}

.treasure-cd-unit-label {
    font-size: 10px;
    color: #baa898;
    font-weight: 500;
}

.treasure-cd-colon-big {
    font-size: 22px;
    font-weight: 700;
    color: #c4a882;
    align-self: center;
    margin-bottom: 16px;
    animation: treasureCdBlink 1s infinite;
}

/* 按钮 */
.treasure-cd-modal-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #c4a882, #a08060);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 1px;
    box-shadow: 0 4px 14px rgba(160, 128, 96, 0.3);
    transition: all 0.2s;
}

.treasure-cd-modal-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

/* ========== 金币动画 ========== */
.treasure-coin-float {
    position: fixed;
    font-size: 24px;
    pointer-events: none;
    z-index: 100000;
    animation: treasureCoinUp 1s ease-out forwards;
}

@keyframes treasureCoinUp {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.5);
    }
}

/* ========== 遮罩层 ========== */
.treasure-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(60, 48, 34, 0.25);
    backdrop-filter: blur(6px);
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.treasure-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* ========== 交易列表 ========== */
.treasure-trans-list {
    flex-shrink: 0 !important;
    margin-bottom: 30px !important;
}
