/* effects.css - 特效相关样式 */
/* ===== 重投选项样式 ===== */
.reroll-options {
    margin-left: 24px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
    border-left: 3px solid var(--accent-color);
}

.sub-option {
    margin-bottom: 10px;
}

.sub-option:last-child {
    margin-bottom: 0;
}

.sub-option label {
    display: inline-block;
    min-width: 80px;
    margin-right: 10px;
}

.sub-option select {
    width: auto;
    min-width: 120px;
}

/* ===== 特效控制组样式 ===== */
.effect-control-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.effect-control-group select {
    width: auto;
    min-width: 70px;
    margin: 0;
}

/* 重投数量输入框样式 */
.effect-control-group input[type="number"] {
    width: 50px;
    height: 38px;
    padding: 0 8px;
    margin: 0;
    text-align: center;
    -moz-appearance: textfield;
}

/* 移除Chrome等浏览器的默认上下箭头 */
.effect-control-group input[type="number"]::-webkit-inner-spin-button,
.effect-control-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ===== 开关按钮样式 ===== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    margin-left: auto;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    inset: 0;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    background-color: lightgray;
    border: 4px solid transparent;
    border-radius: 20px;
    box-shadow: 0 0 10px 0 rgb(0, 0, 0, 0.25) inset;
    overflow: hidden;
    transition: 0.3s;
}

.toggle-label:before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background-color: #fff;
    border-radius: 20px;
    box-shadow: 0 0 10px 3px rgb(0, 0, 0, 0.25);
    transform: translateX(-30px);
    transition: 0.3s;
}

.toggle-label:after {
    content: "";
    display: none;
}

.toggle-input:checked + .toggle-label {
    background-color: var(--round-highlight-color, var(--accent-color));
}

.toggle-input:checked + .toggle-label:before {
    transform: translateX(30px);
    box-shadow: 0 0 10px 3px rgb(0, 0, 0, 0.25);
}

.toggle-input:active + .toggle-label:before {
    transform: translateX(0);
}

.toggle-input:focus + .toggle-label {
    box-shadow: 0 0 0 3px rgba(var(--round-highlight-rgb, var(--accent-color-rgb)), 0.22);
}

.toggle-label:hover:before {
    box-shadow: 0 0 10px 3px rgb(0, 0, 0, 0.25);
}

/* 开关按钮动画效果 */
.toggle-label .toggle-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: 0;
    z-index: 1;
    transform: scale(0);
    transition: transform 0.5s, opacity 0.3s;
}

.toggle-input:checked + .toggle-label .toggle-wave {
    opacity: 0.3;
    transform: scale(3);
    transition: transform 0.5s, opacity 0.3s;
}

/* ===== 特效状态显示区域样式 ===== */
.active-effects-container {
    margin: 15px 0;
    padding: 10px;
    background-color: var(--card-background);
    border-radius: 8px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

.active-effects-container h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.active-effects-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.effect-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.no-effects {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 13px;
}

/* ===== 修正值滑块样式 ===== */
.modifier-slider-container {
    display: flex;
    align-items: center;
    margin: 0 10px;
    position: relative;
}

.modifier-slider {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modifier-node {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: bold;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.modifier-node:hover {
    border-color: var(--primary-color);
}

.modifier-node:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 0.5; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(0.8); }
}

.modifier-node.active {
    background-color: var(--primary-color);
    color: white;
}

.modifier-dots {
    color: var(--primary-color);
    letter-spacing: 8px;
    font-size: 14px;
    padding-left: 12px;
    padding-right: 12px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.modifier-dots:hover {
    text-shadow: 0 0 8px rgba(var(--primary-color-rgb), 0.6);
}

.modifier-dots:hover::after {
    animation: dotsFlow 2s infinite ease-in-out;
    opacity: 1;
}

@keyframes dotsFlow {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ===== 骰子结果提示样式 ===== */
.dice-result-hint,
.wound-dice-result-hint {
    display: inline-flex;
    align-items: center;
    margin-left: 12px;
    background-color: var(--background-secondary);
    border-radius: 4px;
    height: 36px;
    color: var(--text-primary);
    transition: var(--transition-normal);
}

.dice-value-container {
    display: flex;
    align-items: center;
    height: 100%;
}

.original-value, .modified-value {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    height: 100%;
    font-weight: 600;
    font-size: 14px;
    position: relative;
}

.original-value {
    color: var(--text-secondary);
    border-right: 1px dashed rgba(0, 0, 0, 0.1);
}

.modified-value {
    color: var(--primary-color);
    font-weight: 700;
}

.modified-value.success {
    color: var(--success-color);
}

.modified-value.failure {
    color: var(--warning-color);
}

/* ===== 特效选项样式 - 增强版 ===== */
.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: visible;
}

/* 禁用的特效选项样式 */
.effect-option.disabled-effect {
    opacity: 0.6;
    pointer-events: none;
    background-color: rgba(0, 0, 0, 0.05);
    border: 1px dashed rgba(0, 0, 0, 0.1);
}

.effect-option.disabled-effect .toggle-switch {
    opacity: 0.5;
}

.effect-control-group--with-note {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 6px 10px;
}

.effect-control-main {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
}

.effect-control-group--with-note .toggle-switch {
    margin-left: 0;
}

.effect-option-note {
    grid-column: 1 / -1;
    display: block;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* 特效提示样式 */
.effect-note {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

/* ===== 移动端显示

我将为 effects.css 添加移动端适配样式，确保在小屏幕设备上有更好的显示效果。

/* ===== 移动端适配样式 ===== */
@media (max-width: 768px) {
    /* 特效控制组样式调整 */
    .effect-control-group {
        gap: 6px;
    }

    /* 修正值滑块调整 */
    .modifier-slider-container {
        margin: 0 5px;
    }

    /* 骰子结果提示调整 */
    .dice-result-hint,
    .wound-dice-result-hint {
        height: 32px;
        margin-left: 6px;
    }

    .original-value, .modified-value {
        padding: 0 8px;
    }

    /* 开关按钮调整 */
    .toggle-switch {
        width: 60px;
        height: 30px;
    }

    /* 特效状态显示区域调整 */
    .active-effects-container {
        padding: 8px;
    }

    .effect-tag {
        padding: 3px 6px;
        font-size: 11px;
    }

    /* 骰子值选择调整 */
    .dice-values-grid {
        gap: 5px;
    }

    .dice-value-item {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* 小屏幕手机适配 */
@media (max-width: 480px) {
    /* 特效控制组布局调整 - 避免生硬换行 */
    .effect-control-group {
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        gap: 4px;
        min-height: 40px;
    }

    .effect-control-group > span:first-child {
        flex-shrink: 0;
        min-width: auto;
        font-size: 13px;
        font-weight: 500;
        margin-right: 6px;
    }

    /* 输入框和选择器调整 - 更紧凑的布局 */
    .effect-control-group select {
        flex-shrink: 0;
        min-width: 55px;
        max-width: 80px;
        font-size: 12px;
        padding: 2px 4px;
        height: 32px;
    }

    .effect-control-group input[type="number"] {
        flex-shrink: 0;
        width: 35px;
        height: 32px;
        font-size: 12px;
        padding: 0 2px;
    }

    /* 开关按钮调整 */
    .toggle-switch {
        flex-shrink: 0;
        margin-left: auto;
    }

    /* 骰子修正特效保持换行布局 */
     .effect-control-group:has(.modifier-slider-container) {
         flex-wrap: wrap;
         justify-content: space-between;
     }

     .effect-control-group:has(.modifier-slider-container) > span:first-child {
         width: 100%;
         margin-bottom: 5px;
         margin-right: 0;
     }

     /* 所有包含骰子值选择器的特效保持换行布局 */
     .effect-control-group:has(.dice-values-container) {
         flex-wrap: wrap !important;
         justify-content: flex-start !important;
         gap: 3px !important;
     }

     .effect-control-group:has(.dice-values-container) > span:first-child {
         width: auto !important;
         margin-bottom: 0 !important;
         margin-right: 4px !important;
     }

     /* 修正值滑块进一步调整 */
     .modifier-slider-container {
         width: 100%;
         margin: 8px 0;
        justify-content: center;
    }

    /* 骰子结果提示调整 */
    .dice-result-hint,
    .wound-dice-result-hint {
        margin: 8px auto;
    }

    /* 开关按钮位置调整 */
    .toggle-switch {
        margin: 8px 0 0 auto;
    }

    /* 骰子值选择进一步调整 */
    .dice-values-container {
        padding: 10px 5px;
    }

    .dice-values-grid {
        flex-wrap: wrap;
        justify-content: center;
    }

    .dice-value-item {
        width: 32px;
        height: 32px;
    }
}

/* ===== 暗色模式适配 ===== */
@media (prefers-color-scheme: dark) {
    /* 开关按钮 */
    .toggle-label {
        background-color: #555;
    }

    .toggle-input:checked + .toggle-label {
        background-color: var(--round-highlight-color, var(--accent-color));
    }

    /* 特效状态显示区域 */
    .active-effects-container {
        background-color: rgba(255, 255, 255, 0.05);
    }

    /* 修正值滑块 */
    .modifier-node.active {
        background-color: var(--accent-color);
    }

    .modifier-dots {
        color: var(--accent-color);
    }

    .modifier-dots:hover {
        text-shadow: 0 0 8px rgba(var(--accent-color-rgb), 0.6);
    }

    .modifier-node:hover {
        border-color: var(--accent-color);
    }

    /* 骰子结果提示 */
    .original-value {
        border-right: 1px dashed rgba(255, 255, 255, 0.1);
    }

    .modified-value {
        color: var(--accent-color);
    }

    /* 禁用的特效选项样式 */
    .effect-option.disabled-effect {
        opacity: 0.5;
        background-color: rgba(255, 255, 255, 0.05);
        border: 1px dashed rgba(255, 255, 255, 0.1);
    }

    .effect-note {
        color: rgba(255, 255, 255, 0.6);
    }
}
