/* 自定义配置容器 */
.k8-custom-config-container {
    margin-top: 16px;
}

/* 表单元素共享样式 */
.k8-custom-config-form-row {
    display: flex;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.k8-custom-config-label {
    width: 120px;
    color: var(--k8-text-color);
    font-size: 14px;
    padding: 8px 0;
}

.k8-custom-config-input-wrap {
    flex: 1;
    min-width: 200px;
}

/* 提示图标 */
.k8-custom-config-tooltip {
    color: var(--primary-color);
    margin-left: 4px;
    cursor: pointer;
    position: relative;
}

/* 新的提示图标类名 */
.k8-custom-config-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    color: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}
/* 自定义tooltip样式 */
.k8-custom-config-tooltip-content {
    position: fixed;
    padding: 8px 12px;
    background-color: var(--k8-tooltip-bg);
    color: var(--k8-tooltip-text);
    z-index: 9999;
    border-radius: 4px;
    font-size: 14px;
    display: none;
    line-height: 1.4;
    max-width: 300px;
    word-wrap: break-word;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    transition: opacity 0.2s;
    text-align: center;
}

/* 底部箭头样式 */
.k8-custom-config-tooltip-content.bottom::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 0 6px 6px 6px;
    border-style: solid;
    border-color: transparent transparent var(--k8-tooltip-bg) transparent;
}

/* 顶部箭头样式 */
.k8-custom-config-tooltip-content.top::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: var(--k8-tooltip-bg) transparent transparent transparent;
}


/* 带工具提示的输入框的图标按钮 */
.k8-custom-config-form-item [data-tooltip].k8-custom-config-hostname-suffix i,
.k8-custom-config-form-item [data-tooltip].k8-custom-config-password-suffix i {
    cursor: help;
}

/* 下拉框样式 */
.k8-custom-config-select {
    width: 100%;
    max-width: 300px;
    height: 36px;
    border: 1px solid var(--k8-border-color);
    background-color: var(--k8-bg-white);
    border-radius: 4px;
    padding: 0 8px;
    color: var(--k8-text-color);
    outline: none;
    transition: border-color 0.3s;
}

.k8-custom-config-select:focus,
.k8-custom-config-select:hover {
    border-color: var(--primary-color);
}

/* 选项组样式 */
.k8-custom-config-options-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.k8-custom-config-option {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    background-color: var(--k8-fill-2);
    border: 1px solid transparent;
    color: var(--k8-text-color);
    cursor: pointer;
    justify-content: center;
    transition: all 0.3s;
}

.k8-custom-config-option:hover {
    background-color: var(--k8-bg-white);
    border-color: var(--primary-color);
}

.k8-custom-config-option.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 复选框样式 */
.k8-custom-config-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.k8-custom-config-checkbox input[type="checkbox"] {
    margin-right: 8px;
}

/* 滑块样式 */
.k8-custom-config-slider-wrap {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 800px;
}

.k8-custom-config-slider {
    flex: 1;
    height: 4px;
    background: var(--k8-fill-3);
    border-radius: 2px;
    position: relative;
    margin-right: 12px;
    --progress-width: 0%; /* 默认进度宽度为0 */
}

/* 滑块进度条显示 */
.k8-custom-config-slider::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 4px;
    width: var(--progress-width); /* 使用CSS变量控制宽度 */
    background-color: var(--primary-color);
    border-radius: 2px;
    z-index: 1;
}

.k8-custom-config-slider input[type="range"] {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    outline: none;
    z-index: 2;
}

.k8-custom-config-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white;
    position: relative;
    z-index: 3;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

/* 数字输入控件样式 */
.k8-custom-config-number-control {
    display: flex;
    align-items: center;
    width: 130px;
    height: 30px;
    border: none;
    overflow: visible;
}

/* 数字输入框样式 */
.k8-custom-config-number {
    width: 60px;
    text-align: center;
    height: 27px;
    cursor: pointer;
    border: 1px solid var(--k8-border-color);
    background-color: var(--k8-bg-white);
    color: var(--k8-text-color);
    transition: border-color 0.3s;
}

.k8-custom-config-number:hover {
    border-color: var(--primary-color);
}

.k8-custom-config-number:focus {
    cursor: text;
}

/* 加减按钮样式 */
.k8-custom-config-number-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--k8-border-color);
    background-color: var(--k8-bg-white);
    color: var(--k8-border-color);
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.k8-custom-config-number-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    z-index: 1;
}

.k8-custom-config-number-btn:active {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

/* 深色模式下的按钮样式调整 */
html.dark-mode .k8-custom-config-number-btn {
    background-color: var(--k8-fill-3);
}

html.dark-mode .k8-custom-config-number-btn:hover {
    background-color: var(--primary-light);
}

/* 单独存在的数字输入框样式（兼容旧版本） */
.k8-custom-config-slider-wrap > .k8-custom-config-number {
    width: 80px;
    border: 1px solid var(--k8-border-color);
    border-radius: 4px;
    padding: 0 8px;
    transition: border-color 0.3s;
}

.k8-custom-config-unit {
    margin-left: 8px;
    color: var(--k8-text-color-secondary);
}

/* 周期选择样式 */
.k8-custom-config-cycle-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.k8-custom-config-cycle {
    position: relative;
    padding: 6px 16px;
    background-color: var(--k8-fill-2);
    color: var(--k8-text-color);
    border: 1px solid var(--k8-border-color);
    cursor: pointer;
    transition: all 0.3s;
}

.k8-custom-config-cycle:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
}

.k8-custom-config-cycle.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.k8-custom-config-discount {
    position: absolute;
    top: -10px;
    right: -5px;
    font-size: 10px;
    padding: 0 4px;
    height: 16px;
    line-height: 16px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 2px;
}

/* 密码输入框样式 */
.k8-custom-config-password-wrap {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 240px;
    border: 1px solid var(--k8-border-color);
    overflow: hidden;
    transition: border-color 0.3s;
}

.k8-custom-config-password-wrap:hover,
.k8-custom-config-password-wrap:focus-within {
    border-color: var(--primary-color);
}

.k8-custom-config-password-prefix {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--k8-bg-white);
}

.k8-custom-config-password-prefix-icon {
    color: var(--primary-color);
}

.k8-custom-config-password {
    flex: 1;
    height: 36px;
    padding: 0 8px 0 0;
    background: var(--k8-bg-white);
    color: var(--k8-text-color);
    border: none;
    outline: none;
    min-width: 0; /* 防止flex子项溢出 */
}

.k8-custom-config-password-actions {
    display: flex;
    align-items: center;
    background-color: var(--k8-bg-white);
}

.k8-custom-config-password-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--primary-color);
    cursor: pointer;
    background: transparent;
    border: none;
    transition: background-color 0.2s;
}

.k8-custom-config-password-icon:hover {
    background-color: var(--primary-light);
}

#showPassword {
    right: 110px; /* 第一个图标的位置 */
}

#randomPassword {
    right: 80px; /* 第二个图标的位置 */
}

/* 错误提示 */
.k8-custom-config-error {
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .k8-custom-config-label {
        width: 100%;
        margin-bottom: 8px;
    }

    .k8-custom-config-input-wrap {
        width: 100%;
    }
}

/* 级联选择样式 */
.k8-custom-config-cascade-children {
    margin-left: 120px;
    border-left: 2px dashed var(--k8-border-color);
    padding-left: 20px;
    margin-bottom: 16px;
}

/* 资源选择器样式 */
.k8-custom-config-form-row[data-type="resource-radio"] .k8-custom-config-option {
    min-width: 80px;
    text-align: center;
}

/* 区域选择器样式 */
.k8-custom-config-form-row[data-type="datacenter"] .k8-custom-config-option {
    display: flex;
    align-items: center;
}

.k8-custom-config-flag {
    width: 20px;
    height: 15px;
    margin-right: 8px;
    border-radius: 2px;
    object-fit: cover;
    display: inline-block;
}

/* 范围滑块样式改进 */
.k8-custom-config-form-row[data-type="range-pricing"] .k8-custom-config-slider:before,
.k8-custom-config-form-row[data-type="range-staged"] .k8-custom-config-slider:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    width: 100%;
    background-color: var(--k8-fill-3);
    border-radius: 2px;
    z-index: 0;
}

/* 阶段计费滑块特殊样式 */
.k8-custom-config-range-staged::-webkit-slider-thumb {
    border-color: var(--primary-dark) !important;
}

/* 滑块不可用区域 */
.k8-custom-config-range-disabled {
    position: absolute;
    width: 2px;
    height: 8px;
    background-color: var(--k8-text-color-secondary);
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    opacity: 0.5;
    pointer-events: none;
}
/* 响应式级联样式 */
@media (max-width: 768px) {
    .k8-custom-config-cascade-children {
        margin-left: 0;
        padding-left: 12px;
    }
    .k8-custom-config-form-row[data-type="resource-radio"] .k8-custom-config-option {
        min-width: auto;
        text-align: center;
    }
}

/* 操作系统选择样式 */
.k8-custom-config-form-row[data-type="os"] .k8-custom-config-input-wrap {
    display: flex;
    flex-direction: column;
}

.k8-custom-config-os-types {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.k8-custom-config-os-combo {
    display: flex;
    flex-direction: column;
    width: 160px;
    border: 1px solid var(--k8-border-color);
    overflow: visible;
    transition: all 0.3s;
}

.k8-custom-config-os-combo:hover {
    border-color: var(--primary-color);
}

.k8-custom-config-os-combo.active {
    border-color: var(--primary-color);
}

.k8-custom-config-os-header {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    background-color: var(--k8-fill-2);
    border-bottom: 1px solid var(--k8-border-color);
    transition: background-color 0.3s;
}

.k8-custom-config-os-combo.active .k8-custom-config-os-header {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.k8-custom-config-os-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    object-fit: contain;
}

/* 未激活系统图标灰色效果 */
.k8-custom-config-os-combo:not(.active) .k8-custom-config-os-icon {
    filter: grayscale(100%) opacity(0.7);
}

/* 鼠标悬停时恢复图标正常显示 */
.k8-custom-config-os-combo:not(.active):hover .k8-custom-config-os-icon {
    filter: none;
}

/* 鼠标悬停在未激活系统上时改变背景色 */
.k8-custom-config-os-combo:not(.active):hover .k8-custom-config-os-header {
    background-color: var(--k8-bg-white);
}

/* 鼠标悬停在未激活系统的下拉按钮上时改变背景色 */
.k8-custom-config-os-combo:not(.active):hover .k8-custom-config-select-trigger {
    background-color: var(--k8-bg-white);
    color: var(--k8-text-color);
}

.k8-custom-config-os-name {
    color: var(--k8-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.k8-custom-config-os-versions {
    padding: 0;
}

.k8-custom-config-os-select {
    width: 100%;
    border: none;
    outline: none;
    padding: 8px;
    background-color: var(--k8-bg-white);
    color: var(--k8-text-color);
    height: 36px;
}

.k8-custom-config-os-select:disabled {
    background-color: var(--k8-fill-2);
    color: var(--k8-text-color-secondary);
    opacity: 0.8;
}

/* 自定义下拉菜单样式 */
.k8-custom-config-custom-select {
    position: relative;
    width: 100%;
    user-select: none;
    z-index: 1;
}

/* 非激活系统的下拉菜单样式 */
.k8-custom-config-os-combo:not(.active) .k8-custom-config-select-trigger {
    background-color: var(--k8-fill-2);
    color: var(--k8-text-color-secondary);
}

.k8-custom-config-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background-color: var(--k8-bg-white);
    border-top: 1px solid var(--k8-border-color);
    color: var(--k8-text-color);
    cursor: pointer;
    height: 26px;
    transition: background-color 0.3s, color 0.3s;
}

.k8-custom-config-select-trigger i {
    margin-left: 5px;
    transition: transform 0.3s;
}

.k8-custom-config-custom-select.open .k8-custom-config-select-trigger i {
    transform: rotate(180deg);
}

.k8-custom-config-select-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.k8-custom-config-options-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--k8-bg-white);
    border: 1px solid var(--k8-border-color);
    border-top: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transform-origin: top center;
    transform: scaleY(0);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.2s;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

.k8-custom-config-custom-select.open .k8-custom-config-options-container {
    transform: scaleY(1);
    opacity: 1;
    z-index: 999;
}

.k8-custom-config-option-item {
    padding: 8px 10px;
    cursor: pointer;
    color: var(--k8-text-color);
    transition: background-color 0.3s;
}

.k8-custom-config-option-item:hover {
    background-color: var(--primary-light);
}

.k8-custom-config-option-item.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

/* 确保下拉菜单在激活的操作系统上显示更高的z-index */
.k8-custom-config-os-combo .k8-custom-config-custom-select.open {
    z-index: 999;
}

@media (max-width: 360px) {
    .k8-custom-config-os-combo {
        width: 100%;
    }
}

/* 下拉菜单滚动条样式 */
.k8-custom-config-options-container::-webkit-scrollbar {
    width: 6px;
}

.k8-custom-config-options-container::-webkit-scrollbar-track {
    background: transparent;
}

.k8-custom-config-options-container::-webkit-scrollbar-thumb {
    background-color: var(--k8-fill-3);
    border-radius: 3px;
}

.k8-custom-config-options-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--k8-border-color);
}

/* 独立按钮式下拉菜单 */
.k8-custom-config-dropdown {
  position: relative;
  max-width: 300px;
  width: 100%;
}

.k8-custom-config-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background-color: var(--k8-bg-white);
  border: 1px solid var(--k8-border-color);
  color: var(--k8-text-color);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.k8-custom-config-dropdown-toggle:hover,
.k8-custom-config-dropdown.open .k8-custom-config-dropdown-toggle {
  border-color: var(--primary-color);
}

.k8-custom-config-dropdown.open .k8-custom-config-dropdown-toggle {
  box-shadow: 0 0 0 2px rgba(19, 102, 236, 0.1);
}

.k8-custom-config-dropdown-toggle i {
  transition: transform 0.3s;
}

.k8-custom-config-dropdown.open .k8-custom-config-dropdown-toggle i {
  transform: rotate(180deg);
}

.k8-custom-config-dropdown-selected {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.k8-custom-config-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: var(--k8-bg-white);
  border: 1px solid var(--k8-border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  transform-origin: top center;
  transform: scaleY(0);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.2s;
  pointer-events: none;
}

.k8-custom-config-dropdown.open .k8-custom-config-dropdown-menu {
  transform: scaleY(1);
  opacity: 1;
  pointer-events: auto;
}

.k8-custom-config-dropdown-item {
  padding: 8px 12px;
  color: var(--k8-text-color);
  cursor: pointer;
  transition: background 0.2s;
}

.k8-custom-config-dropdown-item:hover {
  background-color: var(--k8-fill-2);
}

.k8-custom-config-dropdown-item.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

/* 自定义下拉菜单滚动条样式 */
.k8-custom-config-dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.k8-custom-config-dropdown-menu::-webkit-scrollbar-track {
  background: transparent;
}

.k8-custom-config-dropdown-menu::-webkit-scrollbar-thumb {
  background-color: var(--k8-fill-3);
  border-radius: 3px;
}

.k8-custom-config-dropdown-menu::-webkit-scrollbar-thumb:hover {
  background-color: var(--k8-border-color);
}

/* 复选框卡片样式 */
.k8-custom-config-checkbox-card {
  display: inline-flex;
  color: var(--k8-text-color);
  cursor: pointer;
  position: relative;
  transition: all 0.3s;
}

.k8-custom-config-checkbox-card-content {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  border: 1px solid var(--k8-border-color);
  background-color: var(--k8-fill-2);
  transition: all 0.3s;
}

.k8-custom-config-checkbox-card:hover .k8-custom-config-checkbox-card-content {
  border-color: var(--primary-color);
  background-color: var(--k8-bg-white);
}

.k8-custom-config-checkbox-card.active .k8-custom-config-checkbox-card-content {
  background-color: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.k8-custom-config-checkbox-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  background-color: var(--k8-bg-white);
  border: 1px solid var(--k8-border-color);
  transition: all 0.3s;
}

.k8-custom-config-checkbox-square {
  display: block;
  width: 0;
  height: 0;
  background-color: var(--primary-color);
  transition: all 0.25s ease;
}

.k8-custom-config-checkbox-card.active .k8-custom-config-checkbox-icon {
  background-color: var(--k8-bg-white);
  border-color: var(--primary-color);
}

.k8-custom-config-checkbox-card.active .k8-custom-config-checkbox-square {
  width: 10px;
  height: 10px;
  background-color: var(--primary-color);
}

.k8-custom-config-checkbox-card:hover .k8-custom-config-checkbox-icon {
  border-color: var(--primary-color);
}

/* 主机名输入框样式 */
.k8-custom-config-hostname-wrap {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 240px;
    border: 1px solid var(--k8-border-color);
    overflow: hidden;
    transition: border-color 0.3s;
}

.k8-custom-config-hostname-wrap:hover {
    border-color: var(--primary-color);
}

.k8-custom-config-hostname {
    flex: 1;
    height: 36px;
    padding: 0 8px 0 0;
    background: var(--k8-fill-2);
    color: var(--k8-text-color);
    border: none;
    outline: none;
    min-width: 0;
    cursor: default;
}

.k8-custom-config-hostname-actions {
    display: flex;
    align-items: center;
    background-color: var(--k8-fill-2);
    border-right: 1px solid transparent;
}

.k8-custom-config-hostname-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--primary-color);
    background: transparent;
    border: none;
}

/* 通用输入框样式 */
.k8-custom-config-input {
    width: 100%;
    max-width: 300px;
    height: 36px;
    border: 1px solid var(--k8-border-color);
    padding: 0 12px;
    color: var(--k8-text-color);
    box-sizing: border-box;
    background-color: var(--k8-bg-white);
    transition: border-color 0.3s;
}

.k8-custom-config-input:hover,
.k8-custom-config-input:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* 只读状态的输入框 */
.k8-custom-config-input[readonly] {
    background-color: var(--k8-fill-2);
    cursor: default;
    max-width: 200px; 
}

.k8-custom-config-form-two {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--k8-border-color);
}

/* 底部固定菜单样式 */
.k8-custom-config-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--k8-bg-white);
    border-top: 1px solid var(--k8-border-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 999;
    padding: 20px 0;
}

.k8-custom-config-footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 25px;
    box-sizing: border-box;
}

.k8-custom-config-footer-left {
    display: flex;
    align-items: center;
}

.k8-custom-config-footer-price {
    display: flex;
    align-items: baseline;
}

.k8-custom-config-footer-label {
    font-size: 16px;
    color: var(--k8-text-color);
    white-space: nowrap;
}

.k8-custom-config-footer-price-amount {
    display: flex;
    align-items: baseline;
    white-space: nowrap;
}

.k8-custom-config-footer-price-currency {
    color: var(--danger-color);
    margin-right: 2px;
    font-weight: 600;
}

.k8-custom-config-footer-price-value {
    font-size: 22px;
    color: var(--danger-color);
    font-weight: 600;
}

.k8-custom-config-footer-price-cycle {
    font-size: 14px;
    color: var(--k8-text-color-secondary);
    margin-left: 2px;
}

.k8-custom-config-footer-discount-tag {
    font-size: 14px;
    color: var(--danger-color);
    margin-left: 5px;
    font-weight: 600;
    border-bottom: 1px dashed var(--danger-color);
    display: inline-block;
    white-space: nowrap;
}

.k8-custom-config-footer-discount-tag-none {
    font-weight: 500;
    border-bottom: 1px dashed var(--k8-text-color-secondary);
    color: var(--k8-text-color-secondary);
}

.k8-custom-config-footer-right {
    display: flex;
    align-items: center;
}

.k8-custom-config-footer-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.k8-custom-config-footer-submit-btn:hover {
    background-color: var(--primary-hover);
}

/* 加载中动画样式 */
.k8-custom-config-btn-loading {
    display: inline-block;
    font-size: 16px;
    animation: spin 1s infinite linear;
    margin-right: 6px;
}

.k8-custom-config-footer-submit-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

/* 加载动画的旋转效果 */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .k8-custom-config-footer-container {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    .k8-custom-config-footer {
        padding: 0;
    }
    
    .k8-custom-config-footer-left {
        width: 100%;
        justify-content: end;
    }
    
    .k8-custom-config-footer-price {
        justify-content: center;
    }
    
    .k8-custom-config-footer-right {
        width: 100%;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
    }
    
    .k8-custom-config-current-config {
        margin-right: 10px;
        margin-bottom: 0;
    }
    
    .k8-custom-config-current-tooltip-content {
        display: none !important;
    }
    
    .k8-custom-config-current-label {
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--k8-text-color);
        font-size: 13px;
        white-space: nowrap;
    }
    
    .k8-custom-config-current-label i {
        margin-right: 5px;
        transition: none;
        transform: none !important;
    }
    
    .k8-custom-config-current-config:hover .k8-custom-config-current-label i {
        transform: none !important;
    }
    
    .k8-custom-config-footer-submit-btn {
        padding: 6px 15px;
        font-size: 14px;
        white-space: nowrap;
    }
    
    .k8-custom-config-footer-submit-btn i {
        margin-right: 4px;
    }
}

/* 订单汇总样式 - 从 ordersummary.tpl 整合 */
.k8-custom-config-order-summary {
  width: 100%;
  padding: 0;
  margin-bottom: 1rem;
}

.k8-custom-config-order-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--k8-border-color);
}

.k8-custom-config-order-summary-item:last-child {
  border-bottom: none;
}

.k8-custom-config-order-summary-label {
  color: var(--k8-text-color-secondary);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}

.k8-custom-config-order-summary-value {
  color: var(--k8-text-color);
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
}

.k8-custom-config-order-summary-divider {
  height: 1px;
  width: 100%;
  background-color: var(--k8-border-color);
  margin: 8px 0;
}

.k8-custom-config-order-summary-total {
  font-weight: 600;
  font-size: 16px;
  color: var(--primary-color);
}

.k8-custom-config-order-summary-discount {
  padding: 0 6px;
  height: 18px;
  background: var(--danger-color);
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}

.k8-custom-config-order-summary img {
  max-height: 16px;
  margin-right: 4px;
}

/* 当前配置标签和悬停提示样式 */
.k8-custom-config-current-config {
  margin-right: 16px;
  position: relative;
  display: flex;
  align-items: center;
}

.k8-custom-config-current-icon {
  color: var(--warning-color);
  margin-left: 5px;
  font-size: 16px;
  display: flex;
  align-items: center;
  transition: transform 0.3s ease;
}

.k8-custom-config-current-config:hover .k8-custom-config-current-icon {
  transform: rotate(180deg);
}

.k8-custom-config-current-label {
  color: var(--warning-color);
  cursor: pointer;
  border-bottom: 1px dashed var(--warning-color);
  transition: all 0.3s;
}

.k8-custom-config-current-label i {
  margin-right: 5px;
  transition: transform 0.3s ease;
  transform: rotate(0deg);
}

.k8-custom-config-current-config:hover .k8-custom-config-current-label i {
  transform: rotate(180deg);
}

.k8-custom-config-current-tooltip {
  position: relative;
}

.k8-custom-config-current-tooltip-content {
  position: absolute;
  bottom: 30px;
  right: -10px;
  background-color: var(--k8-bg-white);
  border: 1px solid var(--k8-border-color);
  box-shadow: 0 4px 12px var(--k8-shadow-color);
  padding: 16px;
  width: 320px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1000;
}

.k8-custom-config-current-config:hover .k8-custom-config-current-tooltip-content {
  opacity: 1;
  visibility: visible;
}

/* 三角形指示器 */
.k8-custom-config-current-tooltip-content::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 15px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--k8-bg-white);
  border-bottom: none;
}

.k8-custom-config-current-tooltip-content::before {
  content: '';
  position: absolute;
  bottom: -9px;
  right: 14px;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 9px solid var(--k8-border-color);
  border-bottom: none;
  z-index: -1;
}

.k8-custom-config-current-tooltip-content h4 {
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--k8-border-color);
  font-weight: 500;
  color: var(--k8-text-color);
  font-size: 16px;
}

.k8-custom-config-current-tooltip-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.k8-custom-config-current-tooltip-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.k8-custom-config-current-tooltip-label {
  color: var(--k8-text-color-secondary);
  margin-right: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.k8-custom-config-current-tooltip-value {
  color: var(--k8-text-color);
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.k8-custom-config-current-tooltip-value img {
  max-height: 15px;
  margin-right: 4px;
  object-fit: contain;
}

.k8-custom-config-current-tooltip-total {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--k8-border-color);
  font-weight: 500;
}

.k8-custom-config-current-tooltip-total .k8-custom-config-current-tooltip-value {
  color: var(--primary-color);
}

/* 折扣标签样式 */
.discount-num {
  color: var(--danger-color);
  font-weight: 500;
}

/* 表格式的当前配置悬停提示 */
.k8-custom-config-current-tooltip-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
  font-size: 13px;
  table-layout: fixed; /* 使用固定布局提高性能 */
  color: var(--k8-text-color);
}

.k8-custom-config-current-tooltip-table th,
.k8-custom-config-current-tooltip-table td {
  padding: 8px 6px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--k8-border-color);
}

.k8-custom-config-current-tooltip-table th {
  font-weight: 600;
  background-color: var(--k8-fill-2);
  color: var(--k8-text-color);
}

.k8-custom-config-current-tooltip-table tr:last-child td {
  border-bottom: none;
}

.k8-custom-config-current-tooltip-table th:nth-child(1),
.k8-custom-config-current-tooltip-table td:nth-child(1) {
  width: 15%;
}

.k8-custom-config-current-tooltip-table th:nth-child(2),
.k8-custom-config-current-tooltip-table td:nth-child(2) {
  width: 40%;
}

.k8-custom-config-current-tooltip-table th:nth-child(3),
.k8-custom-config-current-tooltip-table th:nth-child(4),
.k8-custom-config-current-tooltip-table th:nth-child(5),
.k8-custom-config-current-tooltip-table td:nth-child(3),
.k8-custom-config-current-tooltip-table td:nth-child(4),
.k8-custom-config-current-tooltip-table td:nth-child(5) {
  width: 15%;
  text-align: right;
}

.k8-custom-config-current-tooltip-table tfoot tr {
  background-color: var(--k8-fill-2);
  font-weight: 600;
}

.k8-custom-config-current-tooltip-total-price {
  color: var(--primary-color);
}

.k8-custom-config-current-tooltip-content {
  width: 480px;
  max-width: 90vw;
}

.k8-custom-config-current-tooltip-table img {
  max-height: 15px;
  margin-right: 4px;
  vertical-align: middle;
}

/* 当前配置悬浮提示滚动条样式 */
.k8-custom-config-current-tooltip-content::-webkit-scrollbar {
  width: 4px;
}

.k8-custom-config-current-tooltip-content::-webkit-scrollbar-track {
  background: transparent;
}

.k8-custom-config-current-tooltip-content::-webkit-scrollbar-thumb {
  background-color: var(--k8-fill-3);
  border-radius: 2px;
}

.k8-custom-config-current-tooltip-content::-webkit-scrollbar-thumb:hover {
  background-color: var(--k8-border-color);
}

.k8-custom-config-current-label:hover {
  opacity: 0.85;
}

/* 新的Tip弹出样式 */
.k8-custom-config-tip-popup {
    position: fixed;
    padding: 8px 15px;
    background-color: var(--k8-bg-white);
    color: var(--k8-text-color);
    border: 1px solid var(--primary-color);
    line-height: 1.4;
    max-width: 300px;
    word-wrap: break-word;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    pointer-events: none;
}

/* 左侧箭头 */
.k8-custom-config-tip-popup.left::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -8px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid var(--k8-bg-white);
    z-index: 2;
}

.k8-custom-config-tip-popup.left::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -9px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-right: 9px solid var(--primary-color);
    z-index: 1;
}

/* 移动端半屏模态框样式 */
.k8-custom-config-mobile-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--k8-bg-white);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    max-height: 80vh;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.k8-custom-config-mobile-modal.active {
    transform: translateY(0);
    display: block;
}

.k8-custom-config-mobile-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--k8-border-color);
    position: sticky;
    top: 0;
    background-color: var(--k8-bg-white);
    z-index: 1;
}

.k8-custom-config-mobile-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--k8-text-color);
}

.k8-custom-config-mobile-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: var(--k8-text-color-secondary);
    transition: all 0.3s;
}

.k8-custom-config-mobile-modal-close:hover {
    background-color: var(--k8-fill-3);
    color: var(--k8-text-color);
}

.k8-custom-config-mobile-modal-body {
    padding: 16px 16px 50px 16px;
    overflow-y: auto;
    max-height: calc(80vh - 62px);
}

.k8-custom-config-mobile-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.k8-custom-config-mobile-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

