/* controls.css - 表单控件样式 */
/* 控件样式优化 */
.controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 20px;
}

.input-group {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

label {
    font-weight: 500;
    color: var(--text-primary);
}

/* 统一所有输入框和选择框的高度 */
select,
input {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    background-color: #f9f9f9;
    width: 100%;
    height: 38px;
    box-sizing: border-box;
    font-family: 'Play', 'SarasaUiSC', sans-serif;
}

/* 为数字输入框设置统一样式 */
input[type="number"] {
    width: 100%;
    -moz-appearance: textfield;
    height: 38px;
    font-family: 'Play', 'SarasaUiSC', sans-serif;
}

/* 特效选项中的数字输入框样式 */
.effect-option input[type="number"] {
    width: 60px;
    padding: 6px;
    margin-right: 8px;
    height: 38px;
}

/* 移除Chrome等浏览器的默认上下箭头 */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

select:focus,
input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.15);
}

/* 添加自定义下拉箭头样式 */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* 修改按钮样式 */
button {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    z-index: 1;
    margin-top: 0;
    padding: 10px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.2s ease-in;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 38px;
}

button::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    width: 140%;
    height: 180%;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    transform: translateX(-50%) scaleY(1) scaleX(1.25);
    transition: all 0.5s 0.1s cubic-bezier(0.55, 0, 0.1, 1);
    pointer-events: none;
    z-index: -1;
}

button::after {
    content: "";
    position: absolute;
    left: 55%;
    top: 180%;
    width: 160%;
    height: 190%;
    background-color: var(--secondary-color);
    border-radius: 50%;
    transform: translateX(-50%) scaleY(1) scaleX(1.45);
    transition: all 0.5s 0.1s cubic-bezier(0.55, 0, 0.1, 1);
    pointer-events: none;
    z-index: -1;
}

button:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

button:hover::before {
    top: -35%;
    background-color: var(--secondary-color);
    transform: translateX(-50%) scaleY(1.3) scaleX(0.8);
}

button:hover::after {
    top: -45%;
    background-color: var(--secondary-color);
    transform: translateX(-50%) scaleY(1.3) scaleX(0.8);
}

button:active {
    color: rgba(255, 255, 255, 0.72);
    box-shadow: inset 4px 4px 12px rgba(0, 0, 0, 0.16), inset -4px -4px 12px rgba(255, 255, 255, 0.18);
}

button.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 输入提示样式 */
.input-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    margin-left: 2px;
}

/* 输入提示框样式 */
.input-tooltip {
    position: absolute;
    background-color: var(--card-background);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 13px;
    z-index: 1000;
    max-width: 250px;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    bottom: 100%;
    margin-bottom: 8px;
}

.input-tooltip.active {
    opacity: 1;
    transform: translateY(0);
}

/* 为保护相关的输入框添加特殊的提示框位置 */
#save+.input-tooltip,
#invulnerable_save+.input-tooltip,
.protection-container+.input-tooltip,
#ap_value+.input-tooltip {
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
}

/* 添加小三角形指示器 */
.input-tooltip:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 15px;
    width: 10px;
    height: 10px;
    background-color: var(--card-background);
    transform: rotate(45deg);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* 暗色模式下的控件样式 */
@media (prefers-color-scheme: dark) {
    .input-tooltip {
        background-color: #333;
        color: #fff;
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* 保护输入框组合样式 */
.protection-container {
    display: flex;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    background-color: #f9f9f9;
    transition: var(--transition);
}

.protection-container select {
    flex: 1;
    border: none;
    border-radius: 0;
    margin: 0;
    height: 38px;
    background-color: transparent;
    padding: 10px 12px;
    font-size: 14px;
    font-family: 'Play', 'SarasaUiSC', sans-serif;
}

.protection-container select:first-child {
    border-right: 1px solid #e0e0e0;
    padding-right: 12px;
}

/* 保护容器的焦点状态 */
.protection-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.15);
}

/* 保护容器内的选择框焦点状态 */
.protection-container select:focus {
    border-color: transparent;
    box-shadow: none;
    outline: none;
}

/* 暗色模式下的保护输入框组合样式 */
@media (prefers-color-scheme: dark) {
    .protection-container {
        border-color: #e0e0e0;
        background-color: #f9f9f9;
    }

    .protection-container select {
        background-color: #f9f9f9;
    }

    .protection-container select:first-child {
        border-right-color: #e0e0e0;
    }

    .protection-container:focus-within {
        border-color: var(--primary-color);
    }
}

/* 穿甲值下拉框样式 */
#ap_value {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    background-color: #f9f9f9;
    -moz-appearance: textfield;
}

/* 移除Chrome和Safari的默认样式 */
#ap_value::-webkit-inner-spin-button,
#ap_value::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
