/* 测站安全码设置对话框样式 */

.security-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.security-dialog {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 对话框头部 */
.security-dialog-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.security-dialog-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.security-dialog-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
}

.security-dialog-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* 对话框主体 */
.security-dialog-body {
    padding: 24px;
    max-height: calc(90vh - 160px);
    overflow-y: auto;
}

.station-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.station-info p {
    margin: 8px 0;
    font-size: 14px;
}

.station-info strong {
    color: #495057;
}

/* 开关按钮 */
.security-status {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(26px);
}

/* 安全码输入 */
.security-code-input {
    margin-bottom: 20px;
}

.security-code-input label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.security-code-input .input-group {
    display: flex;
    gap: 8px;
}

.security-code-input input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.security-code-input input:focus {
    outline: none;
    border-color: #667eea;
}

.security-code-input .toggle-visibility {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}

.security-code-input .toggle-visibility:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.security-code-input .hint {
    display: block;
    margin-top: 8px;
    color: #6c757d;
    font-size: 12px;
}

/* 使用提示 */
.usage-hint {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.usage-hint h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #856404;
}

.usage-hint code {
    background: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    display: inline-block;
    margin: 5px 0;
}

.usage-hint .copy-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    transition: background 0.3s;
}

.usage-hint .copy-btn:hover {
    background: #218838;
}

.usage-hint .example {
    margin: 10px 0 0 0;
    font-size: 13px;
    color: #856404;
    line-height: 1.6;
}

/* 对话框底部 */
.security-dialog-footer {
    padding: 15px 24px;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #e0e0e0;
}

.security-dialog-footer button {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.security-dialog-footer .btn-cancel {
    background: white;
    color: #6c757d;
    border: 2px solid #e0e0e0;
}

.security-dialog-footer .btn-cancel:hover {
    background: #f8f9fa;
    border-color: #6c757d;
}

.security-dialog-footer .btn-save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.security-dialog-footer .btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.security-dialog-footer .btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .security-dialog {
        width: 95%;
        margin: 10px;
    }
    
    .security-dialog-body {
        padding: 16px;
    }
    
    .security-dialog-header {
        padding: 15px;
    }
    
    .usage-hint .copy-btn {
        display: block;
        margin: 10px 0;
        width: 100%;
    }
}

/* 测站列表中的安全码图标 */
.station-security-badge {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 8px;
}

.station-security-badge::before {
    content: "🔐 ";
}
