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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    overflow: hidden;
}

/* 全屏容器 */
.fullscreen-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 70%, #8B7355 70%, #654321 100%);
}

/* 顶部信息栏 */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 10;
}

.title {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.timer-display-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.countdown-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.countdown-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.countdown-time {
    font-size: 48px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.countdown-display.time-good {
    background: rgba(72, 187, 120, 0.1);
}

.countdown-display.time-good .countdown-time {
    color: #48bb78;
}

.countdown-display.time-warning {
    background: rgba(237, 137, 54, 0.1);
}

.countdown-display.time-warning .countdown-time {
    color: #ed8936;
}

.countdown-display.time-danger {
    background: rgba(245, 101, 101, 0.1);
    animation: pulse-danger 1.5s ease-in-out infinite;
}

.countdown-display.time-danger .countdown-time {
    color: #f56565;
}

.countdown-display.time-overtime {
    background: rgba(159, 122, 234, 0.1);
}

.countdown-display.time-overtime .countdown-time {
    color: #9f7aea;
}

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

.elapsed-time {
    font-size: 16px;
    color: #718096;
    font-family: 'Courier New', monospace;
}

.stats-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.tree-counter {
    font-size: 32px;
    font-weight: bold;
    color: #2d8659;
}

.distraction-display {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 30px;
}

.distraction-label {
    font-size: 18px;
    color: #666;
}

.distraction-clouds {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    max-width: 300px;
}

.cloud-mark {
    font-size: 24px;
    animation: cloudAppear 0.5s ease-out;
    display: inline-block;
}

@keyframes cloudAppear {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

/* 森林区域 */
.forest-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.forest {
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-end;
    justify-content: center;
    gap: 15px;
    padding-bottom: 50px;
}

.tree {
    font-size: 60px;
    animation: growTree 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
}

@keyframes growTree {
    0% {
        transform: scale(0) translateY(20px);
        opacity: 0;
    }
    60% {
        transform: scale(1.3) translateY(-10px);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* 乌云效果 */
.clouds {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(80, 80, 80, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fadeIn 0.5s ease;
}

.clouds.hidden {
    display: none;
}

.cloud-group {
    display: flex;
    gap: 30px;
}

.cloud {
    font-size: 80px;
    animation: float 3s ease-in-out infinite;
}

.cloud:nth-child(2) {
    animation-delay: 0.5s;
}

.cloud:nth-child(3) {
    animation-delay: 1s;
}

.message {
    font-size: 36px;
    color: white;
    font-weight: bold;
    margin-top: 30px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    animation: pulse 1.5s ease-in-out infinite;
}

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

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

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

/* 底部控制栏 */
.bottom-bar {
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    gap: 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.btn {
    padding: 20px 50px;
    font-size: 24px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-start {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-end {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.btn-end:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(245, 101, 101, 0.4);
}

.btn.hidden {
    display: none;
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 50px;
    border-radius: 30px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-content h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 42px;
}

.result-section {
    background: #f7fafc;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.result-section p {
    margin: 8px 0;
}

.time-success {
    color: #48bb78;
    font-size: 20px;
    font-weight: bold;
    margin-top: 10px;
}

.time-overtime {
    color: #f56565;
    font-size: 20px;
    font-weight: bold;
    margin-top: 10px;
}

.efficiency-tip {
    color: #ed8936;
    font-size: 16px;
    margin-top: 10px;
    font-style: italic;
}

.status-success {
    color: #48bb78;
    font-weight: bold;
}

.status-overtime {
    color: #f56565;
    font-weight: bold;
}

#resultStats {
    margin: 30px 0;
    font-size: 22px;
    line-height: 2;
}

#resultStats p {
    margin: 15px 0;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 40px;
    font-size: 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.btn-secondary-small {
    background: #e2e8f0;
    color: #4a5568;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-secondary-small:hover {
    background: #cbd5e0;
}

.task-input {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin: 20px 0 10px 0;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

.task-input:focus {
    outline: none;
    border-color: #667eea;
}

.time-input-section {
    margin: 20px 0;
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
}

.time-label {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.time-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.time-option {
    padding: 10px 20px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.time-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.time-option.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.custom-time {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-time label {
    color: #4a5568;
    font-size: 16px;
}

.custom-time input {
    padding: 8px 12px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    width: 100px;
}

.custom-time input:focus {
    outline: none;
    border-color: #667eea;
}

/* 模式选择 */
.mode-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    background: #f7fafc;
    border: 3px solid #e2e8f0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.mode-btn:hover {
    background: #edf2f7;
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.mode-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.mode-label {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.mode-desc {
    font-size: 14px;
    color: #666;
}

#focusTaskSection.hidden {
    display: none;
}

.task-name-display {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.history-modal {
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.summary-icon {
    font-size: 40px;
}

.summary-content {
    flex: 1;
}

.summary-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.summary-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 3px;
}

.summary-detail {
    font-size: 14px;
    opacity: 0.8;
}

.achievement-forest {
    background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 70%, #8B7355 70%, #654321 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 250px;
}

.forest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.forest-header h3 {
    color: #333;
    font-size: 18px;
    margin: 0;
}

.forest-tabs {
    display: flex;
    gap: 5px;
}

.forest-tab {
    padding: 6px 15px;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    color: #4a5568;
    transition: all 0.3s ease;
}

.forest-tab:hover {
    background: rgba(255, 255, 255, 0.9);
}

.forest-tab.active {
    background: white;
    color: #667eea;
    font-weight: bold;
}

.forest-display {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    padding: 20px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.forest-empty {
    text-align: center;
    color: #718096;
    font-size: 18px;
    padding: 40px 20px;
}

.achievement-trees {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 15px;
}

.achievement-tree {
    font-size: 32px;
    animation: treePopIn 0.3s ease-out;
    display: inline-block;
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.2));
}

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

.tree-more {
    font-size: 20px;
    color: #667eea;
    font-weight: bold;
    align-self: center;
    padding: 5px 10px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 5px;
}

.forest-summary {
    text-align: center;
    font-size: 16px;
    color: #333;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
}

.forest-summary strong {
    color: #667eea;
    font-size: 20px;
}

.focus-analysis {
    background: #f7fafc;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.focus-analysis h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
}

.analysis-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    color: #4a5568;
}

.focus-rate {
    font-weight: bold;
    font-size: 18px;
    color: #667eea;
}

.history-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.history-tab {
    padding: 8px 20px;
    background: transparent;
    border: none;
    color: #718096;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.history-tab:hover {
    background: #f7fafc;
    color: #667eea;
}

.history-tab.active {
    background: #667eea;
    color: white;
}

.history-list {
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
}

.history-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: #f7fafc;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: #edf2f7;
    transform: translateX(5px);
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.history-task {
    font-weight: bold;
    font-size: 18px;
    color: #333;
}

.history-date {
    color: #718096;
    font-size: 14px;
}

.history-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    color: #4a5568;
    font-size: 15px;
}

@media (max-width: 768px) {
    .stats-summary {
        grid-template-columns: 1fr;
    }
    
    .history-stats {
        flex-direction: column;
        gap: 8px;
    }
}

/* 家长端样式 */
.parent-view {
    max-width: 500px;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    margin: 20px;
}

.status-panel {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.status-item:last-child {
    margin-bottom: 0;
}

.label {
    color: #666;
    font-size: 14px;
}

.value {
    color: #333;
    font-size: 24px;
    font-weight: bold;
}

.status-badge {
    padding: 5px 15px;
    border-radius: 20px;
    background: #e2e8f0;
    color: #4a5568;
    font-weight: bold;
}

.status-badge.active {
    background: #48bb78;
    color: white;
}

.control-panel {
    margin-bottom: 20px;
}

.control-panel h3 {
    margin-bottom: 15px;
    color: #333;
}

.btn-warning {
    background: #ed8936;
    color: white;
    width: 100%;
}

.btn-warning:hover:not(:disabled) {
    background: #dd6b20;
}

.btn-warning:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.btn-large {
    padding: 20px;
    font-size: 20px;
}

.hint {
    text-align: center;
    color: #718096;
    font-size: 14px;
    margin-top: 10px;
}

.settings-panel {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
}

.settings-panel h3 {
    margin-bottom: 15px;
    color: #333;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-item label {
    color: #4a5568;
}

.setting-item input {
    padding: 8px;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    width: 80px;
    font-size: 16px;
}

/* 房间号显示弹窗 */
.room-modal {
    max-width: 500px;
}

.room-instruction {
    text-align: center;
    color: #4a5568;
    font-size: 16px;
    margin: 20px 0;
}

.room-id-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin: 20px 0;
}

.room-id-display span {
    font-size: 48px;
    font-weight: bold;
    letter-spacing: 8px;
    font-family: 'Courier New', monospace;
}

.room-url {
    text-align: center;
    color: #718096;
    font-size: 14px;
    margin: 15px 0;
    word-break: break-all;
}

.room-url span {
    color: #667eea;
    font-weight: bold;
}

/* 房间号输入面板 */
.room-input-panel {
    background: #f7fafc;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.room-input-panel h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
}

.room-input {
    width: 100%;
    padding: 15px;
    font-size: 24px;
    text-align: center;
    letter-spacing: 5px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
}

.room-input:focus {
    outline: none;
    border-color: #667eea;
}

.monitor-panel.hidden {
    display: none;
}

.connected-room-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.room-badge {
    display: flex;
    align-items: center;
    gap: 15px;
}

.room-icon {
    font-size: 32px;
}

.room-details {
    display: flex;
    flex-direction: column;
}

.room-label {
    font-size: 14px;
    opacity: 0.9;
}

.room-number {
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
}

.btn-disconnect {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-disconnect:hover {
    background: rgba(255, 255, 255, 0.3);
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}

body:has(.parent-view) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: auto;
}


/* 返回首页按钮 */
.btn-home {
    display: inline-block;
    padding: 10px 20px;
    background: #e2e8f0;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.btn-home:hover {
    background: #cbd5e0;
    transform: translateX(-3px);
}


/* 背景选择器 */
.background-selector-section {
    margin: 20px 0;
}

.background-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.background-option {
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 10px;
    padding: 5px;
    transition: all 0.2s;
    background: #f7fafc;
}

.background-option:hover {
    border-color: #cbd5e0;
    transform: translateY(-2px);
}

.background-option.active {
    border-color: #667eea;
    background: #e6f2ff;
}

.bg-preview {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    margin-bottom: 5px;
}

.bg-name {
    text-align: center;
    font-size: 12px;
    color: #666;
    font-weight: bold;
}

.background-option.active .bg-name {
    color: #667eea;
}


/* ========== 骰子样式倒计时 ========== */
.dice-timer {
    display: flex;
    gap: 8px;
    align-items: center;
    perspective: 1000px; /* 添加3D透视效果 */
}

.dice-digit {
    width: 50px;
    height: 50px;
    background: white;
    border: 3px solid #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    color: #333;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.3s;
    transform-style: preserve-3d;
}

/* 骰子翻转动画 */
.dice-digit.dice-flip {
    animation: diceFlip 0.3s ease-in-out;
}

@keyframes diceFlip {
    0% {
        transform: rotateY(0deg) scale(1);
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
    50% {
        transform: rotateY(90deg) scale(1.15);
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    }
    100% {
        transform: rotateY(180deg) scale(1);
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
}

/* 秒位骰子使用X轴翻转 */
#diceSec1.dice-flip,
#diceSec2.dice-flip {
    animation: diceFlipX 0.3s ease-in-out;
}

@keyframes diceFlipX {
    0% {
        transform: rotateX(0deg) scale(1);
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
    50% {
        transform: rotateX(90deg) scale(1.15);
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    }
    100% {
        transform: rotateX(180deg) scale(1);
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }
}

/* 开始时的骰子摇动效果 */
.dice-digit.dice-shake-start {
    animation: diceShakeStart 0.6s ease-out;
}

@keyframes diceShakeStart {
    0% {
        transform: rotate(0deg) scale(1);
    }
    10% {
        transform: rotate(-15deg) scale(1.1);
    }
    20% {
        transform: rotate(15deg) scale(1.1);
    }
    30% {
        transform: rotate(-15deg) scale(1.1);
    }
    40% {
        transform: rotate(15deg) scale(1.1);
    }
    50% {
        transform: rotate(-10deg) scale(1.05);
    }
    60% {
        transform: rotate(10deg) scale(1.05);
    }
    70% {
        transform: rotate(-5deg) scale(1.02);
    }
    80% {
        transform: rotate(5deg) scale(1.02);
    }
    90% {
        transform: rotate(-2deg) scale(1.01);
    }
    100% {
        transform: rotate(0deg) scale(1);
    }
}

.dice-separator {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    margin: 0 5px;
}

/* 时间进度条 */
.time-progress-bar {
    position: relative;
    width: 100%;
    max-width: 300px;
    height: 25px;
    background: rgba(200, 200, 200, 0.3);
    border-radius: 12px;
    overflow: hidden;
    margin: 10px 0 5px 0;
    border: 2px solid rgba(150, 150, 150, 0.5);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
    transition: width 1s linear, background 0.5s;
    border-radius: 10px;
}

.progress-bar-fill.warning {
    background: linear-gradient(90deg, #ed8936 0%, #dd6b20 100%);
}

.progress-bar-fill.danger {
    background: linear-gradient(90deg, #f56565 0%, #e53e3e 100%);
    animation: pulse-progress 1s ease-in-out infinite;
}

.progress-bar-fill.overtime {
    background: repeating-linear-gradient(
        45deg,
        #9f7aea,
        #9f7aea 10px,
        #805ad5 10px,
        #805ad5 20px
    );
    background-size: 200% 100%;
    animation: overtime-stripe 2s linear infinite;
}

@keyframes pulse-progress {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

.progress-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* 不同状态的骰子颜色 */
.countdown-display.time-good .dice-digit {
    background: #48bb78;
    color: white;
    border-color: #38a169;
}

.countdown-display.time-warning .dice-digit {
    background: #ed8936;
    color: white;
    border-color: #dd6b20;
}

.countdown-display.time-danger .dice-digit {
    background: #f56565;
    color: white;
    border-color: #e53e3e;
    animation: dice-shake 0.5s ease-in-out infinite;
}

.countdown-display.time-overtime .dice-digit {
    background: #9f7aea;
    color: white;
    border-color: #805ad5;
}

@keyframes dice-shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

/* 小树爆炸效果 */
.tree-exploding {
    animation: tree-explode 0.8s ease-out forwards;
}

@keyframes tree-explode {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0.5;
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
    }
}


/* 爆炸粒子动画 */
@keyframes particle-burst-0 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

@keyframes particle-burst-1 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

@keyframes particle-burst-2 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

@keyframes particle-burst-3 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

@keyframes particle-burst-4 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

@keyframes particle-burst-5 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

@keyframes particle-burst-6 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

@keyframes particle-burst-7 {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}
