/* 卡片组件 */
.card {
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(10, 26, 40, 0.9) 100%);
    border-radius: 8px;
    border: 1px solid var(--color-border);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 20px;
}

/* 添加卡片顶部发光边线 */
.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    opacity: 0.6;
}

.card:hover {
    box-shadow: var(--shadow-glow);
    border-color: rgba(10, 200, 185, 0.3);
}

.card-header {
    padding: 15px 20px;
    background: linear-gradient(90deg, rgba(10, 20, 40, 0.9), rgba(10, 30, 50, 0.8));
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 卡片头部右侧装饰线 */
.card-header::after {
    content: "";
    position: absolute;
    right: 15px;
    top: 10px;
    width: 25px;
    height: 3px;
    background-color: var(--color-tertiary);
    box-shadow: 0 0 5px var(--color-tertiary);
    border-radius: 2px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(10, 200, 185, 0.2), rgba(0, 151, 245, 0.2));
    color: var(--color-primary);
}

.card-content {
    padding: 20px;
}

.full-height {
    height: 100%;
}

/* 按钮组件 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 添加闪光效果 */
.btn-primary::before {
    content: "";
    position: absolute;
    top: 0;
    left: -50%;
    width: 150%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-25deg);
    transition: 0.75s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}



  
.btn-success {
    background: linear-gradient(135deg, var(--color-success), #0AC8B9);
    color: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
}


.btn-danger {
    background: linear-gradient(135deg, var(--color-danger), #F5634A);
    color: var(--bg-dark);
}

.btn-danger:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 15px rgba(232, 69, 69, 0.3);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
}

.btn-square {
    width: 200px;
    height: 36px;
    padding:0;
    font-size: 16px;
    /*border-radius: 50%;*/
        
}

/* 表单元素 */
.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.param-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.param-label {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.param-control {
    display: flex;
    align-items: center;
    position: relative;
}

.numeric-input,
.fancy-select {
    width: 100%;
    background-color: var(--bg-panel);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
    padding: 10px 12px;
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: all 0.3s;
}

.numeric-input:focus,
.fancy-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(10, 200, 185, 0.2);
}

.fancy-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%230AC8B9' 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 10px center;
    background-size: 16px;
    padding-right: 35px;
}

.control-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* 开关控件 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-panel);
    border: 1px solid var(--color-border);
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 3px;
    background-color: var(--color-text-secondary);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: rgba(10, 200, 185, 0.2);
    border-color: var(--color-primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
    background-color: var(--color-primary);
}

/* 杂项辅助类 */
.mt-4 {
    margin-top: 20px;
}

.info-badge {
    display: inline-block;
    padding: 6px 12px;
    background-color: rgba(10, 20, 40, 0.3);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

/* 帮助提示样式 */
.help-container {
    position: relative;
    display: inline-block;
    margin-right: 8px;
}

.help-bubble {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.help-trigger:hover + .help-bubble,
.help-trigger:focus + .help-bubble {
    opacity: 1;
    visibility: visible;
}

.help-content {
    font-size: 12px;
    line-height: 1.6;
    color: #424242;
}

.help-content strong {
    display: block;
    margin-bottom: 8px;
    color: #1976d2;
    font-size: 13px;
}

.help-content p {
    margin: 0;
}

/* 添加小三角指示符 */
.help-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
}


/* 禁用状态控件样式 */
.disabled-control {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* 操作提示气泡 */
.disabled-control::after {
    content: "预设拓扑禁止编辑";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4757;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}

.disabled-control:hover::after {
    opacity: 1;
}

/* 模态框样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  width: 60%;
  max-width: 600px;
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-body pre {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
}

@keyframes modalSlideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
