:root {
    /* PancakeSwap 浅色主题色 */
    --primary: #31D0AA;         /* 看涨绿色 */
    --secondary: #ED4B9E;       /* 看跌粉色 */
    --background: #F8F9FE;      /* 更柔和的背景色 */
    --card-background: #FFFFFF;  /* 改回纯白色 */
    --text-primary: #280D5F;    /* 主要文字 */
    --text-secondary: #7A6EAA;  /* 次要文字 */
    --border-color: #E7E3EB;    /* 边框颜色 */
    --input-background: #F7F7F7; /* 输入框背景 */
}

body {
    margin: 0;
    font-family: 'Kanit', sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    background: linear-gradient(
        135deg,
        #F8F9FE 0%,
        #F0F3FA 50%,
        #EDF1F9 100%
    );
}

.container {
    margin: 16px;
    padding: 16px;
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    width: calc(100% - 64px); /* 减去左右margin和padding */
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

.amount-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--input-background);
    backdrop-filter: none;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 13px;
    box-sizing: border-box;
}

.direction-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.direction-button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

/* 看涨按钮 */
.direction-button.up {
    background: var(--primary);
}

/* 看跌按钮 */
.direction-button.down {
    background: var(--secondary);
}

/* 未选中状态 */
.direction-button.dimmed {
    background: #BDC2C4;  /* 灰色背景 */
    box-shadow: none;
    opacity: 0.6;
}

/* 选中状态 */
.direction-button.selected {
    opacity: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 看涨按钮选中状态 */
.direction-button.up.selected {
    box-shadow: 0 4px 12px rgba(49, 208, 170, 0.4);
}

/* 看跌按钮选中状态 */
.direction-button.down.selected {
    box-shadow: 0 4px 12px rgba(237, 75, 158, 0.4);
}

/* 按钮悬停效果 */
.direction-button:hover:not(.selected) {  /* 非选中状态的悬停效果 */
    opacity: 0.8;
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 按钮点击效果 */
.direction-button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 连接钱包和确认投注按钮的基础样式 */
.connect-button,
.bet-button {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    background: linear-gradient(
        270deg,
        #1FC7D4,
        var(--primary),
        #31D0AA,
        #1FC7D4
    );
    background-size: 300% 100%;
    animation: flowingLight 3s linear infinite;
}

.bet-button {
    background: linear-gradient(
        270deg,
        #ED4B9E,
        var(--secondary),
        #FF80BF,
        #ED4B9E
    );
    background-size: 300% 100%;
}

/* 按钮悬停效果 */
.connect-button:hover,
.bet-button:hover {
    transform: translateY(-1px);
    animation-duration: 1.5s;  /* 加快动画速度 */
}

/* 按钮点击效果 */
.connect-button:active,
.bet-button:active {
    transform: translateY(1px);
    filter: brightness(0.95);
}

/* 禁用状态 */
.bet-button:disabled {
    background: var(--input-background);
    color: var(--text-secondary);
    opacity: 0.5;
    cursor: not-allowed;
    animation: none;
}

/* 流光动画 */
@keyframes flowingLight {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 300% 50%;
    }
}

/* 当前回合面板样式优化 */
.round-info {
    background: white;
    border-radius: 16px;  /* 减小圆角 */
    padding: 16px;  /* 减小内边距 */
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);  /* 调整阴影 */
    border: 1px solid rgba(231, 227, 235, 0.6);
}

/* 当前回合标题 */
.current-round {
    color: var(--text-secondary);
    font-size: 12px;  /* 减小字体 */
    font-weight: 500;
    margin-bottom: 8px;  /* 减小间距 */
    letter-spacing: 0.02em;
}

/* 回合号 */
.epoch-number {
    color: var(--text-primary);
    font-size: 20px;  /* 减小字体 */
    font-weight: 700;
    margin: 6px 0;  /* 减小间距 */
    letter-spacing: -0.01em;
}

/* 倒计时区域样式更新 */
.countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 12px;
    width: 100%;
}

/* 移除旧的圆环样式 */
.countdown-circle {
    display: none;
}

/* 倒计时内容 */
.countdown-content {
    text-align: center;
    margin-bottom: 8px;
}

.countdown-label {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
}

.countdown-time {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
}

/* 修改进度条样式 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(231, 227, 235, 0.3);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    display: flex;
    gap: 4px;  /* 块之间的间隔 */
    padding: 0 2px;  /* 左右留出一点空间 */
}

.progress-bar-fill.snake {
    position: relative;
    height: 100%;
    width: calc((100% - 236px) / 60);  /* 60个块，减去间隔的总宽度 */
    background: var(--primary);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(49, 208, 170, 0.3);
    margin: 0;
    flex-shrink: 0;
    transition: opacity 0.3s ease;  /* 添加过渡效果 */
}

/* 紧急状态样式 */
.countdown.urgent .progress-bar-fill.snake {
    background: var(--secondary);
    box-shadow: 0 0 8px rgba(237, 75, 158, 0.3);
}

.wallet-info {
    margin-bottom: 16px;
    background: white;
    backdrop-filter: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(231, 227, 235, 0.5);
    border-radius: 16px;
    padding: 16px;
}

#walletStatus {
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text-primary);
}

#networkStatus {
    font-size: 12px;
    color: var(--secondary);
}

/* 输入框焦点样式 */
.amount-input:focus {
    outline: none;
    box-shadow: 
        0 0 0 1px var(--primary),
        0 0 15px rgba(49, 208, 170, 0.2);
    background-color: var(--card-background);
}

/* 按钮激活状态 */
.direction-button:active, .connect-button:active, .bet-button:active {
    transform: translateY(1px);
}

.multiplier-buttons {
    margin-top: 6px;
}

.multiplier-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.multiplier-row:last-child {
    margin-bottom: 0;
}

/* 倍数按钮基础样式 */
.multiplier-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    background: var(--primary);
}

/* 负倍数按钮 */
.multiplier-btn.negative {
    background: var(--secondary);
}

/* 未选中状态（灰色） */
.multiplier-btn.dimmed {
    background: #BDC2C4;
    opacity: 0.6;
}

/* 选中状态 */
.multiplier-btn.selected {
    opacity: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 正倍数按钮选中状态 */
.multiplier-btn.selected:not(.negative) {
    box-shadow: 0 4px 12px rgba(49, 208, 170, 0.4);
}

/* 负倍数按钮选中状态 */
.multiplier-btn.negative.selected {
    box-shadow: 0 4px 12px rgba(237, 75, 158, 0.4);
}

.multiplier-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

.actual-amount {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
}

.actual-amount #actualAmount {
    color: var(--text-primary);
    font-weight: 600;
}

/* 历史回合面板 */
.history-panel {
    flex: 1;
    min-width: 0;
}

.history-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap; /* 允许换行 */
    align-items: flex-start; /* 从顶部开始对齐 */
}

/* 历史回合卡片 */
.history-item {
    width: 160px;
    flex: 0 0 auto;
    background: white;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: none;  /* 移除所有模糊效果 */
    border-radius: 12px;
    padding: 12px;
    position: relative;
    transition: all 0.3s ease;
    height: fit-content;
}

/* 上升状态 */
.history-item.up {
    border-bottom: 3px solid var(--primary);
}

/* 下跌状态 */
.history-item.down {
    border-bottom: 3px solid var(--secondary);
}

/* 回合编号样式 */
.history-item .epoch {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* 价格显示区域 */
.price-box {
    margin-top: 4px;
}

/* 当前/结束价格标签 */
.price-label {
    font-size: 11px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 2px;
}

/* 价格数值 */
.close-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

/* 价格变化 */
.price-diff {
    font-size: 12px;
    font-weight: 500;
    margin: 4px 0;
}

.price-diff .diff-value {
    font-weight: 600;
}

.price-diff .diff-percent {
    font-size: 11px;
    opacity: 0.9;
}

/* 锁定价格 */
.locked-price {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 4px 0;
}

/* 实池金额 */
.pool-amount {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 涨跌颜色 */
.close-price.up,
.price-diff.up {
    color: var(--primary);
}

.close-price.down,
.price-diff.down {
    color: var(--secondary);
}

/* 已投入标记 */
.bet-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0.9;
}

/* 操作区域容器 */
.operation-area {
    width: 380px;
    flex-shrink: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(231, 227, 235, 0.8);
    padding: 12px;
}

/* 移除其他操作区域的重复样式 */
.round-info,
.wallet-info,
.input-group,
.direction-buttons,
.connect-button,
.bet-button {
    margin-bottom: 12px;
    background-color: transparent;
    border-radius: 16px;
    box-shadow: none;
    border: 1px solid rgba(231, 227, 235, 0.8);
    padding: 12px;
}

/* 隐藏滚动条但保持功能 */
.history-panel::-webkit-scrollbar {
    height: 0;
    width: 0;
}

.history-panel::-webkit-scrollbar-track {
    background: transparent;
}

.history-panel::-webkit-scrollbar-thumb {
    background: transparent;
}

/* 结束价格颜色 */
.close-price.up {
    color: var(--primary) !important;  /* 上涨显示绿色 */
}

.close-price.down {
    color: var(--secondary) !important;  /* 下跌显示粉色 */
}

/* 移除之前的背景色样式 */
.history-item .current-price div {
    color: inherit;  /* 继承父元素的颜色 */
}

/* 价格变化动画 */
.close-price {
    transition: color 0.3s ease;
    position: relative;
}

/* 价格变化时的闪烁动画 */
@keyframes priceChange {
    0% {
        opacity: 0.3;
        transform: scale(0.95);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 添加动画类 */
.price-change-animation {
    animation: priceChange 0.4s ease;
}

/* 调整字体大小 */
.input-group label {
    font-size: 12px;
    margin-bottom: 4px;
}

.amount-input {
    font-size: 12px;
    padding: 6px;
}

.direction-button {
    font-size: 12px;
    padding: 8px;
}

.bet-button,
.connect-button {
    font-size: 12px;
    padding: 8px;
}

#walletStatus {
    font-size: 12px;
    margin-bottom: 4px;
}

/* 高级设置折叠面板 */
.advanced-settings {
    margin-bottom: 12px;
    border: 1px solid rgba(231, 227, 235, 0.8);
    border-radius: 16px;
    overflow: hidden;
}

.advanced-toggle {
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.advanced-toggle:hover {
    background: rgba(231, 227, 235, 0.1);
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.toggle-icon.open {
    transform: rotate(180deg);
}

.advanced-content {
    padding: 12px;
    border-top: 1px solid rgba(231, 227, 235, 0.8);
}

/* 调整输入组样式 */
.advanced-content .input-group:last-child {
    margin-bottom: 0;
}

/* 赔率显示 */
.odds-info {
    display: flex;
    justify-content: space-between;
    margin: 6px 0;  /* 减小上下间距 */
    padding: 3px 0;  /* 减小上下内边距 */
    border-top: 1px solid rgba(231, 227, 235, 0.6);
    border-bottom: 1px solid rgba(231, 227, 235, 0.6);
}

.odds {
    display: flex;
    align-items: center;
    gap: 3px;  /* 减小间距 */
}

.odds-label {
    font-size: 10px;  /* 从11px减小到10px */
    color: var(--text-secondary);
}

.odds-value {
    font-size: 11px;  /* 从12px减小到11px */
    font-weight: 600;
}

.odds.up .odds-value {
    color: var(--primary);
}

.odds.down .odds-value {
    color: var(--secondary);
}

/* 价格差值显示 */
.price-diff {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 11px;
    margin: 2px 0;
}

.price-diff.up {
    color: var(--primary);
}

.price-diff.down {
    color: var(--secondary);
}

.diff-value {
    font-weight: 600;
}

.diff-percent {
    color: inherit;
    opacity: 0.8;
}

/* 最后一个回合的样式 */
.history-item.live {
    position: relative;
    overflow: hidden;
    background: white;
    box-shadow: 0 0 12px rgba(49, 208, 170, 0.2);
    border: 1.5px solid rgba(49, 208, 170, 0.6);
    transform: scale(1.02);
    backdrop-filter: none;  /* 确保没有模糊效果 */
}

.history-item.live.down {
    box-shadow: 0 0 12px rgba(237, 75, 158, 0.2);
    border: 1.5px solid rgba(237, 75, 158, 0.6);
}

.history-item.live .glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(49, 208, 170, 0.08);
    opacity: 0;
    pointer-events: none;
}

.history-item.live.down .glow {
    background: rgba(237, 75, 158, 0.08);
}

/* 修改动画参数 */
.history-item.live .glow {
    animation: liveGlow 2s ease-in-out infinite;
}

@keyframes liveGlow {
    0% {
        opacity: 0.1;
    }
    50% {
        opacity: 0.2;
    }
    100% {
        opacity: 0.1;
    }
}

/* 价格更新时的闪烁效果 */
.history-item.live.price-update .glow {
    animation: priceUpdateGlow 0.5s ease-out;
}

@keyframes priceUpdateGlow {
    0% {
        opacity: 0.3;
    }
    100% {
        opacity: 0.1;
    }
}

/* 添加边框动画 */
.history-item.live {
    animation: borderPulse 2s ease-in-out infinite;
}

@keyframes borderPulse {
    0% {
        border-color: rgba(49, 208, 170, 0.3);
    }
    50% {
        border-color: rgba(49, 208, 170, 0.7);  /* 边框颜色变化 */
    }
    100% {
        border-color: rgba(49, 208, 170, 0.3);
    }
}

.history-item.live.down {
    animation: borderPulseDown 2s ease-in-out infinite;
}

@keyframes borderPulseDown {
    0% {
        border-color: rgba(237, 75, 158, 0.3);
    }
    50% {
        border-color: rgba(237, 75, 158, 0.7);
    }
    100% {
        border-color: rgba(237, 75, 158, 0.3);
    }
}

/* 确保内容在流光之上 */
.history-item.live .price-box,
.history-item.live .epoch,
.history-item.live .bet-badge {
    position: relative;
    z-index: 1;
}

/* 添加微妙的纹理 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23EDF1F9' fill-opacity='0.3' fill-rule='evenodd'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.3;
    z-index: -1;
}

/* 添加金额输入区域的新样式 */
.amount-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.actual-amount {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    padding: 4px 12px;
    background: rgba(49, 208, 170, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(49, 208, 170, 0.2);
}

.actual-amount .highlight {
    color: var(--primary);
    font-weight: 700;
    font-size: 16px;
    margin: 0 4px;
}

/* 调整输入组的样式 */
.input-group {
    background: white;
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 16px;
}

.input-group label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

/* Toast 通知样式 */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-top: 8px;
    min-width: 280px;
    max-width: 320px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast.success .toast-icon {
    background: rgba(49, 208, 170, 0.1);
    color: var(--primary);
}

.toast.error .toast-icon {
    background: rgba(237, 75, 158, 0.1);
    color: var(--secondary);
}

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.toast-message {
    font-size: 12px;
    color: var(--text-secondary);
} 