/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #fef6e4 0%, #fce4ec 50%, #e8f5e9 100%);
}

#game-container {
    width: 100%;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #fff8e7 0%, #ffe8ec 50%, #e8f5e9 100%);
}

.hidden {
    display: none !important;
}

/* ==================== 顶部状态栏 ==================== */
#top-bar {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 14px;
    font-weight: 600;
    color: #5d4037;
}

.stat-icon {
    font-size: 16px;
}

/* ==================== 游戏主区域 ==================== */
#game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 8px;
    overflow-y: auto;
}

/* 装饰预览 */
#deco-preview {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.deco-title {
    font-size: 15px;
    font-weight: 700;
    color: #5d4037;
    margin-bottom: 6px;
}

.deco-progress {
    position: relative;
    height: 24px;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
}

.deco-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffb74d, #ff8a65);
    border-radius: 12px;
    transition: width 0.5s ease;
}

.deco-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: #5d4037;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

/* 棋盘 */
#board-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    overflow: hidden;
}

#board {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    position: relative;
}

.board-cell {
    background: #f5f0e8;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
}

.board-cell.highlight {
    background: #fff3e0;
    box-shadow: 0 0 0 3px #ffb74d;
}

.board-cell.merge-target {
    background: #e8f5e9;
    box-shadow: 0 0 0 3px #66bb6a;
    animation: pulse 0.6s ease-in-out infinite;
}

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

.item {
    width: 85%;
    height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(18px, 4.5vw, 32px);
    border-radius: 8px;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    cursor: grab;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.item:active {
    cursor: grabbing;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.item.dragging {
    opacity: 0.8;
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    transform: scale(1.15);
}

.item.level-1 { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); }
.item.level-2 { background: linear-gradient(135deg, #c8e6c9, #a5d6a7); }
.item.level-3 { background: linear-gradient(135deg, #a5d6a7, #81c784); }
.item.level-4 { background: linear-gradient(135deg, #fff9c4, #fff59d); }
.item.level-5 { background: linear-gradient(135deg, #fff59d, #ffee58); }
.item.level-6 { background: linear-gradient(135deg, #ffecb3, #ffd54f); }
.item.level-7 { background: linear-gradient(135deg, #ffcc80, #ffa726); }
.item.level-8 { background: linear-gradient(135deg, #f8bbd9, #f48fb1); box-shadow: 0 0 12px rgba(244, 143, 177, 0.5); }

.item-level-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: #ff7043;
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 合并动画 */
@keyframes merge-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.item.merging {
    animation: merge-pop 0.4s ease-out;
}

/* 生成器区域 */
#generator-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.generator {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.gen-icon {
    font-size: 36px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f5e9;
    border-radius: 12px;
}

.gen-info {
    flex: 1;
}

.gen-name {
    font-size: 15px;
    font-weight: 600;
    color: #5d4037;
    margin-bottom: 2px;
}

.gen-cooldown {
    font-size: 12px;
    color: #8d6e63;
}

.gen-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #66bb6a, #43a047);
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(102, 187, 106, 0.4);
    min-width: 80px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.gen-btn:active {
    transform: scale(0.92);
    box-shadow: 0 1px 4px rgba(102, 187, 106, 0.3);
}

.gen-btn:disabled {
    background: #bdbdbd;
    cursor: not-allowed;
    box-shadow: none;
}

/* ==================== 底部导航 ==================== */
#bottom-bar {
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-item.active {
    background: #fff3e0;
}

.nav-item.active .nav-text {
    color: #ff7043;
}

.nav-icon {
    font-size: 22px;
}

.nav-text {
    font-size: 11px;
    color: #8d6e63;
    font-weight: 500;
}

/* 导航红点提示 */
.nav-badge {
    position: absolute;
    top: 2px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #f44336;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(244, 67, 54, 0.4);
    animation: badgePulse 1.5s ease-in-out infinite;
}

.nav-item {
    position: relative;
}

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

/* ==================== 面板样式 ==================== */
.panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;
    background: rgba(255, 248, 231, 0.98);
    z-index: 50;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.8);
}

.panel-header h2 {
    font-size: 18px;
    color: #5d4037;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* 任务项 */
.task-item {
    background: white;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.task-item.completed {
    opacity: 0.6;
}

.task-icon {
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff3e0;
    border-radius: 10px;
}

.task-info {
    flex: 1;
}

.task-name {
    font-size: 14px;
    font-weight: 600;
    color: #5d4037;
    margin-bottom: 4px;
}

.task-progress {
    font-size: 12px;
    color: #8d6e63;
}

.task-progress-bar {
    height: 6px;
    background: #f0f0f0;
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}

.task-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffb74d, #ff8a65);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.task-reward {
    text-align: center;
    font-size: 12px;
    color: #ffa726;
    font-weight: 600;
    min-width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.task-reward-text {
    white-space: nowrap;
    line-height: 1.4;
}

.task-claim-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffb74d, #ff8a65);
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.task-claim-btn:disabled {
    background: #bdbdbd;
    cursor: not-allowed;
}

.task-claim-btn.claimed {
    background: #a5d6a7;
}

.task-claim-all-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #66bb6a, #43a047);
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 12px;
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}

.task-claim-all-btn:active {
    transform: scale(0.97);
    box-shadow: 0 1px 4px rgba(76, 175, 80, 0.3);
}

/* 商店 */
.shop-item {
    background: white;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.shop-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e3f2fd;
    border-radius: 10px;
}

.shop-info {
    flex: 1;
}

.shop-name {
    font-size: 15px;
    font-weight: 600;
    color: #5d4037;
    margin-bottom: 2px;
}

.shop-desc {
    font-size: 12px;
    color: #8d6e63;
}

.shop-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, #7e57c2, #5e35b1);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.shop-btn:active {
    transform: scale(0.95);
}

/* 装饰 */
.decor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.decor-item {
    background: white;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.decor-item.locked {
    background: rgba(245, 245, 245, 0.8);
    border: 1px dashed #ccc;
}

.decor-item.locked .decor-icon {
    filter: grayscale(0.6);
    opacity: 0.7;
}

.decor-icon {
    font-size: 36px;
    margin-bottom: 2px;
}

.decor-name {
    font-size: 12px;
    color: #5d4037;
    font-weight: 500;
}

.decor-buy-btn {
    margin-top: 4px;
    padding: 4px 10px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: white;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s;
}

.decor-buy-btn:active {
    transform: scale(0.95);
}

/* ==================== 弹窗 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    width: 85%;
    max-width: 320px;
    background: white;
    border-radius: 20px;
    padding: 24px 20px;
    text-align: center;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #5d4037;
    margin-bottom: 16px;
}

.reward-items {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.reward-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.reward-item-icon {
    font-size: 36px;
}

.reward-item-value {
    font-size: 16px;
    font-weight: 700;
    color: #ffa726;
}

.modal-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #ffb74d, #ff8a65);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
}

.modal-btn:active {
    transform: scale(0.97);
}

.modal-btn.double-btn {
    background: linear-gradient(135deg, #66bb6a, #43a047);
    margin-bottom: 0;
}

/* ==================== Toast ==================== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 300;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -60%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* ==================== 飘字效果 ==================== */
.floating-text {
    position: absolute;
    font-size: 16px;
    font-weight: 700;
    color: #ffa726;
    pointer-events: none;
    z-index: 200;
    animation: floatUp 1s ease-out forwards;
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-50px); }
}

/* ==================== 新物品出现动画 ==================== */
@keyframes spawn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.item.spawning {
    animation: spawn 0.35s ease-out;
}

/* ==================== 可合并物品高亮 ==================== */
.item.mergeable {
    animation: mergeableGlow 1.2s ease-in-out infinite;
}

@keyframes mergeableGlow {
    0%, 100% {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(102, 187, 106, 0);
    }
    50% {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1), 0 0 0 4px rgba(102, 187, 106, 0.5);
        transform: scale(1.05);
    }
}

/* ==================== 连击指示器 ==================== */
.combo-indicator {
    position: absolute;
    top: 55px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    text-align: center;
    pointer-events: none;
}

.combo-indicator.hidden {
    display: none;
}

.combo-count {
    font-size: 22px;
    font-weight: 800;
    color: #e65100;
    text-shadow: 0 0 8px rgba(255, 152, 0, 0.6), 0 2px 4px rgba(255, 255, 255, 0.8);
}

.combo-multiplier {
    font-size: 14px;
    font-weight: 700;
    color: #d84315;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

.combo-indicator.combo-pop {
    animation: comboPop 0.4s ease-out;
}

@keyframes comboPop {
    0% { transform: translateX(-50%) scale(0.5); opacity: 0; }
    60% { transform: translateX(-50%) scale(1.3); opacity: 1; }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* ==================== 合并增强动画 ==================== */
@keyframes mergeBurst {
    0% { transform: scale(1); }
    30% { transform: scale(1.4); box-shadow: 0 0 20px rgba(255, 193, 7, 0.8); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.item.merging {
    animation: mergeBurst 0.5s ease-out !important;
}

/* ==================== 签到按钮 ==================== */
.checkin-btn {
    position: absolute;
    top: 60px;
    right: 12px;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #ffb74d, #ff8a65);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(255, 138, 101, 0.4);
    transition: transform 0.2s ease;
}

.checkin-btn:active {
    transform: scale(0.92);
}

.checkin-btn span:first-child {
    font-size: 20px;
    line-height: 1;
}

.checkin-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #e53935;
    color: white;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 8px;
    font-weight: 700;
}

.checkin-badge.done {
    background: #66bb6a;
}

/* ==================== 商店分区标题 ==================== */
.shop-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #5d4037;
    margin: 16px 0 10px;
}

.shop-section-title:first-child {
    margin-top: 0;
}

/* ==================== 宝箱 ==================== */
.chest-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.chest-item {
    background: white;
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chest-icon {
    font-size: 42px;
    margin-bottom: 6px;
    animation: chestBounce 2s ease-in-out infinite;
}

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

.chest-name {
    font-size: 14px;
    font-weight: 600;
    color: #5d4037;
    margin-bottom: 2px;
}

.chest-desc {
    font-size: 11px;
    color: #8d6e63;
    margin-bottom: 8px;
}

.chest-btn {
    width: 100%;
    padding: 6px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #ab47bc, #7b1fa2);
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.chest-btn:active {
    transform: scale(0.95);
}

/* ==================== 签到弹窗 ==================== */
.checkin-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 16px;
}

.checkin-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    background: #f5f5f5;
    border-radius: 10px;
    font-size: 11px;
    color: #8d6e63;
}

.checkin-day.checked {
    background: #e8f5e9;
    color: #388e3c;
}

.checkin-day.today {
    background: #fff3e0;
    color: #e65100;
    font-weight: 700;
    box-shadow: 0 0 0 2px #ffb74d;
}

.checkin-day-icon {
    font-size: 20px;
}

.checkin-day-reward {
    font-size: 10px;
    font-weight: 600;
}

/* ==================== 离线收益弹窗 ==================== */
.offline-time {
    font-size: 14px;
    color: #8d6e63;
    margin-bottom: 16px;
}

.offline-reward {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 12px;
}

.offline-reward-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.offline-reward-value {
    font-size: 28px;
    font-weight: 700;
    color: #ffa726;
}

.offline-tip {
    font-size: 12px;
    color: #a1887f;
    margin-bottom: 16px;
}

/* ==================== 宝箱开启弹窗 ==================== */
.chest-open-icon {
    font-size: 72px;
    margin: 10px 0 16px;
    animation: chestOpen 0.6s ease-out;
}

@keyframes chestOpen {
    0% { transform: scale(0) rotate(-30deg); opacity: 0; }
    60% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.chest-rewards {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.chest-reward-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #f5f5f5;
    border-radius: 12px;
    padding: 10px 14px;
    animation: rewardPop 0.4s ease-out;
}

@keyframes rewardPop {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.chest-reward-icon {
    font-size: 28px;
}

.chest-reward-value {
    font-size: 14px;
    font-weight: 700;
    color: #ffa726;
}

/* ==================== Lv9-10 物品颜色 ==================== */
.item.level-9 { background: linear-gradient(135deg, #ce93d8, #ab47bc); box-shadow: 0 0 16px rgba(171, 71, 188, 0.6); }
.item.level-10 { background: linear-gradient(135deg, #b388ff, #7c4dff); box-shadow: 0 0 20px rgba(124, 77, 255, 0.7); }

/* ==================== 家具生成器 ==================== */
.generator:nth-child(2) .gen-icon {
    background: #efebe9;
}

.generator:nth-child(2) .gen-btn {
    background: linear-gradient(135deg, #8d6e63, #6d4c41);
    box-shadow: 0 3px 8px rgba(141, 110, 99, 0.4);
}

.generator:nth-child(2) .gen-btn:disabled {
    background: #bdbdbd;
}

/* ==================== 自动产出按钮 ==================== */
.gen-auto-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    background: #f5f5f5;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.gen-auto-btn:active {
    transform: scale(0.9);
}

.gen-auto-btn.active {
    background: linear-gradient(135deg, #fff176, #ffd54f);
    border-color: #ffa726;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.6);
    animation: autoPulse 2s ease-in-out infinite;
}

@keyframes autoPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 193, 7, 0.4); }
    50% { box-shadow: 0 0 16px rgba(255, 193, 7, 0.8); }
}

/* ==================== 底部导航 5项 ==================== */
#bottom-bar {
    padding: 6px 0;
}

.nav-item {
    padding: 6px 10px;
}

.nav-icon {
    font-size: 20px;
}

.nav-text {
    font-size: 10px;
}

/* ==================== 成就系统 ==================== */
.ach-header {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ach-header span {
    font-size: 13px;
    font-weight: 600;
    color: #5d4037;
}

.ach-progress-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.ach-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd54f, #ffa726);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.ach-item {
    background: white;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ach-item.locked {
    opacity: 0.5;
}

.ach-item.unlocked {
    border: 2px solid #ffd54f;
    background: linear-gradient(135deg, #fffde7, #fff8e1);
}

.ach-icon {
    font-size: 32px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff3e0;
    border-radius: 10px;
}

.ach-item.unlocked .ach-icon {
    background: linear-gradient(135deg, #fff9c4, #fff59d);
}

.ach-info {
    flex: 1;
}

.ach-name {
    font-size: 14px;
    font-weight: 600;
    color: #5d4037;
    margin-bottom: 2px;
}

.ach-desc {
    font-size: 12px;
    color: #8d6e63;
}

.ach-reward {
    font-size: 12px;
    font-weight: 600;
    color: #ffa726;
    white-space: nowrap;
}

/* ==================== 每日挑战 ==================== */
.daily-item {
    background: white;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.daily-item.done {
    opacity: 0.5;
    background: #e8f5e9;
}

.daily-icon {
    font-size: 24px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.daily-info {
    flex: 1;
}

.daily-desc {
    font-size: 13px;
    font-weight: 600;
    color: #5d4037;
    margin-bottom: 4px;
}

.daily-progress-bar {
    height: 5px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.daily-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #66bb6a, #43a047);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.daily-status {
    font-size: 12px;
    font-weight: 600;
    color: #43a047;
    white-space: nowrap;
}

.daily-complete {
    text-align: center;
    padding: 20px;
    font-size: 16px;
    font-weight: 600;
    color: #43a047;
}

.daily-reward-hint {
    text-align: center;
    font-size: 12px;
    color: #ffa726;
    font-weight: 600;
    padding: 10px;
    background: rgba(255, 248, 225, 0.8);
    border-radius: 10px;
    margin-top: 8px;
}

/* ==================== 出售弹窗 ==================== */
.sell-content {
    text-align: center;
}

.sell-icon {
    font-size: 56px;
    margin-bottom: 8px;
}

.sell-name {
    font-size: 18px;
    font-weight: 700;
    color: #5d4037;
    margin-bottom: 8px;
}

.sell-value {
    font-size: 20px;
    font-weight: 700;
    color: #ffa726;
    margin-bottom: 16px;
}

.sell-btn {
    background: linear-gradient(135deg, #ff7043, #f4511e) !important;
}

.info-title {
    font-size: 18px;
    font-weight: 700;
    color: #5d4037;
    margin-bottom: 12px;
}

.info-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 16px;
    padding: 0 8px;
}

.cancel-btn {
    background: #e0e0e0 !important;
    color: #757575 !important;
}

/* ==================== 屏幕震动 ==================== */
@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-3px, -2px); }
    20% { transform: translate(3px, 2px); }
    30% { transform: translate(-2px, 3px); }
    40% { transform: translate(2px, -3px); }
    50% { transform: translate(-3px, 1px); }
    60% { transform: translate(3px, -1px); }
    70% { transform: translate(-1px, -2px); }
    80% { transform: translate(1px, 2px); }
    90% { transform: translate(-2px, -1px); }
}

.shake-light {
    animation: screenShake 0.25s ease;
}

.shake-strong {
    animation: screenShake 0.4s ease;
}

/* ==================== 生成器区域紧凑布局 ==================== */
#generator-area {
    gap: 6px;
}

.generator {
    padding: 6px 10px;
}

.gen-icon {
    font-size: 22px;
    width: 32px;
    height: 32px;
}

.gen-name {
    font-size: 12px;
}

.gen-cooldown {
    font-size: 10px;
}

.gen-btn {
    padding: 6px 14px;
    font-size: 13px;
    min-width: 52px;
}

/* ==================== 特殊物品样式 ==================== */
.item.special-item {
    border: 3px solid gold;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.6), inset 0 0 8px rgba(255, 215, 0, 0.3);
    animation: specialGlow 2s ease-in-out infinite;
}

.item.special-rainbow {
    background: linear-gradient(135deg, #ff6b6b, #ffd93d, #6bcf7f, #4d9de0, #c779d0) !important;
    background-size: 300% 300% !important;
    animation: rainbowShift 3s ease infinite;
}

.item.special-bomb {
    background: linear-gradient(135deg, #455a64, #263238) !important;
    animation: bombPulse 1.5s ease-in-out infinite;
}

.item.special-timeFreeze {
    background: linear-gradient(135deg, #b3e5fc, #0288d1) !important;
    animation: freezeShimmer 2s ease-in-out infinite;
}

@keyframes specialGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.9); }
}

@keyframes rainbowShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

@keyframes freezeShimmer {
    0%, 100% { box-shadow: 0 0 8px rgba(2, 136, 209, 0.5); }
    50% { box-shadow: 0 0 16px rgba(179, 229, 252, 0.9); }
}

/* ==================== 特殊物品商店 ==================== */
.special-shop-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.special-shop-item {
    background: white;
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 2px solid transparent;
    transition: border-color 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.special-shop-item:active {
    border-color: #ffa726;
}

.special-shop-icon {
    font-size: 36px;
    margin-bottom: 4px;
}

.special-shop-name {
    font-size: 13px;
    font-weight: 700;
    color: #5d4037;
    margin-bottom: 2px;
}

.special-shop-desc {
    font-size: 10px;
    color: #8d6e63;
    margin-bottom: 8px;
    line-height: 1.3;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.special-buy-btn {
    background: linear-gradient(135deg, #ab47bc, #8e24aa);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}

/* ==================== 设置面板 ==================== */
.settings-item {
    background: white;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.settings-info {
    flex: 1;
}

.settings-name {
    font-size: 15px;
    font-weight: 600;
    color: #5d4037;
    margin-bottom: 2px;
}

.settings-desc {
    font-size: 12px;
    color: #8d6e63;
    line-height: 1.5;
}

.settings-toggle {
    width: 56px;
    height: 28px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    padding: 2px;
    cursor: pointer;
    transition: background 0.3s;
    position: relative;
    flex-shrink: 0;
}

.settings-toggle.on {
    background: linear-gradient(135deg, #66bb6a, #43a047);
}

.settings-toggle.off {
    background: #e0e0e0;
}

.settings-toggle.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-knob {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.settings-toggle.on .toggle-knob {
    transform: translateX(28px);
}

.toggle-text {
    font-size: 10px;
    font-weight: 600;
    position: absolute;
    color: white;
    left: 50%;
    transform: translateX(-50%);
}

.settings-toggle.off .toggle-text {
    color: #999;
}

.volume-slider {
    width: 120px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #f0f0f0;
    border-radius: 3px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffa726, #f57c00);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.settings-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 12px 0;
}

.settings-reset-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ef5350, #d32f2f);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
}

.settings-version {
    text-align: center;
    font-size: 12px;
    color: #bbb;
    padding: 8px;
}

/* ==================== 区域路线图 ==================== */
.area-roadmap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.area-card {
    background: white;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid transparent;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.area-card.unlocked {
    border-color: #66bb6a;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
}

.area-card.available {
    border-color: #ffa726;
    background: linear-gradient(135deg, #fff8e1, #fff3e0);
    animation: areaGlow 2s ease-in-out infinite;
}

@keyframes areaGlow {
    0%, 100% { box-shadow: 0 2px 6px rgba(255, 167, 38, 0.3); }
    50% { box-shadow: 0 2px 16px rgba(255, 167, 38, 0.6); }
}

.area-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #5d4037;
}

.area-card-status {
    font-size: 12px;
    color: #8d6e63;
}

/* ==================== 分享按钮 ==================== */
.share-stat {
    cursor: pointer;
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-radius: 8px;
    padding: 4px 8px;
    transition: transform 0.2s;
}

.share-stat:active {
    transform: scale(0.95);
}

/* ==================== 分享弹窗 ==================== */
.share-content {
    text-align: center;
}

.share-icon {
    font-size: 56px;
    margin-bottom: 12px;
}

.share-desc {
    font-size: 14px;
    color: #5d4037;
    line-height: 1.6;
    margin-bottom: 16px;
}

.share-rewards {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.share-reward-item {
    background: linear-gradient(135deg, #fff3e0, #fff8e1);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #e65100;
}

.share-tip {
    font-size: 12px;
    color: #8d6e63;
    margin-bottom: 16px;
}

.share-confirm-btn {
    background: linear-gradient(135deg, #66bb6a, #43a047) !important;
}

/* ==================== 底部导航 6项 ==================== */
#bottom-bar {
    padding: 3px 0;
}

.nav-item {
    padding: 3px 4px;
    flex: 1;
}

.nav-icon {
    font-size: 17px;
}

.nav-text {
    font-size: 8px;
}

/* ==================== 区域切换按钮 ==================== */
.area-switch-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #ffa726;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 167, 38, 0.3);
    transition: transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.area-switch-btn:active {
    transform: translateY(-50%) scale(0.9);
}

#deco-preview {
    position: relative;
}

/* ==================== 区域卡片当前状态 ==================== */
.area-card.current {
    border-color: #1976d2 !important;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb) !important;
}

.area-card.current .area-card-name {
    font-weight: 700;
    color: #1565c0;
}

/* ==================== 装饰面板区域标题 ==================== */
.decor-area-header {
    font-size: 16px;
    font-weight: 700;
    color: #5d4037;
    text-align: center;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
}

.decor-warmth {
    font-size: 10px;
    color: #ffa726;
    font-weight: 600;
    margin-top: 2px;
}

/* ==================== 动态棋盘尺寸 ==================== */
#board {
    display: grid;
    gap: 5px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    width: 100%;
    max-width: calc(100vw - 32px);
    max-height: 55vh;
    aspect-ratio: 1;
    margin: 0 auto;
}

.board-cell {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    min-width: 0;
    min-height: 0;
}

/* 5x5 棋盘（默认） */
#board[data-rows="5"][data-cols="5"] {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
}

/* 6x5 棋盘 */
#board[data-rows="6"][data-cols="5"] {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(6, 1fr);
    aspect-ratio: 5/6;
}

/* 6x6 棋盘 */
#board[data-rows="6"][data-cols="6"] {
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(6, 1fr);
}

/* 5x6 棋盘（扩容后） */
#board[data-rows="5"][data-cols="6"] {
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(5, 1fr);
    aspect-ratio: 6/5;
}

/* 5x7 棋盘（扩容后） */
#board[data-rows="5"][data-cols="7"] {
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(5, 1fr);
    aspect-ratio: 7/5;
    gap: 4px;
}

/* 6x7 棋盘（扩容后） */
#board[data-rows="6"][data-cols="7"] {
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    aspect-ratio: 7/6;
    gap: 4px;
}

/* 物品图标自适应 */
.item-icon {
    font-size: clamp(18px, 4.5vw, 32px);
    line-height: 1;
}

.item-level-badge {
    font-size: clamp(8px, 1.8vw, 12px);
}

/* ==================== 区域切换动画 ==================== */

/* 背景过渡 */
#game-container {
    transition: background 0.6s ease;
}

/* 淡出：棋盘缩小并变透明 */
#board.board-fading-out {
    animation: boardFadeOut 0.35s ease forwards;
}

/* 淡入：棋盘从放大状态弹回正常 */
#board.board-fading-in {
    animation: boardFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes boardFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.85) translateY(10px);
    }
}

@keyframes boardFadeIn {
    0% {
        opacity: 0;
        transform: scale(1.1) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 过渡遮罩层 */
#game-container.area-transitioning::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
    z-index: 50;
    animation: transitionPulse 0.6s ease;
}

@keyframes transitionPulse {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* ==================== 任务区块标题 ==================== */

.task-section-header {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    padding: 8px 12px 4px;
    margin-top: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-section-header.area-bedroom {
    color: #e65100;
}

.task-section-header.area-garden {
    color: #2e7d32;
}

.task-section-header.area-kitchen {
    color: #e65100;
}

.task-section-header.area-study {
    color: #1565c0;
}

.task-section-header.other-area {
    color: #999;
    font-style: italic;
    font-size: 12px;
    padding: 6px 12px;
}

.task-area-collapsible {
    margin-bottom: 4px;
}

.collapsible-header {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    padding: 8px 12px;
    border-radius: 8px;
}

.collapsible-header:active {
    background: rgba(0, 0, 0, 0.05);
}

.collapse-arrow {
    font-size: 10px;
    margin-left: auto;
    transition: transform 0.2s;
}

.task-area-badge {
    background: #ff9800;
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    font-style: normal;
    font-weight: 600;
}

.task-area-content {
    padding: 0 4px;
}

.task-area-content.hidden {
    display: none;
}

/* 已领取任务淡化 */
.task-item.claimed {
    opacity: 0.45;
}

/* 装饰奖励标识 */
.task-reward .reward-decor {
    font-size: 11px;
    color: #ff9800;
}

/* ==================== 装饰房间可视化 ==================== */

.decor-room-preview {
    margin: 8px 0 12px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.room-scene {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

.room-wall {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 65%;
    background: linear-gradient(180deg, #fff3e0 0%, #ffe0b2 100%);
}

.room-floor {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35%;
    background: linear-gradient(180deg, #d7ccc8 0%, #bcaaa4 100%);
}

.room-floor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
}

/* 房间装饰物 */
.room-items {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.room-decor {
    position: absolute;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: all 0.4s ease;
    z-index: 2;
}

.room-decor.unlocked {
    animation: decorAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.room-decor-icon {
    font-size: 32px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
    transition: transform 0.2s;
}

.room-decor.unlocked:hover .room-decor-icon {
    transform: scale(1.2) translateY(-4px);
}

.room-decor.locked {
    opacity: 0.3;
    filter: grayscale(1);
}

.room-decor.locked .locked-icon {
    font-size: 22px;
    color: #999;
}

@keyframes decorAppear {
    0% {
        opacity: 0;
        transform: scale(0) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 进度条 */
.room-progress {
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    position: relative;
}

.room-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff9800, #ffc107);
    transition: width 0.5s ease;
    border-radius: 0 3px 3px 0;
}

.room-progress-text {
    padding: 8px 12px;
    font-size: 12px;
    color: #666;
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
}

/* 图鉴标题 */
.decor-grid-title {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    padding: 8px 0 4px;
}

/* ==================== 广告模拟弹窗 ==================== */

.ad-modal-content {
    max-width: 320px;
    text-align: center;
    padding: 32px 24px;
}

.ad-header {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
}

.ad-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.ad-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff9800, #ffc107);
    border-radius: 4px;
    transition: width 1s linear;
}

.ad-timer {
    font-size: 48px;
    font-weight: 700;
    color: #ff9800;
    margin: 8px 0;
}

.ad-hint {
    font-size: 13px;
    color: #999;
}

/* ==================== 底部导航 7项 ==================== */
#bottom-bar .nav-item {
    flex: 1;
    min-width: 0;
}

/* ==================== 物品锁定 ==================== */
.item.locked {
    box-shadow: 0 0 0 2px #ef6c00, 0 2px 6px rgba(0, 0, 0, 0.15);
    border: 1.5px solid #ef6c00;
}

.item-lock-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 14px;
    background: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.item.lock-toggle {
    animation: lockPulse 0.3s ease;
}

@keyframes lockPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* ==================== 图鉴系统 ==================== */
.codex-header {
    text-align: center;
    margin-bottom: 16px;
}

.codex-title {
    font-size: 18px;
    font-weight: 700;
    color: #5d4037;
    margin-bottom: 8px;
}

.codex-progress-text {
    font-size: 13px;
    color: #888;
    margin-bottom: 6px;
}

.codex-progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.codex-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #66bb6a, #43a047);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.codex-line {
    margin-bottom: 20px;
}

.codex-line-title {
    font-size: 15px;
    font-weight: 600;
    color: #5d4037;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.codex-line-count {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

.codex-cards {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.codex-card {
    flex-shrink: 0;
    width: 64px;
    text-align: center;
    padding: 8px 4px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.codex-card.locked {
    background: linear-gradient(135deg, #424242, #616161);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.codex-card-icon {
    font-size: 28px;
    line-height: 1;
    margin-bottom: 4px;
}

.codex-card.locked .codex-card-icon {
    opacity: 0.4;
    filter: grayscale(100%);
}

.codex-card-level {
    font-size: 10px;
    color: #999;
    margin-bottom: 2px;
}

.codex-card.locked .codex-card-level {
    color: #666;
}

.codex-card-name {
    font-size: 11px;
    font-weight: 600;
    color: #5d4037;
    line-height: 1.2;
}

.codex-card.locked .codex-card-name {
    color: #888;
}

/* ==================== 周目标系统 ==================== */
.weekly-header {
    text-align: center;
    margin-bottom: 16px;
}

.weekly-title {
    font-size: 18px;
    font-weight: 700;
    color: #5d4037;
    margin-bottom: 4px;
}

.weekly-week {
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
}

.weekly-countdown {
    font-size: 12px;
    color: #ff9800;
}

.weekly-progress {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #43a047;
    margin-bottom: 16px;
}

.weekly-goal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    margin-bottom: 8px;
}

.weekly-goal-item.completed {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.weekly-goal-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}

.weekly-goal-info {
    flex: 1;
    min-width: 0;
}

.weekly-goal-name {
    font-size: 14px;
    font-weight: 600;
    color: #5d4037;
    margin-bottom: 2px;
}

.weekly-goal-desc {
    font-size: 11px;
    color: #999;
    margin-bottom: 6px;
}

.weekly-goal-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.weekly-goal-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffa726, #ff7043);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.weekly-goal-item.completed .weekly-goal-fill {
    background: linear-gradient(90deg, #66bb6a, #43a047);
}

.weekly-goal-text {
    font-size: 11px;
    color: #888;
    text-align: right;
    margin-top: 2px;
}

.weekly-reward-section {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-radius: 12px;
    text-align: center;
}

.weekly-reward-title {
    font-size: 15px;
    font-weight: 700;
    color: #e65100;
    margin-bottom: 8px;
}

.weekly-reward-desc {
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
}

.weekly-reward-btn {
    padding: 10px 32px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    border: none;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(245, 124, 0, 0.3);
    cursor: pointer;
}

.weekly-reward-btn:active {
    transform: scale(0.95);
}

.weekly-reward-btn.claimed {
    background: #bdbdbd;
    box-shadow: none;
    cursor: default;
}
