/* ===== 特效菜单按钮样式 - 增强版 ===== */
.effects-button {
    background-color: var(--accent-color);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-size: 14px;
    font-weight: 600;
    height: 38px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.effects-button:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    z-index: -1;
}

.effects-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.1);
}

.effects-button:hover:before {
    animation: shine 1.5s ease-out infinite;
}

.effects-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.effects-button svg {
    margin-left: 8px;
    fill: currentColor;
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.effects-button:hover svg {
    transform: rotate(15deg) scale(1.2);
}

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }

    60% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ===== 特效面板基础样式 - 增强版 ===== */
.effects-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    background-color: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    overflow: hidden;
    border: 1px solid rgba(var(--primary-color-rgb), 0.1);
}

.effects-panel.active {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: panelAppear 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes panelAppear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ===== 特效面板头部样式 - 增强版 ===== */
.effects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
}

.effects-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
    position: relative;
    padding-left: 12px;
}

.effects-header h3:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.effects-panel .close-button {
    background: none !important;
    border: none !important;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    margin: 0;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: none !important;
    border-radius: 50% !important;
    transform: none !important;
    position: relative;
    overflow: hidden;
}

.effects-panel .close-button:hover {
    color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.05) !important;
    transform: rotate(90deg) !important;
}

.effects-panel .close-button:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(var(--primary-color-rgb), 0.2) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0);
    transition: all 0.4s ease;
}

.effects-panel .close-button:hover:after {
    opacity: 1;
    transform: scale(1.5);
}

/* ===== 标签页样式 - 创意版 ===== */
.effects-tabs {
    display: flex;
    position: relative;
    padding: 0;
    border-bottom: none;
    overflow: hidden;
}

.effects-tabs::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--primary-color-rgb), 0.3), transparent);
}

.effects-tabs .tab {
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
    overflow: hidden;
    text-align: center;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: none;
}

.effects-tabs .tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.effects-tabs .tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    transform: translateX(-50%);
    transition: width 0.3s ease;
    border-radius: 3px 3px 0 0;
}

.effects-tabs .tab:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.effects-tabs .tab:hover::before {
    opacity: 1;
}

.effects-tabs .tab:hover::after {
    width: 30%;
}

.effects-tabs .tab.active {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: none;
}

.effects-tabs .tab.active::after {
    width: 80%;
    height: 3px;
    background-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(var(--primary-color-rgb), 0.5);
}

.effects-tabs .tab span {
    position: relative;
    display: inline-block;
}

@keyframes pulse-dot {
    0% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translateY(-50%) scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
    .effects-tabs .tab::before {
        background: linear-gradient(135deg, rgba(var(--accent-color-rgb), 0.1) 0%, rgba(var(--accent-color-rgb), 0) 100%);
    }

    .effects-tabs .tab::after {
        background-color: var(--accent-color);
    }

    .effects-tabs .tab:hover {
        color: var(--accent-color);
    }

    .effects-tabs .tab.active {
        color: var(--accent-color);
    }

    .effects-tabs .tab.active::after {
        background-color: var(--accent-color);
        box-shadow: 0 0 8px rgba(var(--accent-color-rgb), 0.5);
    }
}

/* ===== 内容区域样式 - 增强版 ===== */
.effects-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    scroll-behavior: smooth;
}

.effects-content::-webkit-scrollbar {
    width: 8px;
}

.effects-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.effects-content::-webkit-scrollbar-thumb {
    background-color: rgba(var(--primary-color-rgb), 0.3);
    border-radius: 4px;
}

.effects-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(var(--primary-color-rgb), 0.5);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 特效选项样式 - 增强版 ===== */
.effect-option {
    margin-bottom: 16px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.effect-option label {
    font-weight: 500;
}

.effect-description {
    margin-top: 6px;
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-left: 24px;
}

.effect-option input[type="number"] {
    width: 60px;
    padding: 6px;
    margin-right: 8px;
}

/* ===== 骰子值选择样式 ===== */
.dice-values-container {
    padding: 15px 10px;
}

.dice-values-grid {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.dice-value-item {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    color: var(--text-primary);
    border: 2px solid transparent;
    user-select: none;
}

.dice-value-item:hover {
    transform: translateY(-3px) rotate(5deg);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.dice-value-item.selected {
    border-color: var(--primary-color);
    background-color: rgba(var(--primary-color-rgb), 0.1);
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(var(--primary-color-rgb), 0.3);
}

.dice-value-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0.5);
    opacity: 0;
    transition: all 0.3s ease;
}

.dice-value-item.selected::before {
    opacity: 1;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0.5);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(var(--primary-color-rgb), 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0);
    }
}

.dice-value-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* 旧版骰子值选择器样式（保留向后兼容） */
#reroll-values-container {
    display: none;
}

#reroll-values-container label {
    margin-right: 12px;
    cursor: pointer;
}

#reroll-values-container input[type="checkbox"] {
    margin-right: 4px;
}

/* ===== 遮罩层样式 ===== */
.effects-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.effects-overlay.active {
    display: block;
    opacity: 1;
}

/* ===== 响应式调整 ===== */
@media (max-width: 768px) {
    .effects-panel {
        width: 95%;
        max-height: 90vh;
    }

    .effects-tabs {
        overflow-x: auto;
        white-space: nowrap;
    }

    .effects-tabs .tab {
        padding: 12px 15px;
    }
}

/* ===== 暗色模式适配 ===== */
@media (prefers-color-scheme: dark) {
    .dice-value-item {
        background: #333;
        color: #e0e0e0;
    }

    .dice-value-item.selected {
        border-color: var(--accent-color);
        background-color: rgba(72, 149, 239, 0.2);
    }

    .effect-option:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }

    .effects-tabs {
        background-color: rgba(255, 255, 255, 0.02);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .effects-tabs .tab:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }

    .effects-tabs .tab.active {
        border-bottom-color: var(--accent-color);
        color: var(--accent-color);
    }

    .effects-header {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .effects-header h3 {
        color: var(--accent-color);
    }
}